@colijnit/sharedcomponents 254.1.4 → 254.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.
Files changed (30) hide show
  1. package/3rdpartylicenses.txt +1408 -0
  2. package/bundles/colijnit-sharedcomponents.umd.js +440 -126
  3. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
  4. package/colijnit-sharedcomponents.metadata.json +1 -1
  5. package/esm2015/lib/components/role-email-selector/role-email-selector.component.js +112 -0
  6. package/esm2015/lib/components/role-email-selector/role-email-selector.module.js +29 -0
  7. package/esm2015/lib/components/task-creator/task-creator.component.js +166 -111
  8. package/esm2015/lib/components/task-creator/task-creator.module.js +6 -3
  9. package/esm2015/lib/service/shared-connector.service.js +46 -1
  10. package/esm2015/lib/service/shared.service.js +21 -4
  11. package/esm2015/public-api.js +3 -1
  12. package/favicon.ico +0 -0
  13. package/fesm2015/colijnit-sharedcomponents.js +363 -118
  14. package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
  15. package/index.html +12 -0
  16. package/lib/components/role-email-selector/role-email-selector.component.d.ts +29 -0
  17. package/lib/components/role-email-selector/role-email-selector.module.d.ts +2 -0
  18. package/lib/components/role-email-selector/style/_layout.scss +40 -0
  19. package/lib/components/role-email-selector/style/_material-definition.scss +15 -0
  20. package/lib/components/role-email-selector/style/_theme.scss +4 -0
  21. package/lib/components/role-email-selector/style/material.scss +4 -0
  22. package/lib/components/task-creator/task-creator.component.d.ts +28 -13
  23. package/lib/service/shared-connector.service.d.ts +6 -0
  24. package/lib/service/shared.service.d.ts +6 -1
  25. package/main.9761831eb5f539b50eb2.js +1 -0
  26. package/package.json +2 -2
  27. package/polyfills.907fe9d1887c5de17993.js +1 -0
  28. package/public-api.d.ts +2 -0
  29. package/runtime.8aac21847ed3d3829cca.js +1 -0
  30. package/styles.ccda7309f28016f3304b.css +1 -0
@@ -34,6 +34,9 @@ import { Activity } from '@colijnit/mainapi/build/model/activity.bo';
34
34
  import { WorkflowProcessInfoPerStatus } from '@colijnit/mainapi/build/model/workflow-process-info-per-status';
35
35
  import { RelationSmallObject } from '@colijnit/mainapi/build/model/relation-small-object.bo';
36
36
  import { Report } from '@colijnit/mainapi/build/model/report.bo';
37
+ import { Work } from '@colijnit/mainapi/build/model/work.bo';
38
+ import { Remark } from '@colijnit/mainapi/build/model/remark.bo';
39
+ import { Task } from '@colijnit/mainapi/build/model/task.bo';
37
40
  import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
38
41
  import { ArticleExtended } from '@colijnit/articleapi/build/model/article-extended.bo';
39
42
  import { ArticleStock as ArticleStock$1 } from '@colijnit/articleapi/build/model/article-stock';
@@ -72,7 +75,6 @@ import { ActivityListViewModel } from '@colijnit/mainapi/build/model/activity-li
72
75
  import { ActivityViewModel } from '@colijnit/mainapi/build/model/activity-view-model';
73
76
  import { PersonalActivityTabEnum } from '@colijnit/mainapi/build/enum/personal-activity-tab.enum';
74
77
  import { ActivitySortType } from '@colijnit/mainapi/build/enum/activity-sort-type.enum';
75
- import { Task } from '@colijnit/mainapi/build/model/task.bo';
76
78
  import { TableName as TableName$1 } from '@colijnit/mainapi/build/enum/table-name.enum';
77
79
  import { TagCategory } from '@colijnit/mainapi/build/enum/tab-category.enum';
78
80
  import { ValidationResult } from '@colijnit/ioneconnector/build/model/validation-result';
@@ -80,10 +82,9 @@ import { DomainName } from '@colijnit/mainapi/build/enum/domain-name.enum';
80
82
  import { PriorityType } from '@colijnit/mainapi/build/enum/priority-type.enum';
81
83
  import { RelationRequest } from '@colijnit/relationapi/build/model/relation-request';
82
84
  import { Period } from '@colijnit/mainapi/build/enum/period.enum';
83
- import { Remark } from '@colijnit/mainapi/build/model/remark.bo';
84
- import { Work } from '@colijnit/mainapi/build/model/work.bo';
85
85
  import { activityEmailRequestData } from '@colijnit/mainapi/build/model/activity-email-request-data';
86
86
  import { ReportType } from '@colijnit/mainapi/build/enum/report-type.enum';
87
+ import { StringUtils as StringUtils$1 } from '@colijnit/ioneconnector/build/utils/string-utils';
87
88
 
88
89
  class DocsignComponent {
89
90
  constructor() {
@@ -824,6 +825,48 @@ class SharedConnectorService {
824
825
  });
825
826
  });
826
827
  }
828
+ insertWork(activity) {
829
+ return __awaiter(this, void 0, void 0, function* () {
830
+ return new Promise((resolve, reject) => {
831
+ return this.mainConnector.insertActivity(activity).then((result) => __awaiter(this, void 0, void 0, function* () {
832
+ if (result && result.validationResult && result.validationResult.success) {
833
+ resolve(this._boFactory.makeWithRawBackendData(Work, result.resultObject));
834
+ }
835
+ else {
836
+ reject(result.validationMessagesAsString);
837
+ }
838
+ }));
839
+ });
840
+ });
841
+ }
842
+ insertRemark(activity) {
843
+ return __awaiter(this, void 0, void 0, function* () {
844
+ return new Promise((resolve, reject) => {
845
+ return this.mainConnector.insertActivity(activity).then((result) => __awaiter(this, void 0, void 0, function* () {
846
+ if (result && result.validationResult && result.validationResult.success) {
847
+ resolve(this._boFactory.makeWithRawBackendData(Remark, result.resultObject));
848
+ }
849
+ else {
850
+ reject(result.validationMessagesAsString);
851
+ }
852
+ }));
853
+ });
854
+ });
855
+ }
856
+ insertTask(activity) {
857
+ return __awaiter(this, void 0, void 0, function* () {
858
+ return new Promise((resolve, reject) => {
859
+ return this.mainConnector.insertActivity(activity).then((result) => __awaiter(this, void 0, void 0, function* () {
860
+ if (result && result.validationResult && result.validationResult.success) {
861
+ resolve(this._boFactory.makeWithRawBackendData(Task, result.resultObject));
862
+ }
863
+ else {
864
+ reject(result.validationMessagesAsString);
865
+ }
866
+ }));
867
+ });
868
+ });
869
+ }
827
870
  updateActivity(activity) {
828
871
  return __awaiter(this, void 0, void 0, function* () {
829
872
  return new Promise((resolve, reject) => {
@@ -2640,6 +2683,21 @@ class SharedService {
2640
2683
  return yield this.connector.insertActivity(activity);
2641
2684
  });
2642
2685
  }
2686
+ insertWork(activity) {
2687
+ return __awaiter(this, void 0, void 0, function* () {
2688
+ return yield this.connector.insertWork(activity);
2689
+ });
2690
+ }
2691
+ insertRemark(activity) {
2692
+ return __awaiter(this, void 0, void 0, function* () {
2693
+ return yield this.connector.insertRemark(activity);
2694
+ });
2695
+ }
2696
+ insertTask(activity) {
2697
+ return __awaiter(this, void 0, void 0, function* () {
2698
+ return yield this.connector.insertTask(activity);
2699
+ });
2700
+ }
2643
2701
  updateActivity(activity) {
2644
2702
  return __awaiter(this, void 0, void 0, function* () {
2645
2703
  return yield this.connector.updateActivity(activity);
@@ -2707,16 +2765,18 @@ class SharedService {
2707
2765
  return yield this.connector.getReportTemplates(reportTemplatesRequest);
2708
2766
  });
2709
2767
  }
2710
- emailViaTemplate(template, emailTo, subject = "", message = "", attachments = [], parameters = {}) {
2768
+ emailViaTemplate(template, emailTo, emailBcc, reply, subject = "", message = "", attachments = [], parameters = {}) {
2711
2769
  return __awaiter(this, void 0, void 0, function* () {
2712
2770
  const subjectAddition = subject.trim();
2713
- const emailJob = this._createEmailJob(template, emailTo, subjectAddition, message, attachments, parameters);
2771
+ const emailJob = this._createEmailJob(template, emailTo, emailBcc, reply, subjectAddition, message, attachments, parameters);
2714
2772
  return this.connector.emailReport(emailJob);
2715
2773
  });
2716
2774
  }
2717
- _createEmailJob(report, emailTo, subject, message, attachments, parameters = {}) {
2775
+ _createEmailJob(report, emailTo, emailBcc, reply, subject, message, attachments, parameters = {}) {
2718
2776
  const emailJob = new EmailJob();
2719
2777
  emailJob.emailTo = emailTo;
2778
+ emailJob.emailBcc = emailBcc;
2779
+ emailJob.reply = reply;
2720
2780
  emailJob.subject = subject;
2721
2781
  emailJob.message = message;
2722
2782
  emailJob.attachments = attachments;
@@ -14876,18 +14936,25 @@ WorkflowInfoTilesModule.decorators = [
14876
14936
  ];
14877
14937
 
14878
14938
  class TaskCreatorComponent {
14879
- constructor(iconService, sharedService) {
14939
+ constructor(iconService, dictionaryService, sharedService) {
14880
14940
  this.iconService = iconService;
14941
+ this.dictionaryService = dictionaryService;
14881
14942
  this.sharedService = sharedService;
14882
14943
  this.icons = Icon;
14883
14944
  this.table = TableName$1.Transactions;
14884
14945
  this.activityCreated = new EventEmitter();
14946
+ this.optionCollection = [
14947
+ { icon: this.iconService.getIcon(this.icons.CommentRegular), label: this.dictionaryService.get('REMARK', true) },
14948
+ { icon: this.iconService.getIcon(this.icons.PersonDiggingRegular), label: this.dictionaryService.get('WORK', true) },
14949
+ { icon: this.iconService.getIcon(this.icons.Task), label: this.dictionaryService.get('TASK', true) },
14950
+ ];
14885
14951
  this.showFilesDialog = false;
14886
14952
  this.documents = [];
14887
14953
  this.showEmailDialog = false;
14888
- this.emailAddressesAvailable = [];
14954
+ this.senderAddress = '';
14955
+ this.emailAddresses = [];
14956
+ this.bccEmailAddresses = [];
14889
14957
  this.emailRequest = null;
14890
- this.optionCollection = [{ id: 'Opmerking' }, { id: 'Werkzaamheid' }, { id: 'Taak' }];
14891
14958
  this.remarkText = "";
14892
14959
  this.workDescription = "";
14893
14960
  this.taskName = "";
@@ -14898,35 +14965,24 @@ class TaskCreatorComponent {
14898
14965
  }
14899
14966
  ngOnInit() {
14900
14967
  return __awaiter(this, void 0, void 0, function* () {
14901
- this.chosenActivityType = this.optionCollection[1];
14902
- this.emailAddressesAvailable = yield this.sharedService.getRoleEmailAddressesByWorkflowCategoryAndKey('SERVICE_ORDER', this.RemarkAndWorkKey);
14903
- this.senderAddress = yield this.sharedService.getEmailSenderByWorkflowCategoryAndKey('SERVICE_ORDER', this.RemarkAndWorkKey);
14968
+ this.chosenActivityType = this.optionCollection[0];
14969
+ this.senderAddress = yield this.sharedService.getEmailSenderByWorkflowCategoryAndKey('SERVICE_ORDER', this.remarkAndWorkKey);
14904
14970
  });
14905
14971
  }
14972
+ itemSelected(item) {
14973
+ this.chosenActivityType = item;
14974
+ }
14906
14975
  createRemarkClicked() {
14907
14976
  return __awaiter(this, void 0, void 0, function* () {
14908
14977
  this.createForm.submit();
14909
14978
  if (this.createForm.isValid()) {
14910
- let remark = new Remark();
14911
- remark.author = this.author;
14912
- remark.author.image = undefined;
14913
- if (this.documents.length !== 0) {
14914
- remark.documents = this.documents;
14915
- }
14916
- remark.remark = this.remarkText;
14917
- remark.dateTime = new Date();
14918
- remark.table = this.table;
14919
- remark.key = this.RemarkAndWorkKey;
14920
- remark.read = false;
14921
- remark.current = true;
14979
+ let remark = this.createRemark();
14922
14980
  let activity = new Activity();
14923
14981
  activity.activityType = ActivityType.Remark;
14924
14982
  activity.remark = remark;
14925
- let remarkMade = yield this.sharedService.insertActivity(activity);
14926
- if (remarkMade) {
14927
- this.activityCreated.emit();
14928
- //await this.sendEmailIfNeccesary();
14929
- this.clearFields();
14983
+ this.createdRemark = yield this.sharedService.insertRemark(activity);
14984
+ if (this.createdRemark) {
14985
+ this.handleAfterCreation();
14930
14986
  }
14931
14987
  }
14932
14988
  });
@@ -14935,22 +14991,14 @@ class TaskCreatorComponent {
14935
14991
  return __awaiter(this, void 0, void 0, function* () {
14936
14992
  this.createForm.submit();
14937
14993
  if (this.createForm.isValid()) {
14938
- let work = new Work();
14939
- work.executive = this.author;
14940
- work.executive.image = undefined;
14941
- work.documents = this.documents;
14942
- work.workedTime = 0;
14943
- work.workDescription = this.workDescription;
14944
- work.dateTime = new Date();
14945
- work.table = this.table;
14946
- work.key = this.RemarkAndWorkKey;
14994
+ let work = this.createWork();
14947
14995
  let activity = new Activity();
14948
14996
  activity.activityType = ActivityType.Work;
14949
14997
  activity.work = work;
14950
- let workMade = yield this.sharedService.insertActivity(activity);
14951
- if (workMade) {
14998
+ this.createdWork = yield this.sharedService.insertWork(activity);
14999
+ if (this.createdWork) {
14952
15000
  this.activityCreated.emit();
14953
- //await this.sendEmailIfNeccesary();
15001
+ yield this.sendEmailIfNeccesary();
14954
15002
  this.clearFields();
14955
15003
  }
14956
15004
  }
@@ -14960,25 +15008,14 @@ class TaskCreatorComponent {
14960
15008
  return __awaiter(this, void 0, void 0, function* () {
14961
15009
  this.createForm.submit();
14962
15010
  if (this.createForm.isValid()) {
14963
- let task = new Task();
14964
- task.executive = this.author;
14965
- task.executive.image = undefined;
14966
- task.documents = this.documents;
14967
- task.name = this.taskName;
14968
- task.description = this.taskDescription;
14969
- task.creationDateTime = new Date();
14970
- task.dateDefinate = false;
14971
- task.needsPlanning = true;
14972
- task.priority = 0;
14973
- task.workflowCategory = this.workflowCategoryType;
14974
- task.reference = this.TaskKey;
15011
+ const task = this.createTask();
14975
15012
  let activity = new Activity();
14976
15013
  activity.activityType = ActivityType.Task;
14977
15014
  activity.task = task;
14978
- let taskMade = yield this.sharedService.insertActivity(activity);
14979
- if (taskMade) {
15015
+ this.createdTask = yield this.sharedService.insertTask(activity);
15016
+ if (this.createdTask) {
14980
15017
  this.activityCreated.emit();
14981
- //await this.sendEmailIfNeccesary();
15018
+ yield this.sendEmailIfNeccesary();
14982
15019
  this.clearFields();
14983
15020
  }
14984
15021
  }
@@ -14998,30 +15035,82 @@ class TaskCreatorComponent {
14998
15035
  if (this.emailAddresses.length >= 0) {
14999
15036
  this.emailRequest = new activityEmailRequestData;
15000
15037
  this.emailRequest.table = this.table;
15001
- this.emailRequest.key = this.RemarkAndWorkKey;
15038
+ this.emailRequest.key = this.remarkAndWorkKey;
15002
15039
  this.emailRequest.senderAddress = this.senderAddress;
15003
- this.emailRequest.sendAddresses = this.createAddressList(this.emailAddresses);
15004
- this.emailRequest.ccAddresses = this.createAddressList(this.ccEmailAddresses);
15040
+ this.emailRequest.sendAddresses = this.emailAddresses;
15041
+ this.emailRequest.ccAddresses = this.bccEmailAddresses;
15005
15042
  }
15006
15043
  else {
15007
15044
  this.emailRequest = null;
15008
15045
  }
15009
15046
  this.showEmailDialog = false;
15010
15047
  }
15011
- createAddressList(addresses) {
15012
- let addressStrings = [];
15013
- if (addresses && addresses.length !== 0) {
15014
- addresses.forEach(r => {
15015
- r.emailAddresses.forEach(e => {
15016
- addressStrings.push(e);
15017
- });
15018
- });
15019
- }
15020
- return addressStrings;
15048
+ createRemark() {
15049
+ let remark = new Remark();
15050
+ remark.author = this.author;
15051
+ remark.author.image = undefined;
15052
+ remark.documents = this.documents;
15053
+ remark.remark = this.remarkText;
15054
+ remark.dateTime = new Date();
15055
+ remark.table = this.table;
15056
+ remark.key = this.remarkAndWorkKey;
15057
+ remark.read = false;
15058
+ remark.current = true;
15059
+ return remark;
15060
+ }
15061
+ createWork() {
15062
+ let work = new Work();
15063
+ work.executive = this.author;
15064
+ work.executive.image = undefined;
15065
+ work.documents = this.documents;
15066
+ work.workedTime = 0;
15067
+ work.workDescription = this.workDescription;
15068
+ work.dateTime = new Date();
15069
+ work.table = this.table;
15070
+ work.key = this.remarkAndWorkKey;
15071
+ return work;
15072
+ }
15073
+ createTask() {
15074
+ let task = new Task();
15075
+ task.executive = this.author;
15076
+ task.executive.image = undefined;
15077
+ task.reporter = this.author;
15078
+ task.reporter.image = undefined;
15079
+ task.documents = this.documents;
15080
+ task.name = this.taskName;
15081
+ task.description = this.taskDescription;
15082
+ task.creationDateTime = new Date();
15083
+ task.dateDefinate = false;
15084
+ task.needsPlanning = true;
15085
+ task.priority = 0;
15086
+ task.workflowCategory = this.workflowCategoryType;
15087
+ task.reference = this.taskKey;
15088
+ task.emailAddresses = this.emailAddresses;
15089
+ return task;
15090
+ }
15091
+ handleAfterCreation() {
15092
+ return __awaiter(this, void 0, void 0, function* () {
15093
+ this.activityCreated.emit();
15094
+ yield this.sendEmailIfNeccesary();
15095
+ this.clearFields();
15096
+ });
15097
+ }
15098
+ clearFields() {
15099
+ this.remarkText = "";
15100
+ this.workDescription = "";
15101
+ this.taskName = "";
15102
+ this.taskDescription = "";
15103
+ this.senderAddress = "";
15104
+ this.emailAddresses = [];
15105
+ this.bccEmailAddresses = [];
15106
+ this.emailRequest = null;
15107
+ this.createdWork = undefined;
15108
+ this.createdRemark = undefined;
15109
+ this.createdTask = undefined;
15021
15110
  }
15022
15111
  sendEmailIfNeccesary() {
15023
15112
  return __awaiter(this, void 0, void 0, function* () {
15024
- if (this.emailRequest) {
15113
+ if (this.emailAddresses.length > 0) {
15025
15114
  let templates = yield this.sharedService.getDefaultEmailReportTemplatesForBranch(this.branchNo, this.findReportType());
15026
15115
  if (templates.length != 0) {
15027
15116
  let template = this.findDefault(templates);
@@ -15032,6 +15121,11 @@ class TaskCreatorComponent {
15032
15121
  }
15033
15122
  });
15034
15123
  }
15124
+ startEmailing(template) {
15125
+ return __awaiter(this, void 0, void 0, function* () {
15126
+ yield this.sharedService.emailViaTemplate(template, this.createEmailAddressString(this.emailAddresses), this.createEmailAddressString(this.bccEmailAddresses), this.senderAddress, this.createEmailSubject(), "", this.createAttachmentsStringArray(), this.createEmailParams());
15127
+ });
15128
+ }
15035
15129
  findReportType() {
15036
15130
  if (this.chosenActivityType === this.optionCollection[0]) {
15037
15131
  return ReportType.RemarkMessage;
@@ -15043,13 +15137,6 @@ class TaskCreatorComponent {
15043
15137
  return ReportType.TaskMessage;
15044
15138
  }
15045
15139
  }
15046
- startEmailing(template) {
15047
- return __awaiter(this, void 0, void 0, function* () {
15048
- this.emailRequest.sendAddresses.forEach(a => {
15049
- this.sharedService.emailViaTemplate(template, a, 'emailtiteeeel', "", [], {});
15050
- });
15051
- });
15052
- }
15053
15140
  findDefault(reportList) {
15054
15141
  let defaultTemplate = null;
15055
15142
  reportList.forEach(r => {
@@ -15059,41 +15146,73 @@ class TaskCreatorComponent {
15059
15146
  });
15060
15147
  return defaultTemplate;
15061
15148
  }
15062
- clearFields() {
15063
- this.remarkText = "";
15064
- this.workDescription = "";
15065
- this.taskName = "";
15066
- this.taskDescription = "";
15067
- this.senderAddress = "";
15068
- this.emailAddresses = [];
15069
- this.ccEmailAddresses = [];
15070
- this.emailRequest = null;
15149
+ createEmailParams() {
15150
+ if (this.createdRemark) {
15151
+ return { opmerking_id: this.createdRemark.remarkId + "" };
15152
+ }
15153
+ else if (this.createdWork) {
15154
+ return { werkzh_id: this.createdWork.workId + "" };
15155
+ }
15156
+ else if (this.createdTask) {
15157
+ return { taak_id: this.createdTask.taskId + "" };
15158
+ }
15159
+ }
15160
+ createEmailSubject() {
15161
+ let subject = "- ";
15162
+ if (this.createdRemark) {
15163
+ subject += this.dictionaryService.get("REMARK") + " " + this.createdRemark.remarkId;
15164
+ }
15165
+ else if (this.createdWork) {
15166
+ subject += this.dictionaryService.get("WORK") + " " + this.createdWork.workId;
15167
+ }
15168
+ else if (this.createdTask) {
15169
+ subject += (this.createdTask.workflowCategory ? this.createdTask.workflowCategory : this.dictionaryService.get("TASK")) + " " +
15170
+ (this.createdTask.workflowCategory ? this.createdTask.reference : this.createdTask.taskId);
15171
+ }
15172
+ return subject;
15173
+ }
15174
+ createEmailAddressString(addresses) {
15175
+ if (addresses.length === 0) {
15176
+ return '';
15177
+ }
15178
+ else {
15179
+ return addresses.join(';');
15180
+ }
15181
+ }
15182
+ createAttachmentsStringArray() {
15183
+ if (this.documents.length === 0) {
15184
+ return [];
15185
+ }
15186
+ else {
15187
+ let attachments = [];
15188
+ this.documents.forEach(d => {
15189
+ attachments.push(d.documentBody);
15190
+ });
15191
+ return attachments;
15192
+ }
15071
15193
  }
15072
15194
  }
15073
15195
  TaskCreatorComponent.decorators = [
15074
15196
  { type: Component, args: [{
15075
15197
  selector: "co-task-creator",
15076
15198
  template: `
15077
- <div class="input-fields">
15078
- <co-form #createForm>
15079
- <co-list-of-values [collection]="optionCollection" [(model)]="chosenActivityType"
15080
- [displayField]="'id'"></co-list-of-values>
15081
- <co-input-text *ngIf="chosenActivityType === optionCollection[0]" [required]="chosenActivityType === optionCollection[0]"
15082
- [placeholder]="'REMARK' | localize" [(model)]="remarkText"
15083
- [rightIconData]="iconService.getIcon(icons.PaperPlaneTopSolid)"
15084
- (rightIconClick)="createRemarkClicked()"></co-input-text>
15085
- <co-input-text *ngIf="chosenActivityType === optionCollection[1]" [required]="chosenActivityType === optionCollection[1]"
15086
- [placeholder]="'DESCRIPTION' | localize" [(model)]="workDescription"
15199
+ <co-form #createForm class="input-fields">
15200
+ <co-list-of-icons [collection]="optionCollection" (itemSelected)="itemSelected($event)"></co-list-of-icons>
15201
+ <co-input-text *ngIf="chosenActivityType === optionCollection[0]" [required]="chosenActivityType === optionCollection[0]"
15202
+ [placeholder]="'REMARK' | localize" [(model)]="remarkText"
15203
+ [rightIconData]="iconService.getIcon(icons.PaperPlaneTopSolid)"
15204
+ (rightIconClick)="createRemarkClicked()"></co-input-text>
15205
+ <co-input-text *ngIf="chosenActivityType === optionCollection[1]" [required]="chosenActivityType === optionCollection[1]"
15206
+ [placeholder]="'DESCRIPTION' | localize" [(model)]="workDescription"
15207
+ [rightIconData]="iconService.getIcon(icons.PaperPlaneTopSolid)"
15208
+ (rightIconClick)="createWorkClicked()"></co-input-text>
15209
+ <div class="task-input-fields" *ngIf="chosenActivityType === optionCollection[2]">
15210
+ <co-input-text [(model)]="taskName" [placeholder]="'NAME' | localize" [required]="chosenActivityType === optionCollection[2]"
15087
15211
  [rightIconData]="iconService.getIcon(icons.PaperPlaneTopSolid)"
15088
- (rightIconClick)="createWorkClicked()"></co-input-text>
15089
- <div class="task-input-fields" *ngIf="chosenActivityType === optionCollection[2]">
15090
- <co-input-text [(model)]="taskName" [placeholder]="'NAME' | localize" [required]="chosenActivityType === optionCollection[2]"
15091
- [rightIconData]="iconService.getIcon(icons.PaperPlaneTopSolid)"
15092
- (rightIconClick)="createTaskClicked()"></co-input-text>
15093
- <co-input-text [(model)]="taskDescription" [placeholder]="'DESCRIPTION' | localize" [required]="chosenActivityType === optionCollection[2]"></co-input-text>
15094
- </div>
15095
- </co-form>
15096
- </div>
15212
+ (rightIconClick)="createTaskClicked()"></co-input-text>
15213
+ <co-input-text [(model)]="taskDescription" [placeholder]="'DESCRIPTION' | localize" [required]="chosenActivityType === optionCollection[2]"></co-input-text>
15214
+ </div>
15215
+ </co-form>
15097
15216
  <div class="extras-buttons">
15098
15217
  <co-button [iconData]="iconService.getIcon(icons.Email)" (click)="showEmailDialog = true"></co-button>
15099
15218
  <co-button [iconData]="iconService.getIcon(icons.PaperclipRegular)" (click)="showFilesDialog = true"
@@ -15105,15 +15224,9 @@ TaskCreatorComponent.decorators = [
15105
15224
  [documents]="documents" [useWithoutSettingProps]="true"></co-files-upload>
15106
15225
  </co-dialog>
15107
15226
  <co-dialog *ngIf="showEmailDialog" (closeClick)="emailDialogClosed()">
15108
- <co-list-of-values [multiselect]="true" [label]="'RECIPIENTS' | localize"
15109
- [collection]="emailAddressesAvailable" [displayField]="'role'"
15110
- [(model)]="emailAddresses">
15111
- </co-list-of-values>
15112
- <co-list-of-values [multiselect]="true" [label]="'BCC' | localize"
15113
- [collection]="emailAddressesAvailable" [displayField]="'role'"
15114
- [(model)]="ccEmailAddresses">
15115
- </co-list-of-values>
15116
- <co-input-text [readonly]="false" [label]="'SENDER' | localize" [model]="senderAddress"></co-input-text>
15227
+ <co-role-email-selector [(model)]="emailAddresses" [key]="remarkAndWorkKey" [workflowCategoryType]="workflowCategoryType"></co-role-email-selector>
15228
+ <co-role-email-selector [(model)]="bccEmailAddresses" [key]="remarkAndWorkKey" [workflowCategoryType]="workflowCategoryType"></co-role-email-selector>
15229
+ <co-input-text [readonly]="false" [label]="'SENDER' | localize" [model]="senderAddress"></co-input-text>-->
15117
15230
  </co-dialog>
15118
15231
 
15119
15232
  `
@@ -15121,6 +15234,7 @@ TaskCreatorComponent.decorators = [
15121
15234
  ];
15122
15235
  TaskCreatorComponent.ctorParameters = () => [
15123
15236
  { type: IconCacheService },
15237
+ { type: DictionaryService },
15124
15238
  { type: SharedService }
15125
15239
  ];
15126
15240
  TaskCreatorComponent.propDecorators = {
@@ -15128,13 +15242,142 @@ TaskCreatorComponent.propDecorators = {
15128
15242
  author: [{ type: Input }],
15129
15243
  branchNo: [{ type: Input }],
15130
15244
  table: [{ type: Input }],
15131
- RemarkAndWorkKey: [{ type: Input }],
15132
- TaskKey: [{ type: Input }],
15245
+ remarkAndWorkKey: [{ type: Input }],
15246
+ taskKey: [{ type: Input }],
15133
15247
  workflowCategoryType: [{ type: Input }],
15134
15248
  activityCreated: [{ type: Output }],
15135
15249
  showClass: [{ type: HostBinding, args: ["class.co-task-creator",] }]
15136
15250
  };
15137
15251
 
15252
+ class RoleEmailSelectorComponent {
15253
+ constructor(iconService, sharedService) {
15254
+ this.iconService = iconService;
15255
+ this.sharedService = sharedService;
15256
+ this.icons = Icon;
15257
+ this.modelChange = new EventEmitter();
15258
+ this.emailAddressesAvailable = [];
15259
+ this._model = [];
15260
+ }
15261
+ set model(value) {
15262
+ this._model = value;
15263
+ }
15264
+ get model() {
15265
+ return this._model;
15266
+ }
15267
+ set key(value) {
15268
+ this._key = value;
15269
+ this.fetchRoleEmailAddresses();
15270
+ }
15271
+ ;
15272
+ get key() {
15273
+ return this._key;
15274
+ }
15275
+ ;
15276
+ set workflowCategoryType(value) {
15277
+ this._workflowCategoryType = value;
15278
+ this.fetchRoleEmailAddresses();
15279
+ }
15280
+ ;
15281
+ get workflowCategoryType() {
15282
+ return this._workflowCategoryType;
15283
+ }
15284
+ ;
15285
+ showClass() {
15286
+ return true;
15287
+ }
15288
+ ngOnInit() {
15289
+ return __awaiter(this, void 0, void 0, function* () {
15290
+ this.fetchRoleEmailAddresses();
15291
+ });
15292
+ }
15293
+ fetchRoleEmailAddresses() {
15294
+ return __awaiter(this, void 0, void 0, function* () {
15295
+ if (this.workflowCategoryType !== undefined && this.key !== undefined) {
15296
+ this.emailAddressesAvailable = yield this.sharedService.getRoleEmailAddressesByWorkflowCategoryAndKey(this._workflowCategoryType, this._key);
15297
+ }
15298
+ });
15299
+ }
15300
+ roleChosen(role) {
15301
+ if (!role) {
15302
+ return;
15303
+ }
15304
+ const len = role.emailAddresses.length;
15305
+ for (let i = 0; i < len; i++) {
15306
+ if (this.model.indexOf(role.emailAddresses[i]) === -1 && StringUtils$1.IsValidEmail(role.emailAddresses[i])) {
15307
+ this.model.push(role.emailAddresses[i]);
15308
+ this.modelChange.emit(this.model);
15309
+ }
15310
+ }
15311
+ }
15312
+ addEmail(email) {
15313
+ if (this.model.indexOf(email) === -1 && StringUtils$1.IsValidEmail(email)) {
15314
+ this.model.push(email);
15315
+ this.modelChange.emit(this.model);
15316
+ }
15317
+ }
15318
+ removeOptionFromModel(email) {
15319
+ if (this.model.indexOf(email) > -1) {
15320
+ this.model.splice(email.indexOf(email), 1);
15321
+ }
15322
+ }
15323
+ }
15324
+ RoleEmailSelectorComponent.decorators = [
15325
+ { type: Component, args: [{
15326
+ selector: "co-role-email-selector",
15327
+ template: `
15328
+ <co-list-of-values [multiselect]="false" [label]="'RECIPIENTS' | localize"
15329
+ [collection]="emailAddressesAvailable" [displayField]="'role'"
15330
+ (modelChange)="roleChosen($event)">
15331
+ </co-list-of-values>
15332
+ <co-input-text #inp [placeholder]="'EXTRA_EMAIL_ADDRESSES' | localize"
15333
+ [rightIconData]="iconService.getIcon(icons.PaperPlaneTopSolid)"
15334
+ (rightIconClick)="addEmail(inp.model)"></co-input-text>
15335
+
15336
+ <div class="chips-wrapper">
15337
+ <div class="chips" *ngFor="let email of model">
15338
+ <span class="chips-description" [textContent]="email"></span>
15339
+ <co-icon class="remove-chip-icon" [iconData]="iconService.getIcon(icons.CrossSkinny)" (click)="removeOptionFromModel(email)"></co-icon>
15340
+ </div>
15341
+ </div>
15342
+
15343
+ `
15344
+ },] }
15345
+ ];
15346
+ RoleEmailSelectorComponent.ctorParameters = () => [
15347
+ { type: IconCacheService },
15348
+ { type: SharedService }
15349
+ ];
15350
+ RoleEmailSelectorComponent.propDecorators = {
15351
+ model: [{ type: Input }],
15352
+ key: [{ type: Input }],
15353
+ workflowCategoryType: [{ type: Input }],
15354
+ modelChange: [{ type: Output }],
15355
+ showClass: [{ type: HostBinding, args: ["class.co-role-email-selector",] }]
15356
+ };
15357
+
15358
+ class RoleEmailSelectorModule {
15359
+ }
15360
+ RoleEmailSelectorModule.decorators = [
15361
+ { type: NgModule, args: [{
15362
+ imports: [
15363
+ ListOfValuesModule,
15364
+ InputTextModule,
15365
+ LocalizationModule,
15366
+ IconModule,
15367
+ CommonModule,
15368
+ ],
15369
+ declarations: [
15370
+ RoleEmailSelectorComponent
15371
+ ],
15372
+ exports: [
15373
+ RoleEmailSelectorComponent
15374
+ ],
15375
+ providers: [
15376
+ BusinessObjectFactory
15377
+ ]
15378
+ },] }
15379
+ ];
15380
+
15138
15381
  class TaskCreatorModule {
15139
15382
  }
15140
15383
  TaskCreatorModule.decorators = [
@@ -15148,7 +15391,9 @@ TaskCreatorModule.decorators = [
15148
15391
  FilesUploadModule,
15149
15392
  LocalizationModule,
15150
15393
  ListOfIconsModule,
15151
- FormModule
15394
+ FormModule,
15395
+ IconModule,
15396
+ RoleEmailSelectorModule
15152
15397
  ],
15153
15398
  declarations: [
15154
15399
  TaskCreatorComponent
@@ -15170,5 +15415,5 @@ TaskCreatorModule.decorators = [
15170
15415
  * Generated bundle index. Do not edit.
15171
15416
  */
15172
15417
 
15173
- export { ActivityListComponent, ActivityListModule, AgendaEvent, AgendaEventPerDay, CalendarView, CoLinearGaugeComponent, CoLinearGaugeModule, ComponentActivityListComponent, ComponentActivityListModule, DatePlanningComponent, DatePlanningModule, DocsignComponent, DocsignModule, FilesUploadComponent, FilesUploadModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, SimpleTagsComponent, SimpleTagsFormComponent, SimpleTagsFormModule, SimpleTagsModule, StatusbarComponent, StatusbarModule, StockComponent, StockModule, TaskCreatorComponent, TaskCreatorModule, Translation, WorkflowInfoTilesComponent, WorkflowInfoTilesModule, sendMethodsWithIcon, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockStatusbarComponent as ɵba, LocalizationModule as ɵbb, LocalizePipe as ɵbc, StockInformationComponent as ɵbd, StockInformationGridComponent as ɵbe, StockTransferComponent as ɵbf, StockChangeAmountComponent as ɵbg, StockTabComponent as ɵbh, OrderTabComponent as ɵbi, StockTabsComponent as ɵbj, StockHistoryTabsComponent as ɵbk, OrderStockTabComponent as ɵbl, StockLocationComponent as ɵbm, StockHistoryComponent as ɵbn, OrderSupplyStockHistoryComponent as ɵbo, OrderCommissionStockHistoryComponent as ɵbp, OrderStockHistoryComponent as ɵbq, AllocationStockHistoryComponent as ɵbr, StockPrognoseComponent as ɵbs, StockLocationPopupComponent as ɵbt, SendMethod as ɵbu, Icon as ɵbv, CalendarAllYearsComponent as ɵbw, CalendarAllMonthsComponent as ɵbx, CalendarHeaderComponent as ɵby, CalendarComponent as ɵbz, StockService as ɵc, CalendarViewComponent as ɵca, AgendaHeaderComponent as ɵcb, AgendaViewComponent as ɵcc, AgendaMonthViewComponent as ɵcd, AgendaBaseViewComponent as ɵce, AgendaDayViewComponent as ɵcf, AgendaWeekViewComponent as ɵcg, AgendaWeekSelectViewComponent as ɵch, AgendaHourViewComponent as ɵci, AgendaHourCellComponent as ɵcj, AgendaHourViewLabelsComponent as ɵck, AgendaHalfHourCellComponent as ɵcl, AgendaEventsComponent as ɵcm, AgendaEventComponent as ɵcn, ViewSelectComponent as ɵco, AgendaSelectEventComponent as ɵcp, MASTER_PIPES as ɵcq, ArrayNumberPipe as ɵcr, UCfirstPipe as ɵcs, FileTypeImagePipe as ɵct, BaseFileUploadComponent as ɵcu, InputBoolean as ɵcv, ImageDisplayModule as ɵcw, ImageDisplayComponent as ɵcx, FileUploadModule as ɵcy, TileRenderModule as ɵcz, SharedConnectorService as ɵd, TileRenderComponent as ɵda, FileUploadComponent as ɵdb, FileUploadPopupModule as ɵdc, MultiplePropertyTogglerModule as ɵdd, MultiplePropertyTogglerComponent as ɵde, FileUploadPopupComponent as ɵdf, AppFileDropzoneModule as ɵdg, AppFileDropzoneComponent as ɵdh, DragDropContainerComponent as ɵdi, DragDropService as ɵdj, BaseActivityListComponent as ɵdk, PersonalActivityOverviewComponent as ɵdl, BaseActivityOverviewComponent as ɵdm, TaskModifierComponent as ɵdn, ModifyTaskFormComponent as ɵdo, PersonalActivityOverviewModule as ɵdp, ComponentActivityOverviewModule as ɵdq, TaskModifyerModule as ɵdr, ModifyTaskFormModule as ɵds, TaskDetailsModule as ɵdt, TaskDetailsComponent as ɵdu, BaseActivitySummaryComponent as ɵdv, ExecutiveSummaryBlockModule as ɵdw, ActivitySummaryBlockModule as ɵdx, ActivitySummaryBlockComponent as ɵdy, ExecutiveSummaryBlockComponent as ɵdz, OptionsService as ɵe, StatusSummaryBlockModule as ɵea, StatusSummaryBlockComponent as ɵeb, CreationSummaryBlockModule as ɵec, CreationSummaryBlockComponent as ɵed, NotificationSummaryBlockModule as ɵee, NotificationSummaryBlockComponent as ɵef, ComponentActivityOverviewComponent as ɵeg, ActivityListHeaderModule as ɵeh, WorkflowNotificationToggleModule as ɵei, DirectivesModule as ɵej, AbsoluteOverlayTemplateDirective as ɵek, AppAbsoluteOverlayOutletService as ɵel, AlignWithDirective as ɵem, ClickOutsideDirective as ɵen, WorkflowNotificationToggleComponent as ɵeo, WorkflowNotificationTogglePopupComponent as ɵep, PeriodFilterModule as ɵeq, PeriodFilterComponent as ɵer, PeriodFilterPopupComponent as ɵes, ActivityListHeaderComponent as ɵet, WorkflowInfoTileModule as ɵeu, WorkflowInfoTileComponent as ɵev, DictionaryService as ɵf, LocalizeService as ɵg, IconCacheService as ɵh, LanguageCode as ɵi, SendMethodService as ɵj, SendMethodEmailModule as ɵk, LayoutSelectionModule as ɵl, LayoutSelectionComponent as ɵm, SignatureButtonModule as ɵn, SignatureButtonComponent as ɵo, SendMethodEmailComponent as ɵp, SendMethodPrinterModule as ɵq, PrinterSelectionModule as ɵr, PrinterSelectionComponent as ɵs, SendMethodPrinterComponent as ɵt, SendMethodPdfModule as ɵu, SendMethodPdfComponent as ɵv, TabBarModule as ɵw, TabBarComponent as ɵx, StatusbarPopupComponent as ɵy, StockStatusbarModule as ɵz };
15418
+ export { ActivityListComponent, ActivityListModule, AgendaEvent, AgendaEventPerDay, CalendarView, CoLinearGaugeComponent, CoLinearGaugeModule, ComponentActivityListComponent, ComponentActivityListModule, DatePlanningComponent, DatePlanningModule, DocsignComponent, DocsignModule, FilesUploadComponent, FilesUploadModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, RoleEmailSelectorComponent, RoleEmailSelectorModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, SimpleTagsComponent, SimpleTagsFormComponent, SimpleTagsFormModule, SimpleTagsModule, StatusbarComponent, StatusbarModule, StockComponent, StockModule, TaskCreatorComponent, TaskCreatorModule, Translation, WorkflowInfoTilesComponent, WorkflowInfoTilesModule, sendMethodsWithIcon, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockStatusbarComponent as ɵba, LocalizationModule as ɵbb, LocalizePipe as ɵbc, StockInformationComponent as ɵbd, StockInformationGridComponent as ɵbe, StockTransferComponent as ɵbf, StockChangeAmountComponent as ɵbg, StockTabComponent as ɵbh, OrderTabComponent as ɵbi, StockTabsComponent as ɵbj, StockHistoryTabsComponent as ɵbk, OrderStockTabComponent as ɵbl, StockLocationComponent as ɵbm, StockHistoryComponent as ɵbn, OrderSupplyStockHistoryComponent as ɵbo, OrderCommissionStockHistoryComponent as ɵbp, OrderStockHistoryComponent as ɵbq, AllocationStockHistoryComponent as ɵbr, StockPrognoseComponent as ɵbs, StockLocationPopupComponent as ɵbt, SendMethod as ɵbu, Icon as ɵbv, CalendarAllYearsComponent as ɵbw, CalendarAllMonthsComponent as ɵbx, CalendarHeaderComponent as ɵby, CalendarComponent as ɵbz, StockService as ɵc, CalendarViewComponent as ɵca, AgendaHeaderComponent as ɵcb, AgendaViewComponent as ɵcc, AgendaMonthViewComponent as ɵcd, AgendaBaseViewComponent as ɵce, AgendaDayViewComponent as ɵcf, AgendaWeekViewComponent as ɵcg, AgendaWeekSelectViewComponent as ɵch, AgendaHourViewComponent as ɵci, AgendaHourCellComponent as ɵcj, AgendaHourViewLabelsComponent as ɵck, AgendaHalfHourCellComponent as ɵcl, AgendaEventsComponent as ɵcm, AgendaEventComponent as ɵcn, ViewSelectComponent as ɵco, AgendaSelectEventComponent as ɵcp, MASTER_PIPES as ɵcq, ArrayNumberPipe as ɵcr, UCfirstPipe as ɵcs, FileTypeImagePipe as ɵct, BaseFileUploadComponent as ɵcu, InputBoolean as ɵcv, ImageDisplayModule as ɵcw, ImageDisplayComponent as ɵcx, FileUploadModule as ɵcy, TileRenderModule as ɵcz, SharedConnectorService as ɵd, TileRenderComponent as ɵda, FileUploadComponent as ɵdb, FileUploadPopupModule as ɵdc, MultiplePropertyTogglerModule as ɵdd, MultiplePropertyTogglerComponent as ɵde, FileUploadPopupComponent as ɵdf, AppFileDropzoneModule as ɵdg, AppFileDropzoneComponent as ɵdh, DragDropContainerComponent as ɵdi, DragDropService as ɵdj, BaseActivityListComponent as ɵdk, PersonalActivityOverviewComponent as ɵdl, BaseActivityOverviewComponent as ɵdm, TaskModifierComponent as ɵdn, ModifyTaskFormComponent as ɵdo, PersonalActivityOverviewModule as ɵdp, ComponentActivityOverviewModule as ɵdq, TaskModifyerModule as ɵdr, ModifyTaskFormModule as ɵds, TaskDetailsModule as ɵdt, TaskDetailsComponent as ɵdu, BaseActivitySummaryComponent as ɵdv, ExecutiveSummaryBlockModule as ɵdw, ActivitySummaryBlockModule as ɵdx, ActivitySummaryBlockComponent as ɵdy, ExecutiveSummaryBlockComponent as ɵdz, OptionsService as ɵe, StatusSummaryBlockModule as ɵea, StatusSummaryBlockComponent as ɵeb, CreationSummaryBlockModule as ɵec, CreationSummaryBlockComponent as ɵed, NotificationSummaryBlockModule as ɵee, NotificationSummaryBlockComponent as ɵef, ComponentActivityOverviewComponent as ɵeg, ActivityListHeaderModule as ɵeh, WorkflowNotificationToggleModule as ɵei, DirectivesModule as ɵej, AbsoluteOverlayTemplateDirective as ɵek, AppAbsoluteOverlayOutletService as ɵel, AlignWithDirective as ɵem, ClickOutsideDirective as ɵen, WorkflowNotificationToggleComponent as ɵeo, WorkflowNotificationTogglePopupComponent as ɵep, PeriodFilterModule as ɵeq, PeriodFilterComponent as ɵer, PeriodFilterPopupComponent as ɵes, ActivityListHeaderComponent as ɵet, WorkflowInfoTileModule as ɵeu, WorkflowInfoTileComponent as ɵev, DictionaryService as ɵf, LocalizeService as ɵg, IconCacheService as ɵh, LanguageCode as ɵi, SendMethodService as ɵj, SendMethodEmailModule as ɵk, LayoutSelectionModule as ɵl, LayoutSelectionComponent as ɵm, SignatureButtonModule as ɵn, SignatureButtonComponent as ɵo, SendMethodEmailComponent as ɵp, SendMethodPrinterModule as ɵq, PrinterSelectionModule as ɵr, PrinterSelectionComponent as ɵs, SendMethodPrinterComponent as ɵt, SendMethodPdfModule as ɵu, SendMethodPdfComponent as ɵv, TabBarModule as ɵw, TabBarComponent as ɵx, StatusbarPopupComponent as ɵy, StockStatusbarModule as ɵz };
15174
15419
  //# sourceMappingURL=colijnit-sharedcomponents.js.map