Skip to content
This repository was archived by the owner on Dec 23, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1520 from ovh-ux/develop
Browse files Browse the repository at this point in the history
Release v10.35.1
  • Loading branch information
antleblanc authored Sep 18, 2019
2 parents 8f0b157 + a619c15 commit 7633154
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ angular.module('managerApp').controller('XdslModemServiceCtrl', class XdslModemS
}).$promise
.then(({ xdslTask }) => {
sipAlg.value = xdslTask === 'enabled';
sipAlg.isDefine = true;
sipAlg.isDefined = true;
return xdslTask;
}).finally(() => {
this.modemServices.push(sipAlg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,29 @@ export default class TelecomTelephonyLinePhoneProgammableKeysCtrl {
/* ----- End of INITIALIZATION ------*/

getPhone() {
const regexp = new RegExp(/[a-z]+|[\d.-_]+/ig);
const complexNumericRegExp = new RegExp(/\d+/g);

function sortFunctionKeys(a, b) {
const [alphaA, numericA] = a.label.match(regexp);
const [alphaB, numericB] = b.label.match(regexp);
if (alphaA === alphaB) {
const [numericA1, numericA2] = numericA.match(complexNumericRegExp);
const [numericB1, numericB2] = numericB.match(complexNumericRegExp);

if (numericA1 === numericB1) {
return parseInt(numericA2, 10) > parseInt(numericB2, 10) ? 1 : -1;
}
return parseInt(numericA, 10) > parseInt(numericB, 10) ? 1 : -1;
}
return alphaA > alphaB ? 1 : -1;
}

return this.line.getPhone().then(() => {
if (this.line.hasPhone) {
return this.line.phone.initDeffered().then(() => {
this.functionKeys.raw = angular.copy(this.line.phone.functionKeys);
this.functionKeys.raw = _.cloneDeep(this.line.phone.functionKeys);
this.functionKeys.raw.sort(sortFunctionKeys);
});
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ angular.module('managerApp').controller('TelecomTelephonyLinePhoneRebootCtrl', f
.getGroup($stateParams.billingAccount)
.then(group => group.getLine($stateParams.serviceName).getPhone()).then((phone) => {
self.phone = phone;
self.isRebootable = /^phone\.(thomson|swissvoice)/.test(self.phone.brand);
self.isRebootable = !/^phone\.(gigaset|cisco.spa112)/.test(self.phone.brand);
})
.catch(err => new TucToastError(err))
.finally(() => {
Expand Down

0 comments on commit 7633154

Please sign in to comment.