PMCORE-3212: UI implement Error handling component

This commit is contained in:
Rodrigo Quelca
2021-08-16 19:05:45 +00:00
parent 79ad25fdaf
commit 743d26a47e
3 changed files with 108 additions and 15 deletions

View File

@@ -237,9 +237,23 @@
:checked="props.row.selected"
:value="props.row.field"
/>
<div slot="enableFilter" slot-scope="props">
<b-row>
<b-col>
<i
ref="iconClose"
class="fas fa-info-circle"
:id="`popover-1-${props.row.field}`"
></i>
<b-popover
:target="`popover-1-${props.row.field}`"
placement="top"
triggers="hover focus"
:content="searchInfoContent(props.row)"
></b-popover>
</b-col>
<b-col>
<b-form-checkbox
slot="enableFilter"
slot-scope="props"
v-model="enabledFilterRows"
@change="onTongleFilter(props.row.field)"
name="check-button"
@@ -248,6 +262,12 @@
switch
>
</b-form-checkbox>
</b-col>
</b-row>
</div>
<div slot="action" slot-scope="props">
<b-button
@@ -339,8 +359,8 @@ export default {
name: this.$i18n.t("ID_NAME"),
field: this.$i18n.t("ID_FIELD"),
type: this.$i18n.t("ID_TYPE"),
typeOfSearching: this.$i18n.t("ID_TYPE_OF_SEARCHING"),
enableSearchFilter: this.$i18n.t("ID_ENABLE_SEARCH_FILTER"),
typeSearch: this.$i18n.t("ID_TYPE_OF_SEARCHING"),
enableFilter: this.$i18n.t("ID_ENABLE_SEARCH_FILTER"),
action: "",
},
filterable: false,
@@ -371,6 +391,29 @@ export default {
},
methods: {
/**
* Prepare search popover info
* @param {object} row
* @returns {string}
*/
searchInfoContent(row) {
let info = this.$i18n.t("ID_THE_SEARCH_WILL_BE_FROM");
switch (row.type) {
case 'integer':
info += " " + this.$i18n.t("ID_A_RANGE_OF_VALUES");
break;
case 'string':
info += " " + this.$i18n.t("ID_A_TEXT_SEARCH");
break;
case 'date':
info += " " + this.$i18n.t("ID_DATE_TO_DATE");
break;
default:
info = this.$i18n.t("ID_NO_SEARCHING_METHOD");
}
return info;
},
/**
* Edit mode handler
* prepare the datato be rendered
@@ -584,9 +627,9 @@ export default {
Api.updateCaseList(this.params)
.then((response) => {
this.$emit("closeSketch");
})
.catch((err) => {
this.makeToast('danger', this.$i18n.t('ID_ERROR'), err.response.statusText);
console.error(err);
});
} else {
@@ -596,6 +639,7 @@ export default {
})
.catch((err) => {
this.makeToast('danger',this.$i18n.t('ID_ERROR') ,err.response.statusText);
console.error(err);
});
}
@@ -622,6 +666,19 @@ export default {
onTongleFilter(field){
let objIndex = this.dataCaseList.findIndex((obj => obj.field === field));
this.dataCaseList[objIndex].enableFilter = !this.dataCaseList[objIndex].enableFilter
},
/**
* Make the toast component
* @param {string} variant
* @param {string} title
* @param {string} message
*/
makeToast(variant = null, title, message) {
this.$bvToast.toast(message, {
title: `${title || variant}`,
variant: variant,
solid: true
})
}
},
};

View File

@@ -1693,6 +1693,18 @@ msgstr "You can open only files with the .html extension"
msgid "3 days at least"
msgstr "3 days at least"
# TRANSLATION
# LABEL/ID_A_RANGE_OF_VALUES
#: LABEL/ID_A_RANGE_OF_VALUES
msgid "a range of values"
msgstr "a range of values"
# TRANSLATION
# LABEL/ID_A_TEXT_SEARCH
#: LABEL/ID_A_TEXT_SEARCH
msgid "a Text Search"
msgstr "a Text Search"
# TRANSLATION
# LABEL/ID_ABE_ANSWER_SUBMITTED
#: LABEL/ID_ABE_ANSWER_SUBMITTED
@@ -5819,6 +5831,13 @@ msgstr "The value '{0}' is not a valid date for the format '{1}'."
msgid "Date Created"
msgstr "Date Created"
# TRANSLATION
# LABEL/ID_DATE_TO_DATE
#: LABEL/ID_DATE_TO_DATE
msgid "Date to Date"
msgstr "Date to Date"
# TRANSLATION
# LABEL/ID_DAY
#: LABEL/ID_DAY
@@ -20315,6 +20334,12 @@ msgstr "License installed successfully"
msgid "No"
msgstr "No"
# TRANSLATION
# LABEL/ID_NO_SEARCHING_METHOD
#: LABEL/ID_NO_SEARCHING_METHOD
msgid "No searching method"
msgstr "No searching method"
# TRANSLATION
# LABEL/ID_NODELETEOPTIONALL
#: LABEL/ID_NODELETEOPTIONALL
@@ -26309,6 +26334,12 @@ msgstr "Please complete the reassign reason."
msgid "The report table is regenerating please come back in a few minutes."
msgstr "The report table is regenerating please come back in a few minutes."
# TRANSLATION
# LABEL/ID_THE_SEARCH_WILL_BE_FROM
#: LABEL/ID_THE_SEARCH_WILL_BE_FROM
msgid "The search will be from"
msgstr "The search will be from"
# TRANSLATION
# LABEL/ID_THE_UPLOAD_OF_PHP_FILES_WAS_DISABLED
#: LABEL/ID_THE_UPLOAD_OF_PHP_FILES_WAS_DISABLED

View File

@@ -57082,6 +57082,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ESTABLISHING_CON_HOST','en','Establishing connection to host','2014-01-15') ,
( 'LABEL','HTML_FILES','en','You can open only files with the .html extension','2014-01-15') ,
( 'LABEL','ID_3DAYSMINIMUM','en','3 days at least','2014-01-15') ,
( 'LABEL','ID_A_RANGE_OF_VALUES','en','a range of values','2021-08-16') ,
( 'LABEL','ID_A_TEXT_SEARCH','en','a Text Search','2021-08-16') ,
( 'LABEL','ID_ABE_ANSWER_SUBMITTED','en','The answer has been submitted. Thank you.','2017-06-19') ,
( 'LABEL','ID_ABE_CASE_NOTE_ANSWER','en','Answer: {optionLabel}','2018-11-20') ,
( 'LABEL','ID_ABE_CASE_NOTE_COMMENT','en','Comment: {emailBody}','2018-11-20') ,
@@ -57793,6 +57795,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DATE_LABEL','en','Date','2014-01-15') ,
( 'LABEL','ID_DATE_NOT_VALID','en','The value ''{0}'' is not a valid date for the format ''{1}''.','2014-05-29') ,
( 'LABEL','ID_DATE_UPDATED','en','Date Updated','2021-07-26') ,
( 'LABEL','ID_DATE_TO_DATE','en','Date to Date','2021-07-26') ,
( 'LABEL','ID_DAY','en','Day','2014-01-15') ,
( 'LABEL','ID_DAYS','en','Days','2014-01-15') ,
( 'LABEL','ID_DAY_DAYS','en','Day(s)','2020-10-02') ,
@@ -60276,6 +60279,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_NEXT_TASK','en','Next Task/Event','2016-07-29') ,
( 'LABEL','ID_NLIC','en','License installed successfully','2014-12-02') ,
( 'LABEL','ID_NO','en','No','2014-01-15') ,
( 'LABEL','ID_NO_SEARCHING_METHOD','en','No searching method','2021-08-16') ,
( 'LABEL','ID_NODELETEOPTIONALL','en','You must add all the days that you have selected in work days, otherwise you should leave at least an "-- ALL --" option.','2014-01-15') ,
( 'LABEL','ID_NONE','en','None','2014-01-15') ,
( 'LABEL','ID_NONEC','en','@# Replace the value with no change','2014-01-15') ,
@@ -61340,6 +61344,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_THE_PHP_FILES_EXECUTION_WAS_DISABLED','en','The PHP files execution was disabled please contact the system administrator.','2018-04-20') ,
( 'LABEL','ID_THE_REASON_REASSIGN_USER_EMPTY','en','Please complete the reassign reason.','2016-10-20') ,
( 'LABEL','ID_THE_REPORT_TABLE_IS_REGENERATING_PLEASE_COME_BACK_IN_A_FEW_MINUTES','en','The report table is regenerating please come back in a few minutes.','2020-06-01') ,
( 'LABEL','ID_THE_SEARCH_WILL_BE_FROM','en','The search will be from','2021-08-16') ,
( 'LABEL','ID_THE_UPLOAD_OF_PHP_FILES_WAS_DISABLED','en','The upload of PHP files was disabled please contact the system administrator.','2018-04-20') ,
( 'LABEL','ID_THE_USER_ROLES_FOR_ATTRIBUTE_HAS_BEEN_DELETED_PLEASE_CONFIRM','en','The user roles for attribute {0} has been modified, if you proceed to save this attribute, all information for users stored in the attribute will be deleted for the removed role, please confirm.','2020-12-15') ,
( 'LABEL','ID_THE_USERNAME_EMAIL_IS_INCORRECT','en','The username or email is incorrect','2018-01-18') ,