@colijnit/sharedcomponents 255.1.4 → 255.1.6

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.
@@ -1989,18 +1989,20 @@
1989
1989
  };
1990
1990
  SharedConnectorService.prototype.emailReport = function (emailJob) {
1991
1991
  return __awaiter(this, void 0, void 0, function () {
1992
- var _this = this;
1992
+ var result;
1993
1993
  return __generator(this, function (_a) {
1994
- return [2 /*return*/, new Promise(function (resolve, reject) {
1995
- return _this.mainConnector.emailReport(emailJob).then(function (result) {
1996
- if (result.validationResult && result.validationResult.success) {
1997
- resolve(result.resultObject);
1998
- }
1999
- else {
2000
- reject(result.validationMessagesAsString);
2001
- }
2002
- });
2003
- })];
1994
+ switch (_a.label) {
1995
+ case 0: return [4 /*yield*/, this.mainConnector.emailReport(emailJob)];
1996
+ case 1:
1997
+ result = _a.sent();
1998
+ if (result && result.validationResult && result.validationResult.success) {
1999
+ return [2 /*return*/, Promise.resolve(true)];
2000
+ }
2001
+ else {
2002
+ return [2 /*return*/, Promise.resolve(false)];
2003
+ }
2004
+ return [2 /*return*/];
2005
+ }
2004
2006
  });
2005
2007
  });
2006
2008
  };
@@ -11795,6 +11797,7 @@
11795
11797
  this.table = tableName_enum.TableName.Tasks;
11796
11798
  this.expandActivities = false;
11797
11799
  this.showTagPopup = false;
11800
+ this.allTags = [];
11798
11801
  }
11799
11802
  Object.defineProperty(ModifyTaskFormComponent.prototype, "activity", {
11800
11803
  get: function () {
@@ -13681,7 +13684,7 @@
13681
13684
  };
13682
13685
  RoleEmailSelectorComponent.prototype.removeOptionFromModel = function (email) {
13683
13686
  if (this.model.indexOf(email) > -1) {
13684
- this.model.splice(email.indexOf(email), 1);
13687
+ this.model.splice(this.model.indexOf(email), 1);
13685
13688
  }
13686
13689
  };
13687
13690
  return RoleEmailSelectorComponent;
@@ -13689,7 +13692,7 @@
13689
13692
  RoleEmailSelectorComponent.decorators = [
13690
13693
  { type: i0.Component, args: [{
13691
13694
  selector: "co-role-email-selector",
13692
- template: "\n <co-list-of-values [multiselect]=\"false\" [label]=\"recipientLabel | localize\"\n [collection]=\"emailAddressesAvailable\" [displayField]=\"'role'\"\n (modelChange)=\"roleChosen($event)\">\n </co-list-of-values>\n <co-input-text #inp [placeholder]=\"extraLabel | localize\"\n [rightIconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (rightIconClick)=\"addEmail(inp.model)\"></co-input-text>\n\n <div class=\"chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let email of model\">\n <span class=\"chips-description\" [textContent]=\"email\"></span>\n <co-icon class=\"remove-chip-icon\" [iconData]=\"iconService.getIcon(icons.CrossSkinny)\" (click)=\"removeOptionFromModel(email)\"></co-icon>\n </div>\n </div>\n\n "
13695
+ template: "\n <co-list-of-values [multiselect]=\"false\" [label]=\"recipientLabel | localize\"\n [collection]=\"emailAddressesAvailable\" [displayField]=\"'role'\"\n (modelChange)=\"roleChosen($event)\">\n </co-list-of-values>\n <co-input-text #inp [placeholder]=\"extraLabel | localize\"\n [rightIconData]=\"iconService.getIcon(icons.CheckSolid)\"\n (rightIconClick)=\"addEmail(inp.model)\"></co-input-text>\n\n <div class=\"chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let email of model\">\n <span class=\"chips-description\" [textContent]=\"email\"></span>\n <co-icon class=\"remove-chip-icon\" [iconData]=\"iconService.getIcon(icons.CrossSkinny)\" (click)=\"removeOptionFromModel(email)\"></co-icon>\n </div>\n </div>\n\n "
13693
13696
  },] }
13694
13697
  ];
13695
13698
  RoleEmailSelectorComponent.ctorParameters = function () { return [
@@ -14831,10 +14834,13 @@
14831
14834
  ];
14832
14835
  this.showFilesDialog = false;
14833
14836
  this.documents = [];
14837
+ this.oldDocuments = [];
14834
14838
  this.showEmailDialog = false;
14835
14839
  this.senderAddress = '';
14836
14840
  this.emailAddresses = [];
14837
14841
  this.bccEmailAddresses = [];
14842
+ this.oldEmailAddresses = [];
14843
+ this.oldBccEmailAddresses = [];
14838
14844
  this.emailRequest = null;
14839
14845
  this.remarkText = "";
14840
14846
  this.workDescription = "";
@@ -14863,6 +14869,17 @@
14863
14869
  TaskCreatorComponent.prototype.itemSelected = function (item) {
14864
14870
  this.chosenActivityType = item;
14865
14871
  };
14872
+ TaskCreatorComponent.prototype.openAttachmentDialog = function () {
14873
+ this.oldDocuments = this.documents.slice();
14874
+ this.showFilesDialog = true;
14875
+ };
14876
+ TaskCreatorComponent.prototype.attachmentDialogClosed = function () {
14877
+ this.showFilesDialog = false;
14878
+ };
14879
+ TaskCreatorComponent.prototype.attachmentDialogCancelled = function () {
14880
+ this.documents = this.oldDocuments.slice();
14881
+ this.showFilesDialog = false;
14882
+ };
14866
14883
  TaskCreatorComponent.prototype.addedDocument = function (docs) {
14867
14884
  return __awaiter(this, void 0, void 0, function () {
14868
14885
  return __generator(this, function (_a) {
@@ -14879,6 +14896,30 @@
14879
14896
  });
14880
14897
  });
14881
14898
  };
14899
+ TaskCreatorComponent.prototype.openEmailDialog = function () {
14900
+ this.showEmailDialog = true;
14901
+ this.oldEmailAddresses = this.emailAddresses.slice();
14902
+ this.oldBccEmailAddresses = this.bccEmailAddresses.slice();
14903
+ };
14904
+ TaskCreatorComponent.prototype.emailDialogClosed = function () {
14905
+ if (this.emailAddresses.length >= 0) {
14906
+ this.emailRequest = new activityEmailRequestData.activityEmailRequestData;
14907
+ this.emailRequest.table = this.table;
14908
+ this.emailRequest.key = this.remarkAndWorkKey;
14909
+ this.emailRequest.senderAddress = this.senderAddress;
14910
+ this.emailRequest.sendAddresses = this.emailAddresses;
14911
+ this.emailRequest.ccAddresses = this.bccEmailAddresses;
14912
+ }
14913
+ else {
14914
+ this.emailRequest = null;
14915
+ }
14916
+ this.showEmailDialog = false;
14917
+ };
14918
+ TaskCreatorComponent.prototype.emailDialogCancelled = function () {
14919
+ this.emailAddresses = this.oldEmailAddresses.slice();
14920
+ this.bccEmailAddresses = this.oldBccEmailAddresses.slice();
14921
+ this.showEmailDialog = false;
14922
+ };
14882
14923
  TaskCreatorComponent.prototype.createRemarkClicked = function () {
14883
14924
  return __awaiter(this, void 0, void 0, function () {
14884
14925
  var remark, activity, _a;
@@ -14886,7 +14927,7 @@
14886
14927
  switch (_b.label) {
14887
14928
  case 0:
14888
14929
  this._formMasterService.submitSlaves();
14889
- if (!this.createForm.isValid()) return [3 /*break*/, 2];
14930
+ if (!this.createForm.isValid()) return [3 /*break*/, 3];
14890
14931
  remark = this.createRemark();
14891
14932
  activity = new activity_bo.Activity();
14892
14933
  activity.activityType = activityType.ActivityType.Remark;
@@ -14895,29 +14936,16 @@
14895
14936
  return [4 /*yield*/, this.sharedService.insertRemark(activity)];
14896
14937
  case 1:
14897
14938
  _a.createdRemark = _b.sent();
14898
- if (this.createdRemark) {
14899
- this.handleAfterCreation();
14900
- }
14901
- _b.label = 2;
14902
- case 2: return [2 /*return*/];
14939
+ if (!this.createdRemark) return [3 /*break*/, 3];
14940
+ return [4 /*yield*/, this.handleAfterCreation()];
14941
+ case 2:
14942
+ _b.sent();
14943
+ _b.label = 3;
14944
+ case 3: return [2 /*return*/];
14903
14945
  }
14904
14946
  });
14905
14947
  });
14906
14948
  };
14907
- TaskCreatorComponent.prototype.emailDialogClosed = function () {
14908
- if (this.emailAddresses.length >= 0) {
14909
- this.emailRequest = new activityEmailRequestData.activityEmailRequestData;
14910
- this.emailRequest.table = this.table;
14911
- this.emailRequest.key = this.remarkAndWorkKey;
14912
- this.emailRequest.senderAddress = this.senderAddress;
14913
- this.emailRequest.sendAddresses = this.emailAddresses;
14914
- this.emailRequest.ccAddresses = this.bccEmailAddresses;
14915
- }
14916
- else {
14917
- this.emailRequest = null;
14918
- }
14919
- this.showEmailDialog = false;
14920
- };
14921
14949
  TaskCreatorComponent.prototype.createWorkClicked = function () {
14922
14950
  return __awaiter(this, void 0, void 0, function () {
14923
14951
  var work, activity, _a;
@@ -14935,11 +14963,9 @@
14935
14963
  case 1:
14936
14964
  _a.createdWork = _b.sent();
14937
14965
  if (!this.createdWork) return [3 /*break*/, 3];
14938
- this.activityCreated.emit();
14939
- return [4 /*yield*/, this.sendEmailIfNeccesary()];
14966
+ return [4 /*yield*/, this.handleAfterCreation()];
14940
14967
  case 2:
14941
14968
  _b.sent();
14942
- this.clearFields();
14943
14969
  _b.label = 3;
14944
14970
  case 3: return [2 /*return*/];
14945
14971
  }
@@ -14963,11 +14989,9 @@
14963
14989
  case 1:
14964
14990
  _a.createdTask = _b.sent();
14965
14991
  if (!this.createdTask) return [3 /*break*/, 3];
14966
- this.activityCreated.emit();
14967
- return [4 /*yield*/, this.sendEmailIfNeccesary()];
14992
+ return [4 /*yield*/, this.handleAfterCreation()];
14968
14993
  case 2:
14969
14994
  _b.sent();
14970
- this.clearFields();
14971
14995
  _b.label = 3;
14972
14996
  case 3: return [2 /*return*/];
14973
14997
  }
@@ -15082,7 +15106,7 @@
15082
15106
  var emailsSent, history;
15083
15107
  return __generator(this, function (_a) {
15084
15108
  switch (_a.label) {
15085
- case 0: return [4 /*yield*/, this.sharedService.emailViaTemplate(template, this.createEmailAddressString(this.emailAddresses), this.createEmailAddressString(this.bccEmailAddresses), this.senderAddress, this.createEmailSubject(), "", null /*this.createAttachmentsStringArray()*/, this.createEmailParams())];
15109
+ case 0: return [4 /*yield*/, this.sharedService.emailViaTemplate(template, this.createEmailAddressString(this.emailAddresses), this.createEmailAddressString(this.bccEmailAddresses), this.senderAddress, this.createEmailSubject(), "", [], this.createEmailParams())];
15086
15110
  case 1:
15087
15111
  emailsSent = _a.sent();
15088
15112
  if (!emailsSent) return [3 /*break*/, 7];
@@ -15110,19 +15134,6 @@
15110
15134
  });
15111
15135
  });
15112
15136
  };
15113
- TaskCreatorComponent.prototype.registerSentEmails = function () {
15114
- return __awaiter(this, void 0, void 0, function () {
15115
- var history;
15116
- return __generator(this, function (_a) {
15117
- history = new activityEmailHistory_bo.ActivityEmailHistory();
15118
- history.emailAddresses = this.createEmailAddressString(this.emailAddresses) + ';' + this.createEmailAddressString(this.bccEmailAddresses);
15119
- //history.attachments = this.createAttachmentsStringArray();
15120
- history.message = '';
15121
- history.emailDateTime = new Date();
15122
- return [2 /*return*/];
15123
- });
15124
- });
15125
- };
15126
15137
  TaskCreatorComponent.prototype.createEmailAddressString = function (addresses) {
15127
15138
  if (addresses.length === 0) {
15128
15139
  return '';
@@ -15193,7 +15204,7 @@
15193
15204
  TaskCreatorComponent.decorators = [
15194
15205
  { type: i0.Component, args: [{
15195
15206
  selector: "co-task-creator",
15196
- template: "\n <co-form #createForm class=\"input-fields\">\n <co-list-of-icons [collection]=\"optionCollection\" (itemSelected)=\"itemSelected($event)\"></co-list-of-icons>\n <co-input-text *ngIf=\"chosenActivityType === optionCollection[0]\" [required]=\"chosenActivityType === optionCollection[0]\"\n [placeholder]=\"'REMARK' | localize\" [(model)]=\"remarkText\"\n [rightIconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (rightIconClick)=\"createRemarkClicked()\"></co-input-text>\n <co-input-text *ngIf=\"chosenActivityType === optionCollection[1]\" [required]=\"chosenActivityType === optionCollection[1]\"\n [placeholder]=\"'DESCRIPTION' | localize\" [(model)]=\"workDescription\"\n [rightIconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (rightIconClick)=\"createWorkClicked()\"></co-input-text>\n <div class=\"task-input-fields\" *ngIf=\"chosenActivityType === optionCollection[2]\">\n <co-input-text [(model)]=\"taskName\" [placeholder]=\"'NAME' | localize\" [required]=\"chosenActivityType === optionCollection[2]\"\n [rightIconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (rightIconClick)=\"createTaskClicked()\"></co-input-text>\n <co-input-text [(model)]=\"taskDescription\" [placeholder]=\"'DESCRIPTION' | localize\" [required]=\"chosenActivityType === optionCollection[2]\"></co-input-text>\n </div>\n </co-form>\n <div class=\"extras-buttons\">\n <co-button [iconData]=\"iconService.getIcon(icons.EmailRegular)\" (click)=\"showEmailDialog = true\"></co-button>\n <co-button [iconData]=\"iconService.getIcon(icons.PaperclipRegular)\" (click)=\"showFilesDialog = true\"\n [label]=\"documents.length === 0 ? '' : documents.length.toString()\" ></co-button>\n </div>\n\n <co-dialog *ngIf=\"showFilesDialog\" (closeClick)=\"showFilesDialog = false\">\n <co-files-upload (documentsAdded)=\"addedDocument($event)\" (documentDeleted)=\"deletedDocument\"\n [documents]=\"documents\" [useWithoutSettingProps]=\"true\"></co-files-upload>\n </co-dialog>\n <co-dialog *ngIf=\"showEmailDialog\" (closeClick)=\"emailDialogClosed()\" [footerTemplate]=\"footerTemplate\">\n <co-role-email-selector [(model)]=\"emailAddresses\" [key]=\"remarkAndWorkKey\" [workflowCategoryType]=\"workflowCategoryType\"></co-role-email-selector>\n <co-role-email-selector [(model)]=\"bccEmailAddresses\" [key]=\"remarkAndWorkKey\" [workflowCategoryType]=\"workflowCategoryType\" [recipientLabel]=\"'BCC_RECIPIENT'\" [extraLabel]=\"'BCC_EXTRA_EMAIL_ADDRESSES'\"></co-role-email-selector>\n <!--TODO: reimplement once we have the backend functionality for this-->\n <!--<co-input-text [readonly]=\"false\" [label]=\"'SENDER' | localize\" [(model)]=\"senderAddress\"></co-input-text>-->\n\n </co-dialog>\n\n <ng-template #footerTemplate>\n <div class=\"co-dialog-footer-button-wrapper\">\n <co-button class=\"save-button\"\n [iconData]=\"iconService.getIcon(icons.CheckDuotone)\"\n (click)=\"emailDialogClosed()\"></co-button>\n <co-button class=\"close-button\"\n [iconData]=\"iconService.getIcon(icons.CrossSkinny)\"\n (click)=\"emailDialogClosed()\"></co-button>\n </div>\n </ng-template>\n ",
15207
+ template: "\n <co-form #createForm class=\"input-fields\">\n <co-list-of-icons [collection]=\"optionCollection\" (itemSelected)=\"itemSelected($event)\"></co-list-of-icons>\n <co-input-text *ngIf=\"chosenActivityType === optionCollection[0]\" [required]=\"chosenActivityType === optionCollection[0]\"\n [placeholder]=\"'REMARK' | localize\" [(model)]=\"remarkText\"\n [rightIconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (rightIconClick)=\"createRemarkClicked()\"></co-input-text>\n <co-input-text *ngIf=\"chosenActivityType === optionCollection[1]\" [required]=\"chosenActivityType === optionCollection[1]\"\n [placeholder]=\"'DESCRIPTION' | localize\" [(model)]=\"workDescription\"\n [rightIconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (rightIconClick)=\"createWorkClicked()\"></co-input-text>\n <div class=\"task-input-fields\" *ngIf=\"chosenActivityType === optionCollection[2]\">\n <co-input-text [(model)]=\"taskName\" [placeholder]=\"'NAME' | localize\" [required]=\"chosenActivityType === optionCollection[2]\"\n [rightIconData]=\"iconService.getIcon(icons.PaperPlaneTopSolid)\"\n (rightIconClick)=\"createTaskClicked()\"></co-input-text>\n <co-input-text [(model)]=\"taskDescription\" [placeholder]=\"'DESCRIPTION' | localize\" [required]=\"chosenActivityType === optionCollection[2]\"></co-input-text>\n </div>\n </co-form>\n <div class=\"extras-buttons\">\n <co-button [iconData]=\"iconService.getIcon(icons.EmailRegular)\" (click)=\"openEmailDialog()\"></co-button>\n <co-button [iconData]=\"iconService.getIcon(icons.PaperclipRegular)\" (click)=\"openAttachmentDialog()\"\n [label]=\"documents.length === 0 ? '' : documents.length.toString()\" ></co-button>\n </div>\n\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' | localize\"></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\n\n <co-dialog *ngIf=\"showEmailDialog\" (closeClick)=\"emailDialogClosed()\"\n [footerTemplate]=\"emailFooterTemplate\"\n [headerTemplate]=\"emailheaderTemplate\">\n <ng-template #emailheaderTemplate>\n <div class=\"co-dialog-wrapper-popup-title\">\n <co-icon [iconData]=\"iconService.getIcon(icons.EmailRegular)\"></co-icon>\n <div class=\"co-dialog-header-title\" [textContent]=\"'SEND_EMAIL' | localize\"></div>\n </div>\n </ng-template>\n <co-role-email-selector [(model)]=\"emailAddresses\" [key]=\"remarkAndWorkKey\" [workflowCategoryType]=\"workflowCategoryType\"></co-role-email-selector>\n <co-role-email-selector [(model)]=\"bccEmailAddresses\" [key]=\"remarkAndWorkKey\" [workflowCategoryType]=\"workflowCategoryType\" [recipientLabel]=\"'BCC_RECIPIENT'\" [extraLabel]=\"'BCC_EXTRA_EMAIL_ADDRESSES'\"></co-role-email-selector>\n <!--TODO: reimplement once we have the backend functionality for this-->\n <!--<co-input-text [readonly]=\"false\" [label]=\"'SENDER' | localize\" [(model)]=\"senderAddress\"></co-input-text>-->\n\n </co-dialog>\n\n <ng-template #emailFooterTemplate>\n <div class=\"co-dialog-footer-button-wrapper\">\n <co-button class=\"save-button\"\n [iconData]=\"iconService.getIcon(icons.CheckDuotone)\"\n (click)=\"emailDialogClosed()\"></co-button>\n <co-button class=\"close-button\"\n [iconData]=\"iconService.getIcon(icons.CrossSkinny)\"\n (click)=\"emailDialogCancelled()\"></co-button>\n </div>\n </ng-template>\n ",
15197
15208
  providers: [
15198
15209
  corecomponents_v12.FormMasterService
15199
15210
  ]