use non actual options
This commit is contained in:
@@ -63,7 +63,10 @@ class CaseDetailActionHandler extends ActionHandler {
|
||||
const acl = this.view.getAcl();
|
||||
const metadata = this.view.getMetadata();
|
||||
|
||||
if (['Closed', 'Rejected', 'Duplicate'].includes(model.get('status'))) {
|
||||
/** @type {string[]} */
|
||||
const notActualStatuses = metadata.get('entityDefs.Case.fields.status.notActualOptions') || [];
|
||||
|
||||
if (notActualStatuses.includes(model.get('status'))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,10 @@ class DetailActions extends ActionHandler {
|
||||
isCompleteAvailable() {
|
||||
const status = this.view.model.get('status');
|
||||
|
||||
return !['Completed', 'Canceled'].includes(status);
|
||||
/** @type {string[]} */
|
||||
const notActualStatuses = this.view.getMetadata().get('entityDefs.Task.fields.status.notActualOptions') || [];
|
||||
|
||||
return !notActualStatuses.includes(status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,15 +42,18 @@ class TaskMenuHandler extends ActionHandler {
|
||||
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
isCompleteAvailable() {
|
||||
const status = this.view.model.get('status');
|
||||
|
||||
const view = /** @type {module:views/detail} */this.view;
|
||||
|
||||
if (view.getRecordView().isEditMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const status = view.model.get('status');
|
||||
/** @type {string[]} */
|
||||
const notActualStatuses = this.view.getMetadata().get('entityDefs.Task.fields.status.notActualOptions') || [];
|
||||
|
||||
return !['Completed', 'Canceled'].includes(status);
|
||||
return !notActualStatuses.includes(status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user