diff --git a/resources/assets/js/api/Api.js b/resources/assets/js/api/Api.js index 22e0dc1e1..46887a245 100644 --- a/resources/assets/js/api/Api.js +++ b/resources/assets/js/api/Api.js @@ -66,7 +66,8 @@ const services = { PUT_MY_FILTERS: "/cases/advanced-search/filter/", DELETE_MY_FILTERS: "/cases/advanced-search/filter/", SEARCH: "/home/search", - PROCESSES: "/home/processes" + PROCESSES: "/home/processes", + USERS: "/home/users" }; export default { diff --git a/resources/assets/js/api/Cases.js b/resources/assets/js/api/Cases.js index 392ef762e..2fb9b94a0 100644 --- a/resources/assets/js/api/Cases.js +++ b/resources/assets/js/api/Cases.js @@ -172,10 +172,13 @@ export let cases = { export let casesHeader = { get() { - return new Promise((resolutionFunc, rejectionFunc) => { - resolutionFunc({ - data: headerData - }); + return axios.get(window.config.SYS_SERVER + + '/api/1.0/' + + window.config.SYS_WORKSPACE + + '/home/counters', { + headers: { + 'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken + } }); } -}; +}; diff --git a/resources/assets/js/api/Filters.js b/resources/assets/js/api/Filters.js index 53456f4d0..59152fb2c 100644 --- a/resources/assets/js/api/Filters.js +++ b/resources/assets/js/api/Filters.js @@ -57,6 +57,18 @@ export let filters = { keys: {}, }); }, + /** + * Service to get the users list + */ + userList(query) { + return Api.get({ + service: "USERS", + params: { + text: query, + }, + keys: {}, + }); + }, /** * Service to get the users list */ diff --git a/resources/assets/js/components/home/HeaderCounter.vue b/resources/assets/js/components/home/HeaderCounter.vue index 33e1693c6..90f3e4f12 100644 --- a/resources/assets/js/components/home/HeaderCounter.vue +++ b/resources/assets/js/components/home/HeaderCounter.vue @@ -51,7 +51,7 @@ export default { } .v-btn-texts-header { - font-size: 0.7vw; + font-size: 0.8vw; } .v-btn-header { min-width: 150px; @@ -60,4 +60,4 @@ export default { padding-bottom: 5px !important; padding-top: 5px !important; } - \ No newline at end of file + diff --git a/resources/assets/js/components/search/GenericFilter.vue b/resources/assets/js/components/search/GenericFilter.vue index 9feb77068..599634ff5 100644 --- a/resources/assets/js/components/search/GenericFilter.vue +++ b/resources/assets/js/components/search/GenericFilter.vue @@ -105,7 +105,7 @@ v-for="tag in tags" @remove="customRemove(removeTag, tag)" :key="tag" - :title="tag" + :title="searchTagsModels[tag].tagText" :variant="tagVariant" class="mr-1" > @@ -173,6 +173,9 @@ import DueDate from "./popovers/DueDate.vue"; import LastModifiedDate from "./popovers/LastModifiedDate.vue"; import CaseTitle from "./popovers/CaseTitle.vue"; import ProcessName from "./popovers/ProcessName.vue"; +import CasePriority from "./popovers/CasePriority.vue"; +import CaseStatus from "./popovers/CaseStatus.vue"; +import CurrentUser from "./popovers/CurrentUser.vue"; import api from "./../../api/index"; export default { @@ -184,7 +187,10 @@ export default { DueDate, LastModifiedDate, CaseTitle, - ProcessName + ProcessName, + CasePriority, + CaseStatus, + CurrentUser }, data() { return { @@ -224,7 +230,6 @@ export default { filterBy: ["caseTitle"], values: {} }, - ProcessName: { title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_PROCESS_NAME')}`, optionLabel: this.$i18n.t('ID_PROCESS_NAME'), @@ -233,6 +238,45 @@ export default { tagText: "", filterBy: ["process", "processOption"], processOption: {"PRO_TITLE": ""} + }, + CasePriority: { + title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_PRIORITY')}`, + optionLabel: this.$i18n.t('ID_PRIORITY'), + detail: this.$i18n.t('ID_PLEASE_SELECT_THE_PRIORITY_FOR_THE_SEARCH'), + options: [ + { text: this.$i18n.t('ID_VERY_LOW'), value: "VL" }, + { text: this.$i18n.t('ID_LOW'), value: "L" }, + { text: this.$i18n.t('ID_NORMAL'), value: "N" }, + { text: this.$i18n.t('ID_HIGH'), value: "H" }, + { text: this.$i18n.t('ID_VERY_HIGH'), value: "VH" } + ], + tagText: "", + filterBy: ["priorities"], + casePriorities: [] + }, + CaseStatus: { + title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_STATUS')}`, + optionLabel: this.$i18n.t('ID_STATUS'), + detail: this.$i18n.t('ID_PLEASE_SELECT_THE_STATUS_FOR_THE_SEARCH'), + options: [ + { text: this.$i18n.t('ID_CASES_STATUS_DRAFT'), value: "DRAFT" }, + { text: this.$i18n.t('ID_CASES_STATUS_TO_DO'), value: "TO_DO" }, + { text: this.$i18n.t('ID_CASES_STATUS_COMPLETED'), value: "COMPLETED" }, + { text: this.$i18n.t('ID_CASES_STATUS_CANCELLED'), value: "CANCELLED" }, + { text: this.$i18n.t('ID_CASES_STATUS_PAUSED'), value: "PAUSED" }, + ], + tagText: "", + filterBy: ["caseStatuses"], + caseStatuses: [] + }, + CurrentUser: { + title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_CURRENT_USER')}`, + optionLabel: this.$i18n.t('ID_CURRENT_USER'), + detail: "", + placeholder: this.$i18n.t('ID_USER_NAME'), + tagText: "", + filterBy: ["userId", "selectedOption"], + selectedOption: {"USR_FULLNAME": ""} } }, text: "", @@ -295,32 +339,42 @@ export default { let label = ""; switch (type) { case "CaseNumber": - label = `${this.$i18n.t("ID_IUD")}: ${params.filterCases}` + this.searchTagsModels[type].tagText = `${this.$i18n.t("ID_IUD")}: ${params.filterCases}` this.searchTagsModels[type].values["filterCases"] = params.filterCases; break; case "DueDate": - label = `${this.$i18n.t('ID_FROM')}: ${params.dueDateFrom} ${this.$i18n.t('ID_TO')}: ${params.dueDateTo}`; + this.searchTagsModels[type].tagText = `${this.$i18n.t('ID_FROM')}: ${params.dueDateFrom} ${this.$i18n.t('ID_TO')}: ${params.dueDateTo}`; this.searchTagsModels[type].values["dueDateFrom"] = params.dueDateFrom; this.searchTagsModels[type].values["dueDateTo"] = params.dueDateTo; break; case "LastModifiedDate": - label = `${this.$i18n.t('ID_FROM')}: ${params.delegationDateFrom} ${this.$i18n.t('ID_TO')}: ${params.delegationDateTo}`; + this.searchTagsModels[type].tagText = `${this.$i18n.t('ID_FROM')}: ${params.delegationDateFrom} ${this.$i18n.t('ID_TO')}: ${params.delegationDateTo}`; this.searchTagsModels[type].values["delegationDateFrom"] = params.delegationDateFrom; this.searchTagsModels[type].values["delegationDateTo"] = params.delegationDateTo; break; case "CaseTitle": - label = `${this.$i18n.t("ID_CASE_TITLE")}: ${params.caseTitle}`; + this.searchTagsModels[type].tagText = `${this.$i18n.t("ID_CASE_TITLE")}: ${params.caseTitle}`; this.searchTagsModels[type].values["caseTitle"] = params.caseTitle; break; case "ProcessName": - label = `${this.$i18n.t("ID_PROCESS")}: ${params.processOption.PRO_TITLE || ''}`; + this.searchTagsModels[type].tagText = `${this.$i18n.t("ID_PROCESS")}: ${params.processOption.PRO_TITLE || ''}`; this.searchTagsModels[type].processOption = params.processOption || null; break; + case "CasePriority": + this.searchTagsModels[type].tagText = `${this.$i18n.t('ID_PRIORITY')}: ${_.map(params.selectedOptions, 'text').join(",") || ''}`; + this.searchTagsModels[type].casePriorities = _.map(params.selectedOptions, 'value'); + break; + case "CaseStatus": + this.searchTagsModels[type].tagText = `${this.$i18n.t('ID_STATUS')}: ${_.map(params.selectedOptions, 'text').join(",") || ''}`; + this.searchTagsModels[type].caseStatuses = _.map(params.selectedOptions, 'value'); + break; + case "CurrentUser": + this.searchTagsModels[type].tagText = `${this.$i18n.t("ID_USER")}: ${params.selectedOption.USR_FULLNAME || ''}`; + this.searchTagsModels[type].selectedOption = params.selectedOption || null; + break; default: break; } - this.searchTagsModels[type].tagText = label; - }, cleanAllTags() { this.searchTags = []; @@ -403,7 +457,7 @@ export default { filters: this.filters }); } - }, + } }; diff --git a/resources/assets/js/components/search/popovers/ProcessName.vue b/resources/assets/js/components/search/popovers/ProcessName.vue index de92c7f0b..681fca9b1 100644 --- a/resources/assets/js/components/search/popovers/ProcessName.vue +++ b/resources/assets/js/components/search/popovers/ProcessName.vue @@ -1,5 +1,5 @@