Skip to content

Commit

Permalink
UI-2100: fix smart pbx validations
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMaitre committed Mar 25, 2016
1 parent c617250 commit adaaaf9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion submodules/devices/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ define(function(require){
monster.ui.protectField(templateDevice.find('#sip_password'), templateDevice);

monster.ui.tooltips(templateDevice);
templateDevice.find('#mac_address').mask("hh:hh:hh:hh:hh:hh", { placeholder:" " });
templateDevice.find('#mac_address').mask('FF:FF:FF:FF:FF:FF', {translation: {"F": { pattern:/[A-Fa-f0-9]/ }}});
templateDevice.find('.chosen-feature-key-user').chosen({ search_contains: true, width: 'inherit' });

if(!(data.media.encryption.enforce_security)) {
Expand Down
8 changes: 5 additions & 3 deletions submodules/groups/groups.css
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@
white-space: nowrap;
}

#groups_container .list-wrapper .item-row .input-extension {
margin: 0 5px 2px 5px;
width: 50px;
}

#groups_container .list-wrapper .item-row > * {
display: inline-block;
padding: 10px;
Expand All @@ -347,10 +352,7 @@

#groups_container .list-wrapper .item-row button {
margin-right: 15px;
padding: 2px;
width: 80px;
}

#groups_container .list-wrapper .empty-search-row,
#groups_container .list-wrapper .empty-row {
display: none;
Expand Down
4 changes: 4 additions & 0 deletions submodules/groups/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ define(function(require){

monster.ui.validate(groupForm);

groupForm.find('#inputExtension').mask('99ZZZZZZZZZZZZZZ', {translation: {'Z': {pattern: /[0-9]/, optional: true}}});

groupTemplate.find('#create_group').on('click', function() {
if(monster.ui.valid(groupForm)) {
var formattedData = self.groupsCreationMergeData(data, groupTemplate);
Expand Down Expand Up @@ -1248,6 +1250,8 @@ define(function(require){
newLineTemplate = $(monster.template(self, 'groups-newExtension', dataTemplate)),
$listExtensions = template.find('.list-assigned-items');

newLineTemplate.find('.input-extension').mask('99ZZZZZZZZZZZZZZ', {translation: {'Z': {pattern: /[0-9]/, optional: true}}});

listExtension.push(lastExtension);
$listExtensions.find('.empty-row').hide();

Expand Down
4 changes: 4 additions & 0 deletions submodules/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ define(function(require){
var originalData = self.usersFormatAddUser(results),
userTemplate = $(monster.template(self, 'users-creation', originalData));

userTemplate.find('#extension').mask('99ZZZZZZZZZZZZZZ', {translation: {'Z': {pattern: /[0-9]/, optional: true}}});

monster.ui.validate(userTemplate.find('#form_user_creation'), {
rules: {
'callflow.extension': {
Expand Down Expand Up @@ -717,6 +719,8 @@ define(function(require){
newLineTemplate = $(monster.template(self, 'users-newExtension', dataTemplate)),
listExtensions = template.find('.extensions .list-assigned-items');

newLineTemplate.find('.input-extension ').mask('99ZZZZZZZZZZZZZZ', {translation: {'Z': {pattern: /[0-9]/, optional: true}}});

listExtensions.find('.empty-row').hide();

listExtensions.append(newLineTemplate);
Expand Down

0 comments on commit adaaaf9

Please sign in to comment.