Skip to content

Commit

Permalink
Removes resourceList and addresses some errors in survey section of t…
Browse files Browse the repository at this point in the history
…he user profile page. re #4357
  • Loading branch information
chiatt committed Dec 22, 2018
1 parent 8e2eb29 commit 7618727
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 161 deletions.
6 changes: 2 additions & 4 deletions arches/app/media/js/viewmodels/mobile-survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ define([
'underscore',
'knockout',
'views/mobile-survey-manager/identity-list',
'views/mobile-survey-manager/resource-list',
'models/mobile-survey',
'views/components/widgets/map',
'bindings/sortable'
], function($, arches, _, ko, IdentityList, ResourceList, MobileSurveyModel) {
], function($, arches, _, ko, IdentityList, MobileSurveyModel) {
/**
* A base viewmodel for mobile survey management
*
Expand Down Expand Up @@ -106,15 +105,14 @@ define([
});
};


this.resetCards = function(cards){
_.each(self.allResources, function(r){
_.each(r.cards(), function(c){
c.approved(_.contains(cards(), c.cardid));
});
r.hasApprovedCards() ? r.added(true) : r.added(false);
});
}
};

_.each(this.allResources, this.initializeResource);

Expand Down
125 changes: 0 additions & 125 deletions arches/app/media/js/views/mobile-survey-manager/resource-list.js

This file was deleted.

3 changes: 2 additions & 1 deletion arches/app/media/js/views/user-profile-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ define([
this.viewModel.mobilesurveys =
data.mobilesurveys.map(function(mobilesurvey) {
return new MobileSurveyViewModel({
resources: data.resources,
mobilesurvey: mobilesurvey,
identities: data.identities
});
Expand All @@ -65,7 +66,7 @@ define([
mobilesurvey.resources = ko.computed(function() {
var resources = [];
var resourceLookup = {};
_.each(mobilesurvey.resourceList.items(), function(resource) {
_.each(mobilesurvey.allResources, function(resource) {
_.each(resource.cards(), function(card) {
if (_.contains(mobilesurvey.mobilesurvey.cards(), card.cardid)) {
if (resourceLookup[resource.id]) {
Expand Down
31 changes: 0 additions & 31 deletions arches/app/templates/views/mobile-survey-manager/resource-list.htm

This file was deleted.

0 comments on commit 7618727

Please sign in to comment.