fix: worker.basic-data el boton guardar estava activo al hacer F5
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-07-14 12:18:41 +02:00
parent 4a7cfe9122
commit 4f183d1c6a
3 changed files with 27 additions and 39 deletions

View File

@ -0,0 +1,4 @@
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('WorkerDisableExcluded', '*', 'READ', 'ALLOW', 'ROLE', 'itManagement'),
('WorkerDisableExcluded', '*', 'WRITE', 'ALLOW', 'ROLE', 'itManagement');

View File

@ -15,17 +15,10 @@
</div> </div>
</slot-before> </slot-before>
<slot-menu> <slot-menu>
<vn-item <vn-item ng-click="$ctrl.handleExcluded()" translate>
ng-click="$ctrl.handleExcluded()" {{$ctrl.workerExcluded
translate ? 'Click to allow the user to be disabled'
ng-if="!$ctrl.excluded"> : 'Click to exclude the user from getting disabled'}}
Click to exclude the user from getting disabled
</vn-item>
<vn-item
ng-click="$ctrl.handleExcluded()"
translate
ng-if="$ctrl.excluded">
Click to allow the user to be disabled
</vn-item> </vn-item>
</slot-menu> </slot-menu>
<slot-body> <slot-body>

View File

@ -18,28 +18,19 @@ class Controller extends Descriptor {
this.getIsExcluded(); this.getIsExcluded();
} }
get excluded() {
return this.entity.excluded;
}
set excluded(value) {
this.entity.excluded = value;
}
getIsExcluded() { getIsExcluded() {
this.$http.get(`workerDisableExcludeds/${this.entity.id}/exists`).then(data => { this.$http.get(`WorkerDisableExcludeds/${this.entity.id}/exists`).then(data => {
this.excluded = data.data.exists; this.workerExcluded = data.data.exists;
}); });
} }
handleExcluded() { handleExcluded() {
if (this.excluded) { if (this.workerExcluded)
this.$http.delete(`workerDisableExcludeds/${this.entity.id}`); this.$http.delete(`WorkerDisableExcludeds/${this.entity.id}`);
this.excluded = false; else
} else { this.$http.post(`WorkerDisableExcludeds`, {workerFk: this.entity.id, dated: new Date});
this.$http.post(`workerDisableExcludeds`, {workerFk: this.entity.id, dated: new Date});
this.excluded = true; this.workerExcluded = !this.workerExcluded;
}
} }
loadData() { loadData() {