@tuki-io/tuki-widgets 0.0.136 → 0.0.138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -995,6 +995,7 @@ class DeviceProfile {
995
995
  return new FormGroup({
996
996
  name: new FormControl({ value: (line === null || line === void 0 ? void 0 : line.name) || undefined, disabled: true }),
997
997
  extension: new FormControl({ value: (line === null || line === void 0 ? void 0 : line.extension) || undefined, disabled: true }),
998
+ number: new FormControl({ value: (line === null || line === void 0 ? void 0 : line.extension) || undefined, disabled: true }),
998
999
  });
999
1000
  })) !== null && _e !== void 0 ? _e : [])),
1000
1001
  activationState: new FormControl({ value: config.activationState || false, disabled: true }),
@@ -1165,9 +1166,11 @@ class UserService {
1165
1166
  this._userLastName = user.lastName;
1166
1167
  const foundDevice = user.devices.find((device) => device.deviceType === deviceType);
1167
1168
  this._userDevice = new DeviceProfile(Object.assign(Object.assign({}, foundDevice), { model: foundDevice === null || foundDevice === void 0 ? void 0 : foundDevice.deviceType, macAddress: this.getMacAddress(foundDevice.name), lines: (_a = foundDevice === null || foundDevice === void 0 ? void 0 : foundDevice.lineAssociations) === null || _a === void 0 ? void 0 : _a.map((line) => {
1169
+ var _a, _b;
1168
1170
  return {
1169
- name: line && line.directoryNumber && line.directoryNumber.routePartitionName && line.directoryNumber.routePartitionName || '',
1171
+ name: `${this._userName} ${this._userLastName}`,
1170
1172
  extension: line && line.directoryNumber && line.directoryNumber.routePartitionName && line.directoryNumber.directoryNumber || '',
1173
+ number: ((_b = (_a = foundDevice === null || foundDevice === void 0 ? void 0 : foundDevice.lines) === null || _a === void 0 ? void 0 : _a.find((l) => l.pkid === line.pkid)) === null || _b === void 0 ? void 0 : _b.mappedDids[0]) || '',
1171
1174
  };
1172
1175
  }), softwareVersion: foundDevice === null || foundDevice === void 0 ? void 0 : foundDevice.firmwareVersion }));
1173
1176
  }
@@ -1175,8 +1178,16 @@ class UserService {
1175
1178
  }));
1176
1179
  }
1177
1180
  getMacAddress(name) {
1178
- const macAddress = name.match(/\d+/g);
1179
- return macAddress && macAddress[0] && macAddress[0].length === 12 ? macAddress[0] : undefined;
1181
+ const macRegex = /^[A-Fa-f0-9]{12}$/;
1182
+ let macAddress;
1183
+ if (name.length === 12 && macRegex.test(name)) {
1184
+ macAddress = name;
1185
+ }
1186
+ else {
1187
+ const trimmed = name.slice(3);
1188
+ macAddress = macRegex.test(trimmed) ? trimmed : undefined;
1189
+ }
1190
+ return macAddress;
1180
1191
  }
1181
1192
  fetchWebexUserDevice(customerId, userId, deviceType) {
1182
1193
  return forkJoin([