refs #5334 button delete, btn popover
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-05-31 12:02:22 +02:00
parent 0774a94d8b
commit e38bf4f1b3
5 changed files with 6 additions and 8 deletions

View File

@ -5,7 +5,6 @@
<slot-menu>
<vn-item
ng-click="deleteConfirmation.show()"
ng-show="$ctrl.isEditable"
name="deleteDepartment"
translate>
Delete

View File

@ -23,13 +23,11 @@ class Controller extends Descriptor {
this.$state.go(`worker.index`,
{q: JSON.stringify({departmentFk: department.id})});
}
deleteDepartment() {
return this.$http.post(`Departments/${this.id}/setDeleted`)
.then(() => this.reload())
return this.$http.delete(`Departments/${this.id}`)
.then(() => {
const isInsideDepartment = this.$state.current.name.startsWith('department');
if (isInsideDepartment)
this.$state.go('department.index');
this.$state.go('worker.department');
this.vnApp.showSuccess(this.$t('Department deleted.'));
});

View File

@ -5,3 +5,4 @@ import './card';
import './descriptor';
import './basic-data';
import './search-panel';
import './descriptor-popover';

View File

@ -3,7 +3,7 @@
"name": "Workers",
"icon" : "icon-worker",
"validations" : true,
"dependencies": ["account"],
"dependencies": ["account", "worker"],
"menus": {
"main": [
{"state": "worker.index", "icon": "icon-worker"},

View File

@ -29,7 +29,7 @@
</vn-label-value>
<vn-label-value label="Department">
<span
ng-click="workerDepartmentDescriptor.show($event, worker.department.department.id)"
ng-click="workerDepartmentDescriptor.show($event, 31)"
class="link">
{{worker.department.department.name}}
</span>