@colijnit/sharedcomponents 254.1.7 → 254.1.8

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.
@@ -10548,10 +10548,11 @@
10548
10548
 
10549
10549
  // The GUI part of the files-upload component. Not a standalone component.
10550
10550
  var FileUploadComponent = /** @class */ (function () {
10551
- function FileUploadComponent(_promptService, _fileTypeImgPipe, iconService) {
10551
+ function FileUploadComponent(_promptService, _fileTypeImgPipe, iconService, _sharedService) {
10552
10552
  this._promptService = _promptService;
10553
10553
  this._fileTypeImgPipe = _fileTypeImgPipe;
10554
10554
  this.iconService = iconService;
10555
+ this._sharedService = _sharedService;
10555
10556
  this.icons = exports["ɵbv"];
10556
10557
  // Element clickable
10557
10558
  this.link = false;
@@ -10622,30 +10623,35 @@
10622
10623
  };
10623
10624
  FileUploadComponent.prototype.onImageClick = function () {
10624
10625
  return __awaiter(this, void 0, void 0, function () {
10626
+ var _this = this;
10625
10627
  return __generator(this, function (_a) {
10626
- if (this.isAddingTile) {
10627
- return [2 /*return*/];
10628
- }
10629
- if (this.customImageClick) {
10630
- this.imageClick.next(this._file);
10631
- return [2 /*return*/];
10632
- }
10633
- //todo fix methods
10634
- //first download document body if it is stored in a private cdn directory
10635
- if (!this._file.documentBody) {
10636
- //await this._generalDal.getDocumentContent(this._file).then(documentBody => this._file.documentBody = documentBody);
10637
- }
10638
- if (this._file.isImageDocument()) { //preview image
10639
- this._promptService.showImage(this.file.documentBodyAsDataUri, "Preview");
10640
- }
10641
- else { //download document
10642
- try {
10643
- //FileUtils.DownloadFromDataUri(this._file.bodyAsDataUri, this._file.fileName);
10644
- }
10645
- catch (e) {
10646
- }
10628
+ switch (_a.label) {
10629
+ case 0:
10630
+ if (this.isAddingTile) {
10631
+ return [2 /*return*/];
10632
+ }
10633
+ if (this.customImageClick) {
10634
+ this.imageClick.next(this._file);
10635
+ return [2 /*return*/];
10636
+ }
10637
+ if (!!this._file.documentBody) return [3 /*break*/, 2];
10638
+ return [4 /*yield*/, this._sharedService.getDocumentContent(this._file.documentId).then(function (documentBody) { return _this._file.documentBody = documentBody; })];
10639
+ case 1:
10640
+ _a.sent();
10641
+ _a.label = 2;
10642
+ case 2:
10643
+ if (this._file.isImageDocument()) { //preview image
10644
+ this._promptService.showImage(this.file.documentBodyAsDataUri, "Preview");
10645
+ }
10646
+ else { //download document
10647
+ try {
10648
+ //FileUtils.DownloadFromDataUri(this._file.bodyAsDataUri, this._file.fileName);
10649
+ }
10650
+ catch (e) {
10651
+ }
10652
+ }
10653
+ return [2 /*return*/];
10647
10654
  }
10648
- return [2 /*return*/];
10649
10655
  });
10650
10656
  });
10651
10657
  };
@@ -10683,13 +10689,13 @@
10683
10689
  }
10684
10690
  };
10685
10691
  FileUploadComponent.prototype._updatePreviewImage = function () {
10692
+ var _this = this;
10686
10693
  if (this._file) {
10687
10694
  if (this._file.isImageDocument()) {
10688
10695
  this.previewImage = this._file.documentBodyAsDataUri;
10689
10696
  if (this.previewImage === "") {
10690
- //TODO fix fetch
10691
- //this._generalDal.getDocumentContent(this._file).then(documentBody => this._file.documentBody = documentBody);
10692
- //this.previewImage = this._file.documentBody;
10697
+ this._sharedService.getDocumentContent(this._file.documentId).then(function (documentBody) { return _this._file.documentBody = documentBody; });
10698
+ this.previewImage = this._file.documentBody;
10693
10699
  }
10694
10700
  }
10695
10701
  else {
@@ -10709,7 +10715,8 @@
10709
10715
  FileUploadComponent.ctorParameters = function () { return [
10710
10716
  { type: corecomponents_v12.PromptService },
10711
10717
  { type: FileTypeImagePipe },
10712
- { type: IconCacheService }
10718
+ { type: IconCacheService },
10719
+ { type: SharedService }
10713
10720
  ]; };
10714
10721
  FileUploadComponent.propDecorators = {
10715
10722
  form: [{ type: i0.ViewChild, args: [corecomponents_v12.FormComponent,] }],
@@ -11266,7 +11273,7 @@
11266
11273
  ActivityListComponent.decorators = [
11267
11274
  { type: i0.Component, args: [{
11268
11275
  selector: "co-activity-list",
11269
- template: "\n <div class=\"activity-list-wrapper\">\n <div class=\"activity-wrapper\" [class.customer-reply-wrapper]=\"(getRelationKind(activity.author) === RelationKind.Customer)\" *ngFor=\"let activity of activities\" >\n <div class=\"activity-display\">\n <div class=\"activity-display-title\">\n <span>{{activity.author && (activity.author.initials || activity.author.familyName) ? (activity.author.initials || '') + ' ' + (activity.author.familyName || '') : ''}}</span>\n <span>{{getDateString(activity.lastActionDateTime)}}</span>\n <co-icon [iconData]=\"iconCacheService.getIcon(getActivityIcon(activity))\"></co-icon>\n </div>\n <div class=\"activity-display-content\" [class.customer-reply-content]=\"(getRelationKind(activity.author) === RelationKind.Customer)\">\n <div class=\"activity-display-body\">\n <span *ngIf=\"activity.activityType !== ActivityType.StateChange\">{{activity.subDescription}}</span>\n <span *ngIf=\"activity.activityType === ActivityType.StateChange\">{{activity.activityTitle}}</span>\n </div>\n <div class=\"activity-display-footer\">\n <!--TODO discuss with Rob is we can gather the info needed to see which workflow triggers have previously been activated for this trigger-->\n <div class=\"activity-fired-triggers\" *ngIf=\"activity.activityType === ActivityType.StateChange && activity.stateChange.firedTriggerNames &&\n activity.stateChange.firedTriggerNames.length > 0\" >\n <div *ngFor=\"let triggerName of activity.stateChange?.firedTriggerNames\">\n <span>{{triggerName}}</span>\n </div>\n </div>\n <co-icon *ngIf=\"showAttachments(activity)\" [iconData]=\"iconCacheService.getIcon(Icon.PaperclipRegular)\" (click)=\"openActivityPopup(activity)\"></co-icon>\n <span *ngIf=\"showAttachments(activity)\">{{activity.documents.length}}</span>\n <co-icon *ngIf=\"showWorkedTime(activity)\"\n [iconData]=\"iconCacheService.getIcon(Icon.ClockRegular)\"></co-icon>\n <span *ngIf=\"showWorkedTime(activity)\" >\n {{TimeUtils.ConvertToDuration(getWorkedTime(activity))}}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <co-dialog *ngIf=\"showActivityPopup\" (closeClick)=\"showActivityPopup = false\">\n <co-files-upload [documents]=\"currentActivityDocuments\">\n </co-files-upload>\n </co-dialog>\n ",
11276
+ template: "\n <div class=\"activity-list-wrapper\">\n <div class=\"activity-wrapper\" [class.customer-reply-wrapper]=\"(getRelationKind(activity.author) === RelationKind.Customer)\" *ngFor=\"let activity of activities\" >\n <div class=\"activity-display\">\n <div class=\"activity-display-title\">\n <span>{{activity.author && (activity.author.initials || activity.author.familyName) ? (activity.author.initials || '') + ' ' + (activity.author.familyName || '') : ''}}</span>\n <span>{{getDateString(activity.lastActionDateTime)}}</span>\n <co-icon [iconData]=\"iconCacheService.getIcon(getActivityIcon(activity))\"></co-icon>\n </div>\n <div class=\"activity-display-content\" [class.customer-reply-content]=\"(getRelationKind(activity.author) === RelationKind.Customer)\">\n <div class=\"activity-display-body\">\n <span *ngIf=\"activity.activityType !== ActivityType.StateChange\">{{activity.subDescription}}</span>\n <span *ngIf=\"activity.activityType === ActivityType.StateChange\">{{activity.activityTitle}}</span>\n </div>\n <div class=\"activity-display-footer\">\n <div class=\"activity-fired-triggers\" *ngIf=\"activity.activityType === ActivityType.StateChange && activity.stateChange.firedTriggerNames &&\n activity.stateChange.firedTriggerNames.length > 0\" >\n <div class=\"activity-fired-trigger\" *ngFor=\"let triggerName of activity.stateChange?.firedTriggerNames\">\n <span>{{triggerName}}</span>\n </div>\n </div>\n <div class=\"icon-indicators\">\n <co-icon *ngIf=\"showAttachments(activity)\" [iconData]=\"iconCacheService.getIcon(Icon.PaperclipRegular)\" (click)=\"openActivityPopup(activity)\"></co-icon>\n <span *ngIf=\"showAttachments(activity)\">{{activity.documents.length}}</span>\n <co-icon *ngIf=\"showWorkedTime(activity)\"\n [iconData]=\"iconCacheService.getIcon(Icon.ClockRegular)\"></co-icon>\n <span *ngIf=\"showWorkedTime(activity)\" >\n {{TimeUtils.ConvertToDuration(getWorkedTime(activity))}}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <co-dialog *ngIf=\"showActivityPopup\" (closeClick)=\"showActivityPopup = false\">\n <co-files-upload [readonly]=\"true\" [documents]=\"currentActivityDocuments\">\n </co-files-upload>\n </co-dialog>\n ",
11270
11277
  encapsulation: i0.ViewEncapsulation.None
11271
11278
  },] }
11272
11279
  ];