Merge pull request #3810 from emanuelschuetze/workflow-sorting

Fix sorting of states in workflow detail view.
This commit is contained in:
Finn Stutzenstein 2018-08-23 14:35:04 +02:00 committed by GitHub
commit 172f1ed890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View File

@ -49,7 +49,9 @@ angular.module('OpenSlidesApp.motions.workflow', [])
return Workflow.lastModified(workflowId); return Workflow.lastModified(workflowId);
}, function () { }, function () {
$scope.workflow = Workflow.get(workflowId); $scope.workflow = Workflow.get(workflowId);
_.forEach($scope.workflow.states, function (state) { $scope.states = $scope.workflow.states;
$scope.states = _.orderBy($scope.states, 'id');
_.forEach($scope.states, function (state) {
state.newActionWord = gettextCatalog.getString(state.action_word); state.newActionWord = gettextCatalog.getString(state.action_word);
state.newRecommendationLabel = gettextCatalog.getString(state.recommendation_label); state.newRecommendationLabel = gettextCatalog.getString(state.recommendation_label);
}); });

View File

@ -40,7 +40,7 @@
<tr> <tr>
<th class="info-head small"> <th class="info-head small">
<h4 translate>Permissions</h4> <h4 translate>Permissions</h4>
<th ng-repeat="state in workflow.states" ng-mouseover="thHover=true" ng-mouseleave="thHover=false"> <th ng-repeat="state in states" ng-mouseover="thHover=true" ng-mouseleave="thHover=false">
<span class="optional"> <span class="optional">
{{ state.name | translate }} {{ state.name | translate }}
</span> </span>
@ -69,7 +69,7 @@
<td> <td>
<b translate>Action word</b> <b translate>Action word</b>
</td> </td>
<td ng-repeat="state in workflow.states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false"> <td ng-repeat="state in states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false">
<div class="popover-wrapper"> <div class="popover-wrapper">
<span editable-text="state.newActionWord" <span editable-text="state.newActionWord"
onaftersave="setMember(state, 'action_word', state.newActionWord)"> onaftersave="setMember(state, 'action_word', state.newActionWord)">
@ -88,7 +88,7 @@
<td> <td>
<b translate>Recommendation label</b> <b translate>Recommendation label</b>
</td> </td>
<td ng-repeat="state in workflow.states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false"> <td ng-repeat="state in states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false">
<div class="popover-wrapper"> <div class="popover-wrapper">
<span editable-text="state.newRecommendationLabel" <span editable-text="state.newRecommendationLabel"
onaftersave="setMember(state, 'recommendation_label', state.newRecommendationLabel)"> onaftersave="setMember(state, 'recommendation_label', state.newRecommendationLabel)">
@ -107,7 +107,7 @@
<td> <td>
<b>{{ member.displayName | translate }}</b> <b>{{ member.displayName | translate }}</b>
</td> </td>
<td ng-repeat="state in workflow.states" class="pointer" <td ng-repeat="state in states" class="pointer"
ng-click="changeBooleanMember(state, member.name)"> ng-click="changeBooleanMember(state, member.name)">
<!-- Simulating a checkbox with FontAwesome icons. --> <!-- Simulating a checkbox with FontAwesome icons. -->
<i class="fa" <i class="fa"
@ -118,7 +118,7 @@
<td> <td>
<b translate>Label color</b> <b translate>Label color</b>
</td> </td>
<td ng-repeat="state in workflow.states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false"> <td ng-repeat="state in states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false">
<span uib-dropdown> <span uib-dropdown>
<span id="dropdownCssClass{{ state.id }}" class="pointer" uib-dropdown-toggle> <span id="dropdownCssClass{{ state.id }}" class="pointer" uib-dropdown-toggle>
<span class="label" ng-class="'label-' + state.css_class"> <span class="label" ng-class="'label-' + state.css_class">
@ -141,7 +141,7 @@
<td> <td>
<b translate>Required permission to see</b> <b translate>Required permission to see</b>
</td> </td>
<td ng-repeat="state in workflow.states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false"> <td ng-repeat="state in states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false">
<span uib-dropdown> <span uib-dropdown>
<span id="dropdownPermission{{ state.id }}" class="pointer" uib-dropdown-toggle> <span id="dropdownPermission{{ state.id }}" class="pointer" uib-dropdown-toggle>
<div class="no-overflow"> <div class="no-overflow">
@ -169,7 +169,7 @@
<td> <td>
<b translate>Next states</b> <b translate>Next states</b>
</td> </td>
<td ng-repeat="state in workflow.states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false"> <td ng-repeat="state in states" ng-mouseover="tdHover=true" ng-mouseleave="tdHover=false">
<span ng-if="state.getNextStates().length === 0" class="text-muted"> <span ng-if="state.getNextStates().length === 0" class="text-muted">
&mdash; &mdash;
</span> </span>
@ -184,7 +184,7 @@
<i class="fa fa-cog" ng-if="tdHover"></i> <i class="fa fa-cog" ng-if="tdHover"></i>
</span> </span>
<ul class="dropdown-menu" aria-labelledby="dropdownNextStates{{ state.id }}"> <ul class="dropdown-menu" aria-labelledby="dropdownNextStates{{ state.id }}">
<li ng-repeat="s in workflow.states"> <li ng-repeat="s in states">
<a href ng-click="clickNextStateEntry(state, s.id)"> <a href ng-click="clickNextStateEntry(state, s.id)">
<i class="fa fa-check" ng-if="state.next_states_id.indexOf(s.id) > -1"></i> <i class="fa fa-check" ng-if="state.next_states_id.indexOf(s.id) > -1"></i>
{{ s.name | translate }} {{ s.name | translate }}

View File

@ -34,10 +34,11 @@
</div> </div>
</div> </div>
<div class="spacer-top"> <div class="spacer-top">
<translate>Initial password</translate>: {{ user.default_password }}
<span uib-tooltip="{{ 'Initial password can not be changed.' | translate }}"> <span uib-tooltip="{{ 'Initial password can not be changed.' | translate }}">
<i class="fa fa-info-circle"></i> <i class="fa fa-info-circle"></i>
<translate>Initial password</translate>: {{ user.default_password }} </span><br>
</span> <translate>Username</translate>: {{ user.username }}
<span class="pull-right spacer-right pointer" ng-click="showPassword = !showPassword"> <span class="pull-right spacer-right pointer" ng-click="showPassword = !showPassword">
<translate>Show password</translate> <translate>Show password</translate>
<i class="fa" ng-class="showPassword ? 'fa-check-square-o' : 'fa-square-o'"></i> <i class="fa" ng-class="showPassword ? 'fa-check-square-o' : 'fa-square-o'"></i>