@colijnit/sharedcomponents 260.1.3 → 260.1.5

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.
@@ -2101,12 +2101,12 @@
2101
2101
  });
2102
2102
  });
2103
2103
  };
2104
- SharedConnectorService.prototype.getFormResponse = function (formResponseId) {
2104
+ SharedConnectorService.prototype.insertFormResponse = function (formResponse) {
2105
2105
  return __awaiter(this, void 0, void 0, function () {
2106
2106
  var _this = this;
2107
2107
  return __generator(this, function (_a) {
2108
2108
  return [2 /*return*/, new Promise(function (resolve, reject) {
2109
- return _this.mainConnector.getFormResponse(formResponseId).then(function (result) {
2109
+ return _this.mainConnector.insertFormResponse(formResponse).then(function (result) {
2110
2110
  if (result.validationResult && result.validationResult.success) {
2111
2111
  if (result.resultObject) {
2112
2112
  resolve(_this._boFactory.makeWithRawBackendData(formResponse_bo.FormResponse, result.resultObject));
@@ -2120,12 +2120,12 @@
2120
2120
  });
2121
2121
  });
2122
2122
  };
2123
- SharedConnectorService.prototype.insertFormResponse = function (formResponse) {
2123
+ SharedConnectorService.prototype.updateFormResponse = function (formResponse) {
2124
2124
  return __awaiter(this, void 0, void 0, function () {
2125
2125
  var _this = this;
2126
2126
  return __generator(this, function (_a) {
2127
2127
  return [2 /*return*/, new Promise(function (resolve, reject) {
2128
- return _this.mainConnector.insertFormResponse(formResponse).then(function (result) {
2128
+ return _this.mainConnector.updateFormResponse(formResponse).then(function (result) {
2129
2129
  if (result.validationResult && result.validationResult.success) {
2130
2130
  if (result.resultObject) {
2131
2131
  resolve(_this._boFactory.makeWithRawBackendData(formResponse_bo.FormResponse, result.resultObject));
@@ -2139,19 +2139,34 @@
2139
2139
  });
2140
2140
  });
2141
2141
  };
2142
- SharedConnectorService.prototype.updateFormResponse = function (formResponse) {
2142
+ SharedConnectorService.prototype.lockFormResponse = function (formResponseId) {
2143
2143
  return __awaiter(this, void 0, void 0, function () {
2144
2144
  var _this = this;
2145
2145
  return __generator(this, function (_a) {
2146
2146
  return [2 /*return*/, new Promise(function (resolve, reject) {
2147
- return _this.mainConnector.updateFormResponse(formResponse).then(function (result) {
2147
+ return _this.mainConnector.lockFormResponse(formResponseId).then(function (result) {
2148
2148
  if (result.validationResult && result.validationResult.success) {
2149
- if (result.resultObject) {
2150
- resolve(_this._boFactory.makeWithRawBackendData(formResponse_bo.FormResponse, result.resultObject));
2151
- }
2149
+ resolve(true);
2152
2150
  }
2153
2151
  else {
2154
- reject(result.validationMessagesAsString);
2152
+ reject(result.validationResult.messages[0].message);
2153
+ }
2154
+ });
2155
+ })];
2156
+ });
2157
+ });
2158
+ };
2159
+ SharedConnectorService.prototype.unlockFormResponse = function (formResponseId) {
2160
+ return __awaiter(this, void 0, void 0, function () {
2161
+ var _this = this;
2162
+ return __generator(this, function (_a) {
2163
+ return [2 /*return*/, new Promise(function (resolve, reject) {
2164
+ return _this.mainConnector.unlockFormResponse(formResponseId).then(function (result) {
2165
+ if (result.validationResult && result.validationResult.success) {
2166
+ resolve(true);
2167
+ }
2168
+ else {
2169
+ reject(result.validationResult.messages[0].message);
2155
2170
  }
2156
2171
  });
2157
2172
  })];
@@ -4924,7 +4939,6 @@
4924
4939
  },] }
4925
4940
  ];
4926
4941
 
4927
- ;
4928
4942
  var SendMethodPurchaseComponent = /** @class */ (function () {
4929
4943
  function SendMethodPurchaseComponent(sendMethodService) {
4930
4944
  this.sendMethodService = sendMethodService;
@@ -4942,7 +4956,8 @@
4942
4956
  this.overruleOptions = [
4943
4957
  { code: 1, description: 'Print' },
4944
4958
  { code: 2, description: 'E-mail' },
4945
- { code: 3, description: 'EDI' }
4959
+ { code: 3, description: 'EDI' },
4960
+ { code: 8, description: 'PDF' }
4946
4961
  ];
4947
4962
  }
4948
4963
  SendMethodPurchaseComponent.prototype.showClass = function () {
@@ -16436,12 +16451,12 @@
16436
16451
  this._formMasterService = _formMasterService;
16437
16452
  this.icons = exports["ɵcd"];
16438
16453
  this.table = tableName_enum.TableName.Transactions;
16454
+ this.allowEmailing = true;
16439
16455
  this.activityCreated = new i0.EventEmitter();
16440
- this.optionCollection = [
16441
- { icon: this.iconService.getIcon(this.icons.CommentRegular), label: this.dictionaryService.get('REMARK', true) },
16442
- { icon: this.iconService.getIcon(this.icons.PersonDiggingRegular), label: this.dictionaryService.get('WORK', true) },
16443
- { icon: this.iconService.getIcon(this.icons.ListUlRegular), label: this.dictionaryService.get('TASK', true) },
16444
- ];
16456
+ this.optionCollection = [];
16457
+ this.remarkListItem = { icon: this.iconService.getIcon(this.icons.CommentRegular), label: this.dictionaryService.get('REMARK', true) };
16458
+ this.workListItem = { icon: this.iconService.getIcon(this.icons.PersonDiggingRegular), label: this.dictionaryService.get('WORK', true) };
16459
+ this.taskListItem = { icon: this.iconService.getIcon(this.icons.ListUlRegular), label: this.dictionaryService.get('TASK', true) };
16445
16460
  this.showFilesDialog = false;
16446
16461
  this.documents = [];
16447
16462
  this.oldDocuments = [];
@@ -16454,7 +16469,34 @@
16454
16469
  this.workDescription = "";
16455
16470
  this.taskName = "";
16456
16471
  this.taskDescription = "";
16472
+ this._allowRemarkCreation = true;
16473
+ this._allowWorkCreation = true;
16474
+ this._allowTaskCreation = true;
16457
16475
  }
16476
+ Object.defineProperty(TaskCreatorComponent.prototype, "allowRemarkCreation", {
16477
+ set: function (allow) {
16478
+ this._allowRemarkCreation = allow;
16479
+ this.setupOptionCollection();
16480
+ },
16481
+ enumerable: false,
16482
+ configurable: true
16483
+ });
16484
+ Object.defineProperty(TaskCreatorComponent.prototype, "allowWorkCreation", {
16485
+ set: function (allow) {
16486
+ this._allowWorkCreation = allow;
16487
+ this.setupOptionCollection();
16488
+ },
16489
+ enumerable: false,
16490
+ configurable: true
16491
+ });
16492
+ Object.defineProperty(TaskCreatorComponent.prototype, "allowTaskCreation", {
16493
+ set: function (allow) {
16494
+ this._allowTaskCreation = allow;
16495
+ this.setupOptionCollection();
16496
+ },
16497
+ enumerable: false,
16498
+ configurable: true
16499
+ });
16458
16500
  TaskCreatorComponent.prototype.showClass = function () {
16459
16501
  return true;
16460
16502
  };
@@ -16464,7 +16506,7 @@
16464
16506
  return __generator(this, function (_b) {
16465
16507
  switch (_b.label) {
16466
16508
  case 0:
16467
- this.chosenActivityType = this.optionCollection[0];
16509
+ this.setupOptionCollection();
16468
16510
  _a = this;
16469
16511
  return [4 /*yield*/, this.sharedService.getEmailSenderByWorkflowCategoryAndKey('SERVICE_ORDER', this.remarkAndWorkKey)];
16470
16512
  case 1:
@@ -16474,6 +16516,21 @@
16474
16516
  });
16475
16517
  });
16476
16518
  };
16519
+ TaskCreatorComponent.prototype.setupOptionCollection = function () {
16520
+ this.optionCollection = [];
16521
+ if (this._allowRemarkCreation) {
16522
+ this.optionCollection.push(this.remarkListItem);
16523
+ }
16524
+ if (this._allowWorkCreation) {
16525
+ this.optionCollection.push(this.workListItem);
16526
+ }
16527
+ if (this._allowTaskCreation) {
16528
+ this.optionCollection.push(this.taskListItem);
16529
+ }
16530
+ if (this.optionCollection.length > 0) {
16531
+ this.chosenActivityType = this.optionCollection[0];
16532
+ }
16533
+ };
16477
16534
  TaskCreatorComponent.prototype.itemSelected = function (item) {
16478
16535
  this.chosenActivityType = item;
16479
16536
  };
@@ -16666,10 +16723,10 @@
16666
16723
  });
16667
16724
  };
16668
16725
  TaskCreatorComponent.prototype.findReportType = function () {
16669
- if (this.chosenActivityType === this.optionCollection[0]) {
16726
+ if (this.chosenActivityType === this.remarkListItem) {
16670
16727
  return reportType_enum.ReportType.RemarkMessage;
16671
16728
  }
16672
- else if (this.chosenActivityType === this.optionCollection[1]) {
16729
+ else if (this.chosenActivityType === this.workListItem) {
16673
16730
  return reportType_enum.ReportType.WorkMessage;
16674
16731
  }
16675
16732
  else {
@@ -16703,13 +16760,13 @@
16703
16760
  history.emailAddresses = this._createEmailAddressString(this.emailAddresses);
16704
16761
  history.emailDateTime = new Date();
16705
16762
  history.message = 'Email Content created via Report';
16706
- if (!(this.chosenActivityType === this.optionCollection[0])) return [3 /*break*/, 3];
16763
+ if (!(this.chosenActivityType === this.remarkListItem)) return [3 /*break*/, 3];
16707
16764
  return [4 /*yield*/, this.sharedService.insertEmailHistoryForRemark(history)];
16708
16765
  case 2:
16709
16766
  _a.sent();
16710
16767
  return [3 /*break*/, 7];
16711
16768
  case 3:
16712
- if (!(this.chosenActivityType === this.optionCollection[1])) return [3 /*break*/, 5];
16769
+ if (!(this.chosenActivityType === this.workListItem)) return [3 /*break*/, 5];
16713
16770
  return [4 /*yield*/, this.sharedService.insertEmailHistoryForWork(history)];
16714
16771
  case 4:
16715
16772
  _a.sent();
@@ -16774,7 +16831,7 @@
16774
16831
  TaskCreatorComponent.decorators = [
16775
16832
  { type: i0.Component, args: [{
16776
16833
  selector: "co-task-creator",
16777
- template: "\n <div class=\"task-creator-wrapper\">\n <div class=\"top-rows\">\n <co-email-selector [(emailAddresses)]=\"emailAddresses\" [(bccEmailAddresses)]=\"bccEmailAddresses\"\n [key]=\"remarkAndWorkKey\" [workflowCategoryType]=\"workflowCategoryType\"></co-email-selector>\n <co-form #createForm class=\"creator-remarks input-fields\">\n <co-list-of-icons [collection]=\"optionCollection\" (itemSelected)=\"itemSelected($event)\"></co-list-of-icons>\n <co-input-textarea *ngIf=\"chosenActivityType === optionCollection[0]\"\n [required]=\"chosenActivityType === optionCollection[0]\"\n [placeholder]=\"'REMARK' | sharedLocalize\" [(model)]=\"remarkText\"\n class=\"large-remark\"></co-input-textarea>\n <co-input-textarea *ngIf=\"chosenActivityType === optionCollection[1]\"\n [required]=\"chosenActivityType === optionCollection[1]\"\n [placeholder]=\"'DESCRIPTION' | sharedLocalize\" [(model)]=\"workDescription\"\n class=\"large-remark\"></co-input-textarea>\n <div class=\"task-input-fields\" *ngIf=\"chosenActivityType === optionCollection[2]\">\n <co-input-text [(model)]=\"taskName\" [placeholder]=\"'NAME' | sharedLocalize\"\n [required]=\"chosenActivityType === optionCollection[2]\"></co-input-text>\n <co-input-textarea [(model)]=\"taskDescription\" [placeholder]=\"'DESCRIPTION' | sharedLocalize\"\n class=\"large-remark\"\n [required]=\"chosenActivityType === optionCollection[2]\"></co-input-textarea>\n </div>\n </co-form>\n </div>\n <div class=\"extras-buttons\">\n <co-button [iconData]=\"iconService.getIcon(icons.PaperclipRegular)\" (click)=\"openAttachmentDialog()\"\n [label]=\"documents.length === 0 ? '' : documents.length.toString()\"></co-button>\n <co-button *ngIf=\"chosenActivityType === optionCollection[0]\"\n [iconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (click)=\"createRemarkClicked()\"></co-button>\n <co-button *ngIf=\"chosenActivityType === optionCollection[1]\"\n [iconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (click)=\"createWorkClicked()\"></co-button>\n <co-button *ngIf=\"chosenActivityType === optionCollection[2]\"\n [iconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (click)=\"createTaskClicked()\"></co-button>\n </div>\n </div>\n <co-dialog *ngIf=\"showFilesDialog\" (closeClick)=\"attachmentDialogCancelled()\"\n [headerTemplate]=\"attachmentHeaderTemplate\"\n [footerTemplate]=\"attachmentFooterTemplate\">\n\n <ng-template #attachmentHeaderTemplate>\n <div class=\"co-dialog-wrapper-popup-title\">\n <co-icon [iconData]=\"iconService.getIcon(icons.PaperclipRegular)\"></co-icon>\n <div class=\"co-dialog-header-title\" [textContent]=\"'ATTACHMENTS' | sharedLocalize\"></div>\n </div>\n </ng-template>\n <co-files-upload (documentsAdded)=\"addedDocument($event)\" (documentDeleted)=\"deletedDocument\"\n [documents]=\"documents\" [useWithoutSettingProps]=\"true\"></co-files-upload>\n </co-dialog>\n\n\n <ng-template #attachmentFooterTemplate>\n <div class=\"co-dialog-footer-button-wrapper\">\n <co-button class=\"save-button\"\n [iconData]=\"iconService.getIcon(icons.CheckDuotone)\"\n (click)=\"attachmentDialogClosed()\"></co-button>\n <co-button class=\"close-button\"\n [iconData]=\"iconService.getIcon(icons.CrossSkinny)\"\n (click)=\"attachmentDialogCancelled()\"></co-button>\n </div>\n </ng-template>\n ",
16834
+ template: "\n <div class=\"task-creator-wrapper\">\n <div class=\"top-rows\">\n <co-email-selector [(emailAddresses)]=\"emailAddresses\" [(bccEmailAddresses)]=\"bccEmailAddresses\" *ngIf=\"allowEmailing\"\n [key]=\"remarkAndWorkKey\" [workflowCategoryType]=\"workflowCategoryType\"></co-email-selector>\n <co-form #createForm class=\"creator-remarks input-fields\">\n <co-list-of-icons [collection]=\"optionCollection\" (itemSelected)=\"itemSelected($event)\"></co-list-of-icons>\n <co-input-textarea *ngIf=\"chosenActivityType === remarkListItem\"\n [required]=\"chosenActivityType === remarkListItem\"\n [placeholder]=\"'REMARK' | sharedLocalize\" [(model)]=\"remarkText\"\n class=\"large-remark\"></co-input-textarea>\n <co-input-textarea *ngIf=\"chosenActivityType === workListItem\"\n [required]=\"chosenActivityType === workListItem\"\n [placeholder]=\"'DESCRIPTION' | sharedLocalize\" [(model)]=\"workDescription\"\n class=\"large-remark\"></co-input-textarea>\n <div class=\"task-input-fields\" *ngIf=\"chosenActivityType === taskListItem\">\n <co-input-text [(model)]=\"taskName\" [placeholder]=\"'NAME' | sharedLocalize\"\n [required]=\"chosenActivityType === taskListItem\"></co-input-text>\n <co-input-textarea [(model)]=\"taskDescription\" [placeholder]=\"'DESCRIPTION' | sharedLocalize\"\n class=\"large-remark\"\n [required]=\"chosenActivityType === taskListItem\"></co-input-textarea>\n </div>\n </co-form>\n </div>\n <div class=\"extras-buttons\">\n <co-button [iconData]=\"iconService.getIcon(icons.PaperclipRegular)\" (click)=\"openAttachmentDialog()\"\n [label]=\"documents.length === 0 ? '' : documents.length.toString()\"></co-button>\n <co-button *ngIf=\"chosenActivityType === remarkListItem\"\n [iconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (click)=\"createRemarkClicked()\"></co-button>\n <co-button *ngIf=\"chosenActivityType === workListItem\"\n [iconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (click)=\"createWorkClicked()\"></co-button>\n <co-button *ngIf=\"chosenActivityType === taskListItem\"\n [iconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (click)=\"createTaskClicked()\"></co-button>\n </div>\n </div>\n <co-dialog *ngIf=\"showFilesDialog\" (closeClick)=\"attachmentDialogCancelled()\"\n [headerTemplate]=\"attachmentHeaderTemplate\"\n [footerTemplate]=\"attachmentFooterTemplate\">\n\n <ng-template #attachmentHeaderTemplate>\n <div class=\"co-dialog-wrapper-popup-title\">\n <co-icon [iconData]=\"iconService.getIcon(icons.PaperclipRegular)\"></co-icon>\n <div class=\"co-dialog-header-title\" [textContent]=\"'ATTACHMENTS' | sharedLocalize\"></div>\n </div>\n </ng-template>\n <co-files-upload (documentsAdded)=\"addedDocument($event)\" (documentDeleted)=\"deletedDocument\"\n [documents]=\"documents\" [useWithoutSettingProps]=\"true\"></co-files-upload>\n </co-dialog>\n\n\n <ng-template #attachmentFooterTemplate>\n <div class=\"co-dialog-footer-button-wrapper\">\n <co-button class=\"save-button\"\n [iconData]=\"iconService.getIcon(icons.CheckDuotone)\"\n (click)=\"attachmentDialogClosed()\"></co-button>\n <co-button class=\"close-button\"\n [iconData]=\"iconService.getIcon(icons.CrossSkinny)\"\n (click)=\"attachmentDialogCancelled()\"></co-button>\n </div>\n </ng-template>\n ",
16778
16835
  providers: [
16779
16836
  corecomponents_v12.FormMasterService,
16780
16837
  {
@@ -16799,6 +16856,10 @@
16799
16856
  remarkAndWorkKey: [{ type: i0.Input }],
16800
16857
  taskKey: [{ type: i0.Input }],
16801
16858
  workflowCategoryType: [{ type: i0.Input }],
16859
+ allowRemarkCreation: [{ type: i0.Input }],
16860
+ allowWorkCreation: [{ type: i0.Input }],
16861
+ allowTaskCreation: [{ type: i0.Input }],
16862
+ allowEmailing: [{ type: i0.Input }],
16802
16863
  activityCreated: [{ type: i0.Output }],
16803
16864
  showClass: [{ type: i0.HostBinding, args: ["class.co-task-creator",] }],
16804
16865
  hidden: [{ type: i0.HostBinding, args: ['class.co-shared-hidden',] }]
@@ -17097,6 +17158,7 @@
17097
17158
  this.saveForm = new i0.EventEmitter();
17098
17159
  this.definitiveChange = new i0.EventEmitter();
17099
17160
  this.createNewFormResponse = new i0.EventEmitter();
17161
+ this.errorMessage = new i0.EventEmitter();
17100
17162
  this.cloneForm = NULL_FORM_FULL_OBJECT;
17101
17163
  }
17102
17164
  Object.defineProperty(FormBuilderUserFormComponent.prototype, "form", {
@@ -17140,13 +17202,32 @@
17140
17202
  this.saveForm.next(this.formResponse);
17141
17203
  };
17142
17204
  FormBuilderUserFormComponent.prototype.handleCancelForm = function () {
17143
- // if (this.userForm && this.userForm.responseId) {
17144
- // this._formRepo.unlockFormResponse(this.userForm.responseId);
17145
- // }
17146
- this.cloneForm = undefined;
17147
- this.userForm = undefined;
17148
- this.formResponse = undefined;
17149
- this.cancelForm.next();
17205
+ return __awaiter(this, void 0, void 0, function () {
17206
+ var e_1;
17207
+ return __generator(this, function (_b) {
17208
+ switch (_b.label) {
17209
+ case 0:
17210
+ if (!(this.userForm && this.userForm.responseId)) return [3 /*break*/, 4];
17211
+ _b.label = 1;
17212
+ case 1:
17213
+ _b.trys.push([1, 3, , 4]);
17214
+ return [4 /*yield*/, this._sharedConnectorService.unlockFormResponse(this.userForm.responseId)];
17215
+ case 2:
17216
+ _b.sent();
17217
+ return [3 /*break*/, 4];
17218
+ case 3:
17219
+ e_1 = _b.sent();
17220
+ this.errorMessage.emit(e_1);
17221
+ return [3 /*break*/, 4];
17222
+ case 4:
17223
+ this.cloneForm = undefined;
17224
+ this.userForm = undefined;
17225
+ this.formResponse = undefined;
17226
+ this.cancelForm.next();
17227
+ return [2 /*return*/];
17228
+ }
17229
+ });
17230
+ });
17150
17231
  };
17151
17232
  FormBuilderUserFormComponent.prototype.changeMultipleOption = function (id, formResponse, add) {
17152
17233
  var responseList = formResponse.response ? formResponse.response.split(',') : [];
@@ -17182,25 +17263,39 @@
17182
17263
  FormBuilderUserFormComponent.prototype._prepareNewForm = function () {
17183
17264
  var _a;
17184
17265
  return __awaiter(this, void 0, void 0, function () {
17266
+ var e_2;
17185
17267
  return __generator(this, function (_b) {
17186
- this.cloneForm = this._boFactory.makeWithRawBackendData(form_bo.Form, this.form);
17187
- if (!((_a = this.userForm) === null || _a === void 0 ? void 0 : _a.responseId)) {
17188
- this.formResponse = this._boFactory.makeWithRawBackendData(formResponse_bo.FormResponse, this.userForm);
17189
- this.formResponse.formId = this.form.formId;
17190
- this.formResponse.table = this.table;
17191
- this.formResponse.key = this.key;
17192
- FormUtils.MergeResponseWithForm(this.cloneForm, this.formResponse);
17193
- }
17194
- else {
17195
- this.mode = exports.UserFormMode.Edit;
17196
- // const isLockedSuccesfully: boolean = await this._formRepo.lockFormResponse(formResponseId);
17197
- this._prepareExistingForm();
17198
- }
17199
- this._loadDocs();
17200
- if (this.enableQuestions) {
17201
- this._enableQuestions();
17268
+ switch (_b.label) {
17269
+ case 0:
17270
+ this.cloneForm = this._boFactory.makeWithRawBackendData(form_bo.Form, this.form);
17271
+ if (!!((_a = this.userForm) === null || _a === void 0 ? void 0 : _a.responseId)) return [3 /*break*/, 1];
17272
+ this.formResponse = this._boFactory.makeWithRawBackendData(formResponse_bo.FormResponse, this.userForm);
17273
+ this.formResponse.formId = this.form.formId;
17274
+ this.formResponse.table = this.table;
17275
+ this.formResponse.key = this.key;
17276
+ FormUtils.MergeResponseWithForm(this.cloneForm, this.formResponse);
17277
+ return [3 /*break*/, 5];
17278
+ case 1:
17279
+ this.mode = exports.UserFormMode.Edit;
17280
+ this._prepareExistingForm();
17281
+ _b.label = 2;
17282
+ case 2:
17283
+ _b.trys.push([2, 4, , 5]);
17284
+ return [4 /*yield*/, this._sharedConnectorService.lockFormResponse(this.userForm.responseId)];
17285
+ case 3:
17286
+ _b.sent();
17287
+ return [3 /*break*/, 5];
17288
+ case 4:
17289
+ e_2 = _b.sent();
17290
+ this.errorMessage.emit(e_2);
17291
+ return [3 /*break*/, 5];
17292
+ case 5:
17293
+ this._loadDocs();
17294
+ if (this.enableQuestions) {
17295
+ this._enableQuestions();
17296
+ }
17297
+ return [2 /*return*/];
17202
17298
  }
17203
- return [2 /*return*/];
17204
17299
  });
17205
17300
  });
17206
17301
  };
@@ -17257,7 +17352,7 @@
17257
17352
  _this.handleCancelForm();
17258
17353
  }
17259
17354
  else {
17260
- _this._promptService.showError('ERROR_INSERT_FORM_RESPONSE', 'ERROR_INSERT_FORM_RESPONSE_TITLE');
17355
+ _this.errorMessage.emit("ERROR_INSERT_FORM_RESPONSE");
17261
17356
  }
17262
17357
  });
17263
17358
  this.createNewFormResponse.next(this.formResponse);
@@ -17269,7 +17364,7 @@
17269
17364
  _this.handleCancelForm();
17270
17365
  }
17271
17366
  else {
17272
- _this._promptService.showError('ERROR_SAVING_FORM_RESPONSE', 'ERROR_SAVING_FORM_RESPONSE_TITLE');
17367
+ _this.errorMessage.emit("ERROR_SAVING_FORM_RESPONSE");
17273
17368
  }
17274
17369
  });
17275
17370
  break;
@@ -17283,7 +17378,7 @@
17283
17378
  FormBuilderUserFormComponent.decorators = [
17284
17379
  { type: i0.Component, args: [{
17285
17380
  selector: 'co-form-builder-user-form',
17286
- template: "\n <co-dialog [headerTemplate]=\"headerTemplate\" [footerTemplate]=\"footerTemplate\" (closeClick)=\"handleCancelForm()\" >\n <div class=\"main-content-wrapper\">\n <div class=\"section-wrapper mini-scrollbar\" #sectionWrapper>\n <co-form #coForm (validSubmit)=\"onValid()\" [keepInView]=\"sectionWrapper\">\n <ng-container\n *ngFor=\"let question of cloneForm.questions; let index = index\">\n <div [class.active]=\"form.questions.indexOf(question) === form.questions.indexOf(activeQuestion)\" class=\"headers-row\" fxLayout=\"column\"\n [class.disabled]=\"question.disabled && index !== 0\"\n (keydown)=\"enabledNextQuestion(question)\">\n <span class=\"form-rubric-header\"\n [textContent]=\"question.sequence+ '. ' + (question.question)\"></span>\n <div class=\"answer-wrapper\" [ngSwitch]=\"question.questionType\">\n <co-input-text *ngSwitchCase=\"formQuestionType.ShortAnswer\"\n [(model)]=\"question.responseQuestion.response\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-text>\n <co-input-textarea *ngSwitchCase=\"formQuestionType.LongAnswer\"\n [(model)]=\"question.responseQuestion.response\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-textarea>\n <ng-container *ngSwitchCase=\"formQuestionType.MultipleChoiceSingleOption\"\n\n >\n <co-form>\n <co-input-radio-button *ngFor=\"let answer of question.formQuestionAnswers\"\n [label]=\"answer.answer\"\n [model]=\"answer.answerId == question.responseQuestion.response\"\n [disabled]=\"question.disabled && index !== 0\"\n (modelChange)=\"question.responseQuestion.response = answer.answerId + ''; enabledNextQuestion(question, answer)\"\n ></co-input-radio-button>\n </co-form>\n </ng-container>\n <ng-container *ngSwitchCase=\"formQuestionType.MultipleChoiceMultipleOptions\">\n <co-input-checkbox *ngFor=\"let answer of question.formQuestionAnswers\"\n [label]=\"answer.answer\"\n [readonly]=\"readonly\"\n [model]=\"question.responseQuestion.response ? \n question.responseQuestion.response.indexOf(answer.answerId) > -1 : \n question.responseQuestion.response\"\n [disabled]=\"question.disabled && index !== 0\"\n (modelChange)=\"changeMultipleOption(answer.answerId, question.responseQuestion, $event); enabledNextQuestion(question, answer)\"\n ></co-input-checkbox>\n </ng-container>\n <co-list-of-values *ngSwitchCase=\"formQuestionType.DropDownList\"\n [model]=\"question.responseQuestion\"\n [collection]=\"question.formQuestionAnswers\"\n [displayField]=\"'answer'\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n (modelChange)=\"changeLovOption(question.responseQuestion, $event); enabledNextQuestion(question, $event)\"\n ></co-list-of-values>\n <co-user-form-input-scale *ngSwitchCase=\"formQuestionType.LinearScale\"\n [label]=\"question.question\"\n [idField]=\"'answerId'\"\n [selected]=\"question.responseQuestion.response\"\n [scaleModel]=\"question.formQuestionAnswers\"\n [descriptionField]=\"'answer'\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n (selectionChange)=\"question.responseQuestion.response = $event.answerId + ''\"\n ></co-user-form-input-scale>\n <co-input-date *ngSwitchCase=\"formQuestionType.Date\"\n [(model)]=\"question.responseQuestion.dateResponse\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-date>\n <co-input-time *ngSwitchCase=\"formQuestionType.Time\"\n [model]=\"question.responseQuestion?.timeResponse ?? 1\"\n (modelChange)=\"changeTime(question.responseQuestion, $event)\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-time>\n </div>\n </div>\n <div class=\"goto-question\" *ngIf=\"question === activeQuestion && gotoQuestion\"\n [textContent]=\"('GOTO_NEXT_QUESTION' | sharedLocalize) + ' ' + gotoQuestion\"></div>\n </ng-container>\n </co-form>\n </div>\n <div class=\"section-wrapper mini-scrollbar\" #sectionWrapper>\n <co-input-checkbox [model]=\"formResponse?.isFinal\" (modelChange)=\"handleDefinitiveChange($event)\" [label]=\"'DEFINITIVE' | sharedLocalize\"></co-input-checkbox>\n </div>\n\n\n </div>\n\n </co-dialog>\n <ng-template #headerTemplate>\n <div class=\"header-wrapper\">\n <span class=\"form-title\" [textContent]=\"form?.formName\"></span>\n </div>\n </ng-template>\n <ng-template #footerTemplate>\n <div class=\"footer-wrapper\">\n <div class=\"attachments-wrapper\">\n <div class=\"row\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.PaperclipRegular)\" (click)=\"handleOpenFilesUpload()\"></co-icon>\n <input type=\"file\" accept=\"image/*\" capture=\"environment\">\n <co-files-upload #filesUploadComponent [documents]=\"formResponse.documents\" class=\"co-files-upload\"></co-files-upload>\n </div>\n </div>\n <div class=\"row\">\n <co-button class=\"save-button\" (click)=\"commitUserForm()\" [iconData]=\"iconCacheService.getIcon(icons.CheckDuotone)\"></co-button>\n <co-button class=\"close-button\" [iconData]=\"iconCacheService.getIcon(icons.CrossSkinny)\" (click)=\"handleCancelForm()\"></co-button>\n </div>\n </div>\n\n </ng-template>\n\n ",
17381
+ template: "\n <co-dialog [headerTemplate]=\"headerTemplate\" [footerTemplate]=\"footerTemplate\" (closeClick)=\"handleCancelForm()\">\n <div class=\"main-content-wrapper\">\n <div class=\"section-wrapper mini-scrollbar\" #sectionWrapper>\n <co-form #coForm (validSubmit)=\"onValid()\" [keepInView]=\"sectionWrapper\">\n <ng-container\n *ngFor=\"let question of cloneForm.questions; let index = index\">\n <div [class.active]=\"form.questions.indexOf(question) === form.questions.indexOf(activeQuestion)\" class=\"headers-row\" fxLayout=\"column\"\n [class.disabled]=\"question.disabled && index !== 0\"\n (keydown)=\"enabledNextQuestion(question)\">\n <span class=\"form-rubric-header\"\n [textContent]=\"question.sequence+ '. ' + (question.question)\"></span>\n <div class=\"answer-wrapper\" [ngSwitch]=\"question.questionType\">\n <co-input-text *ngSwitchCase=\"formQuestionType.ShortAnswer\"\n [(model)]=\"question.responseQuestion.response\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-text>\n <co-input-textarea *ngSwitchCase=\"formQuestionType.LongAnswer\"\n [(model)]=\"question.responseQuestion.response\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-textarea>\n <ng-container *ngSwitchCase=\"formQuestionType.MultipleChoiceSingleOption\"\n\n >\n <co-form>\n <co-input-radio-button *ngFor=\"let answer of question.formQuestionAnswers\"\n [label]=\"answer.answer\"\n [model]=\"answer.answerId == question.responseQuestion.response\"\n [disabled]=\"question.disabled && index !== 0\"\n (modelChange)=\"question.responseQuestion.response = answer.answerId + ''; enabledNextQuestion(question, answer)\"\n ></co-input-radio-button>\n </co-form>\n </ng-container>\n <ng-container *ngSwitchCase=\"formQuestionType.MultipleChoiceMultipleOptions\">\n <co-input-checkbox *ngFor=\"let answer of question.formQuestionAnswers\"\n [label]=\"answer.answer\"\n [readonly]=\"readonly\"\n [model]=\"question.responseQuestion.response ? \n question.responseQuestion.response.indexOf(answer.answerId) > -1 : \n question.responseQuestion.response\"\n [disabled]=\"question.disabled && index !== 0\"\n (modelChange)=\"changeMultipleOption(answer.answerId, question.responseQuestion, $event); enabledNextQuestion(question, answer)\"\n ></co-input-checkbox>\n </ng-container>\n <co-list-of-values *ngSwitchCase=\"formQuestionType.DropDownList\"\n [model]=\"question.responseQuestion\"\n [collection]=\"question.formQuestionAnswers\"\n [displayField]=\"'answer'\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n (modelChange)=\"changeLovOption(question.responseQuestion, $event); enabledNextQuestion(question, $event)\"\n ></co-list-of-values>\n <co-user-form-input-scale *ngSwitchCase=\"formQuestionType.LinearScale\"\n [label]=\"question.question\"\n [idField]=\"'answerId'\"\n [selected]=\"question.responseQuestion.response\"\n [scaleModel]=\"question.formQuestionAnswers\"\n [descriptionField]=\"'answer'\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n (selectionChange)=\"question.responseQuestion.response = $event.answerId + ''\"\n ></co-user-form-input-scale>\n <co-input-date *ngSwitchCase=\"formQuestionType.Date\"\n [(model)]=\"question.responseQuestion.dateResponse\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-date>\n <co-input-time *ngSwitchCase=\"formQuestionType.Time\"\n [model]=\"question.responseQuestion?.timeResponse ?? 1\"\n (modelChange)=\"changeTime(question.responseQuestion, $event)\"\n [required]=\"question.mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"question.disabled && index !== 0\"\n ></co-input-time>\n </div>\n </div>\n <div class=\"goto-question\" *ngIf=\"question === activeQuestion && gotoQuestion\"\n [textContent]=\"('GOTO_NEXT_QUESTION' | sharedLocalize) + ' ' + gotoQuestion\"></div>\n </ng-container>\n </co-form>\n </div>\n <div class=\"section-wrapper mini-scrollbar\" #sectionWrapper>\n <co-input-checkbox [model]=\"formResponse?.isFinal\" (modelChange)=\"handleDefinitiveChange($event)\" [label]=\"'DEFINITIVE' | sharedLocalize\"></co-input-checkbox>\n </div>\n\n\n </div>\n\n </co-dialog>\n <ng-template #headerTemplate>\n <div class=\"header-wrapper\">\n <span class=\"form-title\" [textContent]=\"form?.formName\"></span>\n </div>\n </ng-template>\n <ng-template #footerTemplate>\n <div class=\"footer-wrapper\">\n <div class=\"attachments-wrapper\">\n <div class=\"row\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.PaperclipRegular)\" (click)=\"handleOpenFilesUpload()\"></co-icon>\n <input type=\"file\" accept=\"image/*\" capture=\"environment\">\n <co-files-upload #filesUploadComponent [documents]=\"formResponse.documents\" class=\"co-files-upload\"></co-files-upload>\n </div>\n </div>\n <div class=\"row\">\n <co-button class=\"save-button\" (click)=\"commitUserForm()\" [iconData]=\"iconCacheService.getIcon(icons.CheckDuotone)\"></co-button>\n <co-button class=\"close-button\" [iconData]=\"iconCacheService.getIcon(icons.CrossSkinny)\" (click)=\"handleCancelForm()\"></co-button>\n </div>\n </div>\n\n </ng-template>\n\n ",
17287
17382
  encapsulation: i0.ViewEncapsulation.None
17288
17383
  },] }
17289
17384
  ];
@@ -17308,6 +17403,7 @@
17308
17403
  saveForm: [{ type: i0.Output }],
17309
17404
  definitiveChange: [{ type: i0.Output }],
17310
17405
  createNewFormResponse: [{ type: i0.Output }],
17406
+ errorMessage: [{ type: i0.Output }],
17311
17407
  showClass: [{ type: i0.HostBinding, args: ['class.co-form-builder-user-form',] }]
17312
17408
  };
17313
17409
  __decorate([