import { NfsService } from '../../../shared/api/nfs.service';
import { CriticalConfirmationModalComponent } from '../../../shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
+import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
import { TableComponent } from '../../../shared/datatable/table/table.component';
import { CellTemplate } from '../../../shared/enum/cell-template.enum';
import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum';
private modalService: BsModalService,
private nfsService: NfsService,
private taskListService: TaskListService,
- private taskWrapper: TaskWrapperService
+ private taskWrapper: TaskWrapperService,
+ public actionLabels: ActionLabelsI18n
) {
this.permission = this.authStorageService.getPermissions().nfs;
const getNfsUri = () =>
this.selection.first().export_id
)}`;
- const addAction: CdTableAction = {
+ const createAction: CdTableAction = {
permission: 'create',
icon: 'fa-plus',
- routerLink: () => '/nfs/add',
+ routerLink: () => '/nfs/create',
canBePrimary: (selection: CdTableSelection) => !selection.hasSingleSelection,
- name: this.i18n('Add')
+ name: this.actionLabels.CREATE
};
const editAction: CdTableAction = {
permission: 'update',
icon: 'fa-pencil',
routerLink: () => `/nfs/edit/${getNfsUri()}`,
- name: this.i18n('Edit')
+ name: this.actionLabels.EDIT
};
const deleteAction: CdTableAction = {
permission: 'delete',
icon: 'fa-times',
click: () => this.deleteNfsModal(),
- name: this.i18n('Delete')
+ name: this.actionLabels.DELETE
};
- this.tableActions = [addAction, editAction, deleteAction];
+ this.tableActions = [createAction, editAction, deleteAction];
}
ngOnInit() {
this.columns = [
{
- name: this.i18n('Export'),
+ name: this.i18n('Path'),
prop: 'path',
flexGrow: 2,
cellTransformation: CellTemplate.executing
},
+ {
+ name: this.i18n('Pseudo'),
+ prop: 'pseudo',
+ flexGrow: 2
+ },
{
name: this.i18n('Cluster'),
prop: 'cluster_id',
.value();
this.isDefaultCluster = clusters.length === 1 && clusters[0] === '_default_';
- this.columns[1].isHidden = this.isDefaultCluster;
+ this.columns[2].isHidden = this.isDefaultCluster;
if (this.table) {
this.table.updateColumns();
}
this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
initialState: {
- itemDescription: this.i18n('NFS'),
+ itemDescription: this.i18n('NFS export'),
+ itemNames: [`${cluster_id}:${export_id}`],
submitActionObservable: () =>
this.taskWrapper.wrapTaskAroundCall({
task: new FinishedTask('nfs/delete', {