1
0
Fork 0

fixed issue #3822 - disabled input field for system collections (#3959)

This commit is contained in:
Heiko 2017-12-08 15:39:37 +01:00 committed by Jan
parent 6d1f238afb
commit b409fd06c8
2 changed files with 53 additions and 24 deletions

View File

@ -1,6 +1,8 @@
devel
-----
* UI: fixed issue #3822: disabled name input field for system collections
* fixed issue #3741: fix terminal color output in Windows
* UI: using default user database api during database creation now

View File

@ -228,30 +228,57 @@
var tableContent = [];
if (!isCoordinator) {
tableContent.push(
window.modalView.createTextEntry(
'change-collection-name',
'Name',
this.model.get('name'),
false,
'',
true,
[
{
rule: Joi.string().regex(/^[a-zA-Z]/),
msg: 'Collection name must always start with a letter.'
},
{
rule: Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),
msg: 'Only Symbols "_" and "-" are allowed.'
},
{
rule: Joi.string().required(),
msg: 'No collection name given.'
}
]
)
);
if (this.model.get('name').substr(0, 1) === '_') {
tableContent.push(
window.modalView.createReadOnlyEntry(
'change-collection-name',
'Name',
this.model.get('name'),
false,
'',
true,
[
{
rule: Joi.string().regex(/^[a-zA-Z]/),
msg: 'Collection name must always start with a letter.'
},
{
rule: Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),
msg: 'Only Symbols "_" and "-" are allowed.'
},
{
rule: Joi.string().required(),
msg: 'No collection name given.'
}
]
)
);
} else {
tableContent.push(
window.modalView.createTextEntry(
'change-collection-name',
'Name',
this.model.get('name'),
false,
'',
true,
[
{
rule: Joi.string().regex(/^[a-zA-Z]/),
msg: 'Collection name must always start with a letter.'
},
{
rule: Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),
msg: 'Only Symbols "_" and "-" are allowed.'
},
{
rule: Joi.string().required(),
msg: 'No collection name given.'
}
]
)
);
}
}
var after = function () {