Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/archesproject/arches into…
Browse files Browse the repository at this point in the history
… official_master

* 'master' of https://github.com/archesproject/arches: (23 commits)
  Update loading mask message style
  Update instruction panel
  fix overflow on MSM default page, update status instructions
  download all concepts in a collection for the mobile app, re #4499
  Update pre-release testing script
  Update pre release script.
  removes uneeded classes, adds active-sub class behavior
  erases comments
  new search icon left nav-bar
  lints
  Enforces card order in the MSM and persists that order to the mobile app. Also fixes card dirty state issues. re #4487
  Update status message
  fix child cards not being added to the mobile survey, re #4472
  Add message for completed, inactive survey
  Only shows active survey message when a survey is active on the server. re #4357
  Notifies user why some features of the MSM are immutable once a survey has been synced. re #4401
  Start update to survey status details
  Locks users and groups if a survey has been synched. re #4383, #4396, #4401
  Fixes to user order so that dirty state does not persist once a user reverses their chanages to the user list.
  Locking critical mobile-survey properties once a survey has been synced. re #4383, #4396, #4401, archesproject/arches-collector#329
  ...
  • Loading branch information
veuncent committed Feb 2, 2019
2 parents 973d5dd + 928f4e7 commit 929f0c3
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 68 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
}
79 changes: 63 additions & 16 deletions arches/app/media/css/arches.css
Original file line number Diff line number Diff line change
Expand Up @@ -2774,7 +2774,7 @@ div.dropdown-menu.open {
.loading-mask {
position: fixed;
opacity: .75;
background-color: gray;
background-color: grey;
top: 0;
bottom: 0;
left: 0;
Expand Down Expand Up @@ -2803,14 +2803,17 @@ div.dropdown-menu.open {


.loading-mask-string {
font-size: 35px;
font-size: 22px;
padding-top: 5%;
font-weight: 600;
width: 100%;
width: 50%;
text-align: center;
top: 25%;
left: 25%;
height: 50%;
position: absolute;
color: #222;
background-color: #999;
color: #fff;
background-color: #000;
z-index: 8000;
}

Expand All @@ -2827,14 +2830,14 @@ div.dropdown-menu.open {

.graph-designer-loading-mask:after {
position: fixed;
opacity: .5;
color: #000;
opacity: .8;
color: #fff;
content: '\f110';
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: 14vw;
font-size: 10vw;
margin-top: 42vh;
margin-left: 32vw;
text-rendering: auto;
Expand Down Expand Up @@ -9276,6 +9279,15 @@ a.clear-geojson-button:hover {
overflow-y: auto;
}

.msm-locked-warning {
height: 40px;
background: #999;
color: #fff;
padding-left: 10px;
position: relative;
padding-top: 10px;
}

.msm-list-filter {
display: flex;
padding: 12px 10px 13px 65px;
Expand Down Expand Up @@ -10781,7 +10793,7 @@ a.search-facet-item.disabled {
.mpm-card-content {
margin: 0px;
border-bottom: 1px solid #ddd;
padding: 40px 25px 50px 25px;
padding: 50px 25px 50px 25px;
background: #f9f9f9;
}

Expand All @@ -10795,7 +10807,11 @@ a.search-facet-item.disabled {
}

.mpm-card-content.active-survey {
background: #f3f3f3;
background: #fafafa;
}

.active-survey .msm-survey-message {
color: #999;
}

.msm-summary-panel .selection-page {
Expand Down Expand Up @@ -10943,11 +10959,12 @@ a.search-facet-item.disabled {
height: 60px;
width: 60px;
border-radius: 50%;
border: 1px solid #C68000;
background: #FFDA39;
border: 1px solid #aaa;
color: #777;
background: #ddd;
font-size: 28px;
padding-top: 12px;
padding-left: 6px;
padding-top: 14px;
padding-left: 2px;
}

.model-selection .msm-icon-wrap {
Expand All @@ -10957,6 +10974,14 @@ a.search-facet-item.disabled {
border: 1px solid #2d3c4b;
}

.active-survey .msm-icon-wrap {
background: #77DAD3;
color:#29b2a6;
padding-top: 15px;
padding-left: 2px;
border: 1px solid #26a69a;
}

a.filter-tools {
margin-left: 0px;
padding: 3px 6px;
Expand Down Expand Up @@ -11125,6 +11150,7 @@ a.filter-tools:hover {

.report-image-grid.mpm {
overflow-y: auto;
overflow-x: hidden;
}

.nav-tabs li a.graph-designer-tab {
Expand Down Expand Up @@ -11806,13 +11832,34 @@ a.filter-tools:hover {
text-align: center;
}

.msm-survey-requirements-text {
margin-top: 20px;
}

.msm-survey-status-text {
margin-top: 0px;
}

.msm-survey-message {
margin-top: 20px;
font-size: 16px;
color: #888;
}

.msm-survey-status-instructions {
padding: 20px 10px 5px 10px;
font-size: 19px;
margin: 10px 20% 20px 20%;
padding: 20px 10px 20px 10px;
font-size: 17px;
background: #ddd;
border: 1px solid #aaa;
color: #2A096E;
text-align: center;
border-radius: 2px;
}

.msm-save-message {
font-size: 17px;
color: #2A096E;
text-align: center;
}

Expand Down
5 changes: 4 additions & 1 deletion arches/app/media/js/models/mobile-survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ define([
});
}
}
currentIdentities.sort();
}
};

Expand Down Expand Up @@ -279,6 +278,10 @@ define([
this.parse(JSON.parse(this._mobilesurvey()), self);
},

getInitialSurvey: function() {
return JSON.parse(this._mobilesurvey());
},

_getURL: function(method) {
return this.url(this.id);
},
Expand Down
27 changes: 25 additions & 2 deletions arches/app/media/js/viewmodels/mobile-survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ define([
}, 200);
};
this.history = params.history;
this.locked = _.keys(this.history.editors) > 0 || false;
this.history.lastsync = moment(this.history.lastsync);
_.each(this.history.editors, function(editor) {
editor.lastsync = moment(editor.lastsync);
Expand Down Expand Up @@ -137,13 +138,17 @@ define([

this.displayUser = ko.observable();

this.resetCards = function(cards){
this.resetCards = function(){
var initialsurvey = this.mobilesurvey.getInitialSurvey();
var initialcards = initialsurvey.cards;
var initialresources = initialsurvey.datadownloadconfig.resources;
_.each(self.allResources, function(r){
_.each(r.cards(), function(c){
c.approved(_.contains(cards(), c.cardid));
c.approved(_.contains(initialcards, c.cardid));
});
r.hasApprovedCards() ? r.added(true) : r.added(false);
});
self.mobilesurvey.datadownloadconfig.resources(initialresources);
};

this.resetIdentities = function(mobilesurvey){
Expand All @@ -161,6 +166,24 @@ define([
_.each(this.allResources, this.initializeResource);
_.each(this.allIdentities, this.initializeIdentities);

this.resourceOrderedCards = ko.pureComputed(function(){
var cards = [];
self.allResources.forEach(function(r){
r.cards()
.filter(function(f){if (f.approved()){return f;}})
.forEach(function(m){
cards.push(m.cardid);
});
});
return cards;
});

this.mobilesurvey.cards(this.resourceOrderedCards());

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

this.selectedResourceIds = ko.pureComputed({
read: function() {
return this.allResources.filter(function(r) {
Expand Down
10 changes: 7 additions & 3 deletions arches/app/models/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,13 @@ def append_node(self, nodeid=None):

nodeToAppendTo = self.nodes[uuid.UUID(str(nodeid))] if nodeid else self.root
card = None
tile_count = models.TileModel.objects.filter(nodegroup_id=nodeToAppendTo.nodegroup_id).count()
if tile_count > 0:
raise GraphValidationError(_("Your resource model: {0}, already has instances saved. You cannot modify a Resource Model with instances.".format(self.name)), 1006)

if not settings.OVERRIDE_RESOURCE_MODEL_LOCK:
tile_count = models.TileModel.objects.filter(nodegroup_id=nodeToAppendTo.nodegroup_id).count()
if tile_count > 0:
raise GraphValidationError(_(
"Your resource model: {0}, already has instances saved. " +
"You cannot modify a Resource Model with instances.".format(self.name)), 1006)

nodegroup = None
if nodeToAppendTo.nodeid == self.root.nodeid and self.isresource is True:
Expand Down
4 changes: 2 additions & 2 deletions arches/app/models/mobile_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def collect_card_widget_node_data(self, graph_obj, graph, parentcard, nodegroupi
found = True
try:
collection_id = node['config']['rdmCollection']
concept_collection = Concept().get_child_collections_hierarchically(collection_id)
concept_collection = Concept().get_child_collections_hierarchically(collection_id, offset=None)
widget.config['options'] = concept_collection
except Exception as e:
pass
Expand All @@ -109,7 +109,7 @@ def collect_card_widget_node_data(self, graph_obj, graph, parentcard, nodegroupi
try:
collection_id = node['config']['rdmCollection']
if collection_id:
concept_collection = Concept().get_child_collections_hierarchically(collection_id)
concept_collection = Concept().get_child_collections_hierarchically(collection_id, offset=None)
widget_model.config['options'] = concept_collection
except Exception as e:
pass
Expand Down
13 changes: 11 additions & 2 deletions arches/app/templates/base-manager.htm
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ <h5 class="hidden-xs">{% trans "Welcome" %}, {{ user.first_name|default:user.use
<a href="{% url 'search_home' %}" class="ep-tools ep-tools-right" data-bind="click:function () { navigate('{% url 'search_home' %}') }">
<div class="" data-placement="bottom" data-toggle="tooltip" data-original-title='{% trans "Search" %}'>
<i class="ion-search"></i>

</div>
</a>
{% endif %}
Expand Down Expand Up @@ -222,7 +223,7 @@ <h5>{% trans "for more documentation, visit" %} <a href="https://arches.readthed
<ul id="mainnav-menu" class="list-group">

<!-- Tools -->
<li class="list-header">{% trans "Tools" %}</li>
<li class="list-header">{% trans "Tools" %}</li>

<!-- System Settings list item -->
{% if request.user|has_group:"System Administrator" %}
Expand All @@ -244,7 +245,15 @@ <h5>{% trans "for more documentation, visit" %} <a href="https://arches.readthed
</li>
{% endif %}


<li{% if "views/search" in main_script %} class="active-sub"{% endif %}>
<a href="{% url 'search_home' %}" data-bind="click:function () { navigate('{% url 'search_home' %}') }">
<i class="fa fa-search"></i>
<span class="menu-title">
<strong>{% trans "Search" %}</strong>
</span>
</a>
</li>

<!--Menu list item-->
{% if request.user|can_edit_resource_instance %}
<li{% if "views/resource" in main_script and is_system_settings is False %} class="active-sub"{% endif %}>
Expand Down
Loading

0 comments on commit 929f0c3

Please sign in to comment.