@colijnit/sharedcomponents 255.1.5 → 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.
@@ -1340,16 +1340,13 @@ class SharedConnectorService {
1340
1340
  }
1341
1341
  emailReport(emailJob) {
1342
1342
  return __awaiter(this, void 0, void 0, function* () {
1343
- return new Promise((resolve, reject) => {
1344
- return this.mainConnector.emailReport(emailJob).then((result) => {
1345
- if (result.validationResult && result.validationResult.success) {
1346
- resolve(result.resultObject);
1347
- }
1348
- else {
1349
- reject(result.validationMessagesAsString);
1350
- }
1351
- });
1352
- });
1343
+ const result = yield this.mainConnector.emailReport(emailJob);
1344
+ if (result && result.validationResult && result.validationResult.success) {
1345
+ return Promise.resolve(true);
1346
+ }
1347
+ else {
1348
+ return Promise.resolve(false);
1349
+ }
1353
1350
  });
1354
1351
  }
1355
1352
  insertEmailHistoryForRemark(remarkId, history) {
@@ -12048,6 +12045,7 @@ class ModifyTaskFormComponent {
12048
12045
  this.table = TableName$1.Tasks;
12049
12046
  this.expandActivities = false;
12050
12047
  this.showTagPopup = false;
12048
+ this.allTags = [];
12051
12049
  }
12052
12050
  /* @ViewChild(ActivityActivitiesComponent, { static: true })
12053
12051
  public activityActivities: ActivityActivitiesComponent;*/
@@ -14142,7 +14140,7 @@ class RoleEmailSelectorComponent {
14142
14140
  }
14143
14141
  removeOptionFromModel(email) {
14144
14142
  if (this.model.indexOf(email) > -1) {
14145
- this.model.splice(email.indexOf(email), 1);
14143
+ this.model.splice(this.model.indexOf(email), 1);
14146
14144
  }
14147
14145
  }
14148
14146
  }
@@ -14155,7 +14153,7 @@ RoleEmailSelectorComponent.decorators = [
14155
14153
  (modelChange)="roleChosen($event)">
14156
14154
  </co-list-of-values>
14157
14155
  <co-input-text #inp [placeholder]="extraLabel | localize"
14158
- [rightIconData]="iconService.getIcon(icons.PaperPlaneTopSolid)"
14156
+ [rightIconData]="iconService.getIcon(icons.CheckSolid)"
14159
14157
  (rightIconClick)="addEmail(inp.model)"></co-input-text>
14160
14158
 
14161
14159
  <div class="chips-wrapper">
@@ -15286,10 +15284,13 @@ class TaskCreatorComponent {
15286
15284
  ];
15287
15285
  this.showFilesDialog = false;
15288
15286
  this.documents = [];
15287
+ this.oldDocuments = [];
15289
15288
  this.showEmailDialog = false;
15290
15289
  this.senderAddress = '';
15291
15290
  this.emailAddresses = [];
15292
15291
  this.bccEmailAddresses = [];
15292
+ this.oldEmailAddresses = [];
15293
+ this.oldBccEmailAddresses = [];
15293
15294
  this.emailRequest = null;
15294
15295
  this.remarkText = "";
15295
15296
  this.workDescription = "";
@@ -15308,6 +15309,17 @@ class TaskCreatorComponent {
15308
15309
  itemSelected(item) {
15309
15310
  this.chosenActivityType = item;
15310
15311
  }
15312
+ openAttachmentDialog() {
15313
+ this.oldDocuments = this.documents.slice();
15314
+ this.showFilesDialog = true;
15315
+ }
15316
+ attachmentDialogClosed() {
15317
+ this.showFilesDialog = false;
15318
+ }
15319
+ attachmentDialogCancelled() {
15320
+ this.documents = this.oldDocuments.slice();
15321
+ this.showFilesDialog = false;
15322
+ }
15311
15323
  addedDocument(docs) {
15312
15324
  return __awaiter(this, void 0, void 0, function* () {
15313
15325
  this.documents = this.documents.concat(docs);
@@ -15318,20 +15330,10 @@ class TaskCreatorComponent {
15318
15330
  ArrayUtils.RemoveElement(doc, this.documents);
15319
15331
  });
15320
15332
  }
15321
- createRemarkClicked() {
15322
- return __awaiter(this, void 0, void 0, function* () {
15323
- this._formMasterService.submitSlaves();
15324
- if (this.createForm.isValid()) {
15325
- let remark = this.createRemark();
15326
- let activity = new Activity();
15327
- activity.activityType = ActivityType.Remark;
15328
- activity.remark = remark;
15329
- this.createdRemark = yield this.sharedService.insertRemark(activity);
15330
- if (this.createdRemark) {
15331
- this.handleAfterCreation();
15332
- }
15333
- }
15334
- });
15333
+ openEmailDialog() {
15334
+ this.showEmailDialog = true;
15335
+ this.oldEmailAddresses = this.emailAddresses.slice();
15336
+ this.oldBccEmailAddresses = this.bccEmailAddresses.slice();
15335
15337
  }
15336
15338
  emailDialogClosed() {
15337
15339
  if (this.emailAddresses.length >= 0) {
@@ -15347,6 +15349,26 @@ class TaskCreatorComponent {
15347
15349
  }
15348
15350
  this.showEmailDialog = false;
15349
15351
  }
15352
+ emailDialogCancelled() {
15353
+ this.emailAddresses = this.oldEmailAddresses.slice();
15354
+ this.bccEmailAddresses = this.oldBccEmailAddresses.slice();
15355
+ this.showEmailDialog = false;
15356
+ }
15357
+ createRemarkClicked() {
15358
+ return __awaiter(this, void 0, void 0, function* () {
15359
+ this._formMasterService.submitSlaves();
15360
+ if (this.createForm.isValid()) {
15361
+ let remark = this.createRemark();
15362
+ let activity = new Activity();
15363
+ activity.activityType = ActivityType.Remark;
15364
+ activity.remark = remark;
15365
+ this.createdRemark = yield this.sharedService.insertRemark(activity);
15366
+ if (this.createdRemark) {
15367
+ yield this.handleAfterCreation();
15368
+ }
15369
+ }
15370
+ });
15371
+ }
15350
15372
  createWorkClicked() {
15351
15373
  return __awaiter(this, void 0, void 0, function* () {
15352
15374
  this._formMasterService.submitSlaves();
@@ -15357,9 +15379,7 @@ class TaskCreatorComponent {
15357
15379
  activity.work = work;
15358
15380
  this.createdWork = yield this.sharedService.insertWork(activity);
15359
15381
  if (this.createdWork) {
15360
- this.activityCreated.emit();
15361
- yield this.sendEmailIfNeccesary();
15362
- this.clearFields();
15382
+ yield this.handleAfterCreation();
15363
15383
  }
15364
15384
  }
15365
15385
  });
@@ -15374,9 +15394,7 @@ class TaskCreatorComponent {
15374
15394
  activity.task = task;
15375
15395
  this.createdTask = yield this.sharedService.insertTask(activity);
15376
15396
  if (this.createdTask) {
15377
- this.activityCreated.emit();
15378
- yield this.sendEmailIfNeccesary();
15379
- this.clearFields();
15397
+ yield this.handleAfterCreation();
15380
15398
  }
15381
15399
  }
15382
15400
  });
@@ -15469,7 +15487,7 @@ class TaskCreatorComponent {
15469
15487
  }
15470
15488
  startEmailing(template) {
15471
15489
  return __awaiter(this, void 0, void 0, function* () {
15472
- const emailsSent = yield this.sharedService.emailViaTemplate(template, this.createEmailAddressString(this.emailAddresses), this.createEmailAddressString(this.bccEmailAddresses), this.senderAddress, this.createEmailSubject(), "", null /*this.createAttachmentsStringArray()*/, this.createEmailParams());
15490
+ const emailsSent = yield this.sharedService.emailViaTemplate(template, this.createEmailAddressString(this.emailAddresses), this.createEmailAddressString(this.bccEmailAddresses), this.senderAddress, this.createEmailSubject(), "", [], this.createEmailParams());
15473
15491
  if (emailsSent) {
15474
15492
  let history = new ActivityEmailHistory();
15475
15493
  history.emailAddresses = this.createEmailAddressString(this.emailAddresses);
@@ -15487,15 +15505,6 @@ class TaskCreatorComponent {
15487
15505
  }
15488
15506
  });
15489
15507
  }
15490
- registerSentEmails() {
15491
- return __awaiter(this, void 0, void 0, function* () {
15492
- let history = new ActivityEmailHistory();
15493
- history.emailAddresses = this.createEmailAddressString(this.emailAddresses) + ';' + this.createEmailAddressString(this.bccEmailAddresses);
15494
- //history.attachments = this.createAttachmentsStringArray();
15495
- history.message = '';
15496
- history.emailDateTime = new Date();
15497
- });
15498
- }
15499
15508
  createEmailAddressString(addresses) {
15500
15509
  if (addresses.length === 0) {
15501
15510
  return '';
@@ -15584,19 +15593,42 @@ TaskCreatorComponent.decorators = [
15584
15593
  </div>
15585
15594
  </co-form>
15586
15595
  <div class="extras-buttons">
15587
- <co-button [iconData]="iconService.getIcon(icons.EmailRegular)" (click)="showEmailDialog = true"></co-button>
15588
- <co-button [iconData]="iconService.getIcon(icons.PaperclipRegular)" (click)="showFilesDialog = true"
15596
+ <co-button [iconData]="iconService.getIcon(icons.EmailRegular)" (click)="openEmailDialog()"></co-button>
15597
+ <co-button [iconData]="iconService.getIcon(icons.PaperclipRegular)" (click)="openAttachmentDialog()"
15589
15598
  [label]="documents.length === 0 ? '' : documents.length.toString()" ></co-button>
15590
15599
  </div>
15591
15600
 
15592
- <co-dialog *ngIf="showFilesDialog" (closeClick)="showFilesDialog = false">
15601
+ <co-dialog *ngIf="showFilesDialog" (closeClick)="attachmentDialogCancelled()"
15602
+ [headerTemplate]="attachmentHeaderTemplate"
15603
+ [footerTemplate]="attachmentFooterTemplate">
15604
+
15605
+ <ng-template #attachmentHeaderTemplate>
15606
+ <div class="co-dialog-wrapper-popup-title">
15607
+ <co-icon [iconData]="iconService.getIcon(icons.PaperclipRegular)"></co-icon>
15608
+ <div class="co-dialog-header-title" [textContent]="'ATTACHMENTS' | localize"></div>
15609
+ </div>
15610
+ </ng-template>
15593
15611
  <co-files-upload (documentsAdded)="addedDocument($event)" (documentDeleted)="deletedDocument"
15594
15612
  [documents]="documents" [useWithoutSettingProps]="true"></co-files-upload>
15595
15613
  </co-dialog>
15614
+
15615
+
15616
+ <ng-template #attachmentFooterTemplate>
15617
+ <div class="co-dialog-footer-button-wrapper">
15618
+ <co-button class="save-button"
15619
+ [iconData]="iconService.getIcon(icons.CheckDuotone)"
15620
+ (click)="attachmentDialogClosed()"></co-button>
15621
+ <co-button class="close-button"
15622
+ [iconData]="iconService.getIcon(icons.CrossSkinny)"
15623
+ (click)="attachmentDialogCancelled()"></co-button>
15624
+ </div>
15625
+ </ng-template>
15626
+
15627
+
15596
15628
  <co-dialog *ngIf="showEmailDialog" (closeClick)="emailDialogClosed()"
15597
- [footerTemplate]="footerTemplate"
15598
- [headerTemplate]="headerTemplate">
15599
- <ng-template #headerTemplate>
15629
+ [footerTemplate]="emailFooterTemplate"
15630
+ [headerTemplate]="emailheaderTemplate">
15631
+ <ng-template #emailheaderTemplate>
15600
15632
  <div class="co-dialog-wrapper-popup-title">
15601
15633
  <co-icon [iconData]="iconService.getIcon(icons.EmailRegular)"></co-icon>
15602
15634
  <div class="co-dialog-header-title" [textContent]="'SEND_EMAIL' | localize"></div>
@@ -15609,14 +15641,14 @@ TaskCreatorComponent.decorators = [
15609
15641
 
15610
15642
  </co-dialog>
15611
15643
 
15612
- <ng-template #footerTemplate>
15644
+ <ng-template #emailFooterTemplate>
15613
15645
  <div class="co-dialog-footer-button-wrapper">
15614
15646
  <co-button class="save-button"
15615
15647
  [iconData]="iconService.getIcon(icons.CheckDuotone)"
15616
15648
  (click)="emailDialogClosed()"></co-button>
15617
15649
  <co-button class="close-button"
15618
15650
  [iconData]="iconService.getIcon(icons.CrossSkinny)"
15619
- (click)="emailDialogClosed()"></co-button>
15651
+ (click)="emailDialogCancelled()"></co-button>
15620
15652
  </div>
15621
15653
  </ng-template>
15622
15654
  `,