Skip to content

Commit

Permalink
Builder, warning msg 'name is too long'
Browse files Browse the repository at this point in the history
  • Loading branch information
r3-gabriel committed Nov 7, 2024
1 parent 6805dcc commit 13fe111
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 11 deletions.
22 changes: 20 additions & 2 deletions www/comps/builder/builderNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ let MyBuilderNew = {
</div>
<p class="error" v-if="nameTaken">{{ capGen.error.nameTaken }}</p>
<p class="error" v-if="nameTooLong">{{ capGen.error.nameTooLong.replace('{LEN}',nameMaxLength) }}</p>
<div class="row">
<my-button image="save.png"
Expand Down Expand Up @@ -148,8 +149,21 @@ let MyBuilderNew = {
};
},
computed:{
// inputs
canSave: (s) => s.inputs.name !== '' && !s.nameTaken,
nameMaxLength:(s) => {
switch(s.entity) {
case 'api': return 64; break;
case 'collection': return 64; break;
case 'form': return 64; break;
case 'jsFunction': return 64; break;
case 'module': return 60; break;
case 'pgFunction': return 60; break;
case 'relation': return 60; break;
case 'role': return 64; break;
case 'variable': return 64; break;
case 'widget': return 64; break;
}
return 0;
},
nameTaken:(s) => {
if(s.inputs.name === '')
return false;
Expand Down Expand Up @@ -213,6 +227,10 @@ let MyBuilderNew = {
}
return '';
},

// simple
canSave: (s) => s.inputs.name !== '' && !s.nameTaken && !s.nameTooLong,
nameTooLong:(s) => s.inputs.name !== '' && s.inputs.name.length > s.nameMaxLength,
showOptions:(s) => ['form','jsFunction','pgFunction','relation','variable'].includes(s.entity),

// stores
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/ar_eg
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"الاسم مأخوذ بالفعل، يرجى اختيار اسم آخر."
"nameTaken":"الاسم مأخوذ بالفعل، يرجى اختيار اسم آخر.",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"صفيف",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/de_de
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"Systemnachricht"
},
"error":{
"nameTaken":"Name bereits in Benutzung, bitte einen anderen wählen."
"nameTaken":"Name bereits in Benutzung, bitte einen anderen wählen.",
"nameTooLong":"Name zu lang, max. erlaubte Länge ist {LEN} Zeichen."
},
"option":{
"aggArray":"Array",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/en_us
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"Name is already taken, please choose another."
"nameTaken":"Name is already taken, please choose another.",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"array",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/fr_fr
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"Ce nom est déjà pris, veuillez en choisir un autre."
"nameTaken":"Ce nom est déjà pris, veuillez en choisir un autre.",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"tableau",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/hu_hu
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"Name is already taken, please choose another."
"nameTaken":"Name is already taken, please choose another.",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"Tömb",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/it_it
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"Name is already taken, please choose another."
"nameTaken":"Name is already taken, please choose another.",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"vettore",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/lv_lv
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"Vārds jau ir aizņemts, lūdzu, izvēlieties citu."
"nameTaken":"Vārds jau ir aizņemts, lūdzu, izvēlieties citu.",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"masīvs",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/ro_ro
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"Name is already taken, please choose another."
"nameTaken":"Name is already taken, please choose another.",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"vector",
Expand Down
3 changes: 2 additions & 1 deletion www/langs/REPLACE_BY_BUILD/zh_cn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"systemMsg":"System message"
},
"error":{
"nameTaken":"名称已被使用,请选择其他名称。"
"nameTaken":"名称已被使用,请选择其他名称。",
"nameTooLong":"Name is too long, max. allowed length is {LEN} characters."
},
"option":{
"aggArray":"数组",
Expand Down

0 comments on commit 13fe111

Please sign in to comment.