PMCORE-2577-A It is not possible to import users by searching them, using the import users button

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-12-22 13:04:44 -04:00
parent 496fd3bbc7
commit 6d0031673c
3 changed files with 39 additions and 29 deletions

View File

@@ -27677,6 +27677,12 @@ msgstr "The row '{USR_UID}' in table USER doesn't exist!"
msgid "Users with role"
msgstr "Users with role"
# TRANSLATION
# LABEL/ID_USE_ALPHANUMERIC_CHARACTERS_INCLUDING
#: LABEL/ID_USE_ALPHANUMERIC_CHARACTERS_INCLUDING
msgid "Please just use alphanumeric characters including: {0}"
msgstr "Please just use alphanumeric characters including: {0}"
# TRANSLATION
# LABEL/ID_USE_LANGUAGE_URL
#: LABEL/ID_USE_LANGUAGE_URL

View File

@@ -61575,6 +61575,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_USER_TO_REASSIGN','en','Reassign to:','2014-01-15') ,
( 'LABEL','ID_USER_UID_DOESNT_EXIST','en','The row ''{USR_UID}'' in table USER doesn''t exist!','2014-01-15') ,
( 'LABEL','ID_USER_WITH_ROLE','en','Users with role','2014-01-15') ,
( 'LABEL','ID_USE_ALPHANUMERIC_CHARACTERS_INCLUDING','en','Please just use alphanumeric characters including: {0}','2020-12-22') ,
( 'LABEL','ID_USE_LANGUAGE_URL','en','Use the language of URL','2014-08-08') ,
( 'LABEL','ID_UXS_NORMAL','en','Normal','2014-01-15') ,
( 'LABEL','ID_UXS_SIMPLIFIED','en','Mobile','2014-01-15') ,

View File

@@ -200,40 +200,35 @@
this.statusAttributeId = null;
},
onsubmit() {
this.statusName = true;
if (this.form.name.trim() === "") {
this.statusName = false;
this.statusNameMessage = this.$root.translation("ID_IS_REQUIRED");
return;
}
this.statusAttributeId = true;
if (this.form.attributeId.trim() === "") {
this.statusAttributeId = false;
this.statusAttributeIdMessage = this.$root.translation("ID_IS_REQUIRED");
return;
}
if (this.form.attributeId.length >= 50) {
this.statusAttributeId = false;
this.statusAttributeIdMessage = this.$root.translation("ID_INVALID_MAX_PERMITTED", [this.$root.translation('ID_ATTRIBUTE_ID'), '50']);
return;
}
if (/^[a-zA-Z][_0-9a-zA-Z]+$/.test(this.form.attributeId) === false) {
this.statusAttributeId = false;
this.statusAttributeIdMessage = this.$root.translation("ID_INVALID_DATA");
return;
}
let promise = this.validateName();
promise.then(response => {
response;
let promise2 = this.validateAttributeId();
promise2.then(response2 => {
response2;
this.saveForm();
if (this.statusName === true && this.statusAttributeId === true) {
this.saveForm();
}
});
});
},
validateName() {
this.statusValidation = false;
this.statusName = true;
if (this.form.name.trim() === "") {
this.statusName = false;
this.statusNameMessage = this.$root.translation("ID_IS_REQUIRED");
return;
}
if (this.form.name.length >= 50) {
this.statusName = false;
this.statusNameMessage = this.$root.translation("ID_INVALID_MAX_PERMITTED", [this.$root.translation('ID_ATTRIBUTE_NAME'), '50']);
return;
}
if (/^[a-zA-Z][-_0-9a-zA-Z]+$/.test(this.form.name) === false) {
this.statusName = false;
this.statusNameMessage = this.$root.translation("ID_USE_ALPHANUMERIC_CHARACTERS_INCLUDING", ["- _"]);
return;
}
let formData = new FormData();
formData.append("id", this.form.id);
formData.append("name", this.form.name);
@@ -245,7 +240,6 @@
this.statusNameMessage = response.data.message;
} else {
this.statusName = true;
this.statusValidation = true;
}
})
.catch(error => {
@@ -255,10 +249,20 @@
});
},
validateAttributeId() {
this.statusValidation = false;
if (/^[a-zA-Z][_0-9a-zA-Z]+$/.test(this.form.attributeId) === false) {
this.statusAttributeId = true;
if (this.form.attributeId.trim() === "") {
this.statusAttributeId = false;
this.statusAttributeIdMessage = this.$root.translation("ID_INVALID_DATA");
this.statusAttributeIdMessage = this.$root.translation("ID_IS_REQUIRED");
return;
}
if (this.form.attributeId.length >= 250) {
this.statusAttributeId = false;
this.statusAttributeIdMessage = this.$root.translation("ID_INVALID_MAX_PERMITTED", [this.$root.translation('ID_ATTRIBUTE_ID'), '250']);
return;
}
if (/^[a-zA-Z][-_.0-9a-zA-Z]+$/.test(this.form.attributeId) === false) {
this.statusAttributeId = false;
this.statusAttributeIdMessage = this.$root.translation("ID_USE_ALPHANUMERIC_CHARACTERS_INCLUDING", [". - _"]);
return;
}
let formData = new FormData();
@@ -272,7 +276,6 @@
this.statusAttributeIdMessage = response.data.message;
} else {
this.statusAttributeId = true;
this.statusValidation = true;
}
})
.catch(error => {