Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforces card order in the MSM and persists that order to the mobile … #4492

Merged
merged 2 commits into from
Jan 30, 2019

Conversation

chiatt
Copy link
Member

@chiatt chiatt commented Jan 30, 2019

Enforces card order in the MSM and persists that order to the mobile app. Also fixes card dirty state issues. re #4487

@@ -152,17 +152,20 @@ def get_child_cardids(card, cardset):
projects_for_couch = [project.serialize_for_mobile() for project in projects]
for project in projects_for_couch:
permitted_cards = set()
for card in models.CardModel.objects.filter(cardid__in=project['cards']):
ordered_project_cards = project['cards'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E703 statement ends with a semicolon

if str(card.nodegroup_id) in permitted_nodegroups:
permitted_cards.add(str(card.cardid))
get_child_cardids(card, permitted_cards)
project['cards'] = list(permitted_cards)
for graph in project['graphs']:
cards = []
for card in graph['cards']:
if card['cardid'] in permitted_cards:
if card['cardid'] in project['cards']:
card['relative_position'] = ordered_project_cards.index(card['cardid']) if card['cardid'] in ordered_project_cards else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (148 > 119 characters)

@@ -56,7 +55,7 @@ def get_survey_resources(mobile_survey):
for i, graph in enumerate(graphs):
cards = []
if i == 0 or unicode(graph.graphid) in active_graphs:
cards = [Card.objects.get(pk=card.cardid) for card in models.CardModel.objects.filter(graph=graph)]
cards = [Card.objects.get(pk=card.cardid) for card in models.CardModel.objects.filter(graph=graph).order_by('sortorder')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (133 > 119 characters)

cards.push(m.cardid);
});
});
return cards
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon. (semi)

return cards
});

this.mobilesurvey.cards(this.resourceOrderedCards())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon. (semi)


this.resourceOrderedCards.subscribe(function(val){
self.mobilesurvey.cards(val);
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon. (semi)

@coveralls
Copy link

coveralls commented Jan 30, 2019

Coverage Status

Coverage decreased (-0.006%) to 40.507% when pulling 32f1d26 on 4487_card_order into 79e4edd on master.

@chiatt chiatt merged commit 85adef2 into master Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants