@sumaris-net/ngx-components 1.1.1 → 1.2.3

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.
@@ -16874,7 +16874,7 @@
16874
16874
  var location$ = this._downloadingJobs.get(request.uri);
16875
16875
  if (location$)
16876
16876
  return location$;
16877
- request = Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted, title: request.title || request.filename }, request);
16877
+ request = Object.assign(Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted, title: request.title || request.filename }, request), { destinationInExternalPublicDir: Object.assign({ dirType: 'Downloads', subPath: request.filename || request.title || '' }, request.destinationInExternalPublicDir) });
16878
16878
  console.debug('[platform] Downloading, using request: ' + JSON.stringify(request));
16879
16879
  // Start download
16880
16880
  location$ = rxjs.from(this.downloader.download(request));
@@ -21474,7 +21474,7 @@
21474
21474
  AppPropertiesForm.decorators = [
21475
21475
  { type: i0.Component, args: [{
21476
21476
  selector: 'app-properties-form',
21477
- template: "\n<!-- Properties -->\n<form [formGroup]=\"form\" class=\"form-container\">\n <ion-grid *ngIf=\"!loading; else propertiesSkeleton\"\n formArrayName=\"properties\" class=\"ion-no-padding\" >\n <ion-row class=\"ion-no-padding\">\n <ion-col class=\"ion-no-padding ion-align-self-end\" size=\"12\">\n <span class=\"toolbar-spacer\"></span>\n\n <!-- Show more options -->\n <ion-button color=\"light\" *ngIf=\"formArray?.length === 0\"\n [title]=\"'SETTINGS.BTN_SHOW_MORE_HELP'|translate\"\n (click)=\"helper.add()\">\n <ion-label translate>COMMON.BTN_SHOW_MORE</ion-label>\n <mat-icon slot=\"end\">arrow_drop_down</mat-icon>\n </ion-button>\n </ion-col>\n </ion-row>\n\n <ng-container *ngFor=\"let fieldForm of fieldForms; let i=index\">\n <ion-row class=\"ion-no-padding\" [formGroupName]=\"i\">\n\n <!-- property key -->\n <ion-col size=\"6\" class=\"ion-no-padding\">\n <mat-form-field floatLabel=\"never\">\n <mat-select [formControl]=\"fieldForm.controls.key\"\n [placeholder]=\"'SETTINGS.PROPERTY_KEY'|translate\"\n (selectionChange)=\"updateDefinitionAt(i)\"\n [tabindex]=\"20+i*2\"\n required>\n\n <!-- When option's key not a well known option, add it as first select option -->\n <mat-option *ngIf=\"isUnknownField(fieldForm)\" [value]=\"fieldForm.controls.key.value\">\n {{fieldForm.controls.key.value}}\n </mat-option>\n\n <mat-option *ngFor=\"let item of definitions\" [value]=\"item.key\">{{ item.label | translate }}\n </mat-option>\n\n </mat-select>\n\n <mat-error *ngIf=\"fieldForm.controls.key.hasError('required') && !helper.isLast(i)\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n </ion-col>\n\n <!-- property value -->\n <ion-col class=\"ion-no-padding\" padding-left >\n <app-form-field *ngIf=\"getDefinitionAt(i) else unknownValue; let definition; \"\n floatLabel=\"never\"\n [definition]=\"definition\"\n [formControl]=\"fieldForm.controls.value\"\n [placeholder]=\"'SETTINGS.PROPERTY_VALUE' | translate\"\n [required]=\"true\"\n [tabindex]=\"20+i*2 + 1\">\n </app-form-field>\n <ng-template #unknownValue>\n <mat-form-field floatLabel=\"never\">\n <input type=\"text\" matInput\n [placeholder]=\"'SETTINGS.PROPERTY_VALUE' | translate\"\n [formControl]=\"fieldForm.controls.value\"\n [required]=\"true\"\n [tabindex]=\"20+i*2 + 1\">\n </mat-form-field>\n </ng-template>\n </ion-col>\n\n <ion-col size=\"auto\" class=\"ion-no-padding\">\n <button type=\"button\" mat-icon-button color=\"light\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_DELETE'|translate\"\n (click)=\"removeAt(i)\">\n <mat-icon>close</mat-icon>\n </button>\n <button [hidden]=\"!helper.isLast(i)\"\n type=\"button\"\n mat-icon-button\n color=\"light\"\n [disabled]=\"disabled\"\n [title]=\"'CONFIGURATION.BTN_ADD_PROPERTY'|translate\"\n (click)=\"helper.add()\">\n <mat-icon>add</mat-icon>\n </button>\n </ion-col>\n </ion-row>\n </ng-container>\n </ion-grid>\n</form>\n\n<ng-template #propertiesSkeleton>\n\n <ion-grid class=\"ion-no-padding\">\n <ng-container *ngTemplateOutlet=\"propertyRowSkeleton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"propertyRowSkeleton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"propertyRowSkeleton\"></ng-container>\n </ion-grid>\n\n</ng-template>\n\n<ng-template #propertyRowSkeleton>\n\n <ion-row>\n <!-- property key -->\n <ion-col>\n <mat-form-field>\n <input matInput hidden>\n <ion-skeleton-text animated style=\"width: 60%\"></ion-skeleton-text>\n <ion-icon name=\"arrow-dropdown\" matSuffix></ion-icon>\n </mat-form-field>\n </ion-col>\n <!-- value -->\n <ion-col>\n <mat-form-field>\n <input matInput hidden>\n <ion-skeleton-text animated style=\"width: 60%\"></ion-skeleton-text>\n </mat-form-field>\n </ion-col>\n <!-- buttons -->\n <ion-col size=\"2\">\n <button type=\"button\" mat-icon-button color=\"light\"\n [disabled]=\"true\">\n <mat-icon>close</mat-icon>\n </button>\n </ion-col>\n </ion-row>\n\n</ng-template>\n",
21477
+ template: "\n<!-- Properties -->\n<form [formGroup]=\"form\" class=\"form-container\">\n <ion-grid *ngIf=\"!loading; else propertiesSkeleton\"\n formArrayName=\"properties\" class=\"ion-no-padding\" >\n <ion-row class=\"ion-no-padding\">\n <ion-col class=\"ion-no-padding ion-align-self-end\" size=\"12\">\n <span class=\"toolbar-spacer\"></span>\n\n <!-- Show more options -->\n <ion-button color=\"light\" *ngIf=\"formArray?.length === 0\"\n [title]=\"'SETTINGS.BTN_SHOW_MORE_HELP'|translate\"\n (click)=\"helper.add()\">\n <ion-label translate>COMMON.BTN_SHOW_MORE</ion-label>\n <mat-icon slot=\"end\">arrow_drop_down</mat-icon>\n </ion-button>\n </ion-col>\n </ion-row>\n\n <ng-container *ngFor=\"let fieldForm of fieldForms; let i=index\">\n <ion-row class=\"ion-no-padding\" [formGroupName]=\"i\">\n\n <!-- property key -->\n <ion-col size=\"6\" class=\"ion-no-padding\">\n <mat-form-field floatLabel=\"never\">\n <mat-select [formControl]=\"fieldForm.controls.key\"\n [placeholder]=\"'SETTINGS.PROPERTY_KEY'|translate\"\n (selectionChange)=\"updateDefinitionAt(i)\"\n [tabindex]=\"20+i*2\"\n required>\n\n <!-- When option's key not a well known option, add it as first select option -->\n <mat-option *ngIf=\"isUnknownField(fieldForm)\" [value]=\"fieldForm.controls.key.value\">\n {{fieldForm.controls.key.value}}\n </mat-option>\n\n <mat-option *ngFor=\"let item of definitions\" [value]=\"item.key\">{{ item.label | translate }}\n </mat-option>\n\n </mat-select>\n\n <mat-error *ngIf=\"fieldForm.controls.key.hasError('required') && !helper.isLast(i)\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n </ion-col>\n\n <!-- property value -->\n <ion-col class=\"ion-no-padding\" padding-left >\n <app-form-field *ngIf=\"getDefinitionAt(i) else unknownValue; let definition; \"\n floatLabel=\"never\"\n [definition]=\"definition\"\n [formControl]=\"fieldForm.controls.value\"\n [placeholder]=\"'SETTINGS.PROPERTY_VALUE' | translate\"\n [required]=\"true\"\n [tabindex]=\"20+i*2 + 1\">\n </app-form-field>\n <ng-template #unknownValue>\n <mat-form-field floatLabel=\"never\">\n <input type=\"text\" matInput\n [placeholder]=\"'SETTINGS.PROPERTY_VALUE' | translate\"\n [formControl]=\"fieldForm.controls.value\"\n [required]=\"true\"\n [tabindex]=\"20+i*2 + 1\">\n </mat-form-field>\n </ng-template>\n </ion-col>\n\n <ion-col size=\"auto\" class=\"ion-no-padding\">\n <button type=\"button\" mat-icon-button color=\"light\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_DELETE'|translate\"\n (click)=\"removeAt(i)\">\n <mat-icon>close</mat-icon>\n </button>\n <button [hidden]=\"!helper.isLast(i)\"\n type=\"button\"\n mat-icon-button\n color=\"light\"\n [disabled]=\"disabled\"\n [title]=\"'SETTINGS.BTN_ADD_PROPERTY'|translate\"\n (click)=\"helper.add()\">\n <mat-icon>add</mat-icon>\n </button>\n </ion-col>\n </ion-row>\n </ng-container>\n </ion-grid>\n</form>\n\n<ng-template #propertiesSkeleton>\n\n <ion-grid class=\"ion-no-padding\">\n <ng-container *ngTemplateOutlet=\"propertyRowSkeleton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"propertyRowSkeleton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"propertyRowSkeleton\"></ng-container>\n </ion-grid>\n\n</ng-template>\n\n<ng-template #propertyRowSkeleton>\n\n <ion-row>\n <!-- property key -->\n <ion-col>\n <mat-form-field>\n <input matInput hidden>\n <ion-skeleton-text animated style=\"width: 60%\"></ion-skeleton-text>\n <ion-icon name=\"arrow-dropdown\" matSuffix></ion-icon>\n </mat-form-field>\n </ion-col>\n <!-- value -->\n <ion-col>\n <mat-form-field>\n <input matInput hidden>\n <ion-skeleton-text animated style=\"width: 60%\"></ion-skeleton-text>\n </mat-form-field>\n </ion-col>\n <!-- buttons -->\n <ion-col size=\"2\">\n <button type=\"button\" mat-icon-button color=\"light\"\n [disabled]=\"true\">\n <mat-icon>close</mat-icon>\n </button>\n </ion-col>\n </ion-row>\n\n</ng-template>\n",
21478
21478
  changeDetection: i0.ChangeDetectionStrategy.OnPush
21479
21479
  },] }
21480
21480
  ];
@@ -21878,17 +21878,25 @@
21878
21878
  };
21879
21879
  AppInstallUpgradeCard.prototype.download = function (event, link) {
21880
21880
  return __awaiter(this, void 0, void 0, function () {
21881
+ var _this = this;
21881
21882
  return __generator(this, function (_a) {
21882
21883
  if (!link || !link.url) {
21883
21884
  console.error('[install-upgrade-card] Missing required argument \'link.url\'');
21884
21885
  return [2 /*return*/]; // Skip
21885
21886
  }
21886
- return [2 /*return*/, this.listenDownloadJob(link.url, this.platform.download({
21887
- uri: link.url,
21888
- title: link.title,
21889
- filename: link.filename,
21890
- mimeType: link.mimeType
21891
- }))];
21887
+ // Mark link as downloading
21888
+ link.downloading = true;
21889
+ this.markForCheck();
21890
+ this.listenDownloadJob(link.url, this.platform.download({
21891
+ uri: link.url,
21892
+ title: link.title,
21893
+ filename: link.filename,
21894
+ mimeType: link.mimeType
21895
+ }))
21896
+ .then(function () { return link.downloading = false; })
21897
+ .catch(function () { return link.downloading = false; })
21898
+ .then(function () { return _this.markForCheck(); });
21899
+ return [2 /*return*/];
21892
21900
  });
21893
21901
  });
21894
21902
  };
@@ -22069,8 +22077,13 @@
22069
22077
  // Listening downloading promise, if exists
22070
22078
  (this.upgradeLinks || []).forEach(function (link) {
22071
22079
  var job = _this.platform.getDownloadingJob(link.url);
22072
- if (job)
22073
- _this.listenDownloadJob(link.url, job);
22080
+ if (job) {
22081
+ link.downloading = true;
22082
+ _this.listenDownloadJob(link.url, job)
22083
+ .then(function () { return link.downloading = false; })
22084
+ .catch(function () { return link.downloading = false; })
22085
+ .then(function () { return _this.markForCheck(); });
22086
+ }
22074
22087
  });
22075
22088
  };
22076
22089
  AppInstallUpgradeCard.prototype.listenDownloadJob = function (url, job) {
@@ -22086,10 +22099,13 @@
22086
22099
  _a.trys.push([1, 3, 4, 5]);
22087
22100
  // Mark as downloading
22088
22101
  if (!this.downloading) {
22089
- console.info("[install-upgrade-card] Platform is already downloading '" + url + "' ...");
22102
+ console.info("[install-upgrade-card] Asking platform to download '" + url + "'...");
22090
22103
  this.downloading = true;
22091
22104
  this.markForCheck();
22092
22105
  }
22106
+ else {
22107
+ console.info("[install-upgrade-card] Platform is already downloading!");
22108
+ }
22093
22109
  return [4 /*yield*/, job.toPromise()];
22094
22110
  case 2:
22095
22111
  location = _a.sent();