herum-shared 0.1.38 → 0.1.46
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.
- package/assets/shared/audio-images/purple-pause.svg +4 -0
- package/assets/shared/audio-images/purple-play.svg +3 -0
- package/atoms/index.d.ts +55 -55
- package/constants/index.d.ts +186 -136
- package/dialogs/index.d.ts +4 -3
- package/environment/index.d.ts +2 -35
- package/fesm2022/herum-shared-animations.mjs +4 -0
- package/fesm2022/herum-shared-animations.mjs.map +1 -1
- package/fesm2022/herum-shared-atoms.mjs +111 -109
- package/fesm2022/herum-shared-atoms.mjs.map +1 -1
- package/fesm2022/herum-shared-constants.mjs +205 -162
- package/fesm2022/herum-shared-constants.mjs.map +1 -1
- package/fesm2022/herum-shared-decorators.mjs +4 -0
- package/fesm2022/herum-shared-decorators.mjs.map +1 -1
- package/fesm2022/herum-shared-dialogs.mjs +7 -4
- package/fesm2022/herum-shared-dialogs.mjs.map +1 -1
- package/fesm2022/herum-shared-directives.mjs +5 -1
- package/fesm2022/herum-shared-directives.mjs.map +1 -1
- package/fesm2022/herum-shared-environment.mjs +4 -0
- package/fesm2022/herum-shared-environment.mjs.map +1 -1
- package/fesm2022/herum-shared-errors.mjs +5 -1
- package/fesm2022/herum-shared-errors.mjs.map +1 -1
- package/fesm2022/herum-shared-fetched-message.mjs +39 -30
- package/fesm2022/herum-shared-fetched-message.mjs.map +1 -1
- package/fesm2022/herum-shared-molecules.mjs +57 -28
- package/fesm2022/herum-shared-molecules.mjs.map +1 -1
- package/fesm2022/herum-shared-mongo.mjs +414 -150
- package/fesm2022/herum-shared-mongo.mjs.map +1 -1
- package/fesm2022/herum-shared-objectsExample.mjs +5 -1
- package/fesm2022/herum-shared-objectsExample.mjs.map +1 -1
- package/fesm2022/herum-shared-pipes.mjs +64 -60
- package/fesm2022/herum-shared-pipes.mjs.map +1 -1
- package/fesm2022/herum-shared-services.mjs +144 -321
- package/fesm2022/herum-shared-services.mjs.map +1 -1
- package/fesm2022/herum-shared-static-services.mjs +4 -0
- package/fesm2022/herum-shared-static-services.mjs.map +1 -1
- package/fesm2022/herum-shared-table.mjs +61 -48
- package/fesm2022/herum-shared-table.mjs.map +1 -1
- package/fesm2022/herum-shared-testsObjects.mjs +89 -119
- package/fesm2022/herum-shared-testsObjects.mjs.map +1 -1
- package/fesm2022/herum-shared-tokens.mjs +4 -0
- package/fesm2022/herum-shared-tokens.mjs.map +1 -1
- package/fesm2022/herum-shared-utils.mjs +43 -39
- package/fesm2022/herum-shared-utils.mjs.map +1 -1
- package/fesm2022/herum-shared-validators.mjs +4 -0
- package/fesm2022/herum-shared-validators.mjs.map +1 -1
- package/fesm2022/herum-shared.mjs +9090 -924
- package/fesm2022/herum-shared.mjs.map +1 -1
- package/fetched-message/index.d.ts +11 -11
- package/index.d.ts +1673 -281
- package/molecules/index.d.ts +11 -8
- package/mongo/index.d.ts +125 -66
- package/objectsExample/index.d.ts +3 -1
- package/package.json +2 -5
- package/pipes/index.d.ts +25 -21
- package/services/index.d.ts +56 -67
- package/styles/_mixin.scss +2 -2
- package/styles/dialogs.scss +0 -5
- package/styles/variables/_colors.scss +5 -109
- package/styles/variables/_sizes.scss +2 -9
- package/table/index.d.ts +25 -18
- package/testsObjects/index.d.ts +3 -3
- package/tokens/index.d.ts +6 -4
- package/utils/index.d.ts +14 -10
- package/fesm2022/herum-shared-herum-types.mjs +0 -107
- package/fesm2022/herum-shared-herum-types.mjs.map +0 -1
- package/herum-types/index.d.ts +0 -200
- package/styles/variables/_colors.college.scss +0 -65
|
@@ -1,27 +1,68 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Inject, Injectable, ViewChildren, Component, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import { ErrorMessageDialogComponent } from 'herum-shared/errors';
|
|
4
|
-
import { dialogsDescriptions, dialogsTitles,
|
|
5
|
-
import { Subject, EMPTY, forkJoin, BehaviorSubject } from 'rxjs';
|
|
4
|
+
import { getSignUpMethod, globalErrorHandlingHeader, dialogsDescriptions, dialogsTitles, uploadsManagerKeys, uploadStatuses, toastStatuses, generalKeys, skipToastHeader, assignmentMetadata, toastContext, toastStates, svgsStrings } from 'herum-shared/constants';
|
|
5
|
+
import { Subject, EMPTY, forkJoin, BehaviorSubject, takeUntil } from 'rxjs';
|
|
6
6
|
import { HERUM_SHARED_CONFIG_TOKEN } from 'herum-shared/environment';
|
|
7
7
|
import * as i1 from '@angular/material/dialog';
|
|
8
|
-
import * as i2 from '
|
|
9
|
-
import * as i3 from '
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import * as i2 from 'herum-shared/services';
|
|
9
|
+
import * as i3 from '@angular/common/http';
|
|
10
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
11
|
+
import { catchError, switchMap, takeUntil as takeUntil$1, shareReplay } from 'rxjs/operators';
|
|
12
|
+
import { buildPath, setHeaders, remainJustWantedValueInDictionary, isTruncatedTitleElement } from 'herum-shared/utils';
|
|
12
13
|
import * as i2$1 from '@angular/common';
|
|
13
14
|
import { CommonModule } from '@angular/common';
|
|
14
15
|
import * as i4 from 'herum-shared/pipes';
|
|
15
16
|
import { PipesModule } from 'herum-shared/pipes';
|
|
16
|
-
import { isTruncatedTitleElement } from 'herum-shared/utils';
|
|
17
17
|
import * as i3$1 from 'herum-shared/atoms';
|
|
18
18
|
import { AtomsModule } from 'herum-shared/atoms';
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
const getMongoMethodsDisplayedNamesMap = (mongoUpdates, authenticationPaths) => ({
|
|
21
|
+
[mongoUpdates.Methods.Attach]: 'שיוך',
|
|
22
|
+
[mongoUpdates.Methods.Create]: 'יצירה',
|
|
23
|
+
[mongoUpdates.Methods.AddOrUpdate]: 'עדכון',
|
|
24
|
+
[mongoUpdates.Methods.Basic]: 'עדכון',
|
|
25
|
+
[mongoUpdates.Methods.Delete]: 'מחיקה',
|
|
26
|
+
[mongoUpdates.Submethods.Duplicate]: 'שכפול',
|
|
27
|
+
[mongoUpdates.Methods.ListItemDeletion]: 'מחיקה',
|
|
28
|
+
[getSignUpMethod(authenticationPaths)]: 'הרשמה'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
class MongoUtilsService {
|
|
32
|
+
environmentConfig;
|
|
33
|
+
constructor(environmentConfig) {
|
|
34
|
+
this.environmentConfig = environmentConfig;
|
|
35
|
+
}
|
|
36
|
+
getDisplayedNameForMongoMethodByUserActivity(urlRequest) {
|
|
37
|
+
let mongoMethodDisplayedName;
|
|
38
|
+
const mongoMethodsDisplayedNamesMap = getMongoMethodsDisplayedNamesMap(this.environmentConfig?.mongoUpdates, this.environmentConfig?.authenticationPaths);
|
|
39
|
+
Object.entries(mongoMethodsDisplayedNamesMap).forEach(([mongoMethod, displayedName]) => {
|
|
40
|
+
const urlParts = urlRequest?.split('/');
|
|
41
|
+
const matchedMethod = urlParts?.find(urlPart => urlPart === mongoMethod);
|
|
42
|
+
if (matchedMethod)
|
|
43
|
+
mongoMethodDisplayedName = displayedName;
|
|
44
|
+
});
|
|
45
|
+
return mongoMethodDisplayedName;
|
|
46
|
+
}
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MongoUtilsService, deps: [{ token: HERUM_SHARED_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
48
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MongoUtilsService, providedIn: 'root' });
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MongoUtilsService, decorators: [{
|
|
51
|
+
type: Injectable,
|
|
52
|
+
args: [{
|
|
53
|
+
providedIn: 'root',
|
|
54
|
+
}]
|
|
55
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
56
|
+
type: Inject,
|
|
57
|
+
args: [HERUM_SHARED_CONFIG_TOKEN]
|
|
58
|
+
}] }] });
|
|
20
59
|
|
|
21
60
|
class ErrorsHandlerService {
|
|
22
61
|
dialog;
|
|
62
|
+
loaderService;
|
|
23
63
|
http;
|
|
24
|
-
|
|
64
|
+
auth;
|
|
65
|
+
mongoUtilsService;
|
|
25
66
|
environmentConfig;
|
|
26
67
|
isErrorPopupCurrentlyOpened = false;
|
|
27
68
|
failedReportUploadProgressRequests = [];
|
|
@@ -30,16 +71,21 @@ class ErrorsHandlerService {
|
|
|
30
71
|
reportUploadProgressRequest$ = new Subject();
|
|
31
72
|
commonDependentsErrorToast$ = new Subject();
|
|
32
73
|
errorToast$ = new Subject();
|
|
33
|
-
constructor(dialog, http,
|
|
74
|
+
constructor(dialog, loaderService, http, auth, mongoUtilsService, environmentConfig) {
|
|
34
75
|
this.dialog = dialog;
|
|
76
|
+
this.loaderService = loaderService;
|
|
35
77
|
this.http = http;
|
|
36
|
-
this.
|
|
78
|
+
this.auth = auth;
|
|
79
|
+
this.mongoUtilsService = mongoUtilsService;
|
|
37
80
|
this.environmentConfig = environmentConfig;
|
|
38
81
|
}
|
|
39
82
|
handleError(errorStatus, errorData) {
|
|
40
83
|
if (!errorData)
|
|
41
84
|
return;
|
|
85
|
+
if (errorData.requestHeaders.get(globalErrorHandlingHeader) === 'false')
|
|
86
|
+
throw errorData;
|
|
42
87
|
let url = errorData?.url;
|
|
88
|
+
this.loaderService.loadersIds = [];
|
|
43
89
|
if (errorData.headers?.dependentId) {
|
|
44
90
|
const commonDependentsErrorToast = { commonDependentsId: errorData.commonDependentsId, numberOfObservableArrowFunctions: errorData.numberOfObservableArrowFunctions, errorStatus };
|
|
45
91
|
this.handleDependentRequestError(commonDependentsErrorToast, errorData.headers?.dependentId);
|
|
@@ -111,6 +157,8 @@ class ErrorsHandlerService {
|
|
|
111
157
|
});
|
|
112
158
|
dialogRef.afterClosed().subscribe(result => {
|
|
113
159
|
this.isErrorPopupCurrentlyOpened = false;
|
|
160
|
+
if (isCritical)
|
|
161
|
+
this.auth.logout();
|
|
114
162
|
});
|
|
115
163
|
}
|
|
116
164
|
handleDependentRequestError(commonDependentsErrorToast, dependentRequestId) {
|
|
@@ -123,7 +171,7 @@ class ErrorsHandlerService {
|
|
|
123
171
|
isErrorToastNeeded(errorData, errorCode) {
|
|
124
172
|
if (errorData === 'CRITICAL' || errorCode === 500 || errorData.headers?.skipToast)
|
|
125
173
|
return false;
|
|
126
|
-
return !!this.
|
|
174
|
+
return !!this.mongoUtilsService.getDisplayedNameForMongoMethodByUserActivity(errorData.url);
|
|
127
175
|
}
|
|
128
176
|
handleErrorToast(errorData) {
|
|
129
177
|
if (errorData.headers?.dependentId) {
|
|
@@ -145,12 +193,12 @@ class ErrorsHandlerService {
|
|
|
145
193
|
else
|
|
146
194
|
this.failedDependentsRequestsContext[dependentId] = initialValue ? { error, failedComplexObservableArrowFunctions, initialValue } : { error, failedComplexObservableArrowFunctions };
|
|
147
195
|
}
|
|
148
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ErrorsHandlerService, deps: [{ token: i1.MatDialog }, { token: i2.
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ErrorsHandlerService, deps: [{ token: i1.MatDialog }, { token: i2.LoaderManagerService }, { token: i3.HttpClient }, { token: i2.AuthService }, { token: MongoUtilsService }, { token: HERUM_SHARED_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
149
197
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ErrorsHandlerService });
|
|
150
198
|
}
|
|
151
199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ErrorsHandlerService, decorators: [{
|
|
152
200
|
type: Injectable
|
|
153
|
-
}], ctorParameters: () => [{ type: i1.MatDialog }, { type: i2.
|
|
201
|
+
}], ctorParameters: () => [{ type: i1.MatDialog }, { type: i2.LoaderManagerService }, { type: i3.HttpClient }, { type: i2.AuthService }, { type: MongoUtilsService }, { type: undefined, decorators: [{
|
|
154
202
|
type: Inject,
|
|
155
203
|
args: [HERUM_SHARED_CONFIG_TOKEN]
|
|
156
204
|
}] }] });
|
|
@@ -249,95 +297,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
249
297
|
type: Injectable
|
|
250
298
|
}], ctorParameters: () => [{ type: ErrorsHandlerService }] });
|
|
251
299
|
|
|
252
|
-
class ToastsService {
|
|
253
|
-
errorsHandlerService;
|
|
254
|
-
utilsService;
|
|
255
|
-
environmentConfig;
|
|
256
|
-
toast$ = new BehaviorSubject(undefined);
|
|
257
|
-
toastId = 0;
|
|
258
|
-
toastsTemplates;
|
|
259
|
-
constructor(errorsHandlerService, utilsService, environmentConfig) {
|
|
260
|
-
this.errorsHandlerService = errorsHandlerService;
|
|
261
|
-
this.utilsService = utilsService;
|
|
262
|
-
this.environmentConfig = environmentConfig;
|
|
263
|
-
this.errorsHandlerService.errorToast$?.subscribe(toastHttpResponseDependencies => this.createToastBasedOnHttpResponse(toastHttpResponseDependencies));
|
|
264
|
-
this.toastsTemplates = getToastsTemplates(this.environmentConfig?.mongoUpdates, this.environmentConfig?.authenticationPaths);
|
|
265
|
-
}
|
|
266
|
-
createToastBasedOnHttpResponse(toastHttpResponseDependencies) {
|
|
267
|
-
if (!toastHttpResponseDependencies)
|
|
268
|
-
return;
|
|
269
|
-
let urlRequest = toastHttpResponseDependencies?.url;
|
|
270
|
-
let mongoMethodDisplayedName = this.utilsService.getDisplayedNameForMongoMethodByUserActivity(urlRequest);
|
|
271
|
-
if (!mongoMethodDisplayedName)
|
|
272
|
-
return;
|
|
273
|
-
let status = this.setToastStatus(toastHttpResponseDependencies.status);
|
|
274
|
-
let content = status === toastStatuses.success ?
|
|
275
|
-
toastContext[status.toString()](mongoMethodDisplayedName) :
|
|
276
|
-
this.findErrorMessageByStatusCode(toastHttpResponseDependencies.status.toString(), mongoMethodDisplayedName);
|
|
277
|
-
this.showToast(toastContext.title(mongoMethodDisplayedName), content, status);
|
|
278
|
-
}
|
|
279
|
-
findErrorMessageByStatusCode(statusCode, mongoMethodDisplayedName) {
|
|
280
|
-
if (!toastContext.statusCodes[statusCode])
|
|
281
|
-
statusCode = 'genericError';
|
|
282
|
-
return toastContext.statusCodes[statusCode](mongoMethodDisplayedName);
|
|
283
|
-
}
|
|
284
|
-
showErrorToast(toastContextKey) {
|
|
285
|
-
if (!this.toastsTemplates[toastContextKey])
|
|
286
|
-
return;
|
|
287
|
-
let content = this.toastsTemplates[toastContextKey][toastStatuses.error];
|
|
288
|
-
let title = this.toastsTemplates[toastContextKey].title;
|
|
289
|
-
this.showToast(title, content, toastStatuses.error);
|
|
290
|
-
}
|
|
291
|
-
showSuccessToast(toastContextKey) {
|
|
292
|
-
if (!this.toastsTemplates[toastContextKey])
|
|
293
|
-
return;
|
|
294
|
-
let content = this.toastsTemplates[toastContextKey][toastStatuses.success];
|
|
295
|
-
let title = this.toastsTemplates[toastContextKey].title;
|
|
296
|
-
this.showToast(title, content, toastStatuses.success);
|
|
297
|
-
}
|
|
298
|
-
showInformationToast(toastContextKey) {
|
|
299
|
-
if (!this.toastsTemplates[toastContextKey])
|
|
300
|
-
return;
|
|
301
|
-
let content = this.toastsTemplates[toastContextKey][toastStatuses.information];
|
|
302
|
-
let title = this.toastsTemplates[toastContextKey].title;
|
|
303
|
-
this.showToast(title, content, toastStatuses.information);
|
|
304
|
-
}
|
|
305
|
-
showOnDemandToast(toastContextKey, status, toastStorageKey) {
|
|
306
|
-
if (!this.toastsTemplates[toastContextKey])
|
|
307
|
-
return;
|
|
308
|
-
if (this.hasToastAlreadyShownAndShouldShowOnce(toastStorageKey))
|
|
309
|
-
return;
|
|
310
|
-
let content = this.toastsTemplates[toastContextKey][status];
|
|
311
|
-
let title = this.toastsTemplates[toastContextKey].title;
|
|
312
|
-
this.showToast(title, content, status);
|
|
313
|
-
}
|
|
314
|
-
hasToastAlreadyShownAndShouldShowOnce(toastStorageKey) {
|
|
315
|
-
if (!toastStorageKey)
|
|
316
|
-
return false;
|
|
317
|
-
if (StorageService.getItem(toastStorageKey))
|
|
318
|
-
return true;
|
|
319
|
-
StorageService.setItem(toastStorageKey, toastStorageKey);
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
showToast(title, content, status) {
|
|
323
|
-
this.toast$.next({ title, content, status, id: ++this.toastId, state: toastStates.preEnter });
|
|
324
|
-
}
|
|
325
|
-
setToastStatus(statusCode) {
|
|
326
|
-
if (statusCode >= 200 && statusCode < 299)
|
|
327
|
-
return toastStatuses.success;
|
|
328
|
-
if (statusCode >= 400 && statusCode < 599)
|
|
329
|
-
return toastStatuses.error;
|
|
330
|
-
}
|
|
331
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ToastsService, deps: [{ token: ErrorsHandlerService }, { token: i3.UtilsService }, { token: HERUM_SHARED_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
332
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ToastsService });
|
|
333
|
-
}
|
|
334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ToastsService, decorators: [{
|
|
335
|
-
type: Injectable
|
|
336
|
-
}], ctorParameters: () => [{ type: ErrorsHandlerService }, { type: i3.UtilsService }, { type: undefined, decorators: [{
|
|
337
|
-
type: Inject,
|
|
338
|
-
args: [HERUM_SHARED_CONFIG_TOKEN]
|
|
339
|
-
}] }] });
|
|
340
|
-
|
|
341
300
|
class UploadsManagerService {
|
|
342
301
|
errorsHandlerService;
|
|
343
302
|
dependentsService;
|
|
@@ -422,12 +381,331 @@ class UploadsManagerService {
|
|
|
422
381
|
let status = areAllCommonUploadsProgressFinishedSuccesfully ? toastStatuses.success : toastStatuses.error;
|
|
423
382
|
this.toastsService.showToast(title, content, status);
|
|
424
383
|
}
|
|
425
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UploadsManagerService, deps: [{ token: ErrorsHandlerService }, { token: DependentsService }, { token:
|
|
384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UploadsManagerService, deps: [{ token: ErrorsHandlerService }, { token: DependentsService }, { token: i3.HttpClient }, { token: i2.ToastsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
426
385
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UploadsManagerService });
|
|
427
386
|
}
|
|
428
387
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UploadsManagerService, decorators: [{
|
|
429
388
|
type: Injectable
|
|
430
|
-
}], ctorParameters: () => [{ type: ErrorsHandlerService }, { type: DependentsService }, { type:
|
|
389
|
+
}], ctorParameters: () => [{ type: ErrorsHandlerService }, { type: DependentsService }, { type: i3.HttpClient }, { type: i2.ToastsService }] });
|
|
390
|
+
|
|
391
|
+
const ATTACH = "Attach";
|
|
392
|
+
class DbActionRequestsService {
|
|
393
|
+
http;
|
|
394
|
+
dbActionsInnerIdManagerService;
|
|
395
|
+
environmentConfig;
|
|
396
|
+
constructor(http, dbActionsInnerIdManagerService, environmentConfig) {
|
|
397
|
+
this.http = http;
|
|
398
|
+
this.dbActionsInnerIdManagerService = dbActionsInnerIdManagerService;
|
|
399
|
+
this.environmentConfig = environmentConfig;
|
|
400
|
+
}
|
|
401
|
+
getFileRequest(request, file) {
|
|
402
|
+
const formData = new FormData();
|
|
403
|
+
formData.append(generalKeys.newFileRequest, JSON.stringify(request));
|
|
404
|
+
formData.append(generalKeys.file, file);
|
|
405
|
+
return formData;
|
|
406
|
+
}
|
|
407
|
+
addOrUpdateAndAttachBulkWithFile(mongoCollectionName, fields, file, ids, uploadsManagerTitle, skipToast) {
|
|
408
|
+
let headers = this.setAddOrUpdateAndAttachBulkWithFileHeaders([uploadsManagerTitle, skipToast]);
|
|
409
|
+
return this.getMongoCollectionModelInfo(mongoCollectionName).pipe(switchMap((modelInfo) => {
|
|
410
|
+
if (fields.files)
|
|
411
|
+
delete fields.files;
|
|
412
|
+
const splittedFields = this.splitFieldByType(fields, modelInfo);
|
|
413
|
+
const request = {
|
|
414
|
+
DbBasicActionRequest: {
|
|
415
|
+
data: splittedFields.keysToUpdate,
|
|
416
|
+
ids
|
|
417
|
+
},
|
|
418
|
+
DbAttachmentActionRequests: this.getFormattedAttachments(ids, splittedFields.keysToAttach, splittedFields.keysToAttachInDifferentModel, modelInfo)
|
|
419
|
+
};
|
|
420
|
+
return this.http.put(buildPath([
|
|
421
|
+
this.environmentConfig?.environment?.siteServerPath,
|
|
422
|
+
mongoCollectionName,
|
|
423
|
+
this.environmentConfig?.mongoUpdates?.Methods?.AddOrUpdate,
|
|
424
|
+
this.environmentConfig?.mongoUpdates?.Submethods?.AndAttach,
|
|
425
|
+
this.environmentConfig?.mongoUpdates?.Options?.Bulk,
|
|
426
|
+
this.environmentConfig?.mongoUpdates?.Options?.SetFile
|
|
427
|
+
]), this.getFileRequest(request, file), { responseType: 'text', reportProgress: !!file, headers });
|
|
428
|
+
}));
|
|
429
|
+
}
|
|
430
|
+
setAddOrUpdateAndAttachBulkWithFileHeaders(headerToSet) {
|
|
431
|
+
let headers = null;
|
|
432
|
+
const [uploadsManagerTitle, skipToast] = headerToSet;
|
|
433
|
+
if (uploadsManagerTitle)
|
|
434
|
+
headers = setHeaders(new HttpHeaders(), [{ key: uploadsManagerKeys.uploadsManagerTitleHeader, value: uploadsManagerTitle }], true);
|
|
435
|
+
if (skipToast)
|
|
436
|
+
headers = skipToastHeader;
|
|
437
|
+
return headers;
|
|
438
|
+
}
|
|
439
|
+
AndAttachBulk(mongoCollectionName, fields, ids, method, attachmentsToUpdate) {
|
|
440
|
+
if (ids.every(id => !id))
|
|
441
|
+
ids = undefined;
|
|
442
|
+
return this.getMongoCollectionModelInfo(mongoCollectionName).pipe(switchMap((modelInfo) => {
|
|
443
|
+
const splittedFields = this.splitFieldByType(fields, modelInfo);
|
|
444
|
+
const request = {
|
|
445
|
+
DbBasicActionRequest: {
|
|
446
|
+
data: Object.assign(splittedFields.keysToUpdate, attachmentsToUpdate),
|
|
447
|
+
ids
|
|
448
|
+
},
|
|
449
|
+
DbAttachmentActionRequests: this.getFormattedAttachments(ids, splittedFields.keysToAttach, splittedFields.keysToAttachInDifferentModel, modelInfo)
|
|
450
|
+
};
|
|
451
|
+
if (method == 'create')
|
|
452
|
+
delete request.DbBasicActionRequest.ids;
|
|
453
|
+
return this.http.request(method == 'create' ? 'post' : 'put', buildPath([
|
|
454
|
+
this.environmentConfig?.environment?.siteServerPath,
|
|
455
|
+
mongoCollectionName,
|
|
456
|
+
method == 'addOrUpdate' ? this.environmentConfig?.mongoUpdates?.Methods?.AddOrUpdate : this.environmentConfig?.mongoUpdates?.Methods?.Create,
|
|
457
|
+
this.environmentConfig?.mongoUpdates?.Submethods?.AndAttach,
|
|
458
|
+
this.environmentConfig?.mongoUpdates?.Options?.Bulk
|
|
459
|
+
]), { body: request });
|
|
460
|
+
}));
|
|
461
|
+
}
|
|
462
|
+
basicBulk(mongoCollectionName, fields, ids, requestType, skipToast) {
|
|
463
|
+
return this.getMongoCollectionModelInfo(mongoCollectionName).pipe(switchMap((modelInfo) => {
|
|
464
|
+
const updatedFields = remainJustWantedValueInDictionary(generalKeys.id, fields);
|
|
465
|
+
const splitedFields = this.splitFieldByType(fields, modelInfo);
|
|
466
|
+
const requests = Object.entries(updatedFields).map(([field, value]) => {
|
|
467
|
+
const fieldModelInfo = splitedFields.keysToAttachInDifferentModel[field];
|
|
468
|
+
return fieldModelInfo?.sourceField ?
|
|
469
|
+
this.buildMirrorSourceCollectionRequestsData(value, fieldModelInfo.sourceField, fieldModelInfo.innerPreviewModelName, ids[0], requestType, fieldModelInfo.attachedToType)
|
|
470
|
+
: this.buildSourceCollectionRequestsData(ids, { [field]: value }, requestType, mongoCollectionName);
|
|
471
|
+
});
|
|
472
|
+
let headers = null;
|
|
473
|
+
if (skipToast)
|
|
474
|
+
headers = skipToastHeader;
|
|
475
|
+
return this.http.post(buildPath([
|
|
476
|
+
this.environmentConfig?.environment?.siteServerPath,
|
|
477
|
+
mongoCollectionName,
|
|
478
|
+
this.environmentConfig?.mongoUpdates?.Methods?.Basic,
|
|
479
|
+
this.environmentConfig?.mongoUpdates?.Options?.Bulk,
|
|
480
|
+
]), { requests }, { headers });
|
|
481
|
+
}));
|
|
482
|
+
}
|
|
483
|
+
buildSourceCollectionRequestsData(mongoSourceCollectionIds, data, requestType, mongoSourceCollectionName) {
|
|
484
|
+
return {
|
|
485
|
+
ids: mongoSourceCollectionIds,
|
|
486
|
+
data,
|
|
487
|
+
requestType,
|
|
488
|
+
actOnType: mongoSourceCollectionName
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
buildMirrorSourceCollectionRequestsData(fieldValue, sourceField, innerPreviewModelName, mongoSourceCollectionId, requestType, attachedToType) {
|
|
492
|
+
return {
|
|
493
|
+
ids: this.arrayOfIdObjectsToIdsArray(fieldValue),
|
|
494
|
+
data: this.buildBasicBulkObjectData(sourceField, innerPreviewModelName, mongoSourceCollectionId),
|
|
495
|
+
requestType,
|
|
496
|
+
actOnType: attachedToType
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
arrayOfIdObjectsToIdsArray(array) {
|
|
500
|
+
return array.map(object => object.id);
|
|
501
|
+
}
|
|
502
|
+
buildBasicBulkObjectData(sourceField, innerPreviewModelName, mongoSourceCollectionId) {
|
|
503
|
+
const value = innerPreviewModelName ? { [innerPreviewModelName]: { id: mongoSourceCollectionId } } : { id: mongoSourceCollectionId };
|
|
504
|
+
return { [sourceField]: [value] };
|
|
505
|
+
}
|
|
506
|
+
deleteMongoDocument(mongoCollectionName, ids) {
|
|
507
|
+
return this.http.post(buildPath([
|
|
508
|
+
this.environmentConfig?.environment?.siteServerPath,
|
|
509
|
+
mongoCollectionName,
|
|
510
|
+
this.environmentConfig?.mongoUpdates?.Methods?.Delete,
|
|
511
|
+
]), ids);
|
|
512
|
+
}
|
|
513
|
+
deletePreviewItemsFromList(mongoCollectionName, fields, ids) {
|
|
514
|
+
const request = {
|
|
515
|
+
ids,
|
|
516
|
+
data: fields
|
|
517
|
+
};
|
|
518
|
+
return this.http.put(buildPath([
|
|
519
|
+
this.environmentConfig?.environment?.siteServerPath,
|
|
520
|
+
mongoCollectionName,
|
|
521
|
+
this.environmentConfig?.mongoUpdates?.Methods?.ListItemDeletion
|
|
522
|
+
]), request);
|
|
523
|
+
}
|
|
524
|
+
getFormattedAttachments(ids, objectsToAttach, keysToAttachInDifferentModel, modelInfo) {
|
|
525
|
+
let result = [];
|
|
526
|
+
Object.keys(objectsToAttach).forEach(keyToAttach => {
|
|
527
|
+
let attachments = {};
|
|
528
|
+
if (Array.isArray(objectsToAttach[keyToAttach]))
|
|
529
|
+
objectsToAttach[keyToAttach].forEach((itemToAttach) => {
|
|
530
|
+
const itemKey = Object.keys(itemToAttach)[0];
|
|
531
|
+
const itemValue = itemToAttach[itemKey];
|
|
532
|
+
this.dbActionsInnerIdManagerService.deleteInnerIdFieldIfExist(itemToAttach, itemValue);
|
|
533
|
+
if (itemValue.hasOwnProperty(generalKeys.id) && itemValue[generalKeys.id] !== null)
|
|
534
|
+
delete itemToAttach[Object.keys(itemToAttach)[0]][generalKeys.id];
|
|
535
|
+
Object.assign(attachments, itemToAttach);
|
|
536
|
+
});
|
|
537
|
+
else
|
|
538
|
+
attachments[objectsToAttach[keyToAttach]] = {};
|
|
539
|
+
objectsToAttach[keyToAttach].forEach((objectToAttach, index) => {
|
|
540
|
+
if (objectsToAttach[keyToAttach] && Object.keys(objectsToAttach[keyToAttach][index]) && attachments[Object.keys(objectsToAttach[keyToAttach][index])[0]])
|
|
541
|
+
Object.keys(attachments[Object.keys(objectsToAttach[keyToAttach][index])[0]]).forEach(keyOfObjectToAttachData => {
|
|
542
|
+
if (modelInfo[keyToAttach].innerPreviewModelName == keyOfObjectToAttachData || !modelInfo[keyToAttach].innerProperties.hasOwnProperty(keyOfObjectToAttachData))
|
|
543
|
+
delete attachments[Object.keys(objectsToAttach[keyToAttach][index])[0]][keyOfObjectToAttachData];
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
result.push({
|
|
547
|
+
field: keyToAttach.charAt(0).toUpperCase() + keyToAttach.slice(1),
|
|
548
|
+
attachments,
|
|
549
|
+
ids
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
Object.keys(keysToAttachInDifferentModel).forEach(field => {
|
|
553
|
+
const extensionValue = Object.values(DbActionsInconsistencyMap[field].extension)[0];
|
|
554
|
+
const updatedExtensionInfo = { [ids[0]]: extensionValue };
|
|
555
|
+
let request = {
|
|
556
|
+
field: keysToAttachInDifferentModel[field].sourceField,
|
|
557
|
+
attachments: updatedExtensionInfo,
|
|
558
|
+
ids: keysToAttachInDifferentModel[field].values.map(value => value.id),
|
|
559
|
+
attachedToType: keysToAttachInDifferentModel[field].attachedToType
|
|
560
|
+
};
|
|
561
|
+
result.push(request);
|
|
562
|
+
});
|
|
563
|
+
return result;
|
|
564
|
+
}
|
|
565
|
+
splitFieldByType(fields, modelInfo) {
|
|
566
|
+
return Object.entries(fields).reduce((acc, [key, value]) => {
|
|
567
|
+
if (modelInfo[key] && (modelInfo[key].attachedToType == null || modelInfo[key].sourceField == null || modelInfo[key].sourceField == undefined)) {
|
|
568
|
+
const group = modelInfo[key].propertyUpdateType === ATTACH ? 'keysToAttach' : 'keysToUpdate';
|
|
569
|
+
if (value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0)) {
|
|
570
|
+
acc[group] = {
|
|
571
|
+
...acc[group], [key]: modelInfo[key].propertyUpdateType === ATTACH ?
|
|
572
|
+
value?.map(value => {
|
|
573
|
+
return { [value.id + '']: value };
|
|
574
|
+
}) :
|
|
575
|
+
value
|
|
576
|
+
};
|
|
577
|
+
this.dbActionsInnerIdManagerService.determineIfInnerIdIsNeeded(value);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
if (modelInfo[DbActionsInconsistencyMap[key]?.backendNaming])
|
|
582
|
+
acc.keysToAttachInDifferentModel = {
|
|
583
|
+
...acc.keysToAttachInDifferentModel, [key]: {
|
|
584
|
+
attachedToType: modelInfo[DbActionsInconsistencyMap[key].backendNaming]?.attachedToType,
|
|
585
|
+
sourceField: modelInfo[DbActionsInconsistencyMap[key].backendNaming]?.sourceField,
|
|
586
|
+
innerPreviewModelName: modelInfo[DbActionsInconsistencyMap[key].backendNaming]?.innerPreviewModelName,
|
|
587
|
+
values: fields[key]
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
else
|
|
591
|
+
acc.keysToAttachInDifferentModel = {
|
|
592
|
+
...acc.keysToAttachInDifferentModel, [key]: {
|
|
593
|
+
attachedToType: modelInfo[key]?.attachedToType,
|
|
594
|
+
sourceField: modelInfo[key]?.sourceField,
|
|
595
|
+
innerPreviewModelName: modelInfo[key]?.innerPreviewModelName,
|
|
596
|
+
values: fields[key]
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
return acc;
|
|
601
|
+
}, { keysToAttach: {}, keysToUpdate: {}, keysToAttachInDifferentModel: {} });
|
|
602
|
+
}
|
|
603
|
+
getMongoCollectionModelInfo(mongoCollectionName) {
|
|
604
|
+
return this.http.get(buildPath([
|
|
605
|
+
this.environmentConfig?.environment?.siteServerPath,
|
|
606
|
+
mongoCollectionName,
|
|
607
|
+
this.environmentConfig?.mongoUpdates?.Methods?.ModelInfo
|
|
608
|
+
]));
|
|
609
|
+
}
|
|
610
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DbActionRequestsService, deps: [{ token: i3.HttpClient }, { token: i2.DbActionsInnerIdManagerService }, { token: HERUM_SHARED_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
611
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DbActionRequestsService });
|
|
612
|
+
}
|
|
613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DbActionRequestsService, decorators: [{
|
|
614
|
+
type: Injectable
|
|
615
|
+
}], ctorParameters: () => [{ type: i3.HttpClient }, { type: i2.DbActionsInnerIdManagerService }, { type: undefined, decorators: [{
|
|
616
|
+
type: Inject,
|
|
617
|
+
args: [HERUM_SHARED_CONFIG_TOKEN]
|
|
618
|
+
}] }] });
|
|
619
|
+
const DbActionsInconsistencyMap = {
|
|
620
|
+
groups: {
|
|
621
|
+
backendNaming: "members",
|
|
622
|
+
extension: {
|
|
623
|
+
"NEW_VALUE": {}
|
|
624
|
+
},
|
|
625
|
+
},
|
|
626
|
+
groupsPermissions: {
|
|
627
|
+
backendNaming: "permittedGroups",
|
|
628
|
+
extension: {
|
|
629
|
+
"NEW_VALUE": {
|
|
630
|
+
"permission": {
|
|
631
|
+
"update": true
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
groupsViewPermissions: {
|
|
637
|
+
backendNaming: "permittedGroups",
|
|
638
|
+
extension: {
|
|
639
|
+
"NEW_VALUE": {
|
|
640
|
+
"permission": {
|
|
641
|
+
"update": false
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
assignments: {
|
|
647
|
+
backendNaming: "assignments",
|
|
648
|
+
extension: {
|
|
649
|
+
"NEW_VALUE": {
|
|
650
|
+
"id": null,
|
|
651
|
+
assignmentMetadata
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
"collegeTeacherAssignments": {
|
|
656
|
+
backendNaming: "collegeTeacherAssignments",
|
|
657
|
+
extension: {
|
|
658
|
+
"NEW_VALUE": {
|
|
659
|
+
"id": null
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
"collegeStudentAssignments": {
|
|
664
|
+
backendNaming: "collegeStudentAssignments",
|
|
665
|
+
extension: {
|
|
666
|
+
"NEW_VALUE": {
|
|
667
|
+
"id": null
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
class DbActionToastService {
|
|
674
|
+
errorsHandlerService;
|
|
675
|
+
toastsService;
|
|
676
|
+
mongoUtilsService;
|
|
677
|
+
toastsTemplates;
|
|
678
|
+
constructor(errorsHandlerService, toastsService, mongoUtilsService) {
|
|
679
|
+
this.errorsHandlerService = errorsHandlerService;
|
|
680
|
+
this.toastsService = toastsService;
|
|
681
|
+
this.mongoUtilsService = mongoUtilsService;
|
|
682
|
+
this.errorsHandlerService.errorToast$?.subscribe(toastHttpResponseDependencies => this.createToastBasedOnHttpResponse(toastHttpResponseDependencies));
|
|
683
|
+
}
|
|
684
|
+
createToastBasedOnHttpResponse(toastHttpResponseDependencies) {
|
|
685
|
+
if (!toastHttpResponseDependencies)
|
|
686
|
+
return;
|
|
687
|
+
let urlRequest = toastHttpResponseDependencies?.url;
|
|
688
|
+
let mongoMethodDisplayedName = this.mongoUtilsService.getDisplayedNameForMongoMethodByUserActivity(urlRequest);
|
|
689
|
+
if (!mongoMethodDisplayedName)
|
|
690
|
+
return;
|
|
691
|
+
let status = this.setToastStatus(toastHttpResponseDependencies.status);
|
|
692
|
+
let content = status === toastStatuses.success ?
|
|
693
|
+
toastContext[status.toString()](mongoMethodDisplayedName) :
|
|
694
|
+
this.toastsService.findErrorMessageByStatusCode(toastHttpResponseDependencies.status.toString(), mongoMethodDisplayedName);
|
|
695
|
+
this.toastsService.showToast(toastContext.title(mongoMethodDisplayedName), content, status);
|
|
696
|
+
}
|
|
697
|
+
setToastStatus(statusCode) {
|
|
698
|
+
if (statusCode >= 200 && statusCode < 299)
|
|
699
|
+
return toastStatuses.success;
|
|
700
|
+
if (statusCode >= 400 && statusCode < 599)
|
|
701
|
+
return toastStatuses.error;
|
|
702
|
+
}
|
|
703
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DbActionToastService, deps: [{ token: ErrorsHandlerService }, { token: i2.ToastsService }, { token: MongoUtilsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
704
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DbActionToastService });
|
|
705
|
+
}
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DbActionToastService, decorators: [{
|
|
707
|
+
type: Injectable
|
|
708
|
+
}], ctorParameters: () => [{ type: ErrorsHandlerService }, { type: i2.ToastsService }, { type: MongoUtilsService }] });
|
|
431
709
|
|
|
432
710
|
class HerumToastsComponent {
|
|
433
711
|
toastsService;
|
|
@@ -438,12 +716,13 @@ class HerumToastsComponent {
|
|
|
438
716
|
transformDuration = 400;
|
|
439
717
|
leavingDuration = 7000;
|
|
440
718
|
gap = 16;
|
|
719
|
+
destroySubject$ = new Subject();
|
|
441
720
|
constructor(toastsService, changeDetectorRef) {
|
|
442
721
|
this.toastsService = toastsService;
|
|
443
722
|
this.changeDetectorRef = changeDetectorRef;
|
|
444
723
|
}
|
|
445
724
|
ngOnInit() {
|
|
446
|
-
this.toastsService.toast$.subscribe(newToast => this.handleNewToast(newToast));
|
|
725
|
+
this.toastsService.toast$.pipe(takeUntil(this.destroySubject$)).subscribe(newToast => this.handleNewToast(newToast));
|
|
447
726
|
}
|
|
448
727
|
handleNewToast(toast) {
|
|
449
728
|
if (!toast)
|
|
@@ -518,13 +797,17 @@ class HerumToastsComponent {
|
|
|
518
797
|
get successStatus() {
|
|
519
798
|
return toastStatuses.success;
|
|
520
799
|
}
|
|
521
|
-
|
|
800
|
+
ngOnDestroy() {
|
|
801
|
+
this.destroySubject$.next(null);
|
|
802
|
+
this.destroySubject$.unsubscribe();
|
|
803
|
+
}
|
|
804
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: HerumToastsComponent, deps: [{ token: i2.ToastsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
522
805
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: HerumToastsComponent, isStandalone: false, selector: "herum-toasts", viewQueries: [{ propertyName: "toastElements", predicate: ["toast"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"toasts?.length\">\r\n <div #toast class=\"herum-toast d-flex\" [ngClass]=\"[toast?.state ?? '',toast?.status ?? '']\"\r\n *ngFor=\"let toast of toasts; trackBy: _trackByFn\">\r\n <span [ngClass]=\"{'icons-color':toast?.status===successStatus}\"\r\n [innerHTML]=\"_toastStatusIcon(toast?.status) | safeHtml\">\r\n </span>\r\n\r\n <div class=\"d-flex flex-column\">\r\n <div class=\"section-title\"> {{toast?.title}}</div>\r\n <div class='toast-content'> {{toast?.content}}</div>\r\n </div>\r\n\r\n <img class=\"close-button\" src=\"assets/shared/icons/secondary-x.svg\" alt=\"close-icon\"\r\n (click)=\"_onHideToast(toast,true)\">\r\n </div>\r\n</ng-container>", styles: [".herum-toast{position:absolute;bottom:0;right:0;width:340px;padding:var(--standard-padding);border-radius:var(--border-radius);background-color:#fff;box-shadow:0 0 var(--box-shadow-blur) #00000029!important;transition:transform .4s ease-out,opacity .4s ease-out;transform:translate(100%);opacity:0}.herum-toast .icons-color{fill:var(--icons-color)}.herum-toast .status-image{height:22px;width:22px;margin-left:6px}.herum-toast .close-button{height:8px;left:8px;top:8px;position:absolute;cursor:pointer;margin-block-end:4px}.toast-content{flex-grow:1;flex-shrink:1}.enter{transform:translate(0);opacity:1}.success{border-right:solid 8px #4caf50}.information{border-right:solid 8px var(--information-color)}.error{border-right:solid 8px var(--error-color)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.SafeHtmlPipe, name: "safeHtml" }] });
|
|
523
806
|
}
|
|
524
807
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: HerumToastsComponent, decorators: [{
|
|
525
808
|
type: Component,
|
|
526
809
|
args: [{ standalone: false, selector: 'herum-toasts', template: "<ng-container *ngIf=\"toasts?.length\">\r\n <div #toast class=\"herum-toast d-flex\" [ngClass]=\"[toast?.state ?? '',toast?.status ?? '']\"\r\n *ngFor=\"let toast of toasts; trackBy: _trackByFn\">\r\n <span [ngClass]=\"{'icons-color':toast?.status===successStatus}\"\r\n [innerHTML]=\"_toastStatusIcon(toast?.status) | safeHtml\">\r\n </span>\r\n\r\n <div class=\"d-flex flex-column\">\r\n <div class=\"section-title\"> {{toast?.title}}</div>\r\n <div class='toast-content'> {{toast?.content}}</div>\r\n </div>\r\n\r\n <img class=\"close-button\" src=\"assets/shared/icons/secondary-x.svg\" alt=\"close-icon\"\r\n (click)=\"_onHideToast(toast,true)\">\r\n </div>\r\n</ng-container>", styles: [".herum-toast{position:absolute;bottom:0;right:0;width:340px;padding:var(--standard-padding);border-radius:var(--border-radius);background-color:#fff;box-shadow:0 0 var(--box-shadow-blur) #00000029!important;transition:transform .4s ease-out,opacity .4s ease-out;transform:translate(100%);opacity:0}.herum-toast .icons-color{fill:var(--icons-color)}.herum-toast .status-image{height:22px;width:22px;margin-left:6px}.herum-toast .close-button{height:8px;left:8px;top:8px;position:absolute;cursor:pointer;margin-block-end:4px}.toast-content{flex-grow:1;flex-shrink:1}.enter{transform:translate(0);opacity:1}.success{border-right:solid 8px #4caf50}.information{border-right:solid 8px var(--information-color)}.error{border-right:solid 8px var(--error-color)}\n"] }]
|
|
527
|
-
}], ctorParameters: () => [{ type: ToastsService }, { type: i0.ChangeDetectorRef }], propDecorators: { toastElements: [{
|
|
810
|
+
}], ctorParameters: () => [{ type: i2.ToastsService }, { type: i0.ChangeDetectorRef }], propDecorators: { toastElements: [{
|
|
528
811
|
type: ViewChildren,
|
|
529
812
|
args: ['toast']
|
|
530
813
|
}] } });
|
|
@@ -560,7 +843,7 @@ class HerumUploadsManagerComponent {
|
|
|
560
843
|
}
|
|
561
844
|
uploadsProgressMetadataSubscription() {
|
|
562
845
|
this.uploadsManagerService.uploadsProgressMetadata$
|
|
563
|
-
.pipe(takeUntil(this.destroySubject$))
|
|
846
|
+
.pipe(takeUntil$1(this.destroySubject$))
|
|
564
847
|
.subscribe(uploadsProgressMetadata => {
|
|
565
848
|
this.uploadsProgressMetadata = uploadsProgressMetadata;
|
|
566
849
|
this.averageProgressSum = this.calculateAverageProgressSum(uploadsProgressMetadata);
|
|
@@ -632,85 +915,66 @@ class HerumUploadsManagerComponent {
|
|
|
632
915
|
this.destroySubject$.complete();
|
|
633
916
|
}
|
|
634
917
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: HerumUploadsManagerComponent, deps: [{ token: UploadsManagerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
635
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: HerumUploadsManagerComponent, isStandalone: false, selector: "herum-uploads-manager", host: { listeners: { "window:beforeunload": "showConfirmationNativeMessage($event)" } }, ngImport: i0, template: "<div class=\"herum-uploads-layout shadow\" [ngClass]=\"{'open':isContainerOpen}\" *ngIf=\"uploadsProgressMetadata?.length\">\r\n <div class=\"herum-uploads-container-header\">\r\n <div class=\"herum-uploads-header\">\r\n <div class=\"herum-uploads-header-text\">\r\n <herum-ellipsis-loader *ngIf=\"!hasUploadProgressFinished\"></herum-ellipsis-loader>\r\n\r\n <p class=\"container-title\" #containerTitle\r\n [matTooltip]=\"_isTruncatedTitleElement(containerTitle)? (containerTitle$ | async) : '' \">\r\n {{containerTitle$ | async | ellipsis:containerTitle}}</p>\r\n </div>\r\n\r\n <div class=\"control-container\">\r\n <img class=\"control-button\"\r\n [ngClass]=\"{'open-chevron':isContainerOpen, 'closed-chevron':!isContainerOpen}\"\r\n src=\"assets/general/white-chevron.svg\" (click)=\"_onToggleUploadsContainer()\">\r\n\r\n <img class=\"control-button\" *ngIf=\"hasUploadProgressFinished\" src=\"assets/shared/icons/X.svg\"\r\n alt=\"close-icon\" (click)=\"_onClose()\">\r\n </div>\r\n </div>\r\n\r\n <herum-progress-bar [percentage]=\"averageProgressSum\" [percentagePosition]=\"'none'\" [borderRadius]=\"'none'\"\r\n [showBorder]=\"false\" [thickness]=\"'thin'\" [showPercentage]=\"false\" [color]=\"progressBarColor\">\r\n </herum-progress-bar>\r\n </div>\r\n\r\n <div class=\"herum-uploads-container\">\r\n <div *ngIf=\"numberOfFailedLoaders > 1\" class=\"upload-all upload-iteration cursor-pointer\"\r\n (click)=\"_onRetryFailedUploads()\">\r\n <div class=\"herum-upload-title w-100\">\r\n \u05D4\u05E2\u05DC\u05D4 \u05DE\u05D7\u05D3\u05E9 \u05E7\u05D1\u05E6\u05D9\u05DD \u05E9\u05E0\u05DB\u05E9\u05DC\u05D5\r\n </div>\r\n\r\n <div class=\"upload-file-image\">\r\n <img src=\"assets/files-icons/upload-file.svg\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"upload-iteration\"\r\n *ngFor=\"let uploadProgressMetadata of uploadsProgressMetadata; trackBy: _trackByFn\">\r\n <div class=\"herum-upload-container\">\r\n <span [ngClass]=\"_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error' : 'icons-color'\"\r\n [innerHTML]=\"_getFileIcon(uploadProgressMetadata.type) | safeHtml\">\r\n </span>\r\n\r\n <div class=\"herum-upload-text-container\">\r\n <p #uploadTitle class=\"herum-upload-title\"\r\n [ngClass]=\"{'error-font-color':_isUploadProgressStatusError(uploadProgressMetadata.status)}\"\r\n [matTooltip]=\"_isTruncatedTitleElement(uploadTitle) ? uploadProgressMetadata.title : ''\">\r\n {{uploadProgressMetadata.title | ellipsis:uploadTitle}}\r\n </p>\r\n\r\n <p\r\n [ngClass]=\"[_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error-font-color' :'disabled-text-color']\">\r\n {{_getUploadProgressDescription(uploadProgressMetadata)}}\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"center\">\r\n <herum-circular-progress-bar [fill]=\"false\"\r\n [percentage]=\"(uploadProgressMetadata.currentSize/uploadProgressMetadata.totalSize)*100\"\r\n *ngIf=\"uploadProgressMetadata.status === loadingStatus\">\r\n </herum-circular-progress-bar>\r\n\r\n <div class=\"images-container\">\r\n <img class=\"cursor-pointer\" *ngIf=\"_isUploadProgressStatusError(uploadProgressMetadata.status)\"\r\n src=\"assets/files-icons/upload-file.svg\"\r\n (click)=\"_onRetryFailedUpload(uploadProgressMetadata.id)\">\r\n\r\n <span\r\n *ngIf=\"uploadProgressMetadata.status === errorStatus || uploadProgressMetadata.status === successStatus\"\r\n [ngClass]=\"{'icons-color':uploadProgressMetadata.status===successStatus}\"\r\n [innerHTML]=\"_getUploadStatusIcon(uploadProgressMetadata.status) | safeHtml\">\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".herum-uploads-layout{border-radius:8px 8px 0 0;background-color:#fffc;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);z-index:
|
|
918
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: HerumUploadsManagerComponent, isStandalone: false, selector: "herum-uploads-manager", host: { listeners: { "window:beforeunload": "showConfirmationNativeMessage($event)" } }, ngImport: i0, template: "<div class=\"herum-uploads-layout shadow\" [ngClass]=\"{'open':isContainerOpen}\" *ngIf=\"uploadsProgressMetadata?.length\">\r\n <div class=\"herum-uploads-container-header\">\r\n <div class=\"herum-uploads-header\">\r\n <div class=\"herum-uploads-header-text\">\r\n <herum-ellipsis-loader *ngIf=\"!hasUploadProgressFinished\"></herum-ellipsis-loader>\r\n\r\n <p class=\"container-title\" #containerTitle\r\n [matTooltip]=\"_isTruncatedTitleElement(containerTitle)? (containerTitle$ | async) : '' \">\r\n {{containerTitle$ | async | ellipsis:containerTitle}}</p>\r\n </div>\r\n\r\n <div class=\"control-container\">\r\n <img class=\"control-button\"\r\n [ngClass]=\"{'open-chevron':isContainerOpen, 'closed-chevron':!isContainerOpen}\"\r\n src=\"assets/general/white-chevron.svg\" (click)=\"_onToggleUploadsContainer()\">\r\n\r\n <img class=\"control-button\" *ngIf=\"hasUploadProgressFinished\" src=\"assets/shared/icons/X.svg\"\r\n alt=\"close-icon\" (click)=\"_onClose()\">\r\n </div>\r\n </div>\r\n\r\n <herum-progress-bar [percentage]=\"averageProgressSum\" [percentagePosition]=\"'none'\" [borderRadius]=\"'none'\"\r\n [showBorder]=\"false\" [thickness]=\"'thin'\" [showPercentage]=\"false\" [color]=\"progressBarColor\">\r\n </herum-progress-bar>\r\n </div>\r\n\r\n <div class=\"herum-uploads-container\">\r\n <div *ngIf=\"numberOfFailedLoaders > 1\" class=\"upload-all upload-iteration cursor-pointer\"\r\n (click)=\"_onRetryFailedUploads()\">\r\n <div class=\"herum-upload-title w-100\">\r\n \u05D4\u05E2\u05DC\u05D4 \u05DE\u05D7\u05D3\u05E9 \u05E7\u05D1\u05E6\u05D9\u05DD \u05E9\u05E0\u05DB\u05E9\u05DC\u05D5\r\n </div>\r\n\r\n <div class=\"upload-file-image\">\r\n <img src=\"assets/files-icons/upload-file.svg\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"upload-iteration\"\r\n *ngFor=\"let uploadProgressMetadata of uploadsProgressMetadata; trackBy: _trackByFn\">\r\n <div class=\"herum-upload-container\">\r\n <span [ngClass]=\"_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error' : 'icons-color'\"\r\n [innerHTML]=\"_getFileIcon(uploadProgressMetadata.type) | safeHtml\">\r\n </span>\r\n\r\n <div class=\"herum-upload-text-container\">\r\n <p #uploadTitle class=\"herum-upload-title\"\r\n [ngClass]=\"{'error-font-color':_isUploadProgressStatusError(uploadProgressMetadata.status)}\"\r\n [matTooltip]=\"_isTruncatedTitleElement(uploadTitle) ? uploadProgressMetadata.title : ''\">\r\n {{uploadProgressMetadata.title | ellipsis:uploadTitle}}\r\n </p>\r\n\r\n <p\r\n [ngClass]=\"[_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error-font-color' :'disabled-text-color']\">\r\n {{_getUploadProgressDescription(uploadProgressMetadata)}}\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"center\">\r\n <herum-circular-progress-bar [fill]=\"false\"\r\n [percentage]=\"(uploadProgressMetadata.currentSize/uploadProgressMetadata.totalSize)*100\"\r\n *ngIf=\"uploadProgressMetadata.status === loadingStatus\">\r\n </herum-circular-progress-bar>\r\n\r\n <div class=\"images-container\">\r\n <img class=\"cursor-pointer\" *ngIf=\"_isUploadProgressStatusError(uploadProgressMetadata.status)\"\r\n src=\"assets/files-icons/upload-file.svg\"\r\n (click)=\"_onRetryFailedUpload(uploadProgressMetadata.id)\">\r\n\r\n <span\r\n *ngIf=\"uploadProgressMetadata.status === errorStatus || uploadProgressMetadata.status === successStatus\"\r\n [ngClass]=\"{'icons-color':uploadProgressMetadata.status===successStatus}\"\r\n [innerHTML]=\"_getUploadStatusIcon(uploadProgressMetadata.status) | safeHtml\">\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".herum-uploads-layout{border-radius:8px 8px 0 0;background-color:#fffc;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);z-index:var(--top-overlay-z-index);direction:rtl;width:350px}.herum-uploads-layout .herum-uploads-container-header{border-radius:8px 8px 0 0;background-color:#22213f;cursor:grab}.herum-uploads-layout .herum-uploads-container-header p{padding-block:12px;color:#fff;font-weight:700;margin:0;font-size:16px}.herum-uploads-layout .herum-uploads-container-header:active{cursor:grabbing}.herum-uploads-layout herum-progress-bar{background-color:#22213f}.herum-uploads-layout .herum-uploads-container{display:none}.herum-upload-text-container{width:80%}.herum-upload-title{line-height:1;font-weight:700;font-size:12px;width:100%;white-space:nowrap;margin-block-end:4px}.open{height:fit-content}.open .herum-uploads-container{overflow-y:auto;max-height:500px;display:flex;flex-direction:column;height:100%}.open .herum-uploads-container .herum-upload-container{display:flex;flex-direction:row;gap:8px;width:70%}.open .herum-uploads-container .herum-upload-container .error{fill:var(--error-color)}.open .herum-uploads-container .herum-upload-container .icons-color{stroke:var(--icons-color)}.open .upload-iteration{display:flex;justify-content:space-between;padding:12px;border-bottom:1px solid var(--chips-divider-color);align-items:center}.open .upload-all{padding-block:21px}.open .upload-iteration:hover{-webkit-backdrop-filter:blur(80px);backdrop-filter:blur(80px);animation:1s ease-in-out}.herum-uploads-header-text{display:flex;width:100%}.herum-uploads-header-text .container-title{width:80%;white-space:nowrap}.herum-uploads-header{display:flex;justify-content:space-between;padding-inline:16px;align-items:center}.herum-uploads-header .control-container{gap:16px;display:flex}.herum-uploads-header .control-container .control-button{width:10px;cursor:pointer}.upload-file-image{width:24px;display:flex;justify-content:center}herum-circular-progress-bar{display:flex;justify-content:center;align-items:center;height:24px;width:24px;transform:scale(1.2)}p{margin:0}.open-chevron{transform:rotate(90deg)}.images-container{display:flex;gap:12px}.icons-color{fill:var(--icons-color)}.icons-color ::ng-deep .generic-file-icon{stroke:var(--icons-color)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.HerumCircularProgressBarComponent, selector: "herum-circular-progress-bar", inputs: ["percentage", "fill", "size", "firstGradient", "fillColor", "showPercentage", "displayedContent", "displayedContentColorMatchesGradientColor"] }, { kind: "component", type: i3$1.HerumEllipsisLoaderComponent, selector: "herum-ellipsis-loader" }, { kind: "component", type: i3$1.HerumProgressBarComponent, selector: "herum-progress-bar", inputs: ["percentage", "invalidPercentage", "showPercentage", "percentagePosition", "type", "size", "color", "borderRadius", "total", "showBorder", "thickness"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.SafeHtmlPipe, name: "safeHtml" }, { kind: "pipe", type: i4.EllipsisPipe, name: "ellipsis" }] });
|
|
636
919
|
}
|
|
637
920
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: HerumUploadsManagerComponent, decorators: [{
|
|
638
921
|
type: Component,
|
|
639
|
-
args: [{ standalone: false, selector: 'herum-uploads-manager', template: "<div class=\"herum-uploads-layout shadow\" [ngClass]=\"{'open':isContainerOpen}\" *ngIf=\"uploadsProgressMetadata?.length\">\r\n <div class=\"herum-uploads-container-header\">\r\n <div class=\"herum-uploads-header\">\r\n <div class=\"herum-uploads-header-text\">\r\n <herum-ellipsis-loader *ngIf=\"!hasUploadProgressFinished\"></herum-ellipsis-loader>\r\n\r\n <p class=\"container-title\" #containerTitle\r\n [matTooltip]=\"_isTruncatedTitleElement(containerTitle)? (containerTitle$ | async) : '' \">\r\n {{containerTitle$ | async | ellipsis:containerTitle}}</p>\r\n </div>\r\n\r\n <div class=\"control-container\">\r\n <img class=\"control-button\"\r\n [ngClass]=\"{'open-chevron':isContainerOpen, 'closed-chevron':!isContainerOpen}\"\r\n src=\"assets/general/white-chevron.svg\" (click)=\"_onToggleUploadsContainer()\">\r\n\r\n <img class=\"control-button\" *ngIf=\"hasUploadProgressFinished\" src=\"assets/shared/icons/X.svg\"\r\n alt=\"close-icon\" (click)=\"_onClose()\">\r\n </div>\r\n </div>\r\n\r\n <herum-progress-bar [percentage]=\"averageProgressSum\" [percentagePosition]=\"'none'\" [borderRadius]=\"'none'\"\r\n [showBorder]=\"false\" [thickness]=\"'thin'\" [showPercentage]=\"false\" [color]=\"progressBarColor\">\r\n </herum-progress-bar>\r\n </div>\r\n\r\n <div class=\"herum-uploads-container\">\r\n <div *ngIf=\"numberOfFailedLoaders > 1\" class=\"upload-all upload-iteration cursor-pointer\"\r\n (click)=\"_onRetryFailedUploads()\">\r\n <div class=\"herum-upload-title w-100\">\r\n \u05D4\u05E2\u05DC\u05D4 \u05DE\u05D7\u05D3\u05E9 \u05E7\u05D1\u05E6\u05D9\u05DD \u05E9\u05E0\u05DB\u05E9\u05DC\u05D5\r\n </div>\r\n\r\n <div class=\"upload-file-image\">\r\n <img src=\"assets/files-icons/upload-file.svg\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"upload-iteration\"\r\n *ngFor=\"let uploadProgressMetadata of uploadsProgressMetadata; trackBy: _trackByFn\">\r\n <div class=\"herum-upload-container\">\r\n <span [ngClass]=\"_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error' : 'icons-color'\"\r\n [innerHTML]=\"_getFileIcon(uploadProgressMetadata.type) | safeHtml\">\r\n </span>\r\n\r\n <div class=\"herum-upload-text-container\">\r\n <p #uploadTitle class=\"herum-upload-title\"\r\n [ngClass]=\"{'error-font-color':_isUploadProgressStatusError(uploadProgressMetadata.status)}\"\r\n [matTooltip]=\"_isTruncatedTitleElement(uploadTitle) ? uploadProgressMetadata.title : ''\">\r\n {{uploadProgressMetadata.title | ellipsis:uploadTitle}}\r\n </p>\r\n\r\n <p\r\n [ngClass]=\"[_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error-font-color' :'disabled-text-color']\">\r\n {{_getUploadProgressDescription(uploadProgressMetadata)}}\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"center\">\r\n <herum-circular-progress-bar [fill]=\"false\"\r\n [percentage]=\"(uploadProgressMetadata.currentSize/uploadProgressMetadata.totalSize)*100\"\r\n *ngIf=\"uploadProgressMetadata.status === loadingStatus\">\r\n </herum-circular-progress-bar>\r\n\r\n <div class=\"images-container\">\r\n <img class=\"cursor-pointer\" *ngIf=\"_isUploadProgressStatusError(uploadProgressMetadata.status)\"\r\n src=\"assets/files-icons/upload-file.svg\"\r\n (click)=\"_onRetryFailedUpload(uploadProgressMetadata.id)\">\r\n\r\n <span\r\n *ngIf=\"uploadProgressMetadata.status === errorStatus || uploadProgressMetadata.status === successStatus\"\r\n [ngClass]=\"{'icons-color':uploadProgressMetadata.status===successStatus}\"\r\n [innerHTML]=\"_getUploadStatusIcon(uploadProgressMetadata.status) | safeHtml\">\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".herum-uploads-layout{border-radius:8px 8px 0 0;background-color:#fffc;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);z-index:
|
|
922
|
+
args: [{ standalone: false, selector: 'herum-uploads-manager', template: "<div class=\"herum-uploads-layout shadow\" [ngClass]=\"{'open':isContainerOpen}\" *ngIf=\"uploadsProgressMetadata?.length\">\r\n <div class=\"herum-uploads-container-header\">\r\n <div class=\"herum-uploads-header\">\r\n <div class=\"herum-uploads-header-text\">\r\n <herum-ellipsis-loader *ngIf=\"!hasUploadProgressFinished\"></herum-ellipsis-loader>\r\n\r\n <p class=\"container-title\" #containerTitle\r\n [matTooltip]=\"_isTruncatedTitleElement(containerTitle)? (containerTitle$ | async) : '' \">\r\n {{containerTitle$ | async | ellipsis:containerTitle}}</p>\r\n </div>\r\n\r\n <div class=\"control-container\">\r\n <img class=\"control-button\"\r\n [ngClass]=\"{'open-chevron':isContainerOpen, 'closed-chevron':!isContainerOpen}\"\r\n src=\"assets/general/white-chevron.svg\" (click)=\"_onToggleUploadsContainer()\">\r\n\r\n <img class=\"control-button\" *ngIf=\"hasUploadProgressFinished\" src=\"assets/shared/icons/X.svg\"\r\n alt=\"close-icon\" (click)=\"_onClose()\">\r\n </div>\r\n </div>\r\n\r\n <herum-progress-bar [percentage]=\"averageProgressSum\" [percentagePosition]=\"'none'\" [borderRadius]=\"'none'\"\r\n [showBorder]=\"false\" [thickness]=\"'thin'\" [showPercentage]=\"false\" [color]=\"progressBarColor\">\r\n </herum-progress-bar>\r\n </div>\r\n\r\n <div class=\"herum-uploads-container\">\r\n <div *ngIf=\"numberOfFailedLoaders > 1\" class=\"upload-all upload-iteration cursor-pointer\"\r\n (click)=\"_onRetryFailedUploads()\">\r\n <div class=\"herum-upload-title w-100\">\r\n \u05D4\u05E2\u05DC\u05D4 \u05DE\u05D7\u05D3\u05E9 \u05E7\u05D1\u05E6\u05D9\u05DD \u05E9\u05E0\u05DB\u05E9\u05DC\u05D5\r\n </div>\r\n\r\n <div class=\"upload-file-image\">\r\n <img src=\"assets/files-icons/upload-file.svg\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"upload-iteration\"\r\n *ngFor=\"let uploadProgressMetadata of uploadsProgressMetadata; trackBy: _trackByFn\">\r\n <div class=\"herum-upload-container\">\r\n <span [ngClass]=\"_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error' : 'icons-color'\"\r\n [innerHTML]=\"_getFileIcon(uploadProgressMetadata.type) | safeHtml\">\r\n </span>\r\n\r\n <div class=\"herum-upload-text-container\">\r\n <p #uploadTitle class=\"herum-upload-title\"\r\n [ngClass]=\"{'error-font-color':_isUploadProgressStatusError(uploadProgressMetadata.status)}\"\r\n [matTooltip]=\"_isTruncatedTitleElement(uploadTitle) ? uploadProgressMetadata.title : ''\">\r\n {{uploadProgressMetadata.title | ellipsis:uploadTitle}}\r\n </p>\r\n\r\n <p\r\n [ngClass]=\"[_isUploadProgressStatusError(uploadProgressMetadata.status)? 'error-font-color' :'disabled-text-color']\">\r\n {{_getUploadProgressDescription(uploadProgressMetadata)}}\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"center\">\r\n <herum-circular-progress-bar [fill]=\"false\"\r\n [percentage]=\"(uploadProgressMetadata.currentSize/uploadProgressMetadata.totalSize)*100\"\r\n *ngIf=\"uploadProgressMetadata.status === loadingStatus\">\r\n </herum-circular-progress-bar>\r\n\r\n <div class=\"images-container\">\r\n <img class=\"cursor-pointer\" *ngIf=\"_isUploadProgressStatusError(uploadProgressMetadata.status)\"\r\n src=\"assets/files-icons/upload-file.svg\"\r\n (click)=\"_onRetryFailedUpload(uploadProgressMetadata.id)\">\r\n\r\n <span\r\n *ngIf=\"uploadProgressMetadata.status === errorStatus || uploadProgressMetadata.status === successStatus\"\r\n [ngClass]=\"{'icons-color':uploadProgressMetadata.status===successStatus}\"\r\n [innerHTML]=\"_getUploadStatusIcon(uploadProgressMetadata.status) | safeHtml\">\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".herum-uploads-layout{border-radius:8px 8px 0 0;background-color:#fffc;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);z-index:var(--top-overlay-z-index);direction:rtl;width:350px}.herum-uploads-layout .herum-uploads-container-header{border-radius:8px 8px 0 0;background-color:#22213f;cursor:grab}.herum-uploads-layout .herum-uploads-container-header p{padding-block:12px;color:#fff;font-weight:700;margin:0;font-size:16px}.herum-uploads-layout .herum-uploads-container-header:active{cursor:grabbing}.herum-uploads-layout herum-progress-bar{background-color:#22213f}.herum-uploads-layout .herum-uploads-container{display:none}.herum-upload-text-container{width:80%}.herum-upload-title{line-height:1;font-weight:700;font-size:12px;width:100%;white-space:nowrap;margin-block-end:4px}.open{height:fit-content}.open .herum-uploads-container{overflow-y:auto;max-height:500px;display:flex;flex-direction:column;height:100%}.open .herum-uploads-container .herum-upload-container{display:flex;flex-direction:row;gap:8px;width:70%}.open .herum-uploads-container .herum-upload-container .error{fill:var(--error-color)}.open .herum-uploads-container .herum-upload-container .icons-color{stroke:var(--icons-color)}.open .upload-iteration{display:flex;justify-content:space-between;padding:12px;border-bottom:1px solid var(--chips-divider-color);align-items:center}.open .upload-all{padding-block:21px}.open .upload-iteration:hover{-webkit-backdrop-filter:blur(80px);backdrop-filter:blur(80px);animation:1s ease-in-out}.herum-uploads-header-text{display:flex;width:100%}.herum-uploads-header-text .container-title{width:80%;white-space:nowrap}.herum-uploads-header{display:flex;justify-content:space-between;padding-inline:16px;align-items:center}.herum-uploads-header .control-container{gap:16px;display:flex}.herum-uploads-header .control-container .control-button{width:10px;cursor:pointer}.upload-file-image{width:24px;display:flex;justify-content:center}herum-circular-progress-bar{display:flex;justify-content:center;align-items:center;height:24px;width:24px;transform:scale(1.2)}p{margin:0}.open-chevron{transform:rotate(90deg)}.images-container{display:flex;gap:12px}.icons-color{fill:var(--icons-color)}.icons-color ::ng-deep .generic-file-icon{stroke:var(--icons-color)}\n"] }]
|
|
640
923
|
}], ctorParameters: () => [{ type: UploadsManagerService }], propDecorators: { showConfirmationNativeMessage: [{
|
|
641
924
|
type: HostListener,
|
|
642
925
|
args: ['window:beforeunload', ['$event']]
|
|
643
926
|
}] } });
|
|
644
927
|
|
|
645
|
-
class
|
|
646
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type:
|
|
647
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.17", ngImport: i0, type:
|
|
928
|
+
class HerumSharedMongoModule {
|
|
929
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: HerumSharedMongoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
930
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.17", ngImport: i0, type: HerumSharedMongoModule, declarations: [HerumToastsComponent,
|
|
648
931
|
HerumUploadsManagerComponent], imports: [CommonModule,
|
|
649
932
|
PipesModule,
|
|
650
933
|
AtomsModule], exports: [HerumToastsComponent,
|
|
651
934
|
HerumUploadsManagerComponent] });
|
|
652
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type:
|
|
653
|
-
|
|
935
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: HerumSharedMongoModule, providers: [
|
|
936
|
+
DbActionRequestsService,
|
|
937
|
+
DbActionToastService,
|
|
938
|
+
DependentsService,
|
|
939
|
+
ErrorsHandlerService,
|
|
940
|
+
UploadsManagerService
|
|
654
941
|
], imports: [CommonModule,
|
|
655
942
|
PipesModule,
|
|
656
943
|
AtomsModule] });
|
|
657
944
|
}
|
|
658
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type:
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: HerumSharedMongoModule, decorators: [{
|
|
659
946
|
type: NgModule,
|
|
660
947
|
args: [{
|
|
661
948
|
declarations: [
|
|
662
949
|
HerumToastsComponent,
|
|
663
950
|
HerumUploadsManagerComponent,
|
|
664
951
|
],
|
|
665
|
-
exports: [
|
|
666
|
-
HerumToastsComponent,
|
|
667
|
-
HerumUploadsManagerComponent,
|
|
668
|
-
],
|
|
669
952
|
imports: [
|
|
670
953
|
CommonModule,
|
|
671
954
|
PipesModule,
|
|
672
955
|
AtomsModule
|
|
673
956
|
],
|
|
674
957
|
providers: [
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
}]
|
|
678
|
-
}] });
|
|
679
|
-
|
|
680
|
-
class MongoModule {
|
|
681
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MongoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
682
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.17", ngImport: i0, type: MongoModule, imports: [CommonModule,
|
|
683
|
-
MongoMoleculesModule], exports: [MongoMoleculesModule] });
|
|
684
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MongoModule, providers: [
|
|
685
|
-
DependentsService,
|
|
686
|
-
ErrorsHandlerService,
|
|
687
|
-
ToastsService,
|
|
688
|
-
UploadsManagerService
|
|
689
|
-
], imports: [CommonModule,
|
|
690
|
-
MongoMoleculesModule, MongoMoleculesModule] });
|
|
691
|
-
}
|
|
692
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MongoModule, decorators: [{
|
|
693
|
-
type: NgModule,
|
|
694
|
-
args: [{
|
|
695
|
-
imports: [
|
|
696
|
-
CommonModule,
|
|
697
|
-
MongoMoleculesModule
|
|
698
|
-
],
|
|
699
|
-
providers: [
|
|
958
|
+
DbActionRequestsService,
|
|
959
|
+
DbActionToastService,
|
|
700
960
|
DependentsService,
|
|
701
961
|
ErrorsHandlerService,
|
|
702
|
-
ToastsService,
|
|
703
962
|
UploadsManagerService
|
|
704
963
|
],
|
|
705
964
|
exports: [
|
|
706
|
-
|
|
707
|
-
|
|
965
|
+
HerumToastsComponent,
|
|
966
|
+
HerumUploadsManagerComponent,
|
|
967
|
+
],
|
|
708
968
|
}]
|
|
709
969
|
}] });
|
|
710
970
|
|
|
971
|
+
/**
|
|
972
|
+
* @file Automatically generated by barrelsby.
|
|
973
|
+
*/
|
|
974
|
+
|
|
711
975
|
/**
|
|
712
976
|
* Generated bundle index. Do not edit.
|
|
713
977
|
*/
|
|
714
978
|
|
|
715
|
-
export { DependentsService, ErrorsHandlerService, HerumToastsComponent, HerumUploadsManagerComponent,
|
|
979
|
+
export { DbActionRequestsService, DbActionToastService, DependentsService, ErrorsHandlerService, HerumSharedMongoModule, HerumToastsComponent, HerumUploadsManagerComponent, MongoUtilsService, UploadsManagerService, getMongoMethodsDisplayedNamesMap };
|
|
716
980
|
//# sourceMappingURL=herum-shared-mongo.mjs.map
|