-
Notifications
You must be signed in to change notification settings - Fork 142
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
Conversation
…app. Also fixes card dirty state issues. re #4487
arches/app/views/api.py
Outdated
@@ -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']; |
There was a problem hiding this comment.
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
arches/app/views/api.py
Outdated
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 |
There was a problem hiding this comment.
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)
arches/app/views/mobile_survey.py
Outdated
@@ -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')] |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon. (semi)
Enforces card order in the MSM and persists that order to the mobile app. Also fixes card dirty state issues. re #4487