Merged in bugfix/PMCORE-2889 (pull request #7837)

PMCORE-2889

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Roly Rudy Gutierrez Pinto
2021-09-23 21:05:53 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -202,7 +202,8 @@
<b-form-group :label="$root.translation('ID_DEFAULT_MAIN_MENU_OPTION')"> <b-form-group :label="$root.translation('ID_DEFAULT_MAIN_MENU_OPTION')">
<b-form-select v-model="form.PREF_DEFAULT_MENUSELECTED" <b-form-select v-model="form.PREF_DEFAULT_MENUSELECTED"
:options="defaultMainMenuOptionList" :options="defaultMainMenuOptionList"
:disabled="disabledField.PREF_DEFAULT_MENUSELECTED"/> :disabled="disabledField.PREF_DEFAULT_MENUSELECTED"
@change="changeDefaultMainMenuOption"/>
</b-form-group> </b-form-group>
</b-col> </b-col>
<b-col cols="2"> <b-col cols="2">
@@ -211,7 +212,7 @@
<b-form-group :label="$root.translation('ID_DEFAULT_CASES_MENU_OPTION')"> <b-form-group :label="$root.translation('ID_DEFAULT_CASES_MENU_OPTION')">
<b-form-select v-model="form.PREF_DEFAULT_CASES_MENUSELECTED" <b-form-select v-model="form.PREF_DEFAULT_CASES_MENUSELECTED"
:options="defaultCasesMenuOptionList" :options="defaultCasesMenuOptionList"
:disabled="disabledField.PREF_DEFAULT_CASES_MENUSELECTED"/> :disabled="disabledField.PREF_DEFAULT_CASES_MENUSELECTED || switchChangeDefaultMainMenuOption"/>
</b-form-group> </b-form-group>
</b-col> </b-col>
<b-col cols="1"> <b-col cols="1">
@@ -458,7 +459,9 @@
}, },
permission: {}, permission: {},
classCustom: "", classCustom: "",
classCustom2: "" classCustom2: "",
switchChangeDefaultMainMenuOption: true,
memoryChangeDefaultMainMenuOption: ""
}; };
}, },
mounted() { mounted() {
@@ -835,6 +838,8 @@
text: response.data.user.REPLACED_NAME text: response.data.user.REPLACED_NAME
}]; }];
} }
//for Default Cases Menu option
this.changeDefaultMainMenuOption();
} }
}) })
.catch(error => { .catch(error => {
@@ -1158,6 +1163,20 @@
}, },
changeRole() { changeRole() {
this.getUserExtendedAttributesList(); this.getUserExtendedAttributesList();
},
changeDefaultMainMenuOption() {
let isPmCases = this.form.PREF_DEFAULT_MENUSELECTED === "PM_CASES";
//disable PREF_DEFAULT_CASES_MENUSELECTED
this.switchChangeDefaultMainMenuOption = !isPmCases;
//remember PREF_DEFAULT_CASES_MENUSELECTED
if (isPmCases && this.form.PREF_DEFAULT_CASES_MENUSELECTED !== "") {
this.memoryChangeDefaultMainMenuOption = this.form.PREF_DEFAULT_CASES_MENUSELECTED;
}
//restore
this.form.PREF_DEFAULT_CASES_MENUSELECTED = isPmCases ? this.memoryChangeDefaultMainMenuOption : "";
} }
} }
} }