fix: worker.basic-data el boton guardar estava activo al hacer F5
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
4a7cfe9122
commit
4f183d1c6a
|
@ -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');
|
|
@ -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>
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue