@solidpepper/solidpepper-modal-media-selection 1.0.0

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.
@@ -0,0 +1,1101 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Input, Output, Component, ViewEncapsulation } from '@angular/core';
3
+ import { Subject, of, Observable } from 'rxjs';
4
+ import { switchMap, catchError, finalize } from 'rxjs/operators';
5
+ import * as i2 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+ import * as i5$1 from '@angular/forms';
8
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
9
+ import * as i5 from '@ngx-translate/core';
10
+ import { TranslateModule } from '@ngx-translate/core';
11
+ import * as i4 from 'ng2-file-upload';
12
+ import { FileUploader, FileUploadModule } from 'ng2-file-upload';
13
+ import * as i3 from '@angular/material/select';
14
+ import { MatSelectModule } from '@angular/material/select';
15
+ import * as i1 from '@solidpepper/solidpepper-service';
16
+ import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
17
+ import * as i3$1 from '@angular/material/tooltip';
18
+ import { MatTooltipModule } from '@angular/material/tooltip';
19
+ import { MatCheckboxModule } from '@angular/material/checkbox';
20
+ import { NgxSelectModule } from 'ngx-select-ex';
21
+ import * as i4$1 from 'ngx-bootstrap/pagination';
22
+ import { PaginationModule } from 'ngx-bootstrap/pagination';
23
+
24
+ class AssetsUploaderComponent {
25
+ constructor(_auth, _companies, _settingsService, _profilesAssets, _damAssets, _teams) {
26
+ this._auth = _auth;
27
+ this._companies = _companies;
28
+ this._settingsService = _settingsService;
29
+ this._profilesAssets = _profilesAssets;
30
+ this._damAssets = _damAssets;
31
+ this._teams = _teams;
32
+ this.allAssetsUpload = new EventEmitter();
33
+ this.folderType = 'DAM';
34
+ this.imageArea = false;
35
+ this.view = 'card';
36
+ this.hasBaseDropZoneOver = false;
37
+ this.profileAssetGuid = '00000000-0000-0000-0000-000000000000';
38
+ this.isMimetypeNotAllowed = false;
39
+ this.teamsBaseModify = [];
40
+ }
41
+ ngOnInit() {
42
+ this.loginName = localStorage.getItem('Login_' + this._settingsService.getAlias());
43
+ this._companies.getAccountSettings().subscribe((res) => {
44
+ this.langueSelectDefault = res['setting'].settingLanguageDefault;
45
+ this.fieldsForTeamsAvailable = {
46
+ text: 'teamName[' + this.langueSelectDefault + ']',
47
+ value: 'teamGuid',
48
+ };
49
+ this._profilesAssets.getProfilesAssets(0, 10000, '', this.langueSelectDefault, 'ASC').subscribe((res) => {
50
+ this.profilesAssets = res['profilesAssets'];
51
+ });
52
+ });
53
+ if (this.folderType == 'EXCEL') {
54
+ this.uploader = new FileUploader({
55
+ url: this._settingsService.getSettings('apiUrl') + 'Dam/assets/upload?profileAssetGuid=' + this.profileAssetGuid,
56
+ authToken: this._settingsService.getHeaders().Authorization,
57
+ allowedMimeType: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
58
+ });
59
+ this.uploader.onWhenAddingFileFailed = (item, response, option) => {
60
+ if (item.type !== 'application/vnd.ms-excel' && item.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
61
+ this.isMimetypeNotAllowed = true;
62
+ }
63
+ else {
64
+ this.isMimetypeNotAllowed = false;
65
+ }
66
+ };
67
+ this.uploader.onAfterAddingFile = (fileItem) => {
68
+ const ext = fileItem.file.name.split('.').pop()?.toLowerCase();
69
+ if (!['xls', 'xlsx'].includes(ext)) {
70
+ this.uploader.removeFromQueue(fileItem);
71
+ alert('Only Excel files (.xls or .xlsx) are allowed.');
72
+ }
73
+ };
74
+ }
75
+ else {
76
+ this.uploader = new FileUploader({
77
+ url: this._settingsService.getSettings('apiUrl') + 'Dam/assets/upload?profileAssetGuid=' + this.profileAssetGuid,
78
+ authToken: this._settingsService.getHeaders().Authorization,
79
+ });
80
+ }
81
+ this._teams.getAllTeams().subscribe((res) => {
82
+ this.teams = res['teams'];
83
+ this.teams.forEach((team) => {
84
+ if (team.users) {
85
+ team.users.forEach((user) => {
86
+ if (user.userLogin == this.loginName) {
87
+ this.teamsBaseModify.push(team.teamGuid);
88
+ }
89
+ });
90
+ }
91
+ });
92
+ });
93
+ }
94
+ setProfileAssetGuid($event) {
95
+ this.profileAssetGuid = $event.value;
96
+ }
97
+ fileOverBase(e) {
98
+ console.log('Fichier sur la zone : ', e);
99
+ this.hasBaseDropZoneOver = e;
100
+ }
101
+ upload() {
102
+ if (this.folderGuid && this.folderGuid != undefined) {
103
+ this.uploader.setOptions({
104
+ url: this._settingsService.getSettings('apiUrl') + 'Dam/assets/upload?folderGuid=' + this.folderGuid + '&profileAssetGuid=' + this.profileAssetGuid,
105
+ });
106
+ }
107
+ else {
108
+ if (this.folderType == 'EXCEL')
109
+ this.uploader.setOptions({
110
+ url: this._settingsService.getSettings('apiUrl') + 'Dam/assets/upload?folderGuid=' + '22222222-2222-2222-2222-222222222222' + '&profileAssetGuid=' + this.profileAssetGuid,
111
+ });
112
+ else
113
+ this.uploader.setOptions({
114
+ url: this._settingsService.getSettings('apiUrl') + 'Dam/assets/upload?folderGuid' + '&profileAssetGuid=' + this.profileAssetGuid,
115
+ });
116
+ }
117
+ this.uploader.uploadAll();
118
+ this.uploader.onCompleteItem = (item, response, status, headers) => {
119
+ this.uploader.removeFromQueue(item);
120
+ };
121
+ this.uploader.onCompleteAll = () => {
122
+ this.allAssetsUpload.emit();
123
+ };
124
+ }
125
+ updateListModify() { }
126
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AssetsUploaderComponent, deps: [{ token: i1.AuthService }, { token: i1.CompaniesService }, { token: i1.SettingsService }, { token: i1.DamAssetsProfilesService }, { token: i1.DamAssetsService }, { token: i1.TeamsService }], target: i0.ɵɵFactoryTarget.Component }); }
127
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: AssetsUploaderComponent, isStandalone: true, selector: "app-assets-uploader", inputs: { folderGuid: "folderGuid", folderType: "folderType", imageArea: "imageArea", view: "view" }, outputs: { allAssetsUpload: "allAssetsUpload" }, ngImport: i0, template: "@if (!imageArea) {\r\n <button\r\n class=\"btn-access btn-download designer\"\r\n style=\"margin-right: 5px\"\r\n (click)=\"_auth.triggerModal(modalUploadAssets)\"\r\n >\r\n <span class=\"fas fa-cloud-upload-alt spanUploadCloud\"></span>\r\n <span\r\n style=\"font-size: 15px\"\r\n [innerHTML]=\"'media.library.UPLOAD' | translate\"\r\n ></span>\r\n </button>\r\n}\r\n\r\n@if (imageArea && view == \"card\") {\r\n <div style=\"width: max-content; display: flex\">\r\n <div class=\"assetsDiv pointer\">\r\n <div class=\"imgCase\">\r\n <div\r\n ng2FileDrop\r\n (onFileDrop)=\"\r\n this.profileAssetGuid = '00000000-0000-0000-0000-000000000000';\r\n upload()\r\n \"\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder-large my-drop-zone boxArea\"\r\n >\r\n <p\r\n style=\"text-align: center; white-space: normal\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n multiple\r\n ></p>\r\n </div>\r\n </div>\r\n </div>\r\n @if (uploader.queue[0]) {\r\n <div>\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div class=\"assetsDiv\">\r\n <div class=\"cssload-container\">\r\n <div class=\"cssload-speeding-wheel\"></div>\r\n </div>\r\n <div class=\"assetNameListingDisplay crop\">\r\n {{ uploader.queue[i].file.name }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n\r\n@if (imageArea && view == \"thumbnail\") {\r\n <div style=\"width: max-content; display: flex\">\r\n <div class=\"assetsDivThumbnail pointer\">\r\n <div class=\"imgCaseThumbnail\">\r\n <div\r\n ng2FileDrop\r\n (onFileDrop)=\"\r\n this.profileAssetGuid = '00000000-0000-0000-0000-000000000000';\r\n upload()\r\n \"\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder-large my-drop-zone boxArea\"\r\n >\r\n <p\r\n style=\"text-align: center; white-space: normal\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n multiple\r\n ></p>\r\n </div>\r\n </div>\r\n </div>\r\n @if (uploader.queue[0]) {\r\n <div>\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div class=\"assetsDivthumbnail\">\r\n <div class=\"cssload-container\">\r\n <div class=\"cssload-speeding-wheel\"></div>\r\n </div>\r\n <div class=\"assetNameListingDisplay crop\">\r\n {{ uploader.queue[i].file.name }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n\r\n@if (imageArea && view == \"list\") {\r\n <div>\r\n <div class=\"imgCaseListView\">\r\n <div\r\n ng2FileDrop\r\n (onFileDrop)=\"\r\n this.profileAssetGuid = '00000000-0000-0000-0000-000000000000';\r\n upload()\r\n \"\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder-large my-drop-zone boxArea\"\r\n >\r\n <p\r\n style=\"text-align: center; margin-bottom: 0px; white-space: normal\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n multiple\r\n ></p>\r\n </div>\r\n </div>\r\n @if (uploader.queue[0]) {\r\n <div>\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div class=\"row assetRowDivListMode\">\r\n <div class=\"cssloadListView-container\">\r\n <div class=\"cssloadListView-speeding-wheel\"></div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n\r\n<!-- Modal upload assets -->\r\n<ng-template #modalUploadAssets let-modal>\r\n @if (uploader) {\r\n <div class=\"modal-header modalHeaderPadding\">\r\n <h5\r\n class=\"modal-title\"\r\n id=\"exampleModalLongTitle\"\r\n [innerHTML]=\"'media.library.IMPORTASSETS' | translate\"\r\n ></h5>\r\n <button\r\n type=\"button\"\r\n class=\"btn-close\"\r\n (click)=\"modal.dismiss('Cross click')\"\r\n aria-label=\"Close\"\r\n >\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"modal-body paddingModalBody\">\r\n <div>\r\n <div\r\n ng2FileDrop\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder my-drop-zone\"\r\n >\r\n <p\r\n style=\"text-align: center\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n ></p>\r\n </div>\r\n <p\r\n style=\"text-align: center\"\r\n [innerHTML]=\"'media.library.OR' | translate\"\r\n ></p>\r\n <label\r\n for=\"file2\"\r\n class=\"file-upload\"\r\n style=\"justify-content: center; display: flex\"\r\n >\r\n <button\r\n class=\"btn btn-primary btn-access\"\r\n style=\"cursor: pointer; width: 100%; margin-left: 0px\"\r\n [innerHTML]=\"'media.library.BROWSE' | translate\"\r\n ></button>\r\n <input\r\n id=\"file2\"\r\n type=\"file\"\r\n ng2FileSelect\r\n [uploader]=\"uploader\"\r\n multiple\r\n [accept]=\"folderType == 'EXCEL' ? '.xls,.xlsx' : ''\"\r\n />\r\n </label>\r\n <div class=\"queueDivCss\">\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div>\r\n <div class=\"row\" style=\"margin-left: 0px\">\r\n <p\r\n style=\"\r\n margin-right: 10px;\r\n margin-top: 2px;\r\n width: auto;\r\n height: 20px;\r\n \"\r\n >\r\n <strong>{{ uploader.queue[i].file.name }}</strong>\r\n </p>\r\n <button\r\n style=\"height: 22px; width: 22px\"\r\n type=\"button\"\r\n class=\"btn-trash\"\r\n (click)=\"item.remove()\"\r\n >\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n @if (\r\n isMimetypeNotAllowed && uploader.queue[0] && folderType == \"EXCEL\"\r\n ) {\r\n <p style=\"text-align: center; color: red\">\r\n {{ \"settings.imports.FORMATNOTALLOWED\" | translate }}\r\n </p>\r\n }\r\n @if (folderType == \"EXCEL\") {\r\n <p style=\"text-align: center; margin-top: 10px\">\r\n {{ \"settings.imports.FORMATALLOWEDEXCEL\" | translate }}\r\n </p>\r\n }\r\n </div>\r\n @if (folderType == \"DAM\") {\r\n <div style=\"display: grid; margin-bottom: 15px; margin-top: 10px\">\r\n <span [innerHTML]=\"'media.library.SIZEMIN' | translate\"></span>\r\n <span [innerHTML]=\"'media.library.SIZEMIN1' | translate\"></span>\r\n <span [innerHTML]=\"'media.library.SIZEMIN2' | translate\"></span>\r\n </div>\r\n }\r\n @if (profilesAssets && folderType == \"DAM\") {\r\n <div class=\"modal-margin-bottom-element\">\r\n <label class=\"modal-label\">\r\n {{ \"media.library.PROFILEASSET\" | translate }}\r\n &nbsp;\r\n <span class=\"red\">(*)</span>\r\n </label>\r\n <mat-select\r\n class=\"div_forclick input-style\"\r\n autocomplete=\"off\"\r\n (selectionChange)=\"setProfileAssetGuid($event)\"\r\n value=\"00000000-0000-0000-0000-000000000000\"\r\n >\r\n @for (profil of profilesAssets; track profil; let i = $index) {\r\n <mat-option [value]=\"profil.profileAssetGuid\">\r\n {{ profil.profileAssetName[this.langueSelectDefault] }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <span\r\n style=\"font-style: italic; padding-top: 10px\"\r\n [innerHTML]=\"'media.library.PROFILTIPS' | translate\"\r\n ></span>\r\n </div>\r\n }\r\n <div>\r\n <div class=\"modal-button-placement\">\r\n <button\r\n type=\"button\"\r\n class=\"btn-denied\"\r\n (click)=\"modal.close('Save click')\"\r\n [innerHTML]=\"'media.library.CANCEL' | translate\"\r\n ></button>\r\n <button\r\n type=\"button\"\r\n class=\"btn-access\"\r\n [disabled]=\"!uploader.queue[0]\"\r\n (click)=\"upload()\"\r\n (click)=\"_auth.closeAllModal()\"\r\n [innerHTML]=\"'media.library.UPLOAD' | translate\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".spanUploadCloud{font-size:16px;margin-right:8px}::ng-deep .cdk-overlay-pane{display:flex!important}::ng-deep .cdk-overlay-container{z-index:20000!important}.crop{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.assetNameListingDisplay{font-size:12px;padding-right:5px;padding-left:5px;display:flex;align-items:center}.assetsDiv{position:relative;padding:unset;margin-bottom:20px;background:#fff;display:inline-block;margin-right:20px;height:195px;border-radius:var(--border-radius);width:150px;justify-content:center;align-items:center;box-shadow:0 2px 4px #0000000d}.assetsDivThumbnail{position:relative;padding:unset;margin-bottom:20px;background:#fff;display:inline-block;margin-right:20px;height:140px;border-radius:var(--border-radius);width:150px;justify-content:center;align-items:center;box-shadow:0 2px 4px #0000000d}.pointer{cursor:pointer}.imgCase{justify-content:center;display:flex;height:195px}.imgCaseThumbnail{justify-content:center;display:flex;height:150px}.imgCaseListView{height:50px;margin-bottom:10px;margin-left:10px;margin-right:-10px}.boxArea{height:100%;display:flex;align-items:center}.cssload-container{background-color:#f3f4f6;height:150px;display:flex;align-items:center}.cssload-speeding-wheel{content:\"\";display:block;width:63px;height:63px;margin:0 auto;border:4px solid rgb(136,118,118);border-radius:50%;border-left-color:transparent;border-right-color:transparent;animation:cssload-spin .5s infinite linear;-o-animation:cssload-spin .5s infinite linear;-ms-animation:cssload-spin .5s infinite linear;-webkit-animation:cssload-spin .5s infinite linear;-moz-animation:cssload-spin .5s infinite linear}@keyframes cssload-spin{to{transform:rotate(360deg)}}@-o-keyframes cssload-spin{to{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes cssload-spin{to{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cssload-spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes cssload-spin{to{-moz-transform:rotate(360deg);transform:rotate(360deg)}}.assetRowDivListMode{margin-left:10px;margin-right:-10px;height:50px;display:flex;align-items:center;border-bottom:1px solid lightgray;background:#fff}.cssloadListView-container{background-color:#fff;display:flex;align-items:center}.cssloadListView-speeding-wheel{content:\"\";display:block;width:30px;height:30px;margin:0 auto;border:4px solid rgb(136,118,118);border-radius:50%;border-left-color:transparent;border-right-color:transparent;animation:cssload-spin .5s infinite linear;-o-animation:cssload-spin .5s infinite linear;-ms-animation:cssload-spin .5s infinite linear;-webkit-animation:cssload-spin .5s infinite linear;-moz-animation:cssload-spin .5s infinite linear}.box-placeholder-large{margin-bottom:15px;padding:20px;border:2px dashed #ddd;background:#fafafa;color:#444;width:150px}.btn-download{min-width:max-content}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FileUploadModule }, { kind: "directive", type: i4.FileDropDirective, selector: "[ng2FileDrop]", inputs: ["uploader"], outputs: ["fileOver", "onFileDrop"] }, { kind: "directive", type: i4.FileSelectDirective, selector: "[ng2FileSelect]", inputs: ["uploader"], outputs: ["onFileSelected"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
128
+ }
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AssetsUploaderComponent, decorators: [{
130
+ type: Component,
131
+ args: [{ selector: 'app-assets-uploader', standalone: true, imports: [CommonModule, TranslateModule, MatSelectModule, FileUploadModule], template: "@if (!imageArea) {\r\n <button\r\n class=\"btn-access btn-download designer\"\r\n style=\"margin-right: 5px\"\r\n (click)=\"_auth.triggerModal(modalUploadAssets)\"\r\n >\r\n <span class=\"fas fa-cloud-upload-alt spanUploadCloud\"></span>\r\n <span\r\n style=\"font-size: 15px\"\r\n [innerHTML]=\"'media.library.UPLOAD' | translate\"\r\n ></span>\r\n </button>\r\n}\r\n\r\n@if (imageArea && view == \"card\") {\r\n <div style=\"width: max-content; display: flex\">\r\n <div class=\"assetsDiv pointer\">\r\n <div class=\"imgCase\">\r\n <div\r\n ng2FileDrop\r\n (onFileDrop)=\"\r\n this.profileAssetGuid = '00000000-0000-0000-0000-000000000000';\r\n upload()\r\n \"\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder-large my-drop-zone boxArea\"\r\n >\r\n <p\r\n style=\"text-align: center; white-space: normal\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n multiple\r\n ></p>\r\n </div>\r\n </div>\r\n </div>\r\n @if (uploader.queue[0]) {\r\n <div>\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div class=\"assetsDiv\">\r\n <div class=\"cssload-container\">\r\n <div class=\"cssload-speeding-wheel\"></div>\r\n </div>\r\n <div class=\"assetNameListingDisplay crop\">\r\n {{ uploader.queue[i].file.name }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n\r\n@if (imageArea && view == \"thumbnail\") {\r\n <div style=\"width: max-content; display: flex\">\r\n <div class=\"assetsDivThumbnail pointer\">\r\n <div class=\"imgCaseThumbnail\">\r\n <div\r\n ng2FileDrop\r\n (onFileDrop)=\"\r\n this.profileAssetGuid = '00000000-0000-0000-0000-000000000000';\r\n upload()\r\n \"\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder-large my-drop-zone boxArea\"\r\n >\r\n <p\r\n style=\"text-align: center; white-space: normal\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n multiple\r\n ></p>\r\n </div>\r\n </div>\r\n </div>\r\n @if (uploader.queue[0]) {\r\n <div>\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div class=\"assetsDivthumbnail\">\r\n <div class=\"cssload-container\">\r\n <div class=\"cssload-speeding-wheel\"></div>\r\n </div>\r\n <div class=\"assetNameListingDisplay crop\">\r\n {{ uploader.queue[i].file.name }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n\r\n@if (imageArea && view == \"list\") {\r\n <div>\r\n <div class=\"imgCaseListView\">\r\n <div\r\n ng2FileDrop\r\n (onFileDrop)=\"\r\n this.profileAssetGuid = '00000000-0000-0000-0000-000000000000';\r\n upload()\r\n \"\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder-large my-drop-zone boxArea\"\r\n >\r\n <p\r\n style=\"text-align: center; margin-bottom: 0px; white-space: normal\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n multiple\r\n ></p>\r\n </div>\r\n </div>\r\n @if (uploader.queue[0]) {\r\n <div>\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div class=\"row assetRowDivListMode\">\r\n <div class=\"cssloadListView-container\">\r\n <div class=\"cssloadListView-speeding-wheel\"></div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n\r\n<!-- Modal upload assets -->\r\n<ng-template #modalUploadAssets let-modal>\r\n @if (uploader) {\r\n <div class=\"modal-header modalHeaderPadding\">\r\n <h5\r\n class=\"modal-title\"\r\n id=\"exampleModalLongTitle\"\r\n [innerHTML]=\"'media.library.IMPORTASSETS' | translate\"\r\n ></h5>\r\n <button\r\n type=\"button\"\r\n class=\"btn-close\"\r\n (click)=\"modal.dismiss('Cross click')\"\r\n aria-label=\"Close\"\r\n >\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"modal-body paddingModalBody\">\r\n <div>\r\n <div\r\n ng2FileDrop\r\n [ngClass]=\"{ 'nv-file-over': hasBaseDropZoneOver }\"\r\n [uploader]=\"uploader\"\r\n class=\"box-placeholder my-drop-zone\"\r\n >\r\n <p\r\n style=\"text-align: center\"\r\n [innerHTML]=\"'media.library.DRAGDROPHERE' | translate\"\r\n ></p>\r\n </div>\r\n <p\r\n style=\"text-align: center\"\r\n [innerHTML]=\"'media.library.OR' | translate\"\r\n ></p>\r\n <label\r\n for=\"file2\"\r\n class=\"file-upload\"\r\n style=\"justify-content: center; display: flex\"\r\n >\r\n <button\r\n class=\"btn btn-primary btn-access\"\r\n style=\"cursor: pointer; width: 100%; margin-left: 0px\"\r\n [innerHTML]=\"'media.library.BROWSE' | translate\"\r\n ></button>\r\n <input\r\n id=\"file2\"\r\n type=\"file\"\r\n ng2FileSelect\r\n [uploader]=\"uploader\"\r\n multiple\r\n [accept]=\"folderType == 'EXCEL' ? '.xls,.xlsx' : ''\"\r\n />\r\n </label>\r\n <div class=\"queueDivCss\">\r\n @for (item of uploader.queue; track item; let i = $index) {\r\n <div>\r\n <div class=\"row\" style=\"margin-left: 0px\">\r\n <p\r\n style=\"\r\n margin-right: 10px;\r\n margin-top: 2px;\r\n width: auto;\r\n height: 20px;\r\n \"\r\n >\r\n <strong>{{ uploader.queue[i].file.name }}</strong>\r\n </p>\r\n <button\r\n style=\"height: 22px; width: 22px\"\r\n type=\"button\"\r\n class=\"btn-trash\"\r\n (click)=\"item.remove()\"\r\n >\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n @if (\r\n isMimetypeNotAllowed && uploader.queue[0] && folderType == \"EXCEL\"\r\n ) {\r\n <p style=\"text-align: center; color: red\">\r\n {{ \"settings.imports.FORMATNOTALLOWED\" | translate }}\r\n </p>\r\n }\r\n @if (folderType == \"EXCEL\") {\r\n <p style=\"text-align: center; margin-top: 10px\">\r\n {{ \"settings.imports.FORMATALLOWEDEXCEL\" | translate }}\r\n </p>\r\n }\r\n </div>\r\n @if (folderType == \"DAM\") {\r\n <div style=\"display: grid; margin-bottom: 15px; margin-top: 10px\">\r\n <span [innerHTML]=\"'media.library.SIZEMIN' | translate\"></span>\r\n <span [innerHTML]=\"'media.library.SIZEMIN1' | translate\"></span>\r\n <span [innerHTML]=\"'media.library.SIZEMIN2' | translate\"></span>\r\n </div>\r\n }\r\n @if (profilesAssets && folderType == \"DAM\") {\r\n <div class=\"modal-margin-bottom-element\">\r\n <label class=\"modal-label\">\r\n {{ \"media.library.PROFILEASSET\" | translate }}\r\n &nbsp;\r\n <span class=\"red\">(*)</span>\r\n </label>\r\n <mat-select\r\n class=\"div_forclick input-style\"\r\n autocomplete=\"off\"\r\n (selectionChange)=\"setProfileAssetGuid($event)\"\r\n value=\"00000000-0000-0000-0000-000000000000\"\r\n >\r\n @for (profil of profilesAssets; track profil; let i = $index) {\r\n <mat-option [value]=\"profil.profileAssetGuid\">\r\n {{ profil.profileAssetName[this.langueSelectDefault] }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <span\r\n style=\"font-style: italic; padding-top: 10px\"\r\n [innerHTML]=\"'media.library.PROFILTIPS' | translate\"\r\n ></span>\r\n </div>\r\n }\r\n <div>\r\n <div class=\"modal-button-placement\">\r\n <button\r\n type=\"button\"\r\n class=\"btn-denied\"\r\n (click)=\"modal.close('Save click')\"\r\n [innerHTML]=\"'media.library.CANCEL' | translate\"\r\n ></button>\r\n <button\r\n type=\"button\"\r\n class=\"btn-access\"\r\n [disabled]=\"!uploader.queue[0]\"\r\n (click)=\"upload()\"\r\n (click)=\"_auth.closeAllModal()\"\r\n [innerHTML]=\"'media.library.UPLOAD' | translate\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".spanUploadCloud{font-size:16px;margin-right:8px}::ng-deep .cdk-overlay-pane{display:flex!important}::ng-deep .cdk-overlay-container{z-index:20000!important}.crop{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.assetNameListingDisplay{font-size:12px;padding-right:5px;padding-left:5px;display:flex;align-items:center}.assetsDiv{position:relative;padding:unset;margin-bottom:20px;background:#fff;display:inline-block;margin-right:20px;height:195px;border-radius:var(--border-radius);width:150px;justify-content:center;align-items:center;box-shadow:0 2px 4px #0000000d}.assetsDivThumbnail{position:relative;padding:unset;margin-bottom:20px;background:#fff;display:inline-block;margin-right:20px;height:140px;border-radius:var(--border-radius);width:150px;justify-content:center;align-items:center;box-shadow:0 2px 4px #0000000d}.pointer{cursor:pointer}.imgCase{justify-content:center;display:flex;height:195px}.imgCaseThumbnail{justify-content:center;display:flex;height:150px}.imgCaseListView{height:50px;margin-bottom:10px;margin-left:10px;margin-right:-10px}.boxArea{height:100%;display:flex;align-items:center}.cssload-container{background-color:#f3f4f6;height:150px;display:flex;align-items:center}.cssload-speeding-wheel{content:\"\";display:block;width:63px;height:63px;margin:0 auto;border:4px solid rgb(136,118,118);border-radius:50%;border-left-color:transparent;border-right-color:transparent;animation:cssload-spin .5s infinite linear;-o-animation:cssload-spin .5s infinite linear;-ms-animation:cssload-spin .5s infinite linear;-webkit-animation:cssload-spin .5s infinite linear;-moz-animation:cssload-spin .5s infinite linear}@keyframes cssload-spin{to{transform:rotate(360deg)}}@-o-keyframes cssload-spin{to{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes cssload-spin{to{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cssload-spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes cssload-spin{to{-moz-transform:rotate(360deg);transform:rotate(360deg)}}.assetRowDivListMode{margin-left:10px;margin-right:-10px;height:50px;display:flex;align-items:center;border-bottom:1px solid lightgray;background:#fff}.cssloadListView-container{background-color:#fff;display:flex;align-items:center}.cssloadListView-speeding-wheel{content:\"\";display:block;width:30px;height:30px;margin:0 auto;border:4px solid rgb(136,118,118);border-radius:50%;border-left-color:transparent;border-right-color:transparent;animation:cssload-spin .5s infinite linear;-o-animation:cssload-spin .5s infinite linear;-ms-animation:cssload-spin .5s infinite linear;-webkit-animation:cssload-spin .5s infinite linear;-moz-animation:cssload-spin .5s infinite linear}.box-placeholder-large{margin-bottom:15px;padding:20px;border:2px dashed #ddd;background:#fafafa;color:#444;width:150px}.btn-download{min-width:max-content}\n"] }]
132
+ }], ctorParameters: () => [{ type: i1.AuthService }, { type: i1.CompaniesService }, { type: i1.SettingsService }, { type: i1.DamAssetsProfilesService }, { type: i1.DamAssetsService }, { type: i1.TeamsService }], propDecorators: { allAssetsUpload: [{
133
+ type: Output
134
+ }], folderGuid: [{
135
+ type: Input
136
+ }], folderType: [{
137
+ type: Input
138
+ }], imageArea: [{
139
+ type: Input
140
+ }], view: [{
141
+ type: Input
142
+ }] } });
143
+
144
+ class ModalMediaSelectionComponent {
145
+ constructor(_damAssets, _searchService, _mediaSelectionService, _settings, _desksService, _suppliersService, _accountsService, _frameworkagreementsService, _webSocket, cdr, rights, _settingsService, _login, auth, translate) {
146
+ this._damAssets = _damAssets;
147
+ this._searchService = _searchService;
148
+ this._mediaSelectionService = _mediaSelectionService;
149
+ this._settings = _settings;
150
+ this._desksService = _desksService;
151
+ this._suppliersService = _suppliersService;
152
+ this._accountsService = _accountsService;
153
+ this._frameworkagreementsService = _frameworkagreementsService;
154
+ this._webSocket = _webSocket;
155
+ this.cdr = cdr;
156
+ this.rights = rights;
157
+ this._settingsService = _settingsService;
158
+ this._login = _login;
159
+ this.auth = auth;
160
+ this.translate = translate;
161
+ this.hasBeenSaved = new EventEmitter();
162
+ this.refreshData = new EventEmitter();
163
+ this.isExternal = false;
164
+ this.alias = ''; //Paramètre de connexion
165
+ this.team = ''; //Paramètre de connexion
166
+ this.designer = false;
167
+ this.workitemGuid = null;
168
+ this.isReplace = false;
169
+ this.sendListGuid = false;
170
+ this.language = '';
171
+ this.isOnlyOneAsset = false;
172
+ this.folders = [];
173
+ //Search
174
+ this.isSearchMode = false;
175
+ this.searchTerm$ = new Subject();
176
+ this.searchResult = [];
177
+ this.searchTermForDisplay = '';
178
+ this.start = 0;
179
+ this.limit = 25;
180
+ this.pagePagination = 1;
181
+ this.nbrElementPage = 25;
182
+ this.maxSize = 3;
183
+ //Assets
184
+ this.assets = [];
185
+ this.assetsInFolder = [];
186
+ this.assetsSelected = [];
187
+ this.assetsSelectedCopyWorkflows = [];
188
+ this.selectAssetSubject = new Subject();
189
+ //Rights
190
+ this.rightsAccesModule = {};
191
+ this.subscriptionRights = this.rights.getRights().subscribe((message) => {
192
+ this.rightsAccesModule = message;
193
+ });
194
+ this._searchService.search(this.searchTerm$).subscribe((results) => {
195
+ this.assetsInFolder = results['assets'];
196
+ });
197
+ this.userLogin = localStorage.getItem('Login_' + this._settings.getAlias());
198
+ }
199
+ ngOnInit() {
200
+ if (this.isExternal && this.alias) {
201
+ this._settingsService.setAlias(this.alias);
202
+ this.externalLogin();
203
+ }
204
+ this.initialization();
205
+ this.initSelectAssetSubscription();
206
+ if (this.workflows) {
207
+ this.assetsSelectedCopyWorkflows = [...this.assetsSelected];
208
+ }
209
+ }
210
+ /* ==================== OTHERS ==================== */
211
+ checkSearchMode() {
212
+ if (this.searchTermForDisplay != '') {
213
+ this.isSearchMode = true;
214
+ }
215
+ else {
216
+ this.isSearchMode = false;
217
+ }
218
+ }
219
+ closeModal() {
220
+ this.hasBeenSaved.emit(this.assetsSelected);
221
+ }
222
+ assignAssetForBom(drawing) {
223
+ this.bomDrawing = drawing;
224
+ }
225
+ assignResToAssetAndDisplay(assets) {
226
+ this.assets = assets['assets'];
227
+ // this.nbrElementTotal = assets['total'];
228
+ }
229
+ changePagePagination($event) {
230
+ if ($event) {
231
+ var start = ($event.page - 1) * this.nbrElementPage;
232
+ }
233
+ else {
234
+ var start = 0;
235
+ }
236
+ if (this.guidActiveFolderOfSelectedFolderForMove) {
237
+ this._damAssets.getAssetsByFolderGuid(this.guidActiveFolderOfSelectedFolderForMove, start, this.limit).subscribe((res) => {
238
+ this.assetsInFolder = res['assets'];
239
+ this.nbrElementTotal = res['total'];
240
+ });
241
+ }
242
+ else {
243
+ this._damAssets.getAssetsByOnLevelOne(start, this.limit, '').subscribe((res) => {
244
+ this.assetsInFolder = res['assets'];
245
+ this.nbrElementTotal = res['total'];
246
+ });
247
+ }
248
+ }
249
+ /* ==================== ASSETS ==================== */
250
+ initSelectAssetSubscription() {
251
+ this.selectAssetSubject
252
+ .pipe(switchMap((assetGuid) => {
253
+ return this.performAssetSelection(assetGuid).pipe(catchError((err) => {
254
+ console.error(err);
255
+ return of(null); // Handle error
256
+ }), finalize(() => {
257
+ this.cdr.detectChanges();
258
+ }));
259
+ }))
260
+ .subscribe();
261
+ }
262
+ performAssetSelection(assetGuid) {
263
+ return new Observable((observer) => {
264
+ if (!this.sendListGuid) {
265
+ if (this.isOnlyOneAsset) {
266
+ this.assetsSelected = [];
267
+ this.assetsSelected.push(assetGuid);
268
+ if (this.typeField == 'boms') {
269
+ this._mediaSelectionService.updateBomImage(this.skuGuid, this.bomParam, this.assetsSelected).subscribe((res) => {
270
+ if (this.bomParam == 'bomImages') {
271
+ this._mediaSelectionService.getAssetsForBom(this.skuGuid).subscribe((res) => {
272
+ this.assignResToAssetAndDisplay(res);
273
+ observer.next(void 0);
274
+ observer.complete();
275
+ });
276
+ }
277
+ else if (this.bomParam == 'bomDrawing') {
278
+ this._mediaSelectionService.getAssetsForBomDrawing(this.skuGuid).subscribe((res) => {
279
+ this.assignResToAssetAndDisplay(res);
280
+ observer.next(void 0);
281
+ observer.complete();
282
+ });
283
+ }
284
+ });
285
+ }
286
+ if (this.workitemGuid != null) {
287
+ this._mediaSelectionService.updateWorkflowImage(assetGuid, this.workitemGuid).subscribe((res) => {
288
+ observer.next(void 0);
289
+ observer.complete();
290
+ });
291
+ }
292
+ if (this.isReplace) {
293
+ if (this.skuGuid && !this.attributeGuid) {
294
+ this._mediaSelectionService.replaceSkuImages(this.skuGuid, this.isReplace, assetGuid, this.archive).subscribe((res) => {
295
+ this._mediaSelectionService.getAssetsForSku(this.skuGuid, this.archive).subscribe((res) => {
296
+ this.assignResToAssetAndDisplay(res);
297
+ this.closeModal();
298
+ observer.next(void 0);
299
+ observer.complete();
300
+ });
301
+ });
302
+ }
303
+ }
304
+ observer.next(void 0);
305
+ observer.complete();
306
+ }
307
+ else {
308
+ if (this.assetsSelected.indexOf(assetGuid) > -1) {
309
+ this.assetsSelected.splice(this.assetsSelected.indexOf(assetGuid), 1);
310
+ this.selectedAll = false;
311
+ if (this.attributeGuid && this.skuGuid) {
312
+ if (this.typeField == 'skus') {
313
+ if (this.type != 'fileMultiLang' && this.type != 'imageMultiLang') {
314
+ this._mediaSelectionService.updateSkuAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid, this.archive).subscribe((res) => {
315
+ this._mediaSelectionService.getAssetsForSkuAttribute(this.skuGuid, this.attributeGuid, this.archive).subscribe((res) => {
316
+ this.assignResToAssetAndDisplay(res);
317
+ observer.next(void 0);
318
+ observer.complete();
319
+ });
320
+ });
321
+ }
322
+ else {
323
+ this._mediaSelectionService.updateSkuAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid, this.archive, this.language).subscribe((res) => {
324
+ this._mediaSelectionService.getAssetsForSkuAttribute(this.skuGuid, this.attributeGuid, this.archive, this.language).subscribe((res) => {
325
+ this.assignResToAssetAndDisplay(res);
326
+ observer.next(void 0);
327
+ observer.complete();
328
+ });
329
+ });
330
+ }
331
+ }
332
+ else if (this.typeField == 'categories') {
333
+ this._mediaSelectionService.updateCategoryAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid).subscribe((res) => {
334
+ this._mediaSelectionService.getAssetsForCategoryAttribute(this.skuGuid, this.attributeGuid).subscribe((res) => {
335
+ this.assignResToAssetAndDisplay(res);
336
+ observer.next(void 0);
337
+ observer.complete();
338
+ });
339
+ });
340
+ }
341
+ else if (this.typeField == 'suppliers') {
342
+ this._suppliersService.updateSupplierField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
343
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'suppliers').subscribe((res) => {
344
+ this.assignResToAssetAndDisplay(res);
345
+ observer.next(void 0);
346
+ observer.complete();
347
+ });
348
+ });
349
+ }
350
+ else if (this.typeField == 'accounts') {
351
+ this._accountsService.updateCustomerByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
352
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'accounts').subscribe((res) => {
353
+ this.assignResToAssetAndDisplay(res);
354
+ observer.next(void 0);
355
+ observer.complete();
356
+ });
357
+ });
358
+ }
359
+ else if (this.typeField == 'frameworkagreements') {
360
+ this._frameworkagreementsService.updateFrameworkAgreementByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
361
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'AccountsFrameworkAgreements').subscribe((res) => {
362
+ this.assignResToAssetAndDisplay(res);
363
+ observer.next(void 0);
364
+ observer.complete();
365
+ });
366
+ });
367
+ }
368
+ else if (this.typeField == 'contacts') {
369
+ this._accountsService.updateContactByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
370
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'accounts/contacts').subscribe((res) => {
371
+ this.assignResToAssetAndDisplay(res);
372
+ observer.next(void 0);
373
+ observer.complete();
374
+ });
375
+ });
376
+ }
377
+ else if (this.typeField == 'boms') {
378
+ this._mediaSelectionService.updateBomImage(this.skuGuid, this.bomParam, this.assetsSelected).subscribe((res) => {
379
+ if (this.bomParam == 'bomImages') {
380
+ this._mediaSelectionService.getAssetsForBom(this.skuGuid).subscribe((res) => {
381
+ this.assignResToAssetAndDisplay(res);
382
+ observer.next(void 0);
383
+ observer.complete();
384
+ });
385
+ }
386
+ else if (this.bomParam == 'bomDrawing') {
387
+ this._mediaSelectionService.getAssetsForBomDrawing(this.skuGuid).subscribe((res) => {
388
+ this.assignResToAssetAndDisplay(res);
389
+ observer.next(void 0);
390
+ observer.complete();
391
+ });
392
+ }
393
+ });
394
+ }
395
+ else if (this.typeField == 'bomsitems') {
396
+ this._mediaSelectionService.updateBomItemImage(this.skuGuid, this.assetsSelected).subscribe((res) => {
397
+ this._mediaSelectionService.getAssetsForBomItem(this.skuGuid).subscribe((res) => {
398
+ this.assignResToAssetAndDisplay(res);
399
+ observer.next(void 0);
400
+ observer.complete();
401
+ });
402
+ });
403
+ }
404
+ }
405
+ else if (this.categoryGuid) {
406
+ this._mediaSelectionService.updateCategoryImage(this.categoryGuid, this.assetsSelected, this.categoryParam).subscribe((res) => {
407
+ this._mediaSelectionService.getAssetsForCategories(this.categoryGuid, this.categoryParam).subscribe((res) => {
408
+ this.assignResToAssetAndDisplay(res);
409
+ observer.next(void 0);
410
+ observer.complete();
411
+ });
412
+ });
413
+ }
414
+ else if (this.skuGuid && !this.attributeGuid) {
415
+ this._mediaSelectionService.updateSkuImages(this.skuGuid, this.assetsSelected, this.archive).subscribe((res) => {
416
+ this._mediaSelectionService.getAssetsForSku(this.skuGuid, this.archive).subscribe((res) => {
417
+ this.assignResToAssetAndDisplay(res);
418
+ observer.next(void 0);
419
+ observer.complete();
420
+ });
421
+ });
422
+ }
423
+ else if (this.categoryGuid) {
424
+ this._mediaSelectionService.updateCategoryImage(this.categoryGuid, this.assetsSelected, this.categoryParam).subscribe((res) => {
425
+ this._mediaSelectionService.getAssetsForCategories(this.categoryGuid, this.categoryParam).subscribe((res) => {
426
+ this.assignResToAssetAndDisplay(res);
427
+ observer.next(void 0);
428
+ observer.complete();
429
+ });
430
+ });
431
+ }
432
+ else if (this.workflows) {
433
+ this._desksService.getAllItemsByWorkItemGuid(this.start, '99999', this.workflows.desk.workdeskGuid, '', '').subscribe((res) => {
434
+ this.workflows.desk.subjects = res['items'];
435
+ let item = this.workflows.desk.subjects.find((element) => element.workitemBaseGuid == assetGuid);
436
+ if (item) {
437
+ this._desksService.deleteItemByDeskGuid(item.workitemGuid).subscribe((res) => {
438
+ this.workflows.desk.subjects.splice(this.workflows.desk.subjects.indexOf(assetGuid), 1);
439
+ this._webSocket.connection.invoke('refresh', 'getallitemsbydesk');
440
+ this.assets = this.assetsInFolder;
441
+ observer.next(void 0);
442
+ observer.complete();
443
+ });
444
+ }
445
+ else {
446
+ observer.next(void 0);
447
+ observer.complete();
448
+ }
449
+ });
450
+ }
451
+ else {
452
+ observer.next(void 0);
453
+ observer.complete();
454
+ }
455
+ }
456
+ else {
457
+ this.assetsSelected.push(assetGuid);
458
+ if (this.assetsSelected.length == this.assets.length) {
459
+ this.selectedAll = true;
460
+ }
461
+ if (this.attributeGuid && this.skuGuid) {
462
+ if (this.typeField == 'skus') {
463
+ if (this.type != 'fileMultiLang' && this.type != 'imageMultiLang') {
464
+ this._mediaSelectionService.updateSkuAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid, this.archive).subscribe((res) => {
465
+ this._mediaSelectionService.getAssetsForSkuAttribute(this.skuGuid, this.attributeGuid, this.archive).subscribe((res) => {
466
+ this.assignResToAssetAndDisplay(res);
467
+ observer.next(void 0);
468
+ observer.complete();
469
+ });
470
+ });
471
+ }
472
+ else {
473
+ this._mediaSelectionService.updateSkuAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid, this.archive, this.language).subscribe((res) => {
474
+ this._mediaSelectionService.getAssetsForSkuAttribute(this.skuGuid, this.attributeGuid, this.archive, this.language).subscribe((res) => {
475
+ this.assignResToAssetAndDisplay(res);
476
+ observer.next(void 0);
477
+ observer.complete();
478
+ });
479
+ });
480
+ }
481
+ }
482
+ else if (this.typeField == 'categories') {
483
+ this._mediaSelectionService.updateCategoryAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid).subscribe((res) => {
484
+ this._mediaSelectionService.getAssetsForCategoryAttribute(this.skuGuid, this.attributeGuid).subscribe((res) => {
485
+ this.assignResToAssetAndDisplay(res);
486
+ observer.next(void 0);
487
+ observer.complete();
488
+ });
489
+ });
490
+ }
491
+ else if (this.typeField == 'suppliers') {
492
+ this._suppliersService.updateSupplierField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
493
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'suppliers').subscribe((res) => {
494
+ this.assignResToAssetAndDisplay(res);
495
+ observer.next(void 0);
496
+ observer.complete();
497
+ });
498
+ });
499
+ }
500
+ else if (this.typeField == 'accounts') {
501
+ this._accountsService.updateCustomerByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
502
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'accounts').subscribe((res) => {
503
+ this.assignResToAssetAndDisplay(res);
504
+ observer.next(void 0);
505
+ observer.complete();
506
+ });
507
+ });
508
+ }
509
+ else if (this.typeField == 'frameworkagreements') {
510
+ this._frameworkagreementsService.updateFrameworkAgreementByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
511
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'AccountsFrameworkAgreements').subscribe((res) => {
512
+ this.assignResToAssetAndDisplay(res);
513
+ observer.next(void 0);
514
+ observer.complete();
515
+ });
516
+ });
517
+ }
518
+ else if (this.typeField == 'contacts') {
519
+ this._accountsService.updateContactByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, '').subscribe((res) => {
520
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'accounts/contacts').subscribe((res) => {
521
+ this.assignResToAssetAndDisplay(res);
522
+ observer.next(void 0);
523
+ observer.complete();
524
+ });
525
+ });
526
+ }
527
+ else if (this.typeField == 'boms') {
528
+ this._mediaSelectionService.updateBomImage(this.skuGuid, this.bomParam, this.assetsSelected).subscribe((res) => {
529
+ if (this.bomParam == 'bomImages') {
530
+ this._mediaSelectionService.getAssetsForBom(this.skuGuid).subscribe((res) => {
531
+ this.assignResToAssetAndDisplay(res);
532
+ observer.next(void 0);
533
+ observer.complete();
534
+ });
535
+ }
536
+ else if (this.bomParam == 'bomDrawing') {
537
+ this._mediaSelectionService.getAssetsForBomDrawing(this.skuGuid).subscribe((res) => {
538
+ this.assignResToAssetAndDisplay(res);
539
+ observer.next(void 0);
540
+ observer.complete();
541
+ });
542
+ }
543
+ });
544
+ }
545
+ else if (this.typeField == 'bomsitems') {
546
+ this._mediaSelectionService.updateBomItemImage(this.skuGuid, this.assetsSelected).subscribe((res) => {
547
+ this._mediaSelectionService.getAssetsForBomItem(this.skuGuid).subscribe((res) => {
548
+ this.assignResToAssetAndDisplay(res);
549
+ observer.next(void 0);
550
+ observer.complete();
551
+ });
552
+ });
553
+ }
554
+ }
555
+ else if (this.categoryGuid) {
556
+ this._mediaSelectionService.updateCategoryImage(this.categoryGuid, this.assetsSelected, this.categoryParam).subscribe((res) => {
557
+ this._mediaSelectionService.getAssetsForCategories(this.categoryGuid, this.categoryParam).subscribe((res) => {
558
+ this.assignResToAssetAndDisplay(res);
559
+ observer.next(void 0);
560
+ observer.complete();
561
+ });
562
+ });
563
+ }
564
+ else if (this.skuGuid && !this.attributeGuid) {
565
+ this._mediaSelectionService.updateSkuImages(this.skuGuid, this.assetsSelected, this.archive).subscribe((res) => {
566
+ this._mediaSelectionService.getAssetsForSku(this.skuGuid, this.archive).subscribe((res) => {
567
+ this.assignResToAssetAndDisplay(res);
568
+ observer.next(void 0);
569
+ observer.complete();
570
+ });
571
+ });
572
+ }
573
+ else if (this.categoryGuid) {
574
+ this._mediaSelectionService.updateCategoryImage(this.categoryGuid, this.assetsSelected, this.categoryParam).subscribe((res) => {
575
+ this._mediaSelectionService.getAssetsForCategories(this.categoryGuid, this.categoryParam).subscribe((res) => {
576
+ this.assignResToAssetAndDisplay(res);
577
+ observer.next(void 0);
578
+ observer.complete();
579
+ });
580
+ });
581
+ }
582
+ else if (this.workflows) {
583
+ let object = {
584
+ workdeskGuid: this.workflows.desk.workdeskGuid,
585
+ workitemBaseGuid: assetGuid,
586
+ workitemType: 'ASSETS',
587
+ };
588
+ this._desksService.addItemByDeskGuid(object).subscribe((res) => {
589
+ let itemGuid = res['addItem'];
590
+ this._desksService.getAllUsersByDeskGuid('0', '9999', this.workflows.desk.workdeskGuid).subscribe((res) => {
591
+ let users = res['deskUsers'];
592
+ let staffs = [];
593
+ users.forEach((user) => {
594
+ staffs.push(user.userGuid);
595
+ });
596
+ this._desksService.getAllStepsByDeskGuid(this.workflows.desk.workdeskGuid).subscribe((res) => {
597
+ res['deskSteps'].forEach((step) => {
598
+ let object = {
599
+ workitemGuid: itemGuid,
600
+ userGuid: staffs,
601
+ workstepGuid: step.workstepGuid,
602
+ };
603
+ this._desksService.addItemStepByDeskGuid(object).subscribe((res) => { });
604
+ });
605
+ });
606
+ });
607
+ this._webSocket.connection.invoke('refresh', 'getallitemsbydesk');
608
+ this.workflows.desk.subjects.push(assetGuid);
609
+ });
610
+ observer.next(void 0);
611
+ observer.complete();
612
+ }
613
+ else {
614
+ observer.next(void 0);
615
+ observer.complete();
616
+ }
617
+ }
618
+ }
619
+ }
620
+ else {
621
+ if (this.assetsSelected.indexOf(assetGuid) > -1) {
622
+ this.assetsSelected.splice(this.assetsSelected.indexOf(assetGuid), 1);
623
+ this.selectedAll = false;
624
+ }
625
+ else {
626
+ this.assetsSelected.push(assetGuid);
627
+ }
628
+ observer.next(void 0);
629
+ observer.complete();
630
+ }
631
+ this.refreshData.emit(this.assetsSelected);
632
+ });
633
+ }
634
+ selectThisAsset(assetGuid) {
635
+ this.selectAssetSubject.next(assetGuid);
636
+ }
637
+ // selectThisAsset(assetGuid) {
638
+ // if (!this.sendListGuid) {
639
+ // if (this.isOnlyOneAsset) {
640
+ // if (this.bom) {
641
+ // this._mediaSelectionService.updateBomModel(this.bom.bomGuid, assetGuid).subscribe(res => {
642
+ // this.assignAssetForBom(assetGuid);
643
+ // })
644
+ // }
645
+ // if(this.workitemGuid != null){
646
+ // this._mediaSelectionService.updateWorkflowImage(assetGuid,this.workitemGuid).subscribe(res =>{
647
+ // })
648
+ // }
649
+ // this.assetsSelected = [];
650
+ // this.assetsSelected.push(assetGuid);
651
+ // } else {
652
+ // if (this.assetsSelected.indexOf(assetGuid) > -1) {
653
+ // this.assetsSelected.splice(this.assetsSelected.indexOf(assetGuid), 1);
654
+ // this.selectedAll = false;
655
+ // if (this.attributeGuid && this.skuGuid) {
656
+ // if (this.typeField == "skus") {
657
+ // this._mediaSelectionService.updateSkuAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid,this.archive).subscribe(res => {
658
+ // this._mediaSelectionService.getAssetsForSkuAttribute(this.skuGuid, this.attributeGuid,this.archive).subscribe(res => {
659
+ // this.assignResToAssetAndDisplay(res);
660
+ // })
661
+ // })
662
+ // } else if (this.typeField == "categories") {
663
+ // this._mediaSelectionService.updateCategoryAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid).subscribe(res => {
664
+ // this._mediaSelectionService.getAssetsForCategoryAttribute(this.skuGuid, this.attributeGuid).subscribe(res => {
665
+ // this.assignResToAssetAndDisplay(res);
666
+ // })
667
+ // })
668
+ // } else if (this.typeField == "suppliers") {
669
+ // this._suppliersService.updateSupplierField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
670
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "suppliers").subscribe(res => {
671
+ // this.assignResToAssetAndDisplay(res);
672
+ // })
673
+ // })
674
+ // } else if (this.typeField == "accounts") {
675
+ // this._accountsService.updateCustomerByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
676
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "accounts").subscribe(res => {
677
+ // this.assignResToAssetAndDisplay(res);
678
+ // })
679
+ // })
680
+ // } else if (this.typeField == "frameworkagreements") {
681
+ // this._frameworkagreementsService.updateFrameworkAgreementByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
682
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "AccountsFrameworkAgreements").subscribe(res => {
683
+ // this.assignResToAssetAndDisplay(res);
684
+ // })
685
+ // })
686
+ // } else if (this.typeField == "contacts") {
687
+ // this._accountsService.updateContactByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
688
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "accounts/contacts").subscribe(res => {
689
+ // this.assignResToAssetAndDisplay(res);
690
+ // })
691
+ // })
692
+ // }
693
+ // } else if (this.bomItemGuid) {
694
+ // this._mediaSelectionService.updateBomItemImage(this.bomItemGuid, this.assetsSelected).subscribe(res => {
695
+ // this._mediaSelectionService.getAssetsForBomItem(this.bomItemGuid).subscribe(res => {
696
+ // this.assignResToAssetAndDisplay(res);
697
+ // })
698
+ // })
699
+ // } else if (this.bomGuid) {
700
+ // this._mediaSelectionService.updateBomImage(this.bomGuid, this.assetsSelected).subscribe(res => {
701
+ // this._mediaSelectionService.getAssetsForBom(this.bomGuid).subscribe(res => {
702
+ // this.assignResToAssetAndDisplay(res);
703
+ // })
704
+ // })
705
+ // } else if (this.bomItemGuid) {
706
+ // this._mediaSelectionService.updateBomItemImage(this.bomItemGuid, this.assetsSelected).subscribe(res => {
707
+ // this._mediaSelectionService.getAssetsForBomItem(this.bomItemGuid).subscribe(res => {
708
+ // this.assignResToAssetAndDisplay(res);
709
+ // })
710
+ // });
711
+ // } else if (this.skuGuid && !this.attributeGuid) {
712
+ // this._mediaSelectionService.updateSkuImages(this.skuGuid, this.assetsSelected,this.archive).subscribe(res => {
713
+ // this._mediaSelectionService.getAssetsForSku(this.skuGuid,this.archive).subscribe(res => {
714
+ // this.assignResToAssetAndDisplay(res);
715
+ // })
716
+ // })
717
+ // } else if (this.workflows) {
718
+ // this._desksService.getAllItemsByWorkItemGuid(this.start, 99999, this.workflows.desk.workdeskGuid, '', '').subscribe((res: any) => {
719
+ // this.workflows.desk.subjects = res['items'];
720
+ // let item = this.workflows.desk.subjects.find(element => element.workitemBaseGuid == assetGuid)
721
+ // if (item) {
722
+ // this._desksService.deleteItemByDeskGuid(item.workitemGuid).subscribe((res: any) => {
723
+ // this.workflows.desk.subjects.splice(this.workflows.desk.subjects.indexOf(assetGuid), 1);
724
+ // this._webSocket.connection.invoke("refresh", "getallitemsbydesk");
725
+ // this.assets = this.assetsInFolder;
726
+ // })
727
+ // }
728
+ // });
729
+ // }
730
+ // }
731
+ // else {
732
+ // this.assetsSelected.push(assetGuid);
733
+ // if (this.assetsSelected.length == this.assets.length) {
734
+ // this.selectedAll = true;
735
+ // }
736
+ // if (this.attributeGuid && this.skuGuid) {
737
+ // if (this.typeField == "skus") {
738
+ // this._mediaSelectionService.updateSkuAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid,this.archive).subscribe(res => {
739
+ // this._mediaSelectionService.getAssetsForSkuAttribute(this.skuGuid, this.attributeGuid,this.archive).subscribe(res => {
740
+ // this.assignResToAssetAndDisplay(res);
741
+ // })
742
+ // })
743
+ // } else if (this.typeField == "categories") {
744
+ // this._mediaSelectionService.updateCategoryAttributeImages(this.skuGuid, this.assetsSelected, this.attributeGuid).subscribe(res => {
745
+ // this._mediaSelectionService.getAssetsForCategoryAttribute(this.skuGuid, this.attributeGuid).subscribe(res => {
746
+ // this.assignResToAssetAndDisplay(res);
747
+ // })
748
+ // })
749
+ // } else if (this.typeField == "suppliers") {
750
+ // this._suppliersService.updateSupplierField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
751
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "suppliers").subscribe(res => {
752
+ // this.assignResToAssetAndDisplay(res);
753
+ // })
754
+ // })
755
+ // } else if (this.typeField == "accounts") {
756
+ // this._accountsService.updateCustomerByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
757
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "accounts").subscribe(res => {
758
+ // this.assignResToAssetAndDisplay(res);
759
+ // })
760
+ // })
761
+ // } else if (this.typeField == "frameworkagreements") {
762
+ // this._frameworkagreementsService.updateFrameworkAgreementByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
763
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "AccountsFrameworkAgreements").subscribe(res => {
764
+ // this.assignResToAssetAndDisplay(res);
765
+ // })
766
+ // })
767
+ // } else if (this.typeField == "contacts") {
768
+ // this._accountsService.updateContactByField(this.skuGuid, this.attributeGuid, this.assetsSelected, true, "").subscribe(res => {
769
+ // this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, "accounts/contacts").subscribe(res => {
770
+ // this.assignResToAssetAndDisplay(res);
771
+ // })
772
+ // })
773
+ // }
774
+ // } else if (this.categoryGuid) {
775
+ // this._mediaSelectionService.updateCategoryImage(this.categoryGuid, this.assetsSelected, this.categoryParam).subscribe(res => {
776
+ // this._mediaSelectionService.getAssetsForCategories(this.categoryGuid, this.categoryParam).subscribe(res => {
777
+ // this.assignResToAssetAndDisplay(res);
778
+ // })
779
+ // })
780
+ // } else if (this.bomItemGuid) {
781
+ // this._mediaSelectionService.updateBomItemImage(this.bomItemGuid, this.assetsSelected).subscribe(res => {
782
+ // this._mediaSelectionService.getAssetsForBomItem(this.bomItemGuid).subscribe(res => {
783
+ // this.assignResToAssetAndDisplay(res);
784
+ // })
785
+ // })
786
+ // } else if (this.bomGuid) {
787
+ // this._mediaSelectionService.updateBomImage(this.bomGuid, this.assetsSelected).subscribe(res => {
788
+ // this._mediaSelectionService.getAssetsForBom(this.bomGuid).subscribe(res => {
789
+ // this.assignResToAssetAndDisplay(res);
790
+ // })
791
+ // })
792
+ // } else if (this.skuGuid && !this.attributeGuid) {
793
+ // this._mediaSelectionService.updateSkuImages(this.skuGuid, this.assetsSelected,this.archive).subscribe(res => {
794
+ // this._mediaSelectionService.getAssetsForSku(this.skuGuid,this.archive).subscribe(res => {
795
+ // this.assignResToAssetAndDisplay(res);
796
+ // })
797
+ // })
798
+ // } else if (this.workflows) {
799
+ // let object = {
800
+ // "workdeskGuid": this.workflows.desk.workdeskGuid,
801
+ // "workitemBaseGuid": assetGuid,
802
+ // "workitemType": "ASSETS"
803
+ // }
804
+ // this._desksService.addItemByDeskGuid(object).subscribe((res: any) => {
805
+ // let itemGuid = res['addItem'];
806
+ // this._desksService.getAllUsersByDeskGuid(0, 9999, this.workflows.desk.workdeskGuid).subscribe((res: any) => {
807
+ // let users = res['deskUsers'];
808
+ // let staffs = [];
809
+ // users.forEach(user => {
810
+ // staffs.push(user.userGuid)
811
+ // });
812
+ // this._desksService.getAllStepsByDeskGuid(this.workflows.desk.workdeskGuid).subscribe((res: any) => {
813
+ // res['deskSteps'].forEach(step => {
814
+ // let object = {
815
+ // "workitemGuid": itemGuid,
816
+ // "userGuid": staffs,
817
+ // "workstepGuid": step.workstepGuid
818
+ // }
819
+ // this._desksService.addItemStepByDeskGuid(object).subscribe((res: any) => { });
820
+ // });
821
+ // });
822
+ // });
823
+ // this._webSocket.connection.invoke("refresh", "getallitemsbydesk");
824
+ // this.workflows.desk.subjects.push(assetGuid);
825
+ // this.assignResToAssetAndDisplay(res);
826
+ // })
827
+ // }
828
+ // }
829
+ // }
830
+ // // if (this.assetsSelected.indexOf(assetGuid) > -1) {
831
+ // // this.assetsSelected.splice(this.assetsSelected.indexOf(assetGuid), 1);
832
+ // // this.selectedAll = false;
833
+ // // } else {
834
+ // // this.assetsSelected.push(assetGuid);
835
+ // // }
836
+ // }
837
+ // else
838
+ // {
839
+ // this.assetsSelected.push(assetGuid);
840
+ // }
841
+ // this.refreshData.emit(this.assetsSelected);
842
+ // }
843
+ /* ==================== FOLDER ==================== */
844
+ returnBackFolderForMoveToAnotherFolder() {
845
+ this._damAssets.getInfoFolder(this.guidActiveFolderOfSelectedFolderForMove).subscribe((res) => {
846
+ let folder = res['folder'];
847
+ if (folder.folderParentGuid !== null) {
848
+ this._damAssets.getInfoFolder(folder.folderParentGuid).subscribe((res) => {
849
+ let nameFolderParent = res['folder'].folderName;
850
+ this._damAssets.getFoldersWithParent(folder.folderParentGuid).subscribe((res) => {
851
+ this.guidActiveFolderOfSelectedFolderForMove = folder.folderParentGuid;
852
+ this.nameParentOfSelectedFolderForMove = nameFolderParent;
853
+ this._damAssets.getAssetsByFolderGuid(folder.folderParentGuid, this.start, this.limit).subscribe((res) => {
854
+ this.assetsInFolder = res['assets'];
855
+ this.nbrElementTotal = res['total'];
856
+ });
857
+ this.folders = res['folders'];
858
+ this.pathFolder = res['pathFolder'];
859
+ });
860
+ });
861
+ }
862
+ else {
863
+ this._damAssets.getFoldersOnLevelOne(false).subscribe((res) => {
864
+ this._damAssets.getAssetsByOnLevelOne(this.start, this.limit, this.searchTermForDisplay).subscribe((res) => {
865
+ this.assetsInFolder = res['assets'];
866
+ this.nbrElementTotal = res['total'];
867
+ });
868
+ this.guidActiveFolderOfSelectedFolderForMove = null;
869
+ this.nameParentOfSelectedFolderForMove = '';
870
+ this.folders = res['folders'];
871
+ this.pathFolder = res['pathFolder'];
872
+ });
873
+ }
874
+ });
875
+ }
876
+ changeLevelOfFolderForMove(folderGuid, folderName) {
877
+ this._damAssets.getFoldersWithParent(folderGuid).subscribe((res) => {
878
+ this._damAssets.getAssetsByFolderGuid(folderGuid, this.start, this.limit).subscribe((res) => {
879
+ this.assetsInFolder = res['assets'];
880
+ this.nbrElementTotal = res['total'];
881
+ });
882
+ this.guidActiveFolderOfSelectedFolderForMove = folderGuid;
883
+ this.nameParentOfSelectedFolderForMove = folderName;
884
+ this.folders = res['folders'];
885
+ this.pathFolder = res['pathFolder'];
886
+ });
887
+ }
888
+ refreshAssetsAfterUpload() {
889
+ if (this.guidActiveFolderOfSelectedFolderForMove != undefined) {
890
+ this._damAssets.getAssetsByFolderGuid(this.guidActiveFolderOfSelectedFolderForMove, this.start, this.limit).subscribe((res) => {
891
+ this.assetsInFolder = res['assets'];
892
+ this.nbrElementTotal = res['total'];
893
+ });
894
+ }
895
+ else {
896
+ let searchWord = '';
897
+ this._damAssets.getAssetsByOnLevelOne(this.start, this.limit, searchWord).subscribe((res) => {
898
+ this.assetsInFolder = res['assets'];
899
+ this.nbrElementTotal = res['total'];
900
+ });
901
+ }
902
+ }
903
+ /* ==================== INITIALZATION ==================== */
904
+ initialization() {
905
+ this.assetsSelected = [];
906
+ this._damAssets.getFoldersOnLevelOne(false).subscribe((res) => {
907
+ this.folders = res['folders'];
908
+ this.pathFolder = res['pathFolder'];
909
+ this._damAssets.getAssetsByOnLevelOne(this.start, this.limit, '').subscribe((res) => {
910
+ this.assetsInFolder = res['assets'];
911
+ this.nbrElementTotal = res['total'];
912
+ });
913
+ });
914
+ if (!this.currentGuids) {
915
+ if (this.attributeGuid && this.skuGuid) {
916
+ if (this.typeField == 'skus') {
917
+ this._mediaSelectionService.getAssetsForSkuAttribute(this.skuGuid, this.attributeGuid, this.archive, this.language).subscribe((assets) => {
918
+ this.assignResToAssetAndDisplay(assets);
919
+ this.assets.forEach((asset) => {
920
+ if (asset) {
921
+ this.assetsSelected.push(asset.assetGuid);
922
+ }
923
+ });
924
+ });
925
+ }
926
+ else if (this.typeField == 'categories') {
927
+ this._mediaSelectionService.getAssetsForCategoryAttribute(this.skuGuid, this.attributeGuid).subscribe((assets) => {
928
+ this.assignResToAssetAndDisplay(assets);
929
+ this.assets.forEach((asset) => {
930
+ this.assetsSelected.push(asset.assetGuid);
931
+ });
932
+ });
933
+ }
934
+ else if (this.typeField == 'suppliers') {
935
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'suppliers').subscribe((assets) => {
936
+ this.assignResToAssetAndDisplay(assets);
937
+ this.assets.forEach((asset) => {
938
+ this.assetsSelected.push(asset.assetGuid);
939
+ });
940
+ });
941
+ }
942
+ else if (this.typeField == 'accounts') {
943
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'accounts').subscribe((assets) => {
944
+ this.assignResToAssetAndDisplay(assets);
945
+ this.assets.forEach((asset) => {
946
+ this.assetsSelected.push(asset.assetGuid);
947
+ });
948
+ });
949
+ }
950
+ else if (this.typeField == 'frameworkagreements') {
951
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'AccountsFrameworkAgreements').subscribe((assets) => {
952
+ this.assignResToAssetAndDisplay(assets);
953
+ this.assets.forEach((asset) => {
954
+ this.assetsSelected.push(asset.assetGuid);
955
+ });
956
+ });
957
+ }
958
+ else if (this.typeField == 'contacts') {
959
+ this._mediaSelectionService.getAssetsByType(this.skuGuid, this.attributeGuid, 'Accounts/contacts').subscribe((assets) => {
960
+ this.assignResToAssetAndDisplay(assets);
961
+ this.assets.forEach((asset) => {
962
+ this.assetsSelected.push(asset.assetGuid);
963
+ });
964
+ });
965
+ }
966
+ else if (this.typeField == 'boms') {
967
+ if (this.bomParam == 'bomImages') {
968
+ this._mediaSelectionService.getAssetsForBom(this.skuGuid).subscribe((assets) => {
969
+ this.assignResToAssetAndDisplay(assets);
970
+ this.assets.forEach((asset) => {
971
+ this.assetsSelected.push(asset.assetGuid);
972
+ });
973
+ });
974
+ }
975
+ else if (this.bomParam == 'bomDrawing') {
976
+ this._mediaSelectionService.getAssetsForBomDrawing(this.skuGuid).subscribe((assets) => {
977
+ this.assignResToAssetAndDisplay(assets);
978
+ this.assets.forEach((asset) => {
979
+ this.assetsSelected.push(asset.assetGuid);
980
+ });
981
+ });
982
+ }
983
+ }
984
+ else if (this.typeField == 'bomitems') {
985
+ this._mediaSelectionService.getAssetsForBomItem(this.skuGuid).subscribe((assets) => {
986
+ this.assignResToAssetAndDisplay(assets);
987
+ this.assets.forEach((asset) => {
988
+ this.assetsSelected.push(asset.assetGuid);
989
+ });
990
+ });
991
+ }
992
+ }
993
+ else if (this.categoryGuid) {
994
+ this._mediaSelectionService.getAssetsForCategories(this.categoryGuid, this.categoryParam).subscribe((assets) => {
995
+ this.assignResToAssetAndDisplay(assets);
996
+ this.assets.forEach((asset) => {
997
+ this.assetsSelected.push(asset.assetGuid);
998
+ });
999
+ });
1000
+ }
1001
+ else if (this.skuGuid && !this.attributeGuid) {
1002
+ this._mediaSelectionService.getAssetsForSku(this.skuGuid, this.archive).subscribe((assets) => {
1003
+ this.assignResToAssetAndDisplay(assets);
1004
+ this.assets.forEach((asset) => {
1005
+ this.assetsSelected.push(asset.assetGuid);
1006
+ });
1007
+ });
1008
+ }
1009
+ else if (this.workflows) {
1010
+ this.workflows.desk.subjects.forEach((subject) => {
1011
+ this.assetsSelected.push(subject.workitemBaseGuid);
1012
+ });
1013
+ }
1014
+ }
1015
+ else {
1016
+ this.assetsSelected = this.currentGuids;
1017
+ }
1018
+ }
1019
+ externalLogin() {
1020
+ let team = this.team;
1021
+ this._login.externalLogin(team).subscribe((res) => {
1022
+ if (res) {
1023
+ localStorage.setItem('language_' + this._settingsService.getAlias(), res['user'].userLanguage);
1024
+ // this.translate['store'] = localStorage.getItem('language_' + this._settingsService.getAlias());
1025
+ this.translate.setDefaultLang();
1026
+ this.translate.useLanguage(localStorage.getItem('language_' + this._settingsService.getAlias()) || res['user'].userLanguage);
1027
+ localStorage.setItem('Login_Iframe_' + this._settingsService.getAlias(), res['user'].userLogin);
1028
+ this.auth.sendToken(res['token']);
1029
+ localStorage.setItem('ProfileGuid_Iframe_' + this._settingsService.getAlias(), res['user']['userProfileGuid']);
1030
+ this._settingsService.getRightsAccesModuleForOneProfile(localStorage.getItem('ProfileGuid_Iframe_' + this._settingsService.getAlias())).subscribe((res) => {
1031
+ this.rights.sendRights(res);
1032
+ });
1033
+ // setTimeout(() => {
1034
+ // this.module = typeModule;
1035
+ // }, 2000);
1036
+ }
1037
+ });
1038
+ }
1039
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ModalMediaSelectionComponent, deps: [{ token: i1.DamAssetsService }, { token: i1.SearchService }, { token: i1.MediaSelectionService }, { token: i1.SettingsService }, { token: i1.WorkflowsDesksService }, { token: i1.SuppliersService }, { token: i1.AccountsService }, { token: i1.FrameworkagreementsService }, { token: i1.websocketService }, { token: i0.ChangeDetectorRef }, { token: i1.RightsService }, { token: i1.SettingsService }, { token: i1.LoginService }, { token: i1.AuthService }, { token: i1.TranslatorService }], target: i0.ɵɵFactoryTarget.Component }); }
1040
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: ModalMediaSelectionComponent, isStandalone: true, selector: "app-solidpepper-modal-media-selection", inputs: { isExternal: "isExternal", alias: "alias", team: "team", designer: "designer", uploadMode: "uploadMode", typeField: "typeField", type: "type", skuGuid: "skuGuid", attributeGuid: "attributeGuid", categoryGuid: "categoryGuid", categoryParam: "categoryParam", bomParam: "bomParam", workflows: "workflows", workitemGuid: "workitemGuid", isReplace: "isReplace", sendListGuid: "sendListGuid", currentGuids: "currentGuids", archive: "archive", language: "language", isOnlyOneAsset: "isOnlyOneAsset" }, outputs: { hasBeenSaved: "hasBeenSaved", refreshData: "refreshData" }, ngImport: i0, template: "<!-- /HEADER -->\r\n@if (!designer) {\r\n <div class=\"modal-side-bar-header-style\">\r\n <div class=\"modal-side-bar-header-content\">\r\n <!-- <button\r\n type=\"button\"\r\n class=\"btn-close modal-side-bar-header-cross-close\"\r\n aria-label=\"Close\"\r\n (click)=\"closeModal()\"\r\n >\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button> -->\r\n <div>\r\n <h4 class=\"modal-side-bar-header-title\">\r\n {{ \"media.media-selection.SELECTASSETS\" | translate }}\r\n </h4>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n<!-- ./HEADER -->\r\n\r\n<!-- /CONTENT -->\r\n<div class=\"modal-side-bar-content\" style=\"padding-left: 10px\">\r\n <div class=\"row\" class=\"header-container\">\r\n <div class=\"col-3\">\r\n @if (!isSearchMode) {\r\n <div class=\"header-full-path-folder\">\r\n @if (nameParentOfSelectedFolderForMove) {\r\n <span\r\n class=\"fas fa-arrow-left pointer\"\r\n style=\"margin-right: 10px; font-size: larger; margin-left: 10px\"\r\n (click)=\"returnBackFolderForMoveToAnotherFolder()\"\r\n ></span>\r\n }\r\n @if (!nameParentOfSelectedFolderForMove) {\r\n <span\r\n class=\"fas fa-folder-open designer\"\r\n style=\"margin-right: 10px; font-size: larger; margin-left: 10px\"\r\n ></span>\r\n }\r\n <h5 class=\"ellipsis-text designer\" style=\"font-size: larger\">\r\n <strong matTooltip=\"{{ pathFolder }}\" matTooltipPosition=\"below\">{{\r\n pathFolder\r\n }}</strong>\r\n </h5>\r\n </div>\r\n }\r\n </div>\r\n <div\r\n class=\"col-9\"\r\n style=\"display: flex; justify-content: right; align-items: center\"\r\n >\r\n @if (uploadMode) {\r\n <app-assets-uploader\r\n [folderGuid]=\"this.guidActiveFolderOfSelectedFolderForMove\"\r\n (allAssetsUpload)=\"refreshAssetsAfterUpload()\"\r\n ></app-assets-uploader>\r\n }\r\n <ng-container>\r\n <app-assets-uploader\r\n [folderGuid]=\"this.guidActiveFolderOfSelectedFolderForMove\"\r\n (allAssetsUpload)=\"refreshAssetsAfterUpload()\"\r\n ></app-assets-uploader>\r\n </ng-container>\r\n <div class=\"search-container\" style=\"width: max-content\">\r\n <input\r\n class=\"search-content form-control\"\r\n type=\"text\"\r\n [(ngModel)]=\"searchTermForDisplay\"\r\n placeholder=\"Rechercher...\"\r\n aria-label=\"Search\"\r\n id=\"searchBar\"\r\n style=\"background-color: #f5f7f8\"\r\n #searchBar\r\n (keyup)=\"searchTerm$.next($event.target.value); checkSearchMode()\"\r\n />\r\n <span class=\"fas fa-search search-logo\"></span>\r\n </div>\r\n <div style=\"display: flex\">\r\n <pagination\r\n #pagination\r\n class=\"pagination-sm paginationCss\"\r\n firstText=\"|<\"\r\n lastText=\">|\"\r\n previousText=\"<\"\r\n nextText=\">\"\r\n [(ngModel)]=\"pagePagination\"\r\n [totalItems]=\"nbrElementTotal\"\r\n [itemsPerPage]=\"nbrElementPage\"\r\n [maxSize]=\"maxSize\"\r\n [boundaryLinks]=\"true\"\r\n [rotate]=\"false\"\r\n (numPages)=\"numPages = $event\"\r\n [directionLinks]=\"true\"\r\n (pageChanged)=\"changePagePagination($event)\"\r\n ></pagination>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\" style=\"overflow: hidden\">\r\n @if (!isSearchMode) {\r\n <div class=\"col-3\" style=\"margin-top: 9px\">\r\n <div class=\"area-folder-container\">\r\n <div class=\"area-folder-path-folder\">\r\n <span\r\n class=\"fas fa-folder-open designer\"\r\n style=\"margin-right: 10px; font-size: larger\"\r\n ></span>\r\n @if (nameParentOfSelectedFolderForMove) {\r\n <label class=\"ellipsis-text designer\" style=\"font-size: larger\">\r\n <strong>{{ nameParentOfSelectedFolderForMove }}</strong>\r\n </label>\r\n }\r\n @if (!nameParentOfSelectedFolderForMove) {\r\n <label class=\"ellipsis-text designer\" style=\"font-size: larger\">\r\n <strong>{{ pathFolder }}</strong>\r\n </label>\r\n }\r\n </div>\r\n <div class=\"area-folder-list\">\r\n @for (folder of folders; track folder) {\r\n @if (\r\n folder &&\r\n folder.folderGuid != \"11111111-1111-1111-1111-111111111111\" &&\r\n folder.folderGuid != \"33333333-3333-3333-3333-333333333333\"\r\n ) {\r\n <div class=\"row\">\r\n @if (\r\n folder.folderGuid !=\r\n \"00000000-0000-0000-0000-000000000000\" ||\r\n (folder.folderGuid ==\r\n \"00000000-0000-0000-0000-000000000000\" &&\r\n this.rightsAccesModule[\"rights\"][\"Media\"][\r\n \"DamAssetsSelections\"\r\n ][\"subModuleIsActive\"])\r\n ) {\r\n <div\r\n class=\"col-12 area-folder-style\"\r\n (click)=\"\r\n changeLevelOfFolderForMove(\r\n folder.folderGuid,\r\n folder.folderName\r\n )\r\n \"\r\n >\r\n <span\r\n class=\"fas fa-folder designer\"\r\n style=\"\r\n margin-right: 20px;\r\n margin-top: 2px;\r\n font-size: larger;\r\n \"\r\n ></span>\r\n <label\r\n class=\"ellipsis-text pointer designer\"\r\n style=\"font-size: larger\"\r\n >\r\n {{ folder.folderName }}\r\n @if (\r\n folder.folderShareTeam &&\r\n folder.folderShareTeam.length > 0\r\n ) {\r\n <span\r\n class=\"fas fa-lock designer\"\r\n style=\"margin-left: 5px\"\r\n ></span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n @if (folders && folders.length == 0) {\r\n <div class=\"row\">\r\n <div\r\n class=\"col-12\"\r\n style=\"display: flex; justify-content: center\"\r\n >\r\n <span\r\n class=\"ellipsis-text designer\"\r\n style=\"margin-top: 10px\"\r\n [innerHTML]=\"\r\n 'media.media-selection.NOSUBFOLDERSTODISPLAY' | translate\r\n \"\r\n ></span>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n <div\r\n [ngClass]=\"{ 'col-9': !isSearchMode, 'col-12': isSearchMode }\"\r\n style=\"overflow-y: auto; overflow-x: hidden; height: calc(90vh - 163px)\"\r\n >\r\n <div class=\"row\" style=\"margin-top: 10px; margin-left: unset\">\r\n <ng-container>\r\n <app-assets-uploader\r\n [folderGuid]=\"this.guidActiveFolderOfSelectedFolderForMove\"\r\n [imageArea]=\"true\"\r\n [view]=\"'thumbnail'\"\r\n (allAssetsUpload)=\"refreshAssetsAfterUpload()\"\r\n style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\"\r\n ></app-assets-uploader>\r\n </ng-container>\r\n\r\n @for (asset of assetsInFolder; track asset) {\r\n @if (\r\n (type == \"image\" || type == \"imageMultiLang\" || type == \"all\") &&\r\n asset.assetType == \"image\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"height: 150px; padding: unset; position: relative\"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div\r\n class=\"checkbox c-checkbox checkBoxSelectionInModal\"\r\n style=\"right: 5px\"\r\n >\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"assetsSelected.indexOf(asset.assetGuid) > -1\"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) >\r\n -1\r\n \"\r\n id=\"{{ asset.assetGuid }}\"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <img\r\n onError=\"this.src='./assets/img/picture-unavailable.png'; \"\r\n style=\"object-fit: contain; width: 140px; height: 100px\"\r\n alt=\"image non disponible\"\r\n [src]=\"asset.assetUrlBig\"\r\n />\r\n <div\r\n class=\"assetNameListingDisplayInModal h5 mt-2 mb-0 fw-bold cropInModal\"\r\n >\r\n {{ asset.assetName }}\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplayInModal d-flex w-100 justify-content-end\"\r\n >\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetMetadatas.width }} x\r\n {{ asset.assetMetadatas.height }}\r\n </p>\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (\r\n (type == \"file\" || type == \"fileMultiLang\" || type == \"all\") &&\r\n asset.assetType == \"file\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"\r\n height: 150px;\r\n width: 140px;\r\n padding: unset;\r\n position: relative;\r\n \"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div class=\"checkbox c-checkbox checkBoxSelectionInModal\">\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"\r\n assetsSelected.indexOf(asset.assetGuid) > -1\r\n \"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(\r\n asset.assetGuid\r\n ) > -1\r\n \"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <div class=\"imgForAudioEtc\">\r\n <img\r\n src=\"./assets/img/icon/text-document.png\"\r\n alt=\"image non disponible\"\r\n />\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay h5 mt-2 mb-0 crop fw-bold\"\r\n >\r\n {{ asset.assetName }}\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay d-flex w-100 justify-content-end\"\r\n >\r\n @if (asset.assetSize >= 1000000) {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000000 | number: \"1.2-2\" }} mo\r\n </p>\r\n } @else {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000 | number: \"1.2-2\" }} ko\r\n </p>\r\n }\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (\r\n (type == \"audio\" || type == \"all\") && asset.assetType == \"audio\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"height: 150px; padding: unset; position: relative\"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div class=\"checkbox c-checkbox checkBoxSelectionInModal\">\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"assetsSelected.indexOf(asset.assetGuid) > -1\"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) >\r\n -1\r\n \"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <div class=\"imgForAudioEtc\">\r\n <img\r\n src=\"./assets/img/icon/speaker.png\"\r\n alt=\"image non disponible\"\r\n />\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay h5 mt-2 mb-0 crop fw-bold\"\r\n >\r\n {{ asset.assetName }}\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay d-flex w-100 justify-content-end\"\r\n >\r\n <div style=\"width: 50%; float: left\">\r\n @if (asset.assetSize >= 1000000) {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000000 | number: \"1.2-2\" }} mo\r\n </p>\r\n } @else {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000 | number: \"1.2-2\" }} ko\r\n </p>\r\n }\r\n </div>\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (\r\n (type == \"video\" || type == \"all\") && asset.assetType == \"video\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"height: 150px; padding: unset; position: relative\"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div class=\"checkbox c-checkbox checkBoxSelectionInModal\">\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"assetsSelected.indexOf(asset.assetGuid) > -1\"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) >\r\n -1\r\n \"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <div class=\"imgForAudioEtc\">\r\n <img\r\n src=\"./assets/img/icon/play.png\"\r\n alt=\"image non disponible\"\r\n />\r\n </div>\r\n <div class=\"assetNameListingDisplay crop\">\r\n {{ asset.assetName }}\r\n </div>\r\n <div class=\"assetNameListingDisplay\">\r\n <div style=\"width: 50%; float: left\">\r\n @if (asset.assetSize >= 1000000) {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000000 | number: \"1.2-2\" }} mo\r\n </p>\r\n } @else {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000 | number: \"1.2-2\" }} ko\r\n </p>\r\n }\r\n </div>\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<!-- ./CONTENT -->\r\n\r\n<!-- /ACTION -->\r\n@if (!designer) {\r\n <div class=\"modal-side-bar-footer\">\r\n <div class=\"modal-side-bar-footer-line\"></div>\r\n <div class=\"modal-side-bar-footer-right-placement\">\r\n <button\r\n type=\"button\"\r\n class=\"btn-denied\"\r\n (click)=\"closeModal()\"\r\n [innerHTML]=\"'products.skus.skus-detail.skus-prices.CLOSE' | translate\"\r\n ></button>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- ./ACTION -->\r\n", styles: [".header-container{height:45px;display:flex;align-items:center;position:sticky;top:0;background-color:#fff;z-index:100}.header-full-path-folder{display:flex;margin-bottom:6px;align-items:baseline}.area-folder-container{background-color:#f5f7f8;border-radius:var(--border-radius);height:100%;overflow-y:auto;overflow-x:hidden}.area-folder-path-folder{display:flex;padding:5px 10px;height:30px;color:var(--btn-accept);border-bottom:1px solid #c2c2c2;align-items:center}.area-folder-list{height:calc(90vh - 213px);overflow:auto;overflow-x:hidden}.ellipsis-text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.area-folder-style{padding:10px 22px;display:flex;color:var(--btn-accept);cursor:pointer}.area-folder-style:hover{background-color:var(--btn-accept);color:#fff}.assetsDiv{position:relative;padding:unset;margin-bottom:20px;background:#fff;display:inline-block;margin-right:20px;height:200px;width:200px;justify-content:center;overflow:hidden;align-items:center;box-shadow:0 2px 4px #0000000d}.modal-header{background-color:#293133;color:#fff;padding-top:8px;padding-bottom:8px}.modal-header h5{margin:0}.btn-close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#fff;text-shadow:0 1px 0 #fff;opacity:.5;background:none}button.btn-close{background-color:transparent;border:0}input[type=checkbox]:checked+span,.c-checkbox input,.form-check-input:checked{background-color:var(--btn-accept)!important;border-color:var(--btn-accept)!important;accent-color:var(--btn-accept)!important}input[type=checkbox]:disabled+span{border-color:#ddd!important;background-color:#ddd!important}input{font-family:var(--font-family)!important}.assetNameListingDisplay{font-size:10px;padding:0 5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zoneImg{width:200px;height:150px;justify-content:center;display:flex}.imageDis{object-fit:contain;max-width:100%;max-height:100%}.divPictureAdd{height:200px;align-items:center;justify-content:center;display:flex;background-color:#edf1f2;cursor:pointer}.modal-dialog{max-width:700px}.divForDivSearch{height:60px;background-color:#f5f7f8;position:sticky;top:0;z-index:100;align-items:center;display:flex}.addPictureText{width:100%;padding-top:10px;color:var(--btn-accept);font-weight:700;justify-content:center;display:flex}.titleCssModalAsset{font-weight:700;margin-top:2px;font-size:16px}#exampleModalLongTitle:before{content:\"\\f0c2\";font-family:\"Font Awesome 7 Free\";font-weight:900;font-size:1.1em;padding-right:5px}.overflow{overflow-x:hidden;overflow-y:auto;height:100%}.classificationRow{cursor:pointer;overflow-y:auto;overflow-x:hidden}.titleLevel:before{font-family:\"Font Awesome 7 Free\";font-weight:900;color:var(--btn-accept);content:\"\\f07b\";padding-right:5px}.titleLevel{padding:5px;width:100%;display:block;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-o-user-select:none;color:var(--btn-accept)}.modalHeaderCss{justify-content:unset}.arrowFolder{font-size:16px;margin-top:2px;margin-right:10px;cursor:pointer}.contentRightfolderTitleDiv{display:inline-flex;margin-top:5px}.chevron{font-size:17px;margin-right:10px}.modalBodyCss{height:400px;padding-right:unset;padding-top:unset;background:#f5f7f8}.assetTitleInModal{display:flex;margin-top:15px}.assetsDivInModal{position:relative;background:#fff;display:inline-block;justify-content:center;overflow:hidden;align-items:center;box-shadow:0 2px 4px #0000000d}.pointer{cursor:pointer}.checkBoxSelectionInModal{right:0;position:absolute;top:9px;color:var(--btn-accept)}.assetNameListingDisplayInModal{font-size:10px;padding:0 5px}.cropInModal{width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::-webkit-scrollbar{width:8px;background-color:#fff}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#fff}::-webkit-scrollbar-thumb{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#d3d3d3}.imgForAudioEtc{justify-content:center;align-items:center;display:flex;height:100px;width:140px}.imgForAudioEtcNotOnModal{height:150px;width:200px;justify-content:center;align-items:center;display:flex}.timeToUnlinkAsset{right:0;position:absolute;font-size:20px;margin-right:5px;margin-top:5px;color:var(--btn-accept);display:none;z-index:100000}.assetsDiv:hover .timeToUnlinkAsset,.assetsDiv:hover .divArrowLeft,.assetsDiv:hover .divArrowRight{display:flex}.closePreview{color:var(--btn-accept)!important;right:0;position:absolute;margin-right:10px;margin-top:5px;font-size:30px}.modal{margin:0 auto}.searchDiv{height:30px;font-size:15px;border-radius:var(--border-radius);border:1px solid lightgray;display:flex;width:97%;right:0}.inputSearchCss{color:var(--btn-accept);height:30px;border:unset;background:unset;display:flex;align-items:center;padding-left:10px;width:100%}.searchLogo{padding:6px}.paginationCss{box-shadow:0 2px 4px #0000000d;height:30px}::ng-deep .pagination-first{font-weight:700;color:var(--btn-accept)}::ng-deep .page-item.active .page-link{z-index:1;color:#fff;background-color:var(--btn-accept);border-color:var(--btn-accept)}::ng-deep .page-link{height:30px;font-size:14px;width:40px;text-align:center;padding-top:6px;color:#4a4a4a;border:unset}::ng-deep .pagination-last{font-weight:700;color:var(--btn-accept)}.pagination{justify-content:flex-end;position:relative;margin-right:55px;width:100%;margin-top:-5px;display:flex}.divArrowLeft{position:absolute;cursor:pointer;height:100%;width:40px;background:#d3d3d3b3;align-items:center;text-align:center;display:none;font-size:20px;justify-content:center;color:var(--btn-accept)}.divArrowRight{cursor:pointer;background:#d3d3d3b3;align-items:center;text-align:center;width:40px;display:none;font-size:20px;height:100%;justify-content:center;color:var(--btn-accept);position:absolute;top:0;right:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: AssetsUploaderComponent, selector: "app-assets-uploader", inputs: ["folderGuid", "folderType", "imageArea", "view"], outputs: ["allAssetsUpload"] }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: NgxSelectModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: PaginationModule }, { kind: "component", type: i4$1.PaginationComponent, selector: "pagination", inputs: ["align", "maxSize", "boundaryLinks", "directionLinks", "firstText", "previousText", "nextText", "lastText", "rotate", "pageBtnClass", "disabled", "customPageTemplate", "customNextTemplate", "customPreviousTemplate", "customFirstTemplate", "customLastTemplate", "itemsPerPage", "totalItems"], outputs: ["numPages", "pageChanged"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i2.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
1041
+ }
1042
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ModalMediaSelectionComponent, decorators: [{
1043
+ type: Component,
1044
+ args: [{ selector: 'app-solidpepper-modal-media-selection', standalone: true, encapsulation: ViewEncapsulation.Emulated, imports: [CommonModule, AssetsUploaderComponent, BsDropdownModule, MatSelectModule, TranslateModule, NgxSelectModule, MatTooltipModule, MatCheckboxModule, PaginationModule, FormsModule, ReactiveFormsModule], template: "<!-- /HEADER -->\r\n@if (!designer) {\r\n <div class=\"modal-side-bar-header-style\">\r\n <div class=\"modal-side-bar-header-content\">\r\n <!-- <button\r\n type=\"button\"\r\n class=\"btn-close modal-side-bar-header-cross-close\"\r\n aria-label=\"Close\"\r\n (click)=\"closeModal()\"\r\n >\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button> -->\r\n <div>\r\n <h4 class=\"modal-side-bar-header-title\">\r\n {{ \"media.media-selection.SELECTASSETS\" | translate }}\r\n </h4>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n<!-- ./HEADER -->\r\n\r\n<!-- /CONTENT -->\r\n<div class=\"modal-side-bar-content\" style=\"padding-left: 10px\">\r\n <div class=\"row\" class=\"header-container\">\r\n <div class=\"col-3\">\r\n @if (!isSearchMode) {\r\n <div class=\"header-full-path-folder\">\r\n @if (nameParentOfSelectedFolderForMove) {\r\n <span\r\n class=\"fas fa-arrow-left pointer\"\r\n style=\"margin-right: 10px; font-size: larger; margin-left: 10px\"\r\n (click)=\"returnBackFolderForMoveToAnotherFolder()\"\r\n ></span>\r\n }\r\n @if (!nameParentOfSelectedFolderForMove) {\r\n <span\r\n class=\"fas fa-folder-open designer\"\r\n style=\"margin-right: 10px; font-size: larger; margin-left: 10px\"\r\n ></span>\r\n }\r\n <h5 class=\"ellipsis-text designer\" style=\"font-size: larger\">\r\n <strong matTooltip=\"{{ pathFolder }}\" matTooltipPosition=\"below\">{{\r\n pathFolder\r\n }}</strong>\r\n </h5>\r\n </div>\r\n }\r\n </div>\r\n <div\r\n class=\"col-9\"\r\n style=\"display: flex; justify-content: right; align-items: center\"\r\n >\r\n @if (uploadMode) {\r\n <app-assets-uploader\r\n [folderGuid]=\"this.guidActiveFolderOfSelectedFolderForMove\"\r\n (allAssetsUpload)=\"refreshAssetsAfterUpload()\"\r\n ></app-assets-uploader>\r\n }\r\n <ng-container>\r\n <app-assets-uploader\r\n [folderGuid]=\"this.guidActiveFolderOfSelectedFolderForMove\"\r\n (allAssetsUpload)=\"refreshAssetsAfterUpload()\"\r\n ></app-assets-uploader>\r\n </ng-container>\r\n <div class=\"search-container\" style=\"width: max-content\">\r\n <input\r\n class=\"search-content form-control\"\r\n type=\"text\"\r\n [(ngModel)]=\"searchTermForDisplay\"\r\n placeholder=\"Rechercher...\"\r\n aria-label=\"Search\"\r\n id=\"searchBar\"\r\n style=\"background-color: #f5f7f8\"\r\n #searchBar\r\n (keyup)=\"searchTerm$.next($event.target.value); checkSearchMode()\"\r\n />\r\n <span class=\"fas fa-search search-logo\"></span>\r\n </div>\r\n <div style=\"display: flex\">\r\n <pagination\r\n #pagination\r\n class=\"pagination-sm paginationCss\"\r\n firstText=\"|<\"\r\n lastText=\">|\"\r\n previousText=\"<\"\r\n nextText=\">\"\r\n [(ngModel)]=\"pagePagination\"\r\n [totalItems]=\"nbrElementTotal\"\r\n [itemsPerPage]=\"nbrElementPage\"\r\n [maxSize]=\"maxSize\"\r\n [boundaryLinks]=\"true\"\r\n [rotate]=\"false\"\r\n (numPages)=\"numPages = $event\"\r\n [directionLinks]=\"true\"\r\n (pageChanged)=\"changePagePagination($event)\"\r\n ></pagination>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\" style=\"overflow: hidden\">\r\n @if (!isSearchMode) {\r\n <div class=\"col-3\" style=\"margin-top: 9px\">\r\n <div class=\"area-folder-container\">\r\n <div class=\"area-folder-path-folder\">\r\n <span\r\n class=\"fas fa-folder-open designer\"\r\n style=\"margin-right: 10px; font-size: larger\"\r\n ></span>\r\n @if (nameParentOfSelectedFolderForMove) {\r\n <label class=\"ellipsis-text designer\" style=\"font-size: larger\">\r\n <strong>{{ nameParentOfSelectedFolderForMove }}</strong>\r\n </label>\r\n }\r\n @if (!nameParentOfSelectedFolderForMove) {\r\n <label class=\"ellipsis-text designer\" style=\"font-size: larger\">\r\n <strong>{{ pathFolder }}</strong>\r\n </label>\r\n }\r\n </div>\r\n <div class=\"area-folder-list\">\r\n @for (folder of folders; track folder) {\r\n @if (\r\n folder &&\r\n folder.folderGuid != \"11111111-1111-1111-1111-111111111111\" &&\r\n folder.folderGuid != \"33333333-3333-3333-3333-333333333333\"\r\n ) {\r\n <div class=\"row\">\r\n @if (\r\n folder.folderGuid !=\r\n \"00000000-0000-0000-0000-000000000000\" ||\r\n (folder.folderGuid ==\r\n \"00000000-0000-0000-0000-000000000000\" &&\r\n this.rightsAccesModule[\"rights\"][\"Media\"][\r\n \"DamAssetsSelections\"\r\n ][\"subModuleIsActive\"])\r\n ) {\r\n <div\r\n class=\"col-12 area-folder-style\"\r\n (click)=\"\r\n changeLevelOfFolderForMove(\r\n folder.folderGuid,\r\n folder.folderName\r\n )\r\n \"\r\n >\r\n <span\r\n class=\"fas fa-folder designer\"\r\n style=\"\r\n margin-right: 20px;\r\n margin-top: 2px;\r\n font-size: larger;\r\n \"\r\n ></span>\r\n <label\r\n class=\"ellipsis-text pointer designer\"\r\n style=\"font-size: larger\"\r\n >\r\n {{ folder.folderName }}\r\n @if (\r\n folder.folderShareTeam &&\r\n folder.folderShareTeam.length > 0\r\n ) {\r\n <span\r\n class=\"fas fa-lock designer\"\r\n style=\"margin-left: 5px\"\r\n ></span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n @if (folders && folders.length == 0) {\r\n <div class=\"row\">\r\n <div\r\n class=\"col-12\"\r\n style=\"display: flex; justify-content: center\"\r\n >\r\n <span\r\n class=\"ellipsis-text designer\"\r\n style=\"margin-top: 10px\"\r\n [innerHTML]=\"\r\n 'media.media-selection.NOSUBFOLDERSTODISPLAY' | translate\r\n \"\r\n ></span>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n <div\r\n [ngClass]=\"{ 'col-9': !isSearchMode, 'col-12': isSearchMode }\"\r\n style=\"overflow-y: auto; overflow-x: hidden; height: calc(90vh - 163px)\"\r\n >\r\n <div class=\"row\" style=\"margin-top: 10px; margin-left: unset\">\r\n <ng-container>\r\n <app-assets-uploader\r\n [folderGuid]=\"this.guidActiveFolderOfSelectedFolderForMove\"\r\n [imageArea]=\"true\"\r\n [view]=\"'thumbnail'\"\r\n (allAssetsUpload)=\"refreshAssetsAfterUpload()\"\r\n style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\"\r\n ></app-assets-uploader>\r\n </ng-container>\r\n\r\n @for (asset of assetsInFolder; track asset) {\r\n @if (\r\n (type == \"image\" || type == \"imageMultiLang\" || type == \"all\") &&\r\n asset.assetType == \"image\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"height: 150px; padding: unset; position: relative\"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div\r\n class=\"checkbox c-checkbox checkBoxSelectionInModal\"\r\n style=\"right: 5px\"\r\n >\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"assetsSelected.indexOf(asset.assetGuid) > -1\"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) >\r\n -1\r\n \"\r\n id=\"{{ asset.assetGuid }}\"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <img\r\n onError=\"this.src='./assets/img/picture-unavailable.png'; \"\r\n style=\"object-fit: contain; width: 140px; height: 100px\"\r\n alt=\"image non disponible\"\r\n [src]=\"asset.assetUrlBig\"\r\n />\r\n <div\r\n class=\"assetNameListingDisplayInModal h5 mt-2 mb-0 fw-bold cropInModal\"\r\n >\r\n {{ asset.assetName }}\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplayInModal d-flex w-100 justify-content-end\"\r\n >\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetMetadatas.width }} x\r\n {{ asset.assetMetadatas.height }}\r\n </p>\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (\r\n (type == \"file\" || type == \"fileMultiLang\" || type == \"all\") &&\r\n asset.assetType == \"file\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"\r\n height: 150px;\r\n width: 140px;\r\n padding: unset;\r\n position: relative;\r\n \"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div class=\"checkbox c-checkbox checkBoxSelectionInModal\">\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"\r\n assetsSelected.indexOf(asset.assetGuid) > -1\r\n \"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(\r\n asset.assetGuid\r\n ) > -1\r\n \"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <div class=\"imgForAudioEtc\">\r\n <img\r\n src=\"./assets/img/icon/text-document.png\"\r\n alt=\"image non disponible\"\r\n />\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay h5 mt-2 mb-0 crop fw-bold\"\r\n >\r\n {{ asset.assetName }}\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay d-flex w-100 justify-content-end\"\r\n >\r\n @if (asset.assetSize >= 1000000) {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000000 | number: \"1.2-2\" }} mo\r\n </p>\r\n } @else {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000 | number: \"1.2-2\" }} ko\r\n </p>\r\n }\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (\r\n (type == \"audio\" || type == \"all\") && asset.assetType == \"audio\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"height: 150px; padding: unset; position: relative\"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div class=\"checkbox c-checkbox checkBoxSelectionInModal\">\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"assetsSelected.indexOf(asset.assetGuid) > -1\"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) >\r\n -1\r\n \"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <div class=\"imgForAudioEtc\">\r\n <img\r\n src=\"./assets/img/icon/speaker.png\"\r\n alt=\"image non disponible\"\r\n />\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay h5 mt-2 mb-0 crop fw-bold\"\r\n >\r\n {{ asset.assetName }}\r\n </div>\r\n <div\r\n class=\"assetNameListingDisplay d-flex w-100 justify-content-end\"\r\n >\r\n <div style=\"width: 50%; float: left\">\r\n @if (asset.assetSize >= 1000000) {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000000 | number: \"1.2-2\" }} mo\r\n </p>\r\n } @else {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000 | number: \"1.2-2\" }} ko\r\n </p>\r\n }\r\n </div>\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (\r\n (type == \"video\" || type == \"all\") && asset.assetType == \"video\"\r\n ) {\r\n <div style=\"width: 140px; margin-right: 20px; margin-bottom: 20px\">\r\n <div\r\n class=\"assetsDivInModal pointer\"\r\n (mouseleave)=\"assetOnOver = ''\"\r\n matTooltip=\"{{ asset.assetName }}\"\r\n matTooltipPosition=\"above\"\r\n style=\"height: 150px; padding: unset; position: relative\"\r\n (mouseenter)=\"assetOnOver = asset.assetGuid\"\r\n >\r\n @if (\r\n assetOnOver == asset.assetGuid || assetsSelected.length > 0\r\n ) {\r\n <div class=\"checkbox c-checkbox checkBoxSelectionInModal\">\r\n <label>\r\n <input\r\n type=\"checkbox\"\r\n (click)=\"selectThisAsset(asset.assetGuid)\"\r\n [checked]=\"assetsSelected.indexOf(asset.assetGuid) > -1\"\r\n [disabled]=\"\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) >\r\n -1\r\n \"\r\n />\r\n <span class=\"fa fa-check\"></span>\r\n </label>\r\n </div>\r\n }\r\n <div\r\n (click)=\"\r\n !(\r\n workflows &&\r\n assetsSelectedCopyWorkflows.indexOf(asset.assetGuid) > -1\r\n )\r\n ? selectThisAsset(asset.assetGuid)\r\n : ''\r\n \"\r\n >\r\n <div class=\"imgForAudioEtc\">\r\n <img\r\n src=\"./assets/img/icon/play.png\"\r\n alt=\"image non disponible\"\r\n />\r\n </div>\r\n <div class=\"assetNameListingDisplay crop\">\r\n {{ asset.assetName }}\r\n </div>\r\n <div class=\"assetNameListingDisplay\">\r\n <div style=\"width: 50%; float: left\">\r\n @if (asset.assetSize >= 1000000) {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000000 | number: \"1.2-2\" }} mo\r\n </p>\r\n } @else {\r\n <p class=\"small m-0 p-0 fst-italic mt-auto\">\r\n {{ asset.assetSize / 1000 | number: \"1.2-2\" }} ko\r\n </p>\r\n }\r\n </div>\r\n <span\r\n class=\"badge bg-dark ms-auto mt-1\"\r\n style=\"font-size: 0.6rem\"\r\n >\r\n {{ asset.assetFormat | uppercase }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<!-- ./CONTENT -->\r\n\r\n<!-- /ACTION -->\r\n@if (!designer) {\r\n <div class=\"modal-side-bar-footer\">\r\n <div class=\"modal-side-bar-footer-line\"></div>\r\n <div class=\"modal-side-bar-footer-right-placement\">\r\n <button\r\n type=\"button\"\r\n class=\"btn-denied\"\r\n (click)=\"closeModal()\"\r\n [innerHTML]=\"'products.skus.skus-detail.skus-prices.CLOSE' | translate\"\r\n ></button>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- ./ACTION -->\r\n", styles: [".header-container{height:45px;display:flex;align-items:center;position:sticky;top:0;background-color:#fff;z-index:100}.header-full-path-folder{display:flex;margin-bottom:6px;align-items:baseline}.area-folder-container{background-color:#f5f7f8;border-radius:var(--border-radius);height:100%;overflow-y:auto;overflow-x:hidden}.area-folder-path-folder{display:flex;padding:5px 10px;height:30px;color:var(--btn-accept);border-bottom:1px solid #c2c2c2;align-items:center}.area-folder-list{height:calc(90vh - 213px);overflow:auto;overflow-x:hidden}.ellipsis-text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.area-folder-style{padding:10px 22px;display:flex;color:var(--btn-accept);cursor:pointer}.area-folder-style:hover{background-color:var(--btn-accept);color:#fff}.assetsDiv{position:relative;padding:unset;margin-bottom:20px;background:#fff;display:inline-block;margin-right:20px;height:200px;width:200px;justify-content:center;overflow:hidden;align-items:center;box-shadow:0 2px 4px #0000000d}.modal-header{background-color:#293133;color:#fff;padding-top:8px;padding-bottom:8px}.modal-header h5{margin:0}.btn-close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#fff;text-shadow:0 1px 0 #fff;opacity:.5;background:none}button.btn-close{background-color:transparent;border:0}input[type=checkbox]:checked+span,.c-checkbox input,.form-check-input:checked{background-color:var(--btn-accept)!important;border-color:var(--btn-accept)!important;accent-color:var(--btn-accept)!important}input[type=checkbox]:disabled+span{border-color:#ddd!important;background-color:#ddd!important}input{font-family:var(--font-family)!important}.assetNameListingDisplay{font-size:10px;padding:0 5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zoneImg{width:200px;height:150px;justify-content:center;display:flex}.imageDis{object-fit:contain;max-width:100%;max-height:100%}.divPictureAdd{height:200px;align-items:center;justify-content:center;display:flex;background-color:#edf1f2;cursor:pointer}.modal-dialog{max-width:700px}.divForDivSearch{height:60px;background-color:#f5f7f8;position:sticky;top:0;z-index:100;align-items:center;display:flex}.addPictureText{width:100%;padding-top:10px;color:var(--btn-accept);font-weight:700;justify-content:center;display:flex}.titleCssModalAsset{font-weight:700;margin-top:2px;font-size:16px}#exampleModalLongTitle:before{content:\"\\f0c2\";font-family:\"Font Awesome 7 Free\";font-weight:900;font-size:1.1em;padding-right:5px}.overflow{overflow-x:hidden;overflow-y:auto;height:100%}.classificationRow{cursor:pointer;overflow-y:auto;overflow-x:hidden}.titleLevel:before{font-family:\"Font Awesome 7 Free\";font-weight:900;color:var(--btn-accept);content:\"\\f07b\";padding-right:5px}.titleLevel{padding:5px;width:100%;display:block;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-o-user-select:none;color:var(--btn-accept)}.modalHeaderCss{justify-content:unset}.arrowFolder{font-size:16px;margin-top:2px;margin-right:10px;cursor:pointer}.contentRightfolderTitleDiv{display:inline-flex;margin-top:5px}.chevron{font-size:17px;margin-right:10px}.modalBodyCss{height:400px;padding-right:unset;padding-top:unset;background:#f5f7f8}.assetTitleInModal{display:flex;margin-top:15px}.assetsDivInModal{position:relative;background:#fff;display:inline-block;justify-content:center;overflow:hidden;align-items:center;box-shadow:0 2px 4px #0000000d}.pointer{cursor:pointer}.checkBoxSelectionInModal{right:0;position:absolute;top:9px;color:var(--btn-accept)}.assetNameListingDisplayInModal{font-size:10px;padding:0 5px}.cropInModal{width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::-webkit-scrollbar{width:8px;background-color:#fff}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#fff}::-webkit-scrollbar-thumb{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#d3d3d3}.imgForAudioEtc{justify-content:center;align-items:center;display:flex;height:100px;width:140px}.imgForAudioEtcNotOnModal{height:150px;width:200px;justify-content:center;align-items:center;display:flex}.timeToUnlinkAsset{right:0;position:absolute;font-size:20px;margin-right:5px;margin-top:5px;color:var(--btn-accept);display:none;z-index:100000}.assetsDiv:hover .timeToUnlinkAsset,.assetsDiv:hover .divArrowLeft,.assetsDiv:hover .divArrowRight{display:flex}.closePreview{color:var(--btn-accept)!important;right:0;position:absolute;margin-right:10px;margin-top:5px;font-size:30px}.modal{margin:0 auto}.searchDiv{height:30px;font-size:15px;border-radius:var(--border-radius);border:1px solid lightgray;display:flex;width:97%;right:0}.inputSearchCss{color:var(--btn-accept);height:30px;border:unset;background:unset;display:flex;align-items:center;padding-left:10px;width:100%}.searchLogo{padding:6px}.paginationCss{box-shadow:0 2px 4px #0000000d;height:30px}::ng-deep .pagination-first{font-weight:700;color:var(--btn-accept)}::ng-deep .page-item.active .page-link{z-index:1;color:#fff;background-color:var(--btn-accept);border-color:var(--btn-accept)}::ng-deep .page-link{height:30px;font-size:14px;width:40px;text-align:center;padding-top:6px;color:#4a4a4a;border:unset}::ng-deep .pagination-last{font-weight:700;color:var(--btn-accept)}.pagination{justify-content:flex-end;position:relative;margin-right:55px;width:100%;margin-top:-5px;display:flex}.divArrowLeft{position:absolute;cursor:pointer;height:100%;width:40px;background:#d3d3d3b3;align-items:center;text-align:center;display:none;font-size:20px;justify-content:center;color:var(--btn-accept)}.divArrowRight{cursor:pointer;background:#d3d3d3b3;align-items:center;text-align:center;width:40px;display:none;font-size:20px;height:100%;justify-content:center;color:var(--btn-accept);position:absolute;top:0;right:0}\n"] }]
1045
+ }], ctorParameters: () => [{ type: i1.DamAssetsService }, { type: i1.SearchService }, { type: i1.MediaSelectionService }, { type: i1.SettingsService }, { type: i1.WorkflowsDesksService }, { type: i1.SuppliersService }, { type: i1.AccountsService }, { type: i1.FrameworkagreementsService }, { type: i1.websocketService }, { type: i0.ChangeDetectorRef }, { type: i1.RightsService }, { type: i1.SettingsService }, { type: i1.LoginService }, { type: i1.AuthService }, { type: i1.TranslatorService }], propDecorators: { hasBeenSaved: [{
1046
+ type: Output
1047
+ }], refreshData: [{
1048
+ type: Output
1049
+ }], isExternal: [{
1050
+ type: Input
1051
+ }], alias: [{
1052
+ type: Input
1053
+ }], team: [{
1054
+ type: Input
1055
+ }], designer: [{
1056
+ type: Input
1057
+ }], uploadMode: [{
1058
+ type: Input
1059
+ }], typeField: [{
1060
+ type: Input
1061
+ }], type: [{
1062
+ type: Input
1063
+ }], skuGuid: [{
1064
+ type: Input
1065
+ }], attributeGuid: [{
1066
+ type: Input
1067
+ }], categoryGuid: [{
1068
+ type: Input
1069
+ }], categoryParam: [{
1070
+ type: Input
1071
+ }], bomParam: [{
1072
+ type: Input
1073
+ }], workflows: [{
1074
+ type: Input
1075
+ }], workitemGuid: [{
1076
+ type: Input
1077
+ }], isReplace: [{
1078
+ type: Input
1079
+ }], sendListGuid: [{
1080
+ type: Input
1081
+ }], currentGuids: [{
1082
+ type: Input
1083
+ }], archive: [{
1084
+ type: Input
1085
+ }], language: [{
1086
+ type: Input
1087
+ }], isOnlyOneAsset: [{
1088
+ type: Input,
1089
+ args: ['isOnlyOneAsset']
1090
+ }] } });
1091
+
1092
+ /*
1093
+ * Public API Surface of solidpepper-modal-media-selection
1094
+ */
1095
+
1096
+ /**
1097
+ * Generated bundle index. Do not edit.
1098
+ */
1099
+
1100
+ export { AssetsUploaderComponent, ModalMediaSelectionComponent };
1101
+ //# sourceMappingURL=solidpepper-solidpepper-modal-media-selection.mjs.map