dashboard: improve checklist handling
This commit is contained in:
@@ -729,7 +729,26 @@
|
||||
</div>
|
||||
<div class="col-sm-8 card-container">
|
||||
<div class="card" ng-show="view === 'info'">
|
||||
<p><label class="control-label">{{ 'app.updates.info.title' | tr }}</label></p>
|
||||
<p>
|
||||
<label class="control-label">{{ 'app.updates.info.title' | tr }}</label>
|
||||
<a href="" class="pull-right" ng-click="info.showDoneChecklist = true" ng-show="info.hasOldChecklist && !info.showDoneChecklist">Show Checklist</a>
|
||||
</p>
|
||||
|
||||
<div ng-repeat="item in app.checklist">
|
||||
<div class="checklist-item" ng-hide="item.acknowledged">
|
||||
{{ item.message }}
|
||||
<button class="btn btn-sm btn-default btn-outline" ng-click="info.checklistAck(item)"><i class="fas fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-repeat="item in app.checklist" ng-show="info.showDoneChecklist">
|
||||
<div class="checklist-item checklist-item-acknowledged" ng-show="item.acknowledged">
|
||||
{{ item.message }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 10px"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<span class="text-muted">{{ 'app.updates.info.description' | tr }}</span>
|
||||
@@ -768,24 +787,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="text-right" ng-click="info.showDoneChecklist = !info.showDoneChecklist"><a href="">Show App Checklist</a></div> -->
|
||||
|
||||
<br/>
|
||||
|
||||
<div ng-repeat="item in app.checklist">
|
||||
<div class="checklist-item" ng-hide="item.acknowledged">
|
||||
{{ item.message }}
|
||||
<button class="btn btn-sm btn-default btn-outline" ng-click="info.checklistAck(item)"><i class="fas fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-repeat="item in app.checklist" ng-show="info.showDoneChecklist">
|
||||
<div class="checklist-item checklist-item-acknowledged" ng-show="item.acknowledged">
|
||||
{{ item.message }}
|
||||
<button class="btn btn-sm btn-default btn-outline" ng-click="info.checklistAck(item)"><i class="fas fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<p><label class="control-label">{{ 'app.info.notes.title' | tr }}</label></p>
|
||||
|
||||
@@ -138,6 +138,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
$scope.info = {
|
||||
showDoneChecklist: false,
|
||||
hasOldChecklist: false,
|
||||
|
||||
notes: {
|
||||
busy: false,
|
||||
@@ -173,6 +174,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
},
|
||||
|
||||
show: function () {
|
||||
$scope.info.hasOldChecklist = !!Object.keys($scope.app.checklist).find((k) => { return $scope.app.checklist[k].acknowledged; });
|
||||
$scope.info.notes.content = $scope.app.notes;
|
||||
$scope.info.notes.editing = false;
|
||||
$scope.info.notes.busy = false;
|
||||
@@ -183,6 +185,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
Client.configureApp($scope.app.id, 'checklist', { checklist: $scope.app.checklist }, function (error) {
|
||||
if (error) return console.error('Failed to save checklist.', error);
|
||||
$scope.info.hasOldChecklist = true;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user