@tsi-developpement/tsi-shared-ui 1.10.19 → 1.10.21

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.
@@ -501,6 +501,7 @@ const ReportingSegments = {
501
501
  getReportDescriminator: 'get-report-descriminator',
502
502
  deleteDefaultReportTemplateFile: 'delete-default-report-template-file',
503
503
  dashboardModule: 'dashboardmodule',
504
+ toggleSeedOnStartup: 'toggle-seed-on-startup',
504
505
  };
505
506
  const ReportingEndpoints = {
506
507
  addToBuiltInTemplate: (reportUid) => `${Segment.base}/${ReportingSegments.reporting}/${ReportingSegments.addReportToBuiltIn}/${reportUid}`,
@@ -526,6 +527,7 @@ const ReportingEndpoints = {
526
527
  makeReportLayoutAsDefaultLayout: () => `${Segment.base}/${ReportingSegments.reporting}/${ReportingSegments.makeReportTemplateLayoutAsDefault}`,
527
528
  getReportDescriminator: (entityName, propertyName, propertyValue) => `${Segment.base}/${ReportingSegments.reporting}/${ReportingSegments.getReportDescriminator}/${entityName}/${propertyName}/${propertyValue}`,
528
529
  getReportTemplateByModuleCode: (moduleCode) => `${Segment.reportingServiceBase}/api/${ReportingSegments.dashboardModule}/${moduleCode}`,
530
+ toggleSeedOnStartup: (formName, templateName) => `${Segment.base}/${ReportingSegments.reporting}/${ReportingSegments.toggleSeedOnStartup}/${formName}/${templateName}`,
529
531
  };
530
532
 
531
533
  const IdentityPlatformSegments = {
@@ -4499,6 +4501,9 @@ class ReportingService {
4499
4501
  deleteDefaultReportTemplateFile(formName, templateName) {
4500
4502
  return this.httpClient.delete(ReportingEndpoints.deleteDefaultReportTemplate(formName, templateName));
4501
4503
  }
4504
+ toggleSeedOnStartup(formName, templateName) {
4505
+ return this.httpClient.post(ReportingEndpoints.toggleSeedOnStartup(formName, templateName), {});
4506
+ }
4502
4507
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ReportingService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
4503
4508
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ReportingService, providedIn: 'root' }); }
4504
4509
  }
@@ -8487,11 +8492,23 @@ class EditableGridComponent extends TsiInputBase {
8487
8492
  if (this._isAutoRowNumber) {
8488
8493
  duplicatedRow[this._autoRowNumberField] = this._nextRowNumber();
8489
8494
  }
8490
- this.gridData.push(duplicatedRow);
8491
- this.isDirty = true;
8492
8495
  if (this.editableTable?.sortField && this.editableTable.sortOrder) {
8493
- this.editableTable?.value.push(duplicatedRow);
8496
+ const tableIndex = this.editableTable.value.indexOf(item, 0);
8497
+ if (tableIndex > -1) {
8498
+ this.editableTable.value.splice(tableIndex + 1, 0, duplicatedRow);
8499
+ }
8500
+ else {
8501
+ this.editableTable.value.push(duplicatedRow);
8502
+ }
8503
+ }
8504
+ const dataIndex = this.gridData.indexOf(item, 0);
8505
+ if (dataIndex > -1) {
8506
+ this.gridData.splice(dataIndex + 1, 0, duplicatedRow);
8507
+ }
8508
+ else {
8509
+ this.gridData.push(duplicatedRow);
8494
8510
  }
8511
+ this.isDirty = true;
8495
8512
  this.refreshSort();
8496
8513
  if (updateSelection) {
8497
8514
  this.selectedItem = duplicatedRow;
@@ -8500,7 +8517,7 @@ class EditableGridComponent extends TsiInputBase {
8500
8517
  : duplicatedRow;
8501
8518
  }
8502
8519
  const result = {
8503
- rowNumber: this.gridData.length - 1,
8520
+ rowNumber: this.gridData.indexOf(duplicatedRow),
8504
8521
  data: duplicatedRow
8505
8522
  };
8506
8523
  if (!skipEmit) {
@@ -19311,6 +19328,11 @@ class ManageReportingComponent extends TsiFormComponentBaseComponent {
19311
19328
  field: 'name',
19312
19329
  header: 'shared_reporting_report_name',
19313
19330
  },
19331
+ {
19332
+ field: 'seedOnStartup',
19333
+ header: 'shared_reporting_seed_on_startup',
19334
+ type: DisplayTypes.CHECKBOX_DISPLAY,
19335
+ },
19314
19336
  {
19315
19337
  field: 'reportTypeName',
19316
19338
  header: 'shared_reporting_report_type',
@@ -19331,6 +19353,14 @@ class ManageReportingComponent extends TsiFormComponentBaseComponent {
19331
19353
  styleClass: 'p-button-text p-button-primary',
19332
19354
  toolTipText: 'shared_reporting_add_to_my_list_report',
19333
19355
  },
19356
+ {
19357
+ header: '',
19358
+ field: 'Toggle_Seed_On_Startup',
19359
+ isButton: true,
19360
+ buttonIcon: 'pi pi-bolt',
19361
+ styleClass: 'p-button-text p-button-warning',
19362
+ toolTipText: 'shared_reporting_toggle_seed_on_startup',
19363
+ },
19334
19364
  ];
19335
19365
  }
19336
19366
  //#endregion
@@ -19348,6 +19378,12 @@ class ManageReportingComponent extends TsiFormComponentBaseComponent {
19348
19378
  if (buttonDeleteDefaultReportFileIndex != -1) {
19349
19379
  this.defaultTemplateColumns.splice(buttonDeleteDefaultReportFileIndex, 1);
19350
19380
  }
19381
+ let buttonToggleSeedOnStartupIndex = this.defaultTemplateColumns.findIndex((col) => {
19382
+ return col.field == 'Toggle_Seed_On_Startup';
19383
+ });
19384
+ if (buttonToggleSeedOnStartupIndex != -1) {
19385
+ this.defaultTemplateColumns.splice(buttonToggleSeedOnStartupIndex, 1);
19386
+ }
19351
19387
  }
19352
19388
  }
19353
19389
  //handle Lifecycle Hooks
@@ -19486,6 +19522,11 @@ class ManageReportingComponent extends TsiFormComponentBaseComponent {
19486
19522
  this.deleteDefaultReportFile(event.key);
19487
19523
  break;
19488
19524
  }
19525
+ case 'Toggle_Seed_On_Startup': {
19526
+ console.log('Toggle_Seed_On_Startup');
19527
+ this._toggleSeedOnStartup(event.key);
19528
+ break;
19529
+ }
19489
19530
  default:
19490
19531
  break;
19491
19532
  }
@@ -20113,6 +20154,21 @@ class ManageReportingComponent extends TsiFormComponentBaseComponent {
20113
20154
  },
20114
20155
  });
20115
20156
  }
20157
+ //toggle whether a builtin report template should be auto-seeded on API startup
20158
+ _toggleSeedOnStartup(templateName) {
20159
+ let formName = this.otherFormName ?? this.EDITION_PERSONNALISE;
20160
+ this.reportingService
20161
+ .toggleSeedOnStartup(formName, templateName)
20162
+ .subscribe({
20163
+ next: async () => {
20164
+ await this._refreshReports(true);
20165
+ this.notificationService.success('shared_reporting_toggle_seed_on_startup_success');
20166
+ },
20167
+ error: (err) => {
20168
+ this.notificationService.error(this.errorMessageKey);
20169
+ },
20170
+ });
20171
+ }
20116
20172
  //add a report from the user list to built-in model template
20117
20173
  _addToBuiltInTemplates(reportId) {
20118
20174
  this.reportingService.addToBuiltInTemplate(reportId).subscribe({