@everymatrix/stage-mm-verification-report 1.0.32 → 1.0.33

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.
Files changed (3) hide show
  1. package/main.js +19 -4
  2. package/main.js.map +1 -1
  3. package/package.json +1 -1
package/main.js CHANGED
@@ -52206,6 +52206,7 @@ var SaveTemplateModalComponent = class _SaveTemplateModalComponent {
52206
52206
  templateService = inject(TemplateService);
52207
52207
  globalMessageService = inject(GlobalMessageService);
52208
52208
  sessionService = inject(SessionService);
52209
+ sendingService = inject(SendingService);
52209
52210
  nameControl = new FormControl("", [
52210
52211
  Validators.required,
52211
52212
  Validators.pattern(/^[A-Za-z0-9\-_]+$/)
@@ -52252,7 +52253,7 @@ var SaveTemplateModalComponent = class _SaveTemplateModalComponent {
52252
52253
  }
52253
52254
  save() {
52254
52255
  this.loading.set(true);
52255
- this.templateService.saveTemplate(this.nameControl.value, this.descriptionControl.value, this.params(), this.reportId(), this.radioButtonControl.value === "existing" ? this.template?.template_id : null, false).pipe(take(1)).subscribe({
52256
+ this.deleteSchedulesIfNeeded(this.template).pipe(switchMap(() => this.templateService.saveTemplate(this.nameControl.value, this.descriptionControl.value, this.params(), this.reportId(), this.radioButtonControl.value === "existing" ? this.template?.template_id : null, false).pipe(take(1)))).subscribe({
52256
52257
  next: (template) => {
52257
52258
  this.radioButtonControl.setValue("existing");
52258
52259
  if (this.template?.template_id !== template.template_id) {
@@ -52296,6 +52297,19 @@ var SaveTemplateModalComponent = class _SaveTemplateModalComponent {
52296
52297
  showWarningMessage = () => {
52297
52298
  return this.isTemplatePresent && this.isExisting && (this.selectedDifferentSiteId() || this.hasConfiguredSendOptions());
52298
52299
  };
52300
+ deleteSchedulesIfNeeded(template) {
52301
+ const reportKey = Object.values(REPORTS).find((r) => r.reportId === template?.report_id)?.reportKey;
52302
+ if (!template || !template?.input_params.send_option || this.radioButtonControl.value !== "existing" || !reportKey) {
52303
+ return of(null);
52304
+ }
52305
+ return this.getSchedules(template, reportKey).pipe(take(1), switchMap((schedulesData) => {
52306
+ const deleteObservables = schedulesData.flatMap((schedule) => schedule.schedules.map((scheduleItem) => from(this.sendingService.deleteSchedule(template.domain_id, scheduleItem.schedule_id))));
52307
+ return deleteObservables.length > 0 ? forkJoin(deleteObservables) : of(null);
52308
+ }));
52309
+ }
52310
+ getSchedules(template, reportKey) {
52311
+ return this.sendingService.getSchedules(reportKey, template.template_id, template.domain_id);
52312
+ }
52299
52313
  static \u0275fac = function SaveTemplateModalComponent_Factory(__ngFactoryType__) {
52300
52314
  return new (__ngFactoryType__ || _SaveTemplateModalComponent)();
52301
52315
  };
@@ -52479,7 +52493,7 @@ var SaveTemplateModalComponent = class _SaveTemplateModalComponent {
52479
52493
  }], () => [], null);
52480
52494
  })();
52481
52495
  (() => {
52482
- (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(SaveTemplateModalComponent, { className: "SaveTemplateModalComponent", filePath: "libs/shared/ui/components/src/lib/modals/save-template-modal/save-template-modal.component.ts", lineNumber: 158 });
52496
+ (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(SaveTemplateModalComponent, { className: "SaveTemplateModalComponent", filePath: "libs/shared/ui/components/src/lib/modals/save-template-modal/save-template-modal.component.ts", lineNumber: 161 });
52483
52497
  })();
52484
52498
 
52485
52499
  // node_modules/primeng/fesm2022/primeng-dragdrop.mjs
@@ -53799,7 +53813,7 @@ function SendSettingsModalComponent_Conditional_0_Conditional_10_Conditional_3_T
53799
53813
  \u0275\u0275advance();
53800
53814
  \u0275\u0275property("control", ctx_r1.onceForm.get("folderName"));
53801
53815
  \u0275\u0275advance();
53802
- \u0275\u0275property("control", ctx_r1.onceForm.get("fileName"))("hint", ctx_r1.fileNameHint)("permanentHint", true)("suggestionsList", ctx_r1.fileNameVariables)("autocomplete", true)("searchCharacter", "#")("showEmptyMessage", false)("appendToBody", true);
53816
+ \u0275\u0275property("control", ctx_r1.onceForm.get("fileName"))("hint", ctx_r1.fileNameHint)("permanentHint", true)("suggestionsList", ctx_r1.onceFileNameVariables)("autocomplete", true)("searchCharacter", "#")("showEmptyMessage", false)("appendToBody", true);
53803
53817
  \u0275\u0275advance();
53804
53818
  \u0275\u0275property("options", ctx_r1.dateTimeFormatOptions())("filter", false)("hint", ctx_r1.dateTimeFormatHint)("permanentHint", true)("appendToBody", true);
53805
53819
  }
@@ -54229,6 +54243,7 @@ var SendSettingsModalComponent = class _SendSettingsModalComponent {
54229
54243
  mailTo = "";
54230
54244
  scheduleId = "";
54231
54245
  fileNameVariables = this.sendingService.fileNameVariables;
54246
+ onceFileNameVariables = this.sendingService.fileNameVariables.filter(({ id }) => id !== "schedule_name");
54232
54247
  constructor(fb, apiTracingInfo) {
54233
54248
  this.fb = fb;
54234
54249
  this.apiTracingInfo = apiTracingInfo;
@@ -54695,7 +54710,7 @@ var SendSettingsModalComponent = class _SendSettingsModalComponent {
54695
54710
  [permanentHint]="true"\r
54696
54711
  label="File Name"\r
54697
54712
  placeholder="File Name"\r
54698
- [suggestionsList]="fileNameVariables"\r
54713
+ [suggestionsList]="onceFileNameVariables"\r
54699
54714
  [autocomplete]="true"\r
54700
54715
  [searchCharacter]="'#'"\r
54701
54716
  [showEmptyMessage]="false"\r