@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.
@@ -987,6 +987,7 @@ class DeviceProfile {
987
987
  return new FormGroup({
988
988
  name: new FormControl({ value: line?.name || undefined, disabled: true }),
989
989
  extension: new FormControl({ value: line?.extension || undefined, disabled: true }),
990
+ number: new FormControl({ value: line?.extension || undefined, disabled: true }),
990
991
  });
991
992
  }) ?? [])),
992
993
  activationState: new FormControl({ value: config.activationState || false, disabled: true }),
@@ -1158,8 +1159,9 @@ class UserService {
1158
1159
  macAddress: this.getMacAddress(foundDevice.name),
1159
1160
  lines: foundDevice?.lineAssociations?.map((line) => {
1160
1161
  return {
1161
- name: line && line.directoryNumber && line.directoryNumber.routePartitionName && line.directoryNumber.routePartitionName || '',
1162
+ name: `${this._userName} ${this._userLastName}`,
1162
1163
  extension: line && line.directoryNumber && line.directoryNumber.routePartitionName && line.directoryNumber.directoryNumber || '',
1164
+ number: foundDevice?.lines?.find((l) => l.pkid === line.pkid)?.mappedDids[0] || '',
1163
1165
  };
1164
1166
  }),
1165
1167
  softwareVersion: foundDevice?.firmwareVersion
@@ -1169,8 +1171,16 @@ class UserService {
1169
1171
  }));
1170
1172
  }
1171
1173
  getMacAddress(name) {
1172
- const macAddress = name.match(/\d+/g);
1173
- return macAddress && macAddress[0] && macAddress[0].length === 12 ? macAddress[0] : undefined;
1174
+ const macRegex = /^[A-Fa-f0-9]{12}$/;
1175
+ let macAddress;
1176
+ if (name.length === 12 && macRegex.test(name)) {
1177
+ macAddress = name;
1178
+ }
1179
+ else {
1180
+ const trimmed = name.slice(3);
1181
+ macAddress = macRegex.test(trimmed) ? trimmed : undefined;
1182
+ }
1183
+ return macAddress;
1174
1184
  }
1175
1185
  fetchWebexUserDevice(customerId, userId, deviceType) {
1176
1186
  return forkJoin([