Skip to content

Commit

Permalink
Merge pull request #576 from archesproject/575_dependency_updates_lin…
Browse files Browse the repository at this point in the history
…ting

575 dependency updates linting
  • Loading branch information
apeters authored Feb 6, 2020
2 parents 3f57d29 + 28f068f commit 12816f1
Show file tree
Hide file tree
Showing 37 changed files with 2,914 additions and 2,166 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"mapbox-gl-cordova-offline": "archesproject/mapbox-gl-cordova-offline#master",
"moment": "^2.24.0",
"onsenui": "~2.10.5",
"pouchdb": "^6.4.3",
"pouchdb": "^7.1.1",
"pouchdb-adapter-cordova-sqlite": "pouchdb-community/pouchdb-adapter-cordova-sqlite#master",
"pouchdb-find": "^6.4.3",
"pouchdb-upsert": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app/editor/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
segueToForm: function(card) {
var dbtile = 'blank';
if (card.tile !== null) {
dbtile = this.$store.getters.tiles.find(function(t){
dbtile = this.$store.getters.tiles.find(function(t) {
return t.tileid === card.tile.tileid;
});
}
Expand All @@ -74,7 +74,7 @@ export default {
// editorTab value to take us back to the report
this.$store.getters.activeServer.card_nav_stack = [
this.$store.getters.activeServer.card_nav_stack[0]
]
];
this.$emit('switch-tabs', 1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/editor/components/ResourceEditForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
},
allowDelete: {
get: function() {
if(this.tile) {
if (this.tile) {
return this.canDeleteTile(this.tile) && !this.hasChildCards(this.tile);
} else {
return false;
Expand Down
52 changes: 24 additions & 28 deletions src/app/editor/components/ResourceEditPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,25 @@ export default {
// and set the tile to null or the parent tile of this.tile
// push that onto the stack
// push the saved item back onto the stack, but change the showForm to false
if (this.activeindex===0) {
if (this.activeindex === 0) {
this.$router.push({
'name': 'project',
name: 'project',
params: {
'project': this.project,
'tabIndex': 1
project: this.project,
tabIndex: 1
}
});
} else if (this.$store.getters.activeServer.card_nav_stack.length === 1) {
if (this.$store.getters.activeServer.card_nav_stack[0].editorTab !== undefined) {
this.$emit('switch-tabs', this.$store.getters.activeServer.card_nav_stack[0].editorTab);
this.$store.getters.activeServer.card_nav_stack = [];
this.$store.getters.activeServer.card_nav_stack.unshift({card: null, tile: null, showForm: false, activeObject: 'tile'});
this.$store.getters.activeServer.card_nav_stack.unshift({ card: null, tile: null, showForm: false, activeObject: 'tile' });
} else {
this.$router.push({
'name': 'project',
name: 'project',
params: {
'project': this.project,
'tabIndex': this.$store.getters.activeServer.card_nav_stack[0].tabIndex
project: this.project,
tabIndex: this.$store.getters.activeServer.card_nav_stack[0].tabIndex
}
});
}
Expand All @@ -207,16 +207,16 @@ export default {
return tile.tileid === this.tile.parenttile_id;
}, this);
this.$store.getters.activeServer.card_nav_stack.splice(1, 0, {
'card': navItem.card,
'tile': !!parentOfThisTile ? parentOfThisTile : null,
'showForm': false,
'activeObject': 'card'
card: navItem.card,
tile: !!parentOfThisTile ? parentOfThisTile : null,
showForm: false,
activeObject: 'card'
});
this.$store.getters.activeServer.card_nav_stack.splice(1, 0, {
'card': navItem.card,
'tile': navItem.tile,
'showForm': false,
'activeObject': 'tile'
card: navItem.card,
tile: navItem.tile,
showForm: false,
activeObject: 'tile'
});
}
this.$store.getters.activeServer.card_nav_stack.shift();
Expand All @@ -227,7 +227,6 @@ export default {
return widget.card_id === card.cardid;
}, this);
if (widgets.length > 0) {
var value;
return this.$underscore.sortBy(widgets, 'sortorder')[0];
}
return undefined;
Expand All @@ -240,17 +239,14 @@ export default {
var value;
var widget = this.$underscore.sortBy(widgets, 'sortorder')[0];
var key = widget.node_id;
var node = this.$underscore.find(this.allNodes, function(node) {
return node.nodeid === key;
});
if (!!tile.provisionaledits && this.user.id in tile.provisionaledits) {
value = tile.provisionaledits[this.user.id]['value'][key];
value = tile.provisionaledits[this.user.id].value[key];
} else {
value = tile.data[key];
}
return {label: widget.label, value: !!value ? value : 'undefined'};
return { label: widget.label, value: !!value ? value : 'undefined' };
} else {
return {label: '', value: card.name};
return { label: '', value: card.name };
}
},
navigateChildCard: function(card, showForm) {
Expand Down Expand Up @@ -279,13 +275,13 @@ export default {
}
this.$store.getters.activeServer.card_nav_stack.unshift({
'card': card,
'tile': tile,
'showForm': !!showForm,
'activeObject': 'card'
card: card,
tile: tile,
showForm: !!showForm,
activeObject: 'card'
});
},
getCardTiles: function(card){
getCardTiles: function(card) {
var nodegroupid = card ? card.nodegroup_id : this.nodegroup_id;
var tiles = this.$underscore.filter(this.tiles, function(tile) {
return tile.nodegroup_id === nodegroupid;
Expand Down
14 changes: 7 additions & 7 deletions src/app/editor/components/ResourcePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ export default {
var navItem = this.currentNavItem;
var displayname = this.resourceid ? this.$store.getters.activeServer.active_resource.displayname : 'Unnamed Resource';
if (!!navItem && !!navItem.card) {
return {'value': navItem.card.name, 'label': displayname};
return { value: navItem.card.name, label: displayname };
} else {
return {'value': this.$store.getters.activeGraph.name, 'label': displayname}
return { value: this.$store.getters.activeGraph.name, label: displayname };
}
},
resourceid: {
Expand Down Expand Up @@ -156,7 +156,7 @@ export default {
createNewRecord: function(e) {
this.$store.commit('clearActiveResourceInstance');
this.$store.getters.activeServer.card_nav_stack = [];
this.$store.getters.activeServer.card_nav_stack.unshift({card: null, tile: null, showForm: false, activeObject: 'tile', 'tabIndex': this.tabIndex});
this.$store.getters.activeServer.card_nav_stack.unshift({ card: null, tile: null, showForm: false, activeObject: 'tile', tabIndex: this.tabIndex });
this.nodegroupid = null;
this.tabIndex = 0;
this.toggleSideNav();
Expand All @@ -168,10 +168,10 @@ export default {
project_id: this.project.id
};
this.$store.commit('setActiveProject', payload);
this.$router.push({'name': 'project', params: {project: this.project, tabIndex: tabIndex}});
this.$router.push({ name: 'project', params: { project: this.project, tabIndex: tabIndex } });
},
showResourceModels: function(e) {
this.jumpToProjectPage(0);
this.jumpToProjectPage(0);
},
showResourceList: function(e) {
this.jumpToProjectPage(1);
Expand All @@ -182,14 +182,14 @@ export default {
selectProject: function(e) {
this.$store.commit('clearActiveResourceInstance');
this.$router.push({
'name': 'projectlist'
name: 'projectlist'
});
}
},
created: function() {
if (!!this.$store.getters.activeServer) {
this.$store.getters.activeServer.card_nav_stack = [];
this.$store.getters.activeServer.card_nav_stack.unshift({card: null, tile: null, showForm: false, activeObject: 'tile', 'tabIndex': this.tabIndex});
this.$store.getters.activeServer.card_nav_stack.unshift({ card: null, tile: null, showForm: false, activeObject: 'tile', tabIndex: this.tabIndex });
}
}
};
Expand Down
29 changes: 14 additions & 15 deletions src/app/editor/mixins/nav-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export default {
}
}
this.$store.getters.activeServer.card_nav_stack.unshift({
'card': this.card,
'tile': tile,
'showForm': !!showForm,
'activeObject': 'tile',
'editorTab': editorTab
card: this.card,
tile: tile,
showForm: !!showForm,
activeObject: 'tile',
editorTab: editorTab
});
},
hasChildCards: function(card) {
Expand Down Expand Up @@ -89,7 +89,6 @@ export default {
return tiles.every(function(tile) {
return this.canDeleteTile(tile);
}, this);

},
getBlankTile: function(card, parentTile) {
return {
Expand Down Expand Up @@ -128,19 +127,19 @@ export default {
var self = this;
e.stopPropagation();
this.$ons.notification.confirm({
message: 'Delete this Data? This can\'t be undone.',
callback: function(answer){
message: 'Delete this Data? This can\'t be undone.',
callback: function(answer) {
if (!!answer) {
self.$store.dispatch('deleteTiles', tile)
.finally(function() {
console.log('tile delete finished...');
if(!!callback) {
callback();
}
});
.finally(function() {
console.log('tile delete finished...');
if (!!callback) {
callback();
}
});
}
}
});
}
}
}
};
9 changes: 2 additions & 7 deletions src/app/projects/components/ProjectPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ export default {
var self = this;
this.syncing = true;
this.sync_failed = false;
this.$store.dispatch('syncRemote', {'projectId': this.project.id})
this.$store.dispatch('syncRemote', { projectId: this.project.id })
.catch(function(err) {
self.syncfailed = true;
self.syncErrorMessage = err.notification ? err.notification : "Error. Unable to sync survey";
self.syncErrorMessage = err.notification ? err.notification : 'Error. Unable to sync survey';
self.handleAlert(self.syncErrorMessage);
})
.finally(function(doc) {
Expand Down Expand Up @@ -216,7 +216,6 @@ export default {
top: 6px;
}


/* Place the navbar at the bottom of the page, and make it stick */

.navbar {
Expand All @@ -237,7 +236,6 @@ export default {
justify-content: space-around;
}


/* Style the links inside the navigation bar */

.navbar a {
Expand All @@ -261,16 +259,13 @@ export default {
font-size: 12px !important;
}


/* Change the color of links on hover */


/*.navbar a:hover {
background-color: #ddd;
color: black;
}*/


/* Add a color to the active/current link */

.navbar a.active {
Expand Down
41 changes: 22 additions & 19 deletions src/app/projects/components/SelectResourceInstancePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ export default {
var self = this;
if (this.sorted) {
return this.$underscore.sortBy(this.instances, function(resourceInstance) {
if(self.sortValue === 'name'){
if (self.sortValue === 'name') {
return resourceInstance.displayname;
}
if(self.sortValue === 'editDate'){
if(!!resourceInstance.edited){
if (self.sortValue === 'editDate') {
if (!!resourceInstance.edited) {
return new Date(resourceInstance.edited.day + ' ' + resourceInstance.edited.time).valueOf();
}else{
} else {
return 0;
}
}
});
} else {
return this.$underscore.sortBy(this.instances, function(resourceInstance) {
if(self.sortValue === 'name'){
if (self.sortValue === 'name') {
return resourceInstance.displayname;
}
if(self.sortValue === 'editDate'){
if(!!resourceInstance.edited){
if (self.sortValue === 'editDate') {
if (!!resourceInstance.edited) {
return new Date(resourceInstance.edited.day + ' ' + resourceInstance.edited.time).valueOf();
}else{
} else {
return 0;
}
}
Expand All @@ -92,10 +92,10 @@ export default {
this.$store.commit('setActiveResourceInstance', resource);
this.$store.commit('setActiveGraphId', resource.graph_id);
this.$router.push({
'name': 'resource',
name: 'resource',
params: {
'nodegroupid': null,
'tabIndex': 1
nodegroupid: null,
tabIndex: 1
}
});
},
Expand All @@ -106,7 +106,7 @@ export default {
this.$store.getters.activeProject.id
).then((res) => {
self.instances = [];
res['docs'].forEach(function(doc){
res.docs.forEach(function(doc) {
if (self.resource_types[doc.graph_id]) {
if (doc.edited) {
var datetime = moment(doc.edited.day + ' ' + doc.edited.time);
Expand All @@ -119,10 +119,13 @@ export default {
});
self.loading = false;
})
.catch((error) => {
self.loading = false;
self.handleAlert('Unable to load resources. Check network connection.');
});
.catch((error) => {
if (error) {
console.log(error);
}
self.loading = false;
self.handleAlert('Unable to load resources. Check network connection.');
});
},
deleteResource: function(resource, e) {
var self = this;
Expand All @@ -134,16 +137,16 @@ export default {
self.$store.dispatch('deleteResource', resource);
self.getResourceData();
} else {
//console.log('not deleting');
// console.log('not deleting');
}
}
})
});
},
sortResources: function(passeddata) {},
handleAlert: function(alertMessage) {
this.$store.commit('handleAlert', alertMessage);
}
},
}
};
</script>

Expand Down
Loading

0 comments on commit 12816f1

Please sign in to comment.