Skip to content

Commit

Permalink
fix(telecom.telephony): remove mgcp restriction list for change phone (
Browse files Browse the repository at this point in the history
…#14086)

ref: MANAGER-14948

Signed-off-by: Guillaume Hyenne <[email protected]>
  • Loading branch information
ghyenne committed Nov 29, 2024
1 parent 2514fcf commit c1e7d5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,11 @@ export const TELEPHONY_LINE_PHONE_CHOICE = {
},
};

export const TELEPHONY_LINE_PHONE_CHOICE_FOR_MGCP_PHONE = ['yealink.t53'];

export const PHONE_PROTOCOL = {
MGCP: 'mgcp',
};

export default {
TELEPHONY_LINE_PHONE_CHOICE,
TELEPHONY_LINE_PHONE_CHOICE_FOR_MGCP_PHONE,
PHONE_PROTOCOL,
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import orderBy from 'lodash/orderBy';
import set from 'lodash/set';
import upperFirst from 'lodash/upperFirst';

import {
TELEPHONY_LINE_PHONE_CHOICE,
TELEPHONY_LINE_PHONE_CHOICE_FOR_MGCP_PHONE,
PHONE_PROTOCOL,
} from './choice.constant';
import { TELEPHONY_LINE_PHONE_CHOICE } from './choice.constant';
import initializeBrandList from './choice.service';

export default class TelephonyLinePhoneOrderChoiceCtrl {
Expand Down Expand Up @@ -43,16 +39,12 @@ export default class TelephonyLinePhoneOrderChoiceCtrl {

this.isStepLoading = true;
if (this.phone) {
this.isMgcpPhone = this.phone.protocol === PHONE_PROTOCOL.MGCP;

return this.fetchMerchandiseAvailable()
.then((result) => {
map(result, (phone) => {
this.phoneListMap(phone);
});
this.merchandise = this.isMgcpPhone
? this.filterPhoneForMgcp(result)
: result;
this.merchandise = result;
})
.catch((err) => new this.TucToastError(err))
.finally(() => {
Expand All @@ -72,14 +64,6 @@ export default class TelephonyLinePhoneOrderChoiceCtrl {
});
}

filterPhoneForMgcp(phones) {
return phones.filter((phone) =>
TELEPHONY_LINE_PHONE_CHOICE_FOR_MGCP_PHONE.includes(
this.hasSuffixVersion(phone) ? phone.nameWithoutSuffix : phone.brand,
),
);
}

hasSuffixVersion = function hasSuffixVersion(phone) {
return phone.name
? phone.name.match(/.v[0-9]+$/)
Expand Down

0 comments on commit c1e7d5a

Please sign in to comment.