@provoly/hypervisor 1.4.36 → 1.4.38

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.
@@ -1906,7 +1906,8 @@ class EventDetailComponent extends SubscriptionnerDirective {
1906
1906
  this.errors = [];
1907
1907
  events.forEach((event, idx) => {
1908
1908
  const eventErrors = [];
1909
- if (!event.name || event.name.length === 0) {
1909
+ const regex = new RegExp(/^\s+$/);
1910
+ if (!event.name || event.name.length === 0 || regex.test(event.name)) {
1910
1911
  eventErrors.push({ field: 'name', code: 'required' });
1911
1912
  }
1912
1913
  if (!event.category || event.category.length === 0) {
@@ -1915,7 +1916,7 @@ class EventDetailComponent extends SubscriptionnerDirective {
1915
1916
  if (!event.criticality || event.criticality.length === 0) {
1916
1917
  eventErrors.push({ field: 'criticality', code: 'required' });
1917
1918
  }
1918
- if (!event.description || event.description.length === 0) {
1919
+ if (!event.description || event.description.length === 0 || regex.test(event.description)) {
1919
1920
  eventErrors.push({ field: 'description', code: 'required' });
1920
1921
  }
1921
1922
  const equipment = event.equipment;
@@ -2369,7 +2370,20 @@ class EventListComponent extends SubscriptionnerDirective {
2369
2370
  this.Math = Math;
2370
2371
  this.padId = padId;
2371
2372
  this.store.dispatch(EventActions.load({}));
2372
- this.events$ = this.store.select(EventSelectors.events);
2373
+ this.events$ = this.store.select(EventSelectors.events).pipe(map((events) => events.map(event => {
2374
+ const regex = new RegExp('[^\\s]{100,}|[\\s]{100,}');
2375
+ const tooLongAdress = event.address.match(regex);
2376
+ let newAdress = event.address;
2377
+ if (tooLongAdress) {
2378
+ newAdress = newAdress
2379
+ .slice(0, tooLongAdress.index)
2380
+ .concat(tooLongAdress["0"].slice(0, 97).concat('...'));
2381
+ }
2382
+ return {
2383
+ ...event,
2384
+ address: newAdress
2385
+ };
2386
+ })));
2373
2387
  this.selectedIds$ = this.store.select(EventSelectors.selectedIds);
2374
2388
  this.allSelected$ = combineLatest([this.events$, this.selectedIds$]).pipe(map(([events, selectedIds]) => events.length > 0 && events.filter((ev) => !selectedIds.includes(ev.id)).length === 0));
2375
2389
  }