@rs-pk/asset-management 1.0.11 → 1.0.12

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.
@@ -1277,7 +1277,9 @@ class UploadAssetsService {
1277
1277
  formData.append('companyId', '732DA8D2-04EC-4BE0-A168-63EE0DCF50D8');
1278
1278
  for (const file of files) {
1279
1279
  /** @type {?} */
1280
- const ext = file.type.indexOf('svg') > -1 ? '.svg' : `.${file.type.split('/')[1]}`;
1280
+ const nameSplit = file.name.split('.');
1281
+ /** @type {?} */
1282
+ const ext = `.${nameSplit.splice(nameSplit.length - 1, 1)[0]}`;
1281
1283
  /** @type {?} */
1282
1284
  const originName = file.name;
1283
1285
  /** @type {?} */
@@ -1990,10 +1992,9 @@ class FileItemComponent {
1990
1992
  const { supportedTypes, supportedSize } = this.uploadAssetService;
1991
1993
  /** @type {?} */
1992
1994
  const nameSplit = file.name.split('.');
1993
- nameSplit.splice(nameSplit.length - 1, 1);
1995
+ this.dataFile.ext = nameSplit.splice(nameSplit.length - 1, 1)[0];
1994
1996
  this.dataFile.name = nameSplit.join('.');
1995
1997
  this.dataFile.size = file.size;
1996
- this.dataFile.ext = file.type.split('/')[1];
1997
1998
  this.dataFile.errors = {
1998
1999
  ext: supportedTypes.indexOf(`.${this.dataFile.ext}`) < 0,
1999
2000
  size: supportedSize < this.dataFile.size,
@@ -2043,7 +2044,7 @@ class FileItemComponent {
2043
2044
  FileItemComponent.decorators = [
2044
2045
  { type: Component, args: [{
2045
2046
  selector: 'lib-file-item',
2046
- template: "<div class=\"file-item__img\">\n <ng-container\n *ngIf=\"\n file.type.indexOf('image') > -1 || dataFile.ext === 'pdf';\n else defaultFile\n \"\n >\n <img\n [class.image]=\"file.type.indexOf('image') > -1\"\n *ngIf=\"dataFile.ext === 'pdf' || dataFile.data\"\n [src]=\"dataFile.ext === 'pdf' ? base64Pdf : dataFile.data\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n</div>\n<div class=\"file-item__content\">\n <input\n class=\"file-item__content--name\"\n matInput\n placeholder=\"Enter file name\"\n [value]=\"dataFile.name\"\n required\n (input)=\"onChange($event)\"\n />\n <div class=\"file-item__content--info\">\n <div class=\"file-item__content--info__item\">\n Type of file: <span>{{ dataFile.ext }}</span>\n </div>\n <div class=\"file-item__content--info__item\">\n Size: <span>{{ dataFile.size | fileSize }}</span>\n </div>\n </div>\n <div *ngIf=\"dataFile.errors.ext\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['ext'] }}\n {{ uploadAssetService.supportedTypes.join(', ') }}\n </div>\n <div *ngIf=\"dataFile.errors.size\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['size'] }}\n {{ uploadAssetService.supportedSize | fileSize: 0 }}\n </div>\n</div>\n<div class=\"file-item__action\">\n <mat-icon (click)=\"onRemove()\">delete_outline</mat-icon>\n</div>\n",
2047
+ template: "<div class=\"file-item__img\">\n <ng-container\n *ngIf=\"\n file.type.indexOf('image') > -1 || dataFile.ext === 'pdf';\n else defaultFile\n \"\n >\n <img\n [class.image]=\"file.type.indexOf('image') > -1\"\n *ngIf=\"dataFile.ext === 'pdf' || dataFile.data\"\n [src]=\"dataFile.ext === 'pdf' ? base64Pdf : dataFile.data\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n</div>\n<div class=\"file-item__content\">\n <input\n class=\"file-item__content--name\"\n matInput\n placeholder=\"Enter file name\"\n [value]=\"dataFile.name\"\n required\n (input)=\"onChange($event)\"\n />\n <div class=\"file-item__content--info\">\n <div class=\"file-item__content--info__item\">\n Extension: <span>{{ dataFile.ext }}</span>\n </div>\n <div class=\"file-item__content--info__item\">\n Size: <span>{{ dataFile.size | fileSize }}</span>\n </div>\n </div>\n <div *ngIf=\"dataFile.errors.ext\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['ext'] }}\n {{ uploadAssetService.supportedTypes.join(', ') }}\n </div>\n <div *ngIf=\"dataFile.errors.size\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['size'] }}\n {{ uploadAssetService.supportedSize | fileSize: 0 }}\n </div>\n</div>\n<div class=\"file-item__action\">\n <mat-icon (click)=\"onRemove()\">delete_outline</mat-icon>\n</div>\n",
2047
2048
  styles: [":host::ng-deep{padding:10px 5%;display:flex;justify-content:space-between;align-items:center;background-color:#f9f9f9;border-radius:10px}:host::ng-deep .file-item__img{display:flex;justify-content:center;align-items:center;width:250px;height:150px;border-radius:10px}:host::ng-deep .file-item__img img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}:host::ng-deep .file-item__img img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .file-item__img mat-icon{font-size:100px;width:auto;height:auto}:host::ng-deep .file-item__content{flex:1;padding-left:5%;padding-right:5%}:host::ng-deep .file-item__content--name{width:100%;padding:10px;border:1px solid #d8d8d8;border-radius:5px}:host::ng-deep .file-item__content--info{margin-top:10px;display:flex}:host::ng-deep .file-item__content--info__item:not(:last-child){margin-right:50px}:host::ng-deep .file-item__content--info__item span{color:#000;text-transform:uppercase}:host::ng-deep .file-item__error{margin-top:10px;color:#f44336}:host::ng-deep .file-item__action{color:#f44336;cursor:pointer}"]
2048
2049
  }] }
2049
2050
  ];
@@ -3261,6 +3262,7 @@ if (false) {
3261
3262
  }
3262
3263
  class AssetDialogComponent {
3263
3264
  /**
3265
+ * @param {?} _env
3264
3266
  * @param {?} dialog
3265
3267
  * @param {?} data
3266
3268
  * @param {?} dialogRef
@@ -3270,7 +3272,8 @@ class AssetDialogComponent {
3270
3272
  * @param {?} domSanitizer
3271
3273
  * @param {?} svc
3272
3274
  */
3273
- constructor(dialog, data, dialogRef, fileSize, assetService, fileService, domSanitizer, svc) {
3275
+ constructor(_env, dialog, data, dialogRef, fileSize, assetService, fileService, domSanitizer, svc) {
3276
+ this._env = _env;
3274
3277
  this.dialog = dialog;
3275
3278
  this.data = data;
3276
3279
  this.dialogRef = dialogRef;
@@ -3296,7 +3299,7 @@ class AssetDialogComponent {
3296
3299
  * @return {?}
3297
3300
  */
3298
3301
  ngOnInit() {
3299
- this.linkDownload = `https://sandboxunitedapi.relationshop.net/V6/Asset2/api/File/Download/${this.data.assetId}`;
3302
+ this.linkDownload = `${this._env.asset2Url}/File/Download/${this.data.assetId}`;
3300
3303
  this.getAssetDetail();
3301
3304
  }
3302
3305
  /**
@@ -3526,6 +3529,7 @@ AssetDialogComponent.decorators = [
3526
3529
  ];
3527
3530
  /** @nocollapse */
3528
3531
  AssetDialogComponent.ctorParameters = () => [
3532
+ { type: undefined, decorators: [{ type: Inject, args: [AM_CONFIG,] }] },
3529
3533
  { type: MatDialog },
3530
3534
  { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
3531
3535
  { type: MatDialogRef },
@@ -3572,6 +3576,11 @@ if (false) {
3572
3576
  AssetDialogComponent.prototype.isUpdating;
3573
3577
  /** @type {?} */
3574
3578
  AssetDialogComponent.prototype.fileType;
3579
+ /**
3580
+ * @type {?}
3581
+ * @private
3582
+ */
3583
+ AssetDialogComponent.prototype._env;
3575
3584
  /**
3576
3585
  * @type {?}
3577
3586
  * @private