ngssm-remote-data 20.3.10 → 21.1.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.
- package/fesm2022/ngssm-remote-data-testing.mjs +4 -6
- package/fesm2022/ngssm-remote-data-testing.mjs.map +1 -1
- package/fesm2022/ngssm-remote-data.mjs +116 -118
- package/fesm2022/ngssm-remote-data.mjs.map +1 -1
- package/package.json +4 -4
- package/{index.d.ts → types/ngssm-remote-data.d.ts} +5 -5
- /package/{testing/index.d.ts → types/ngssm-remote-data-testing.d.ts} +0 -0
|
@@ -10,9 +10,7 @@ import { StoreMock } from 'ngssm-store/testing';
|
|
|
10
10
|
* Provides methods to set the status or error of a remote call.
|
|
11
11
|
*/
|
|
12
12
|
class NgssmRemoteCallSetter {
|
|
13
|
-
|
|
14
|
-
this.store = inject(Store);
|
|
15
|
-
}
|
|
13
|
+
store = inject(Store);
|
|
16
14
|
/**
|
|
17
15
|
* Initializes the given remote call in the state.
|
|
18
16
|
* @param remoteCallId The identifier of the remote call
|
|
@@ -60,10 +58,10 @@ class NgssmRemoteCallSetter {
|
|
|
60
58
|
});
|
|
61
59
|
return this;
|
|
62
60
|
}
|
|
63
|
-
static
|
|
64
|
-
static
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallSetter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
62
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallSetter });
|
|
65
63
|
}
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallSetter, decorators: [{
|
|
67
65
|
type: Injectable
|
|
68
66
|
}] });
|
|
69
67
|
const ngssmRemoteCallSetter = () => TestBed.inject(NgssmRemoteCallSetter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-remote-data-testing.mjs","sources":["../../../projects/ngssm-remote-data/testing/src/ngssm-remote-call-setter.ts","../../../projects/ngssm-remote-data/testing/src/provide-ngssm-remote-call-testing.ts","../../../projects/ngssm-remote-data/testing/ngssm-remote-data-testing.ts"],"sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { TestBed } from '@angular/core/testing';\n\nimport { getDefaultRemoteCall, RemoteCallStatus, updateNgssmRemoteCallState } from 'ngssm-remote-data';\nimport { Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\n/**\n * Utility service for setting and updating remote call status and errors in the StoreMock during tests.\n * Provides methods to set the status or error of a remote call.\n */\n@Injectable()\nexport class NgssmRemoteCallSetter {\n public readonly store = inject(Store) as unknown as StoreMock;\n\n /**\n * Initializes the given remote call in the state.\n * @param remoteCallId The identifier of the remote call\n * @returns The NgssmRemoteCallSetter instance for chaining.\n */\n public initRemoteCall(remoteCallId: string): NgssmRemoteCallSetter {\n this.store.stateValue = updateNgssmRemoteCallState(this.store.stateValue, {\n remoteCalls: {\n [remoteCallId]: {\n $set: getDefaultRemoteCall()\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the status of a remote call in the StoreMock.\n * @param remoteCallId The identifier of the remote call.\n * @param status The new status to set.\n * @returns The NgssmRemoteCallSetter instance for chaining.\n */\n public setRemoteCallStatus(remoteCallId: string, status: RemoteCallStatus): NgssmRemoteCallSetter {\n this.store.stateValue = updateNgssmRemoteCallState(this.store.stateValue, {\n remoteCalls: {\n [remoteCallId]: {\n status: { $set: status }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the error of a remote call in the StoreMock.\n * @param remoteCallId The identifier of the remote call.\n * @param error The error to set (optional).\n * @returns The NgssmRemoteCallSetter instance for chaining.\n */\n public setRemoteCallError(remoteCallId: string, error?: HttpErrorResponse): NgssmRemoteCallSetter {\n this.store.stateValue = updateNgssmRemoteCallState(this.store.stateValue, {\n remoteCalls: {\n [remoteCallId]: {\n httpErrorResponse: { $set: error }\n }\n }\n });\n\n return this;\n }\n}\n\nexport const ngssmRemoteCallSetter = () => TestBed.inject(NgssmRemoteCallSetter);\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';\n\nimport { Logger, Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\nimport { NgssmRemoteCallStateSpecification, NgssmRemoteCallStateInitializer, RemoteCallResultProcessor } from 'ngssm-remote-data';\nimport { NgssmRemoteCallSetter } from './ngssm-remote-call-setter';\n\n/**\n * App initializer that sets up the NgssmRemoteCall state and sources in the StoreMock for testing purposes.\n * Throws an error if StoreMock is not registered.\n */\nexport const ngssmRemoteCallStateAndRemoteCallsInitializer = () => {\n const logger = inject(Logger);\n logger.information('[ngssm-remote-call-testing] Initialization of state and sources');\n const store = inject(Store);\n if (!(store instanceof StoreMock)) {\n throw new Error('StoreMock is not registered.');\n }\n\n store.stateValue = {\n ...store.stateValue,\n [NgssmRemoteCallStateSpecification.featureStateKey]: NgssmRemoteCallStateSpecification.initialState\n };\n\n const stateInitializer = inject(NgssmRemoteCallStateInitializer);\n store.stateValue = stateInitializer.initializeState(store.stateValue);\n};\n\n/**\n * Provides environment providers for remote call testing, including the state initializer and helper services.\n */\nexport const provideNgssmRemoteCallTesting = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideAppInitializer(ngssmRemoteCallStateAndRemoteCallsInitializer),\n NgssmRemoteCallStateInitializer,\n NgssmRemoteCallSetter,\n {\n provide: RemoteCallResultProcessor,\n useValue: {\n processRemoteCallError: () => {\n // nothing to do. Used for testing\n },\n processRemoteCallSuccess: () => {\n // nothing to do. Used for testing\n }\n }\n }\n ]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAQA;;;AAGG;MAEU,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"ngssm-remote-data-testing.mjs","sources":["../../../projects/ngssm-remote-data/testing/src/ngssm-remote-call-setter.ts","../../../projects/ngssm-remote-data/testing/src/provide-ngssm-remote-call-testing.ts","../../../projects/ngssm-remote-data/testing/ngssm-remote-data-testing.ts"],"sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { TestBed } from '@angular/core/testing';\n\nimport { getDefaultRemoteCall, RemoteCallStatus, updateNgssmRemoteCallState } from 'ngssm-remote-data';\nimport { Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\n/**\n * Utility service for setting and updating remote call status and errors in the StoreMock during tests.\n * Provides methods to set the status or error of a remote call.\n */\n@Injectable()\nexport class NgssmRemoteCallSetter {\n public readonly store = inject(Store) as unknown as StoreMock;\n\n /**\n * Initializes the given remote call in the state.\n * @param remoteCallId The identifier of the remote call\n * @returns The NgssmRemoteCallSetter instance for chaining.\n */\n public initRemoteCall(remoteCallId: string): NgssmRemoteCallSetter {\n this.store.stateValue = updateNgssmRemoteCallState(this.store.stateValue, {\n remoteCalls: {\n [remoteCallId]: {\n $set: getDefaultRemoteCall()\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the status of a remote call in the StoreMock.\n * @param remoteCallId The identifier of the remote call.\n * @param status The new status to set.\n * @returns The NgssmRemoteCallSetter instance for chaining.\n */\n public setRemoteCallStatus(remoteCallId: string, status: RemoteCallStatus): NgssmRemoteCallSetter {\n this.store.stateValue = updateNgssmRemoteCallState(this.store.stateValue, {\n remoteCalls: {\n [remoteCallId]: {\n status: { $set: status }\n }\n }\n });\n\n return this;\n }\n\n /**\n * Sets the error of a remote call in the StoreMock.\n * @param remoteCallId The identifier of the remote call.\n * @param error The error to set (optional).\n * @returns The NgssmRemoteCallSetter instance for chaining.\n */\n public setRemoteCallError(remoteCallId: string, error?: HttpErrorResponse): NgssmRemoteCallSetter {\n this.store.stateValue = updateNgssmRemoteCallState(this.store.stateValue, {\n remoteCalls: {\n [remoteCallId]: {\n httpErrorResponse: { $set: error }\n }\n }\n });\n\n return this;\n }\n}\n\nexport const ngssmRemoteCallSetter = () => TestBed.inject(NgssmRemoteCallSetter);\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';\n\nimport { Logger, Store } from 'ngssm-store';\nimport { StoreMock } from 'ngssm-store/testing';\n\nimport { NgssmRemoteCallStateSpecification, NgssmRemoteCallStateInitializer, RemoteCallResultProcessor } from 'ngssm-remote-data';\nimport { NgssmRemoteCallSetter } from './ngssm-remote-call-setter';\n\n/**\n * App initializer that sets up the NgssmRemoteCall state and sources in the StoreMock for testing purposes.\n * Throws an error if StoreMock is not registered.\n */\nexport const ngssmRemoteCallStateAndRemoteCallsInitializer = () => {\n const logger = inject(Logger);\n logger.information('[ngssm-remote-call-testing] Initialization of state and sources');\n const store = inject(Store);\n if (!(store instanceof StoreMock)) {\n throw new Error('StoreMock is not registered.');\n }\n\n store.stateValue = {\n ...store.stateValue,\n [NgssmRemoteCallStateSpecification.featureStateKey]: NgssmRemoteCallStateSpecification.initialState\n };\n\n const stateInitializer = inject(NgssmRemoteCallStateInitializer);\n store.stateValue = stateInitializer.initializeState(store.stateValue);\n};\n\n/**\n * Provides environment providers for remote call testing, including the state initializer and helper services.\n */\nexport const provideNgssmRemoteCallTesting = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideAppInitializer(ngssmRemoteCallStateAndRemoteCallsInitializer),\n NgssmRemoteCallStateInitializer,\n NgssmRemoteCallSetter,\n {\n provide: RemoteCallResultProcessor,\n useValue: {\n processRemoteCallError: () => {\n // nothing to do. Used for testing\n },\n processRemoteCallSuccess: () => {\n // nothing to do. Used for testing\n }\n }\n }\n ]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAQA;;;AAGG;MAEU,qBAAqB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;AACI,MAAM,6CAA6C,GAAG,MAAK;AAChE,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,IAAA,MAAM,CAAC,WAAW,CAAC,iEAAiE,CAAC;AACrF,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,IAAA,IAAI,EAAE,KAAK,YAAY,SAAS,CAAC,EAAE;AACjC,QAAA,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC;IACjD;IAEA,KAAK,CAAC,UAAU,GAAG;QACjB,GAAG,KAAK,CAAC,UAAU;AACnB,QAAA,CAAC,iCAAiC,CAAC,eAAe,GAAG,iCAAiC,CAAC;KACxF;AAED,IAAA,MAAM,gBAAgB,GAAG,MAAM,CAAC,+BAA+B,CAAC;IAChE,KAAK,CAAC,UAAU,GAAG,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC;AACvE;AAEA;;AAEG;AACI,MAAM,6BAA6B,GAAG,MAA2B;AACtE,IAAA,OAAO,wBAAwB,CAAC;QAC9B,qBAAqB,CAAC,6CAA6C,CAAC;QACpE,+BAA+B;QAC/B,qBAAqB;AACrB,QAAA;AACE,YAAA,OAAO,EAAE,yBAAyB;AAClC,YAAA,QAAQ,EAAE;gBACR,sBAAsB,EAAE,MAAK;;gBAE7B,CAAC;gBACD,wBAAwB,EAAE,MAAK;;gBAE/B;AACD;AACF;AACF,KAAA,CAAC;AACJ;;ACjDA;;AAEG;;;;"}
|
|
@@ -2,8 +2,8 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, makeEnvironmentProviders, inject, Injectable, signal, input, effect, ChangeDetectionStrategy, Component, EnvironmentInjector, runInInjectionContext, Injector } from '@angular/core';
|
|
3
3
|
import { __decorate } from 'tslib';
|
|
4
4
|
import update from 'immutability-helper';
|
|
5
|
-
import { NgSsmFeatureState, Store, createSignal, provideReducer, provideEffects,
|
|
6
|
-
import { DatePipe
|
|
5
|
+
import { NgSsmFeatureState, Store, createSignal, NGSSM_STATE_INITIALIZER, provideReducer, provideEffects, provideReducers, Logger } from 'ngssm-store';
|
|
6
|
+
import { DatePipe } from '@angular/common';
|
|
7
7
|
import * as i2 from '@angular/material/icon';
|
|
8
8
|
import { MatIconModule } from '@angular/material/icon';
|
|
9
9
|
import * as i2$1 from '@angular/material/button';
|
|
@@ -58,8 +58,8 @@ const updateRemoteDataState = (state, command) => update(state, {
|
|
|
58
58
|
[RemoteDataStateSpecification.featureStateKey]: command
|
|
59
59
|
});
|
|
60
60
|
let RemoteDataStateSpecification = class RemoteDataStateSpecification {
|
|
61
|
-
static
|
|
62
|
-
static
|
|
61
|
+
static featureStateKey = 'remote-data-state';
|
|
62
|
+
static initialState = {};
|
|
63
63
|
};
|
|
64
64
|
RemoteDataStateSpecification = __decorate([
|
|
65
65
|
NgSsmFeatureState({
|
|
@@ -79,28 +79,33 @@ var RemoteDataActionType;
|
|
|
79
79
|
})(RemoteDataActionType || (RemoteDataActionType = {}));
|
|
80
80
|
|
|
81
81
|
class LoadRemoteDataAction {
|
|
82
|
+
remoteDataKey;
|
|
83
|
+
params;
|
|
84
|
+
type = RemoteDataActionType.loadRemoteData;
|
|
82
85
|
constructor(remoteDataKey, params) {
|
|
83
86
|
this.remoteDataKey = remoteDataKey;
|
|
84
87
|
this.params = params;
|
|
85
|
-
this.type = RemoteDataActionType.loadRemoteData;
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
class RegisterLoadedRemoteDataAction {
|
|
92
|
+
remoteDataKey;
|
|
93
|
+
status;
|
|
94
|
+
data;
|
|
95
|
+
message;
|
|
96
|
+
remoteCallError;
|
|
97
|
+
type = RemoteDataActionType.registerLoadedRemoteData;
|
|
90
98
|
constructor(remoteDataKey, status, data, message, remoteCallError) {
|
|
91
99
|
this.remoteDataKey = remoteDataKey;
|
|
92
100
|
this.status = status;
|
|
93
101
|
this.data = data;
|
|
94
102
|
this.message = message;
|
|
95
103
|
this.remoteCallError = remoteCallError;
|
|
96
|
-
this.type = RemoteDataActionType.registerLoadedRemoteData;
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
|
|
100
107
|
class RemoteDataLoadingGuard {
|
|
101
|
-
|
|
102
|
-
this.store = inject(Store);
|
|
103
|
-
}
|
|
108
|
+
store = inject(Store);
|
|
104
109
|
canActivate(route) {
|
|
105
110
|
const parameters = route.data;
|
|
106
111
|
(parameters?.remoteDataItems ?? []).forEach((item) => {
|
|
@@ -108,10 +113,10 @@ class RemoteDataLoadingGuard {
|
|
|
108
113
|
});
|
|
109
114
|
return true;
|
|
110
115
|
}
|
|
111
|
-
static
|
|
112
|
-
static
|
|
116
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataLoadingGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
117
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataLoadingGuard, providedIn: 'root' });
|
|
113
118
|
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataLoadingGuard, decorators: [{
|
|
115
120
|
type: Injectable,
|
|
116
121
|
args: [{
|
|
117
122
|
providedIn: 'root'
|
|
@@ -126,14 +131,14 @@ const ngssmReloadRemoteData = (remoteDataKey, params = { forceReload: true }) =>
|
|
|
126
131
|
|
|
127
132
|
const datePipe = new DatePipe('en-US');
|
|
128
133
|
class NgssmRemoteDataReloadButtonComponent {
|
|
134
|
+
tooltipMessage = signal('', ...(ngDevMode ? [{ debugName: "tooltipMessage" }] : []));
|
|
135
|
+
disabled = signal(true, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
136
|
+
inLoadingStatus = signal(false, ...(ngDevMode ? [{ debugName: "inLoadingStatus" }] : []));
|
|
137
|
+
actionTypes = input([], ...(ngDevMode ? [{ debugName: "actionTypes" }] : []));
|
|
138
|
+
remoteDataKeys = input([], ...(ngDevMode ? [{ debugName: "remoteDataKeys" }] : []));
|
|
139
|
+
store = inject(Store);
|
|
140
|
+
remoteDataState = createSignal((state) => selectRemoteDataState(state));
|
|
129
141
|
constructor() {
|
|
130
|
-
this.store = inject(Store);
|
|
131
|
-
this.remoteDataState = createSignal((state) => selectRemoteDataState(state));
|
|
132
|
-
this.tooltipMessage = signal('', ...(ngDevMode ? [{ debugName: "tooltipMessage" }] : []));
|
|
133
|
-
this.disabled = signal(true, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
134
|
-
this.inLoadingStatus = signal(false, ...(ngDevMode ? [{ debugName: "inLoadingStatus" }] : []));
|
|
135
|
-
this.actionTypes = input([], ...(ngDevMode ? [{ debugName: "actionTypes" }] : []));
|
|
136
|
-
this.remoteDataKeys = input([], ...(ngDevMode ? [{ debugName: "remoteDataKeys" }] : []));
|
|
137
142
|
effect(() => {
|
|
138
143
|
const remoteDataState = this.remoteDataState();
|
|
139
144
|
const keys = this.remoteDataKeys();
|
|
@@ -159,60 +164,55 @@ class NgssmRemoteDataReloadButtonComponent {
|
|
|
159
164
|
this.remoteDataKeys().forEach((key) => this.store.dispatchAction(new LoadRemoteDataAction(key, { forceReload: true, keepStoredGetterParams: true })));
|
|
160
165
|
this.actionTypes().forEach((type) => this.store.dispatchActionType(type));
|
|
161
166
|
}
|
|
162
|
-
static
|
|
163
|
-
static
|
|
167
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteDataReloadButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
168
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: NgssmRemoteDataReloadButtonComponent, isStandalone: true, selector: "ngssm-remote-data-reload-button", inputs: { actionTypes: { classPropertyName: "actionTypes", publicName: "actionTypes", isSignal: true, isRequired: false, transformFunction: null }, remoteDataKeys: { classPropertyName: "remoteDataKeys", publicName: "remoteDataKeys", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button\n mat-icon-button\n color=\"primary\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"disabled() === true\"\n id=\"reloadButton\">\n @if (inLoadingStatus()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n }\n</button>\n", dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
164
169
|
}
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteDataReloadButtonComponent, decorators: [{
|
|
166
171
|
type: Component,
|
|
167
|
-
args: [{ selector: 'ngssm-remote-data-reload-button', imports: [
|
|
172
|
+
args: [{ selector: 'ngssm-remote-data-reload-button', imports: [MatIconModule, MatButtonModule, MatTooltipModule, MatProgressSpinnerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n mat-icon-button\n color=\"primary\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"disabled() === true\"\n id=\"reloadButton\">\n @if (inLoadingStatus()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n }\n</button>\n" }]
|
|
168
173
|
}], ctorParameters: () => [], propDecorators: { actionTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionTypes", required: false }] }], remoteDataKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "remoteDataKeys", required: false }] }] } });
|
|
169
174
|
|
|
170
175
|
class NgssmCachesDisplayButtonComponent {
|
|
171
|
-
|
|
172
|
-
this.store = inject(Store);
|
|
173
|
-
}
|
|
176
|
+
store = inject(Store);
|
|
174
177
|
displayCaches() {
|
|
175
178
|
this.store.dispatchActionType(RemoteDataActionType.displayCaches);
|
|
176
179
|
}
|
|
177
|
-
static
|
|
178
|
-
static
|
|
180
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmCachesDisplayButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: NgssmCachesDisplayButtonComponent, isStandalone: true, selector: "ngssm-caches-display-button", ngImport: i0, template: "<button mat-icon-button matTooltip=\"Display caches\" (click)=\"displayCaches()\">\n <mat-icon class=\"fa-solid fa-cloud-bolt\"></mat-icon>\n</button>\n", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
179
182
|
}
|
|
180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmCachesDisplayButtonComponent, decorators: [{
|
|
181
184
|
type: Component,
|
|
182
|
-
args: [{ selector: 'ngssm-caches-display-button', imports: [
|
|
185
|
+
args: [{ selector: 'ngssm-caches-display-button', imports: [MatButtonModule, MatIconModule, MatTooltipModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button mat-icon-button matTooltip=\"Display caches\" (click)=\"displayCaches()\">\n <mat-icon class=\"fa-solid fa-cloud-bolt\"></mat-icon>\n</button>\n" }]
|
|
183
186
|
}] });
|
|
184
187
|
|
|
185
188
|
class NgssmCachesComponent {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
this.dataStatus = DataStatus;
|
|
196
|
-
}
|
|
189
|
+
caches = createSignal((state) => {
|
|
190
|
+
const remoteDataState = selectRemoteDataState(state);
|
|
191
|
+
return Object.keys(remoteDataState).map((key) => ({
|
|
192
|
+
key,
|
|
193
|
+
value: remoteDataState[key]
|
|
194
|
+
}));
|
|
195
|
+
});
|
|
196
|
+
dataStatus = DataStatus;
|
|
197
|
+
store = inject(Store);
|
|
197
198
|
close() {
|
|
198
199
|
this.store.dispatchActionType(RemoteDataActionType.closeCachesComponent);
|
|
199
200
|
}
|
|
200
201
|
reloadCache(cache) {
|
|
201
202
|
this.store.dispatchAction(new LoadRemoteDataAction(cache.key, { forceReload: true, keepStoredGetterParams: true }));
|
|
202
203
|
}
|
|
203
|
-
static
|
|
204
|
-
static
|
|
204
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmCachesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
205
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: NgssmCachesComponent, isStandalone: true, selector: "ngssm-caches", ngImport: i0, template: "<h1 mat-dialog-title>List of caches</h1>\n<mat-dialog-content class=\"flex-column-stretch fxFlex\">\n <mat-table [dataSource]=\"caches()\" class=\"fxFlex\">\n <ng-container matColumnDef=\"actions\">\n <mat-header-cell *matHeaderCellDef> </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n <button\n mat-icon-button\n [disabled]=\"element.value.status === dataStatus.loading\"\n (click)=\"reloadCache(element)\"\n color=\"primary\"\n id=\"reload_{{ element.key }}\">\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n </button>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"key\">\n <mat-header-cell *matHeaderCellDef> Key </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.key }} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <mat-header-cell *matHeaderCellDef> Status </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n @switch (element.value.status) {\n @case (dataStatus.none) {\n <mat-icon class=\"fa-solid fa-minus\"></mat-icon>\n }\n @case (dataStatus.loaded) {\n <mat-icon class=\"fa-solid fa-check\" color=\"primary\"></mat-icon>\n }\n @case (dataStatus.error) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.notFound) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.loading) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n }\n }\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"timestamp\">\n <mat-header-cell *matHeaderCellDef> Timestamp </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.value.timestamp }} </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['actions', 'status', 'key', 'timestamp']; sticky: true\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: ['actions', 'status', 'key', 'timestamp']\"></mat-row>\n </mat-table>\n</mat-dialog-content>\n<mat-dialog-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button (click)=\"close()\" id=\"closeButton\">Close</button>\n</mat-dialog-actions>\n", styles: [":host{display:flex;flex-direction:column;min-width:800px;max-width:80vw;min-height:500px;max-height:80vh}:host .mat-column-actions{min-width:50px;max-width:50px;padding-left:0!important}:host .mat-column-status{min-width:60px;max-width:60px}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
205
206
|
}
|
|
206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmCachesComponent, decorators: [{
|
|
207
208
|
type: Component,
|
|
208
|
-
args: [{ selector: 'ngssm-caches', imports: [
|
|
209
|
+
args: [{ selector: 'ngssm-caches', imports: [MatDialogModule, MatButtonModule, MatTableModule, MatIconModule, MatProgressSpinnerModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<h1 mat-dialog-title>List of caches</h1>\n<mat-dialog-content class=\"flex-column-stretch fxFlex\">\n <mat-table [dataSource]=\"caches()\" class=\"fxFlex\">\n <ng-container matColumnDef=\"actions\">\n <mat-header-cell *matHeaderCellDef> </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n <button\n mat-icon-button\n [disabled]=\"element.value.status === dataStatus.loading\"\n (click)=\"reloadCache(element)\"\n color=\"primary\"\n id=\"reload_{{ element.key }}\">\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n </button>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"key\">\n <mat-header-cell *matHeaderCellDef> Key </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.key }} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <mat-header-cell *matHeaderCellDef> Status </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n @switch (element.value.status) {\n @case (dataStatus.none) {\n <mat-icon class=\"fa-solid fa-minus\"></mat-icon>\n }\n @case (dataStatus.loaded) {\n <mat-icon class=\"fa-solid fa-check\" color=\"primary\"></mat-icon>\n }\n @case (dataStatus.error) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.notFound) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.loading) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n }\n }\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"timestamp\">\n <mat-header-cell *matHeaderCellDef> Timestamp </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.value.timestamp }} </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['actions', 'status', 'key', 'timestamp']; sticky: true\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: ['actions', 'status', 'key', 'timestamp']\"></mat-row>\n </mat-table>\n</mat-dialog-content>\n<mat-dialog-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button (click)=\"close()\" id=\"closeButton\">Close</button>\n</mat-dialog-actions>\n", styles: [":host{display:flex;flex-direction:column;min-width:800px;max-width:80vw;min-height:500px;max-height:80vh}:host .mat-column-actions{min-width:50px;max-width:50px;padding-left:0!important}:host .mat-column-status{min-width:60px;max-width:60px}\n"] }]
|
|
209
210
|
}] });
|
|
210
211
|
|
|
211
212
|
class CachesDisplayEffect {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
213
|
+
processedActions = [RemoteDataActionType.displayCaches, RemoteDataActionType.closeCachesComponent];
|
|
214
|
+
matDialog = inject(MatDialog);
|
|
215
|
+
dialog;
|
|
216
216
|
processAction(actiondispatcher, state, action) {
|
|
217
217
|
switch (action.type) {
|
|
218
218
|
case RemoteDataActionType.displayCaches: {
|
|
@@ -228,21 +228,22 @@ class CachesDisplayEffect {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
static
|
|
232
|
-
static
|
|
231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CachesDisplayEffect, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
232
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CachesDisplayEffect });
|
|
233
233
|
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CachesDisplayEffect, decorators: [{
|
|
235
235
|
type: Injectable
|
|
236
236
|
}] });
|
|
237
237
|
|
|
238
238
|
class RemoteDataLoadingEffect {
|
|
239
|
+
processedActions = [RemoteDataActionType.loadRemoteData];
|
|
240
|
+
remoteDataProviders = inject(NGSSM_REMOTE_DATA_PROVIDER, {
|
|
241
|
+
optional: true
|
|
242
|
+
});
|
|
243
|
+
notifierService = inject(NgssmNotifierService);
|
|
244
|
+
injector = inject(EnvironmentInjector);
|
|
245
|
+
remoteDataProvidersPerKey;
|
|
239
246
|
constructor() {
|
|
240
|
-
this.remoteDataProviders = inject(NGSSM_REMOTE_DATA_PROVIDER, {
|
|
241
|
-
optional: true
|
|
242
|
-
});
|
|
243
|
-
this.notifierService = inject(NgssmNotifierService);
|
|
244
|
-
this.injector = inject(EnvironmentInjector);
|
|
245
|
-
this.processedActions = [RemoteDataActionType.loadRemoteData];
|
|
246
247
|
this.remoteDataProvidersPerKey = new Map((this.remoteDataProviders ?? []).map((r) => [r.remoteDataKey, r]));
|
|
247
248
|
}
|
|
248
249
|
processAction(actiondispatcher, state, action) {
|
|
@@ -270,19 +271,20 @@ class RemoteDataLoadingEffect {
|
|
|
270
271
|
});
|
|
271
272
|
});
|
|
272
273
|
}
|
|
273
|
-
static
|
|
274
|
-
static
|
|
274
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataLoadingEffect, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
275
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataLoadingEffect });
|
|
275
276
|
}
|
|
276
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataLoadingEffect, decorators: [{
|
|
277
278
|
type: Injectable
|
|
278
279
|
}], ctorParameters: () => [] });
|
|
279
280
|
|
|
280
281
|
class RemoteDataReducer {
|
|
282
|
+
processedActions = [RemoteDataActionType.loadRemoteData, RemoteDataActionType.registerLoadedRemoteData];
|
|
283
|
+
remoteDataProviders = inject(NGSSM_REMOTE_DATA_PROVIDER, {
|
|
284
|
+
optional: true
|
|
285
|
+
});
|
|
286
|
+
remoteDataProvidersPerKey;
|
|
281
287
|
constructor() {
|
|
282
|
-
this.remoteDataProviders = inject(NGSSM_REMOTE_DATA_PROVIDER, {
|
|
283
|
-
optional: true
|
|
284
|
-
});
|
|
285
|
-
this.processedActions = [RemoteDataActionType.loadRemoteData, RemoteDataActionType.registerLoadedRemoteData];
|
|
286
288
|
this.remoteDataProvidersPerKey = new Map((this.remoteDataProviders ?? []).map((r) => [r.remoteDataKey, r]));
|
|
287
289
|
}
|
|
288
290
|
updateState(state, action) {
|
|
@@ -338,27 +340,25 @@ class RemoteDataReducer {
|
|
|
338
340
|
}
|
|
339
341
|
return state;
|
|
340
342
|
}
|
|
341
|
-
static
|
|
342
|
-
static
|
|
343
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
344
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataReducer });
|
|
343
345
|
}
|
|
344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataReducer, decorators: [{
|
|
345
347
|
type: Injectable
|
|
346
348
|
}], ctorParameters: () => [] });
|
|
347
349
|
|
|
348
350
|
class RemoteDataStateInitializer {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
});
|
|
353
|
-
}
|
|
351
|
+
remoteDataProviders = inject(NGSSM_REMOTE_DATA_PROVIDER, {
|
|
352
|
+
optional: true
|
|
353
|
+
});
|
|
354
354
|
initializeState(state) {
|
|
355
355
|
const tempState = state;
|
|
356
356
|
return (this.remoteDataProviders ?? []).reduce((s, provider) => updateRemoteDataState(s, { [provider.remoteDataKey]: { $set: { status: DataStatus.none } } }), tempState);
|
|
357
357
|
}
|
|
358
|
-
static
|
|
359
|
-
static
|
|
358
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataStateInitializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
359
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataStateInitializer });
|
|
360
360
|
}
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteDataStateInitializer, decorators: [{
|
|
362
362
|
type: Injectable
|
|
363
363
|
}] });
|
|
364
364
|
|
|
@@ -387,6 +387,8 @@ const provideNgssmRemoteData = () => {
|
|
|
387
387
|
* @param remoteCall - The remote call instance containing the result details.
|
|
388
388
|
*/
|
|
389
389
|
class NgssmRemoteCallResultAction {
|
|
390
|
+
type;
|
|
391
|
+
remoteCall;
|
|
390
392
|
constructor(type, remoteCall) {
|
|
391
393
|
this.type = type;
|
|
392
394
|
this.remoteCall = remoteCall;
|
|
@@ -433,10 +435,10 @@ const updateNgssmRemoteCallState = (state, command) => update(state, {
|
|
|
433
435
|
[NgssmRemoteCallStateSpecification.featureStateKey]: command
|
|
434
436
|
});
|
|
435
437
|
let NgssmRemoteCallStateSpecification = class NgssmRemoteCallStateSpecification {
|
|
436
|
-
static
|
|
437
|
-
static
|
|
438
|
+
static featureStateKey = 'ngssm-remote-call-state';
|
|
439
|
+
static initialState = {
|
|
438
440
|
remoteCalls: {}
|
|
439
|
-
};
|
|
441
|
+
};
|
|
440
442
|
};
|
|
441
443
|
NgssmRemoteCallStateSpecification = __decorate([
|
|
442
444
|
NgSsmFeatureState({
|
|
@@ -446,28 +448,26 @@ NgssmRemoteCallStateSpecification = __decorate([
|
|
|
446
448
|
], NgssmRemoteCallStateSpecification);
|
|
447
449
|
|
|
448
450
|
class NgssmRemoteCallStateInitializer {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
});
|
|
453
|
-
}
|
|
451
|
+
remoteCallConfigs = inject(NGSSM_REMOTE_CALL_CONFIG, {
|
|
452
|
+
optional: true
|
|
453
|
+
});
|
|
454
454
|
initializeState(state) {
|
|
455
455
|
const tempState = state;
|
|
456
456
|
return (this.remoteCallConfigs ?? []).reduce((s, config) => updateNgssmRemoteCallState(s, { remoteCalls: { [config.id]: { $set: { status: RemoteCallStatus.none } } } }), tempState);
|
|
457
457
|
}
|
|
458
|
-
static
|
|
459
|
-
static
|
|
458
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallStateInitializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
459
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallStateInitializer });
|
|
460
460
|
}
|
|
461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallStateInitializer, decorators: [{
|
|
462
462
|
type: Injectable
|
|
463
463
|
}] });
|
|
464
464
|
|
|
465
465
|
class RemoteCallReducer {
|
|
466
|
+
processedActions = [];
|
|
467
|
+
remoteCallConfigs = inject(NGSSM_REMOTE_CALL_CONFIG, {
|
|
468
|
+
optional: true
|
|
469
|
+
});
|
|
466
470
|
constructor() {
|
|
467
|
-
this.remoteCallConfigs = inject(NGSSM_REMOTE_CALL_CONFIG, {
|
|
468
|
-
optional: true
|
|
469
|
-
});
|
|
470
|
-
this.processedActions = [];
|
|
471
471
|
(this.remoteCallConfigs ?? []).forEach((c) => this.processedActions.push(...[...c.triggeredActionTypes, ...c.resultActionTypes]));
|
|
472
472
|
}
|
|
473
473
|
updateState(state, action) {
|
|
@@ -492,10 +492,10 @@ class RemoteCallReducer {
|
|
|
492
492
|
});
|
|
493
493
|
return output;
|
|
494
494
|
}
|
|
495
|
-
static
|
|
496
|
-
static
|
|
495
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
496
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallReducer });
|
|
497
497
|
}
|
|
498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallReducer, decorators: [{
|
|
499
499
|
type: Injectable
|
|
500
500
|
}], ctorParameters: () => [] });
|
|
501
501
|
|
|
@@ -504,17 +504,17 @@ var NgssmRemoteCallActionType;
|
|
|
504
504
|
NgssmRemoteCallActionType["setRemoteCall"] = "[NgssmRemoteCallActionType] setRemoteCall";
|
|
505
505
|
})(NgssmRemoteCallActionType || (NgssmRemoteCallActionType = {}));
|
|
506
506
|
class SetRemoteCallAction {
|
|
507
|
+
remoteCallId;
|
|
508
|
+
remoteCall;
|
|
509
|
+
type = NgssmRemoteCallActionType.setRemoteCall;
|
|
507
510
|
constructor(remoteCallId, remoteCall) {
|
|
508
511
|
this.remoteCallId = remoteCallId;
|
|
509
512
|
this.remoteCall = remoteCall;
|
|
510
|
-
this.type = NgssmRemoteCallActionType.setRemoteCall;
|
|
511
513
|
}
|
|
512
514
|
}
|
|
513
515
|
|
|
514
516
|
class RemoteCallSetterReducer {
|
|
515
|
-
|
|
516
|
-
this.processedActions = [NgssmRemoteCallActionType.setRemoteCall];
|
|
517
|
-
}
|
|
517
|
+
processedActions = [NgssmRemoteCallActionType.setRemoteCall];
|
|
518
518
|
updateState(state, action) {
|
|
519
519
|
switch (action.type) {
|
|
520
520
|
case NgssmRemoteCallActionType.setRemoteCall: {
|
|
@@ -528,10 +528,10 @@ class RemoteCallSetterReducer {
|
|
|
528
528
|
}
|
|
529
529
|
return state;
|
|
530
530
|
}
|
|
531
|
-
static
|
|
532
|
-
static
|
|
531
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallSetterReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
532
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallSetterReducer });
|
|
533
533
|
}
|
|
534
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallSetterReducer, decorators: [{
|
|
535
535
|
type: Injectable
|
|
536
536
|
}] });
|
|
537
537
|
|
|
@@ -551,12 +551,10 @@ const selectRemoteCall = (state, id) => selectNgssmRemoteCallState(state).remote
|
|
|
551
551
|
const isNgssmRemoteCallInProgress = (state, remoteCallId) => selectRemoteCall(state, remoteCallId)?.status === RemoteCallStatus.inProgress;
|
|
552
552
|
|
|
553
553
|
class RemoteCallResultProcessor {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
this.notifier = inject(NgssmNotifierService);
|
|
559
|
-
}
|
|
554
|
+
logger = inject(Logger);
|
|
555
|
+
// Inject Injector instead of Store because Effects are injected into Store and this class may be used by Effects
|
|
556
|
+
injector = inject(Injector);
|
|
557
|
+
notifier = inject(NgssmNotifierService);
|
|
560
558
|
processRemoteCallError(remoteCallId, error, errorMessage) {
|
|
561
559
|
this.logger.error(errorMessage, error);
|
|
562
560
|
this.notifier.notifyError(`${errorMessage}: ${error.message}`);
|
|
@@ -569,10 +567,10 @@ class RemoteCallResultProcessor {
|
|
|
569
567
|
this.notifier.notifySuccess(message);
|
|
570
568
|
this.injector.get(Store).dispatchAction(new SetRemoteCallAction(remoteCallId, { status: RemoteCallStatus.done }));
|
|
571
569
|
}
|
|
572
|
-
static
|
|
573
|
-
static
|
|
570
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallResultProcessor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
571
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallResultProcessor, providedIn: 'root' });
|
|
574
572
|
}
|
|
575
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
573
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RemoteCallResultProcessor, decorators: [{
|
|
576
574
|
type: Injectable,
|
|
577
575
|
args: [{
|
|
578
576
|
providedIn: 'root'
|
|
@@ -597,11 +595,11 @@ const processRemoteCallError = (error, errorMessage, remoteCallId, actionDispatc
|
|
|
597
595
|
};
|
|
598
596
|
|
|
599
597
|
class NgssmRemoteCallErrorComponent {
|
|
598
|
+
remoteCallId = input('', ...(ngDevMode ? [{ debugName: "remoteCallId" }] : []));
|
|
599
|
+
errorContainerRendered = signal(false, ...(ngDevMode ? [{ debugName: "errorContainerRendered" }] : []));
|
|
600
|
+
errorDescription = signal('', ...(ngDevMode ? [{ debugName: "errorDescription" }] : []));
|
|
601
|
+
remoteCalls = createSignal((state) => selectNgssmRemoteCallState(state).remoteCalls);
|
|
600
602
|
constructor() {
|
|
601
|
-
this.remoteCalls = createSignal((state) => selectNgssmRemoteCallState(state).remoteCalls);
|
|
602
|
-
this.remoteCallId = input('', ...(ngDevMode ? [{ debugName: "remoteCallId" }] : []));
|
|
603
|
-
this.errorContainerRendered = signal(false, ...(ngDevMode ? [{ debugName: "errorContainerRendered" }] : []));
|
|
604
|
-
this.errorDescription = signal('', ...(ngDevMode ? [{ debugName: "errorDescription" }] : []));
|
|
605
603
|
effect(() => {
|
|
606
604
|
const id = this.remoteCallId();
|
|
607
605
|
const remoteCall = this.remoteCalls()[id];
|
|
@@ -618,12 +616,12 @@ class NgssmRemoteCallErrorComponent {
|
|
|
618
616
|
this.errorDescription.set(description);
|
|
619
617
|
});
|
|
620
618
|
}
|
|
621
|
-
static
|
|
622
|
-
static
|
|
619
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
620
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: NgssmRemoteCallErrorComponent, isStandalone: true, selector: "ngssm-remote-call-error", inputs: { remoteCallId: { classPropertyName: "remoteCallId", publicName: "remoteCallId", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ngssm-remote-call-error" }, ngImport: i0, template: "@if (errorContainerRendered()) {\n <div class=\"ngssm-remote-call-error-container\">\n {{ errorDescription() }}\n\n <button mat-icon-button color=\"warn\" class=\"ngssm-remote-call-error-close-button\" (click)=\"errorContainerRendered.set(false)\">\n <mat-icon class=\"fa-solid fa-square-xmark\"></mat-icon>\n </button>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
623
621
|
}
|
|
624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgssmRemoteCallErrorComponent, decorators: [{
|
|
625
623
|
type: Component,
|
|
626
|
-
args: [{ selector: 'ngssm-remote-call-error', imports: [
|
|
624
|
+
args: [{ selector: 'ngssm-remote-call-error', imports: [MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
627
625
|
class: 'ngssm-remote-call-error'
|
|
628
626
|
}, template: "@if (errorContainerRendered()) {\n <div class=\"ngssm-remote-call-error-container\">\n {{ errorDescription() }}\n\n <button mat-icon-button color=\"warn\" class=\"ngssm-remote-call-error-close-button\" (click)=\"errorContainerRendered.set(false)\">\n <mat-icon class=\"fa-solid fa-square-xmark\"></mat-icon>\n </button>\n </div>\n}\n" }]
|
|
629
627
|
}], ctorParameters: () => [], propDecorators: { remoteCallId: [{ type: i0.Input, args: [{ isSignal: true, alias: "remoteCallId", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-remote-data.mjs","sources":["../../../projects/ngssm-remote-data/src/lib/remote-data/model/data-status.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/model/remote-data.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/model/remote-data-provider.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/state/remote-data.state.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/state/selectors.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/actions/remote-data-action-type.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/actions/load-remote-data.action.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/actions/register-loaded-remote-data.action.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/guards/remote-data-loading.guard.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-remote-data-reload-button/ngssm-remote-data-reload-button.component.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-remote-data-reload-button/ngssm-remote-data-reload-button.component.html","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches-display-button/ngssm-caches-display-button.component.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches-display-button/ngssm-caches-display-button.component.html","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches/ngssm-caches.component.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches/ngssm-caches.component.html","../../../projects/ngssm-remote-data/src/lib/remote-data/effects/caches-display.effect.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/effects/remote-data-loading.effect.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/reducers/remote-data.reducer.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/remote-data-state-initializer.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/provide-ngssm-remote-data.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/public-api.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/register-remote-call.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/remote-call.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call.state.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call-state-initializer.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/reducers/remote-call.reducer.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/actions.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/reducers/remote-call-setter.reducer.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/provide-ngssm-remote-call.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/selectors.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/remote-call-result-processor.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call-error/ngssm-remote-call-error.component.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call-error/ngssm-remote-call-error.component.html","../../../projects/ngssm-remote-data/src/public-api.ts","../../../projects/ngssm-remote-data/src/ngssm-remote-data.ts"],"sourcesContent":["export enum DataStatus {\n none = 'None',\n loading = 'Loading',\n loaded = 'Loaded',\n notFound = 'NotFound',\n error = 'Error'\n}\n","import { DataStatus } from './data-status';\nimport { RemoteCallError } from './remote-call-error';\nimport { RemoteDataGetterParams } from './remote-data-getter-params';\n\nexport interface RemoteData<TData = unknown, TGetterParams = unknown> {\n status: DataStatus;\n data?: TData;\n timestamp?: Date;\n message?: string;\n error?: RemoteCallError;\n getterParams?: RemoteDataGetterParams<TGetterParams>;\n}\n\nexport const getDefaultRemoteData = <T>(defaultValue?: T, defaultStatus: DataStatus = DataStatus.none): RemoteData<T> => ({\n status: defaultStatus,\n data: defaultValue\n});\n","import { EnvironmentProviders, InjectionToken, Type, makeEnvironmentProviders } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { RemoteDataGetterParams } from './remote-data-getter-params';\n\nexport interface RemoteDataProvider<TData = unknown, TValue = unknown> {\n readonly remoteDataKey: string;\n readonly cacheDurationInSeconds?: number;\n\n get(params?: RemoteDataGetterParams<TValue>): Observable<TData>;\n}\n\nexport const NGSSM_REMOTE_DATA_PROVIDER = new InjectionToken<RemoteDataProvider>('NGSSM_REMOTE_DATA_PROVIDER');\n\nexport const provideRemoteDataProviders = (...providers: Type<RemoteDataProvider>[]): EnvironmentProviders => {\n return makeEnvironmentProviders(providers.map((provider) => ({ provide: NGSSM_REMOTE_DATA_PROVIDER, useClass: provider, multi: true })));\n};\n\nexport type RemoteDataLoadingFunc<TData = unknown, TValue = unknown> = (params?: RemoteDataGetterParams<TValue>) => Observable<TData>;\n\nexport const provideRemoteDataFunc = <TData = unknown, TValue = unknown>(\n remoteDataKey: string,\n remoteDataLoadingFunc: RemoteDataLoadingFunc<TData, TValue>,\n cacheDurationInSeconds?: number\n): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_REMOTE_DATA_PROVIDER,\n useFactory: () => {\n const provider: RemoteDataProvider<TData, TValue> = {\n remoteDataKey,\n cacheDurationInSeconds,\n get: remoteDataLoadingFunc\n };\n return provider;\n },\n multi: true\n }\n ]);\n};\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nimport { RemoteData } from '../model';\n\nexport const selectRemoteDataState = (state: State): RemoteDataState =>\n state[RemoteDataStateSpecification.featureStateKey] as RemoteDataState;\n\nexport const updateRemoteDataState = (state: State, command: Spec<RemoteDataState, never>): State =>\n update(state, {\n [RemoteDataStateSpecification.featureStateKey]: command\n });\n\nexport type RemoteDataState = Record<string, RemoteData<unknown>>;\n\n@NgSsmFeatureState({\n featureStateKey: RemoteDataStateSpecification.featureStateKey,\n initialState: RemoteDataStateSpecification.initialState\n})\nexport class RemoteDataStateSpecification {\n public static readonly featureStateKey = 'remote-data-state';\n public static readonly initialState: RemoteDataState = {};\n}\n","import { State } from 'ngssm-store';\n\nimport { selectRemoteDataState } from './remote-data.state';\nimport { RemoteData } from '../model';\n\nexport const selectRemoteData = <TData = unknown>(state: State, remoteDataKey: string): RemoteData<TData> | undefined =>\n selectRemoteDataState(state)[remoteDataKey] as RemoteData<TData>;\n","export enum RemoteDataActionType {\n loadRemoteData = '[RemoteDataActionType] loadRemoteData',\n registerLoadedRemoteData = '[RemoteDataActionType] registerLoadedRemoteData',\n displayCaches = '[RemoteDataActionType] displayCaches',\n closeCachesComponent = '[RemoteDataActionType] closeCachesComponent'\n}\n","import { Action } from 'ngssm-store';\n\nimport { ReloadParams } from '../model';\nimport { RemoteDataActionType } from './remote-data-action-type';\n\nexport class LoadRemoteDataAction<TValue = unknown> implements Action {\n public readonly type: string = RemoteDataActionType.loadRemoteData;\n\n constructor(\n public readonly remoteDataKey: string,\n public readonly params?: ReloadParams<TValue>\n ) {}\n}\n","import { Action } from 'ngssm-store';\n\nimport { DataStatus, RemoteCallError } from '../model';\nimport { RemoteDataActionType } from './remote-data-action-type';\n\nexport class RegisterLoadedRemoteDataAction<T = unknown> implements Action {\n public readonly type: string = RemoteDataActionType.registerLoadedRemoteData;\n\n constructor(\n public readonly remoteDataKey: string,\n public readonly status: DataStatus,\n public readonly data: T,\n public readonly message?: string,\n public readonly remoteCallError?: RemoteCallError\n ) {}\n}\n","import { inject, Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, UrlTree } from '@angular/router';\nimport { Observable } from 'rxjs';\n\nimport { Store } from 'ngssm-store';\n\nimport { LoadRemoteDataAction } from '../actions';\nimport { ReloadParams } from '../model';\n\nexport interface RemoteDataLoadingGuardItem {\n remoteDataKey: string;\n forceReload?: boolean;\n}\n\nexport interface RemoteDataLoadingGuardParameters {\n remoteDataItems: RemoteDataLoadingGuardItem[];\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RemoteDataLoadingGuard {\n private readonly store = inject(Store);\n\n public canActivate(route: ActivatedRouteSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n const parameters = route.data as RemoteDataLoadingGuardParameters;\n (parameters?.remoteDataItems ?? []).forEach((item) => {\n this.store.dispatchAction(new LoadRemoteDataAction(item.remoteDataKey, { forceReload: item.forceReload === true }));\n });\n\n return true;\n }\n}\n\nexport const ngssmReloadRemoteData = <TData = unknown>(\n remoteDataKey: string,\n params: ReloadParams<TData> = { forceReload: true }\n): (() => boolean) => {\n return () => {\n inject(Store).dispatchAction(new LoadRemoteDataAction(remoteDataKey, params));\n return true;\n };\n};\n","import { Component, ChangeDetectionStrategy, signal, input, inject, effect } from '@angular/core';\nimport { CommonModule, DatePipe } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { createSignal, Store } from 'ngssm-store';\n\nimport { LoadRemoteDataAction } from '../../actions';\nimport { selectRemoteDataState } from '../../state';\nimport { DataStatus } from '../../model';\n\nconst datePipe = new DatePipe('en-US');\n\n@Component({\n selector: 'ngssm-remote-data-reload-button',\n imports: [CommonModule, MatIconModule, MatButtonModule, MatTooltipModule, MatProgressSpinnerModule],\n templateUrl: './ngssm-remote-data-reload-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmRemoteDataReloadButtonComponent {\n private readonly store = inject(Store);\n private readonly remoteDataState = createSignal((state) => selectRemoteDataState(state));\n\n public readonly tooltipMessage = signal<string>('');\n public readonly disabled = signal<boolean>(true);\n public readonly inLoadingStatus = signal<boolean>(false);\n\n public actionTypes = input<string[]>([]);\n public remoteDataKeys = input<string[]>([]);\n\n constructor() {\n effect(() => {\n const remoteDataState = this.remoteDataState();\n const keys = this.remoteDataKeys();\n\n this.inLoadingStatus.set(keys.findIndex((v) => remoteDataState[v]?.status === DataStatus.loading) !== -1);\n this.disabled.set(this.inLoadingStatus() === true || keys.findIndex((v) => !!remoteDataState[v]) === -1);\n let timestamp: Date | undefined;\n keys.forEach((key) => {\n const keyTimestamp = remoteDataState[key]?.timestamp;\n if (keyTimestamp) {\n if (!timestamp || timestamp.getTime() > keyTimestamp.getTime()) {\n timestamp = keyTimestamp;\n }\n }\n });\n\n let tooltiMessage = 'Reload data.';\n if (timestamp) {\n tooltiMessage = [tooltiMessage, `Loaded at ${datePipe.transform(timestamp, 'mediumTime')}`].join('\\n');\n }\n this.tooltipMessage.set(tooltiMessage);\n });\n }\n\n public reload(): void {\n this.remoteDataKeys().forEach((key) =>\n this.store.dispatchAction(new LoadRemoteDataAction(key, { forceReload: true, keepStoredGetterParams: true }))\n );\n this.actionTypes().forEach((type) => this.store.dispatchActionType(type));\n }\n}\n","<button\n mat-icon-button\n color=\"primary\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"disabled() === true\"\n id=\"reloadButton\">\n @if (inLoadingStatus()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n }\n</button>\n","import { Component, ChangeDetectionStrategy, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { Store } from 'ngssm-store';\n\nimport { RemoteDataActionType } from '../../actions';\n\n@Component({\n selector: 'ngssm-caches-display-button',\n imports: [CommonModule, MatButtonModule, MatIconModule, MatTooltipModule],\n templateUrl: './ngssm-caches-display-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmCachesDisplayButtonComponent {\n private readonly store = inject(Store);\n\n public displayCaches(): void {\n this.store.dispatchActionType(RemoteDataActionType.displayCaches);\n }\n}\n","<button mat-icon-button matTooltip=\"Display caches\" (click)=\"displayCaches()\">\n <mat-icon class=\"fa-solid fa-cloud-bolt\"></mat-icon>\n</button>\n","import { Component, ChangeDetectionStrategy, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTableModule } from '@angular/material/table';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { createSignal, Store } from 'ngssm-store';\n\nimport { RemoteDataActionType, LoadRemoteDataAction } from '../../actions';\nimport { DataStatus, RemoteData } from '../../model';\nimport { selectRemoteDataState } from '../../state';\n\ninterface Cache {\n key: string;\n value: RemoteData;\n}\n\n@Component({\n selector: 'ngssm-caches',\n imports: [CommonModule, MatDialogModule, MatButtonModule, MatTableModule, MatIconModule, MatProgressSpinnerModule],\n templateUrl: './ngssm-caches.component.html',\n styleUrls: ['./ngssm-caches.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmCachesComponent {\n private readonly store = inject(Store);\n\n public readonly caches = createSignal<Cache[]>((state) => {\n const remoteDataState = selectRemoteDataState(state);\n return Object.keys(remoteDataState).map((key) => ({\n key,\n value: remoteDataState[key]\n }));\n });\n\n public readonly dataStatus = DataStatus;\n\n public close(): void {\n this.store.dispatchActionType(RemoteDataActionType.closeCachesComponent);\n }\n\n public reloadCache(cache: Cache): void {\n this.store.dispatchAction(new LoadRemoteDataAction(cache.key, { forceReload: true, keepStoredGetterParams: true }));\n }\n}\n","<h1 mat-dialog-title>List of caches</h1>\n<mat-dialog-content class=\"flex-column-stretch fxFlex\">\n <mat-table [dataSource]=\"caches()\" class=\"fxFlex\">\n <ng-container matColumnDef=\"actions\">\n <mat-header-cell *matHeaderCellDef> </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n <button\n mat-icon-button\n [disabled]=\"element.value.status === dataStatus.loading\"\n (click)=\"reloadCache(element)\"\n color=\"primary\"\n id=\"reload_{{ element.key }}\">\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n </button>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"key\">\n <mat-header-cell *matHeaderCellDef> Key </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.key }} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <mat-header-cell *matHeaderCellDef> Status </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n @switch (element.value.status) {\n @case (dataStatus.none) {\n <mat-icon class=\"fa-solid fa-minus\"></mat-icon>\n }\n @case (dataStatus.loaded) {\n <mat-icon class=\"fa-solid fa-check\" color=\"primary\"></mat-icon>\n }\n @case (dataStatus.error) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.notFound) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.loading) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n }\n }\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"timestamp\">\n <mat-header-cell *matHeaderCellDef> Timestamp </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.value.timestamp }} </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['actions', 'status', 'key', 'timestamp']; sticky: true\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: ['actions', 'status', 'key', 'timestamp']\"></mat-row>\n </mat-table>\n</mat-dialog-content>\n<mat-dialog-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button (click)=\"close()\" id=\"closeButton\">Close</button>\n</mat-dialog-actions>\n","import { Injectable, inject } from '@angular/core';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\n\nimport { Effect, State, Action, ActionDispatcher } from 'ngssm-store';\nimport { RemoteDataActionType } from '../actions';\nimport { NgssmCachesComponent } from '../components';\n\n@Injectable()\nexport class CachesDisplayEffect implements Effect {\n private readonly matDialog = inject(MatDialog);\n\n private dialog: MatDialogRef<NgssmCachesComponent> | undefined;\n\n public readonly processedActions: string[] = [RemoteDataActionType.displayCaches, RemoteDataActionType.closeCachesComponent];\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n switch (action.type) {\n case RemoteDataActionType.displayCaches: {\n this.dialog = this.matDialog.open(NgssmCachesComponent, {\n disableClose: true\n });\n\n break;\n }\n\n case RemoteDataActionType.closeCachesComponent: {\n this.dialog?.close();\n this.dialog = undefined;\n\n break;\n }\n }\n }\n}\n","import { EnvironmentInjector, Injectable, runInInjectionContext, inject } from '@angular/core';\n\nimport { Effect, State, Action, ActionDispatcher } from 'ngssm-store';\nimport { NgssmNotifierService } from 'ngssm-toolkit';\n\nimport { LoadRemoteDataAction, RegisterLoadedRemoteDataAction, RemoteDataActionType } from '../actions';\nimport { DataStatus, RemoteDataProvider, NGSSM_REMOTE_DATA_PROVIDER } from '../model';\nimport { selectRemoteDataState } from '../state';\n\n@Injectable()\nexport class RemoteDataLoadingEffect implements Effect {\n private readonly remoteDataProviders: RemoteDataProvider[] | null = inject(NGSSM_REMOTE_DATA_PROVIDER, {\n optional: true\n }) as unknown as RemoteDataProvider[];\n private readonly notifierService = inject(NgssmNotifierService);\n private readonly injector = inject(EnvironmentInjector);\n\n private readonly remoteDataProvidersPerKey: Map<string, RemoteDataProvider>;\n\n public readonly processedActions: string[] = [RemoteDataActionType.loadRemoteData];\n\n constructor() {\n this.remoteDataProvidersPerKey = new Map<string, RemoteDataProvider>((this.remoteDataProviders ?? []).map((r) => [r.remoteDataKey, r]));\n }\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n const loadRemoteDataAction = action as LoadRemoteDataAction;\n const item = selectRemoteDataState(state)[loadRemoteDataAction.remoteDataKey];\n const provider = this.remoteDataProvidersPerKey.get(loadRemoteDataAction.remoteDataKey);\n\n if (!item || !provider || item.status !== DataStatus.loading) {\n return;\n }\n\n runInInjectionContext(this.injector, () => {\n provider.get(item.getterParams).subscribe({\n next: (value) => {\n actiondispatcher.dispatchAction(new RegisterLoadedRemoteDataAction(loadRemoteDataAction.remoteDataKey, DataStatus.loaded, value));\n if (item.getterParams?.callbackAction) {\n actiondispatcher.dispatchActionType(item.getterParams.callbackAction);\n }\n },\n error: (error) => {\n console.error(`Unable to load data for '${loadRemoteDataAction.remoteDataKey}'`, error);\n if (item.getterParams?.errorNotificationMessage) {\n this.notifierService.notifyError(item.getterParams.errorNotificationMessage(error?.error));\n }\n\n actiondispatcher.dispatchAction(\n new RegisterLoadedRemoteDataAction(loadRemoteDataAction.remoteDataKey, DataStatus.error, undefined, error?.error)\n );\n }\n });\n });\n }\n}\n","import { Injectable, inject } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { LoadRemoteDataAction, RegisterLoadedRemoteDataAction, RemoteDataActionType } from '../actions';\nimport { DataStatus, RemoteDataProvider, NGSSM_REMOTE_DATA_PROVIDER } from '../model';\nimport { selectRemoteDataState, updateRemoteDataState } from '../state';\n\n@Injectable()\nexport class RemoteDataReducer implements Reducer {\n private readonly remoteDataProviders: RemoteDataProvider[] | null = inject(NGSSM_REMOTE_DATA_PROVIDER, {\n optional: true\n }) as unknown as RemoteDataProvider[];\n\n private readonly remoteDataProvidersPerKey: Map<string, RemoteDataProvider>;\n\n public readonly processedActions: string[] = [RemoteDataActionType.loadRemoteData, RemoteDataActionType.registerLoadedRemoteData];\n\n constructor() {\n this.remoteDataProvidersPerKey = new Map<string, RemoteDataProvider>((this.remoteDataProviders ?? []).map((r) => [r.remoteDataKey, r]));\n }\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case RemoteDataActionType.loadRemoteData: {\n const loadRemoteDataAction = action as LoadRemoteDataAction;\n const item = selectRemoteDataState(state)[loadRemoteDataAction.remoteDataKey];\n if (!item) {\n return state;\n }\n\n const provider = this.remoteDataProvidersPerKey.get(loadRemoteDataAction.remoteDataKey);\n if (!provider) {\n return state;\n }\n\n if (\n !provider.cacheDurationInSeconds ||\n loadRemoteDataAction.params?.forceReload === true ||\n item.status === DataStatus.none ||\n item.status === DataStatus.error ||\n item.status === DataStatus.notFound ||\n !item.timestamp ||\n new Date().getTime() - item.timestamp.getTime() >= 1000 * provider.cacheDurationInSeconds\n ) {\n return updateRemoteDataState(state, {\n [loadRemoteDataAction.remoteDataKey]: {\n status: { $set: DataStatus.loading },\n getterParams: {\n $apply: (value) => {\n if (!loadRemoteDataAction.params || loadRemoteDataAction.params.keepStoredGetterParams !== true) {\n return loadRemoteDataAction.params?.params;\n }\n\n return value;\n }\n }\n }\n });\n }\n\n break;\n }\n\n case RemoteDataActionType.registerLoadedRemoteData: {\n const registerLoadedRemoteDataAction = action as RegisterLoadedRemoteDataAction;\n if (this.remoteDataProvidersPerKey.has(registerLoadedRemoteDataAction.remoteDataKey)) {\n return updateRemoteDataState(state, {\n [registerLoadedRemoteDataAction.remoteDataKey]: {\n status: { $set: registerLoadedRemoteDataAction.status },\n data: { $set: registerLoadedRemoteDataAction.data },\n timestamp: { $set: new Date() },\n message: { $set: registerLoadedRemoteDataAction.message },\n error: { $set: registerLoadedRemoteDataAction.remoteCallError }\n }\n });\n }\n\n break;\n }\n }\n\n return state;\n }\n}\n","import { Injectable, inject } from '@angular/core';\n\nimport { State, StateInitializer } from 'ngssm-store';\n\nimport { DataStatus, RemoteDataProvider, NGSSM_REMOTE_DATA_PROVIDER } from './model';\nimport { updateRemoteDataState } from './state';\n\n@Injectable()\nexport class RemoteDataStateInitializer implements StateInitializer {\n private readonly remoteDataProviders: RemoteDataProvider[] | null = inject(NGSSM_REMOTE_DATA_PROVIDER, {\n optional: true\n }) as unknown as RemoteDataProvider[];\n\n public initializeState(state: State): State {\n const tempState = state;\n return (this.remoteDataProviders ?? []).reduce(\n (s, provider) => updateRemoteDataState(s, { [provider.remoteDataKey]: { $set: { status: DataStatus.none } } }),\n tempState\n );\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { NGSSM_STATE_INITIALIZER, provideEffects, provideReducer } from 'ngssm-store';\n\nimport { CachesDisplayEffect, RemoteDataLoadingEffect } from './effects';\nimport { RemoteDataReducer } from './reducers/remote-data.reducer';\nimport { RemoteDataStateInitializer } from './remote-data-state-initializer';\n\nexport const provideNgssmRemoteData = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideReducer(RemoteDataReducer),\n provideEffects(CachesDisplayEffect, RemoteDataLoadingEffect),\n { provide: NGSSM_STATE_INITIALIZER, useClass: RemoteDataStateInitializer, multi: true }\n ]);\n};\n","/*\n * Public API Surface of ngssm-remote-data\n */\n\nexport * from './model';\nexport * from './state';\nexport * from './actions';\nexport * from './guards';\nexport * from './components';\nexport * from './provide-ngssm-remote-data';\n","import { InjectionToken, Provider } from '@angular/core';\n\nimport { Action } from 'ngssm-store';\n\nimport { RemoteCall } from './remote-call';\n\n/**\n * Represents an action that encapsulates the result of a remote call.\n *\n * This action is typically dispatched when a remote call completes,\n * carrying both the action type and the associated remote call data.\n *\n * @remarks\n * Implements the `Action` interface.\n *\n * @param type - The type of the action.\n * @param remoteCall - The remote call instance containing the result details.\n */\nexport class NgssmRemoteCallResultAction implements Action {\n constructor(\n public readonly type: string,\n public readonly remoteCall: RemoteCall\n ) {}\n}\n\n// Configuration for a remote call, including its identifier and associated action types.\nexport interface RemoteCallConfig {\n id: string; // Unique identifier for the remote call\n triggeredActionTypes: string[]; // Action types that trigger the remote call\n resultActionTypes: string[]; // Action derived from NgssmRemoteCallResultAction that will notify end of call\n}\n\n/**\n * Injection token for providing NGSSM remote call configuration.\n * Used to register and inject RemoteCallConfig objects in Angular's dependency injection system.\n */\nexport const NGSSM_REMOTE_CALL_CONFIG = new InjectionToken<RemoteCallConfig>('NGSSM_REMOTE_CALL_CONFIG');\n\n/**\n * Provides the configuration for NGSSM remote calls as an Angular provider.\n *\n * @param config - The remote call configuration object to be provided.\n * @returns An Angular provider object that supplies the given configuration for NGSSM remote calls.\n *\n * @remarks\n * This function is intended to be used in Angular module providers to register\n * multiple remote call configurations using the `multi: true` option.\n */\nexport const provideNgssmRemoteCallConfig = (config: RemoteCallConfig): Provider => ({\n provide: NGSSM_REMOTE_CALL_CONFIG,\n useValue: config,\n multi: true\n});\n","import { HttpErrorResponse } from '@angular/common/http';\n\n// Represents the possible statuses of a remote call.\nexport enum RemoteCallStatus {\n none = 'None', // No call has been made yet\n inProgress = 'In progress', // The remote call is currently in progress\n done = 'Done', // The remote call completed successfully\n ko = 'Ko' // The remote call failed\n}\n\n/**\n * Describes the state and result of a remote call, including error information if applicable.\n *\n * Note that the property error is only here to ensure compatibility with previous versions. It will be removed in a future release.\n * Only the processRemoteCallError helper sets this property.\n * The service RemoteCallResultProcessor which must be used instead of the helper does not set this property.\n */\nexport interface RemoteCall<TErrorType = unknown> {\n status: RemoteCallStatus; // The current status of the remote call\n httpErrorResponse?: HttpErrorResponse; // Optional HTTP error response if the call failed\n message?: string; // Optional message describing the result or error\n error?: TErrorType; // Error property of HttpErrorResponse => to avoid too many impacts on code using this.\n}\n\n/**\n * Returns a default RemoteCall object with the specified status (defaults to 'none').\n * @param status The status to set for the remote call.\n * @returns A RemoteCall object with the given status.\n */\nexport const getDefaultRemoteCall = (status: RemoteCallStatus = RemoteCallStatus.none): RemoteCall => ({ status });\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nimport { RemoteCall } from './remote-call';\n\nexport const selectNgssmRemoteCallState = (state: State): NgssmRemoteCallState =>\n state[NgssmRemoteCallStateSpecification.featureStateKey] as NgssmRemoteCallState;\n\nexport const updateNgssmRemoteCallState = (state: State, command: Spec<NgssmRemoteCallState, never>): State =>\n update(state, {\n [NgssmRemoteCallStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmRemoteCallState {\n remoteCalls: Record<string, RemoteCall>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmRemoteCallStateSpecification.featureStateKey,\n initialState: NgssmRemoteCallStateSpecification.initialState\n})\nexport class NgssmRemoteCallStateSpecification {\n public static readonly featureStateKey = 'ngssm-remote-call-state';\n public static readonly initialState: NgssmRemoteCallState = {\n remoteCalls: {}\n };\n}\n","import { inject, Injectable } from '@angular/core';\n\nimport { State, StateInitializer } from 'ngssm-store';\n\nimport { NGSSM_REMOTE_CALL_CONFIG, RemoteCallConfig } from './register-remote-call';\nimport { RemoteCallStatus } from './remote-call';\nimport { updateNgssmRemoteCallState } from './ngssm-remote-call.state';\n\n@Injectable()\nexport class NgssmRemoteCallStateInitializer implements StateInitializer {\n private readonly remoteCallConfigs: RemoteCallConfig[] | null = inject(NGSSM_REMOTE_CALL_CONFIG, {\n optional: true\n }) as unknown as RemoteCallConfig[];\n\n public initializeState(state: State): State {\n const tempState = state;\n return (this.remoteCallConfigs ?? []).reduce(\n (s, config) => updateNgssmRemoteCallState(s, { remoteCalls: { [config.id]: { $set: { status: RemoteCallStatus.none } } } }),\n tempState\n );\n }\n}\n","import { inject, Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NGSSM_REMOTE_CALL_CONFIG, NgssmRemoteCallResultAction, RemoteCallConfig } from '../register-remote-call';\nimport { getDefaultRemoteCall, RemoteCallStatus } from '../remote-call';\nimport { updateNgssmRemoteCallState } from '../ngssm-remote-call.state';\n\n@Injectable()\nexport class RemoteCallReducer implements Reducer {\n private readonly remoteCallConfigs: RemoteCallConfig[] | null = inject(NGSSM_REMOTE_CALL_CONFIG, {\n optional: true\n }) as unknown as RemoteCallConfig[];\n\n public readonly processedActions: string[] = [];\n\n constructor() {\n (this.remoteCallConfigs ?? []).forEach((c) => this.processedActions.push(...[...c.triggeredActionTypes, ...c.resultActionTypes]));\n }\n\n public updateState(state: State, action: Action): State {\n const configs = (this.remoteCallConfigs ?? []).filter(\n (c) => c.triggeredActionTypes.includes(action.type) || c.resultActionTypes.includes(action.type)\n );\n let output = state;\n configs.forEach((config) => {\n if (config.triggeredActionTypes.includes(action.type)) {\n output = updateNgssmRemoteCallState(output, {\n remoteCalls: {\n [config.id]: { $set: getDefaultRemoteCall(RemoteCallStatus.inProgress) }\n }\n });\n } else {\n const ngssmRemoteCallResultAction = action as NgssmRemoteCallResultAction;\n output = updateNgssmRemoteCallState(output, {\n remoteCalls: {\n [config.id]: { $set: ngssmRemoteCallResultAction.remoteCall }\n }\n });\n }\n });\n\n return output;\n }\n}\n","import { Action } from 'ngssm-store';\n\nimport { RemoteCall } from './remote-call';\n\nexport enum NgssmRemoteCallActionType {\n setRemoteCall = '[NgssmRemoteCallActionType] setRemoteCall'\n}\n\nexport class SetRemoteCallAction implements Action {\n public readonly type: string = NgssmRemoteCallActionType.setRemoteCall;\n\n constructor(\n public readonly remoteCallId: string,\n public readonly remoteCall: RemoteCall\n ) {}\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmRemoteCallActionType, SetRemoteCallAction } from '../actions';\nimport { updateNgssmRemoteCallState } from '../ngssm-remote-call.state';\n\n@Injectable()\nexport class RemoteCallSetterReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmRemoteCallActionType.setRemoteCall];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmRemoteCallActionType.setRemoteCall: {\n const setRemoteCallAction = action as SetRemoteCallAction;\n return updateNgssmRemoteCallState(state, {\n remoteCalls: {\n [setRemoteCallAction.remoteCallId]: { $set: setRemoteCallAction.remoteCall }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { NGSSM_STATE_INITIALIZER, provideReducers } from 'ngssm-store';\n\nimport { NgssmRemoteCallStateInitializer } from './ngssm-remote-call-state-initializer';\nimport { RemoteCallReducer, RemoteCallSetterReducer } from './reducers';\n\nexport const provideNgssmRemoteCall = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n { provide: NGSSM_STATE_INITIALIZER, useClass: NgssmRemoteCallStateInitializer, multi: true },\n provideReducers(RemoteCallSetterReducer, RemoteCallReducer)\n ]);\n};\n","import { State } from 'ngssm-store';\n\nimport { getDefaultRemoteCall, RemoteCall, RemoteCallStatus } from './remote-call';\nimport { selectNgssmRemoteCallState } from './ngssm-remote-call.state';\n\nexport const selectRemoteCall = (state: State, id: string): RemoteCall =>\n selectNgssmRemoteCallState(state).remoteCalls[id] ?? getDefaultRemoteCall();\n\n/**\n * Returns true if the specified remote call is currently in progress, false otherwise.\n * @param state The global application state.\n * @param remoteCallId The unique id of the remote call.\n */\nexport const isNgssmRemoteCallInProgress = (state: State, remoteCallId: string): boolean =>\n selectRemoteCall(state, remoteCallId)?.status === RemoteCallStatus.inProgress;\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, Injector, inject } from '@angular/core';\n\nimport { ActionDispatcher, Logger, Store } from 'ngssm-store';\nimport { NgssmNotifierService } from 'ngssm-toolkit';\n\nimport { SetRemoteCallAction } from './actions';\nimport { RemoteCallStatus } from './remote-call';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RemoteCallResultProcessor {\n private readonly logger = inject(Logger);\n\n // Inject Injector instead of Store because Effects are injected into Store and this class may be used by Effects\n private readonly injector = inject(Injector);\n private readonly notifier = inject(NgssmNotifierService);\n\n public processRemoteCallError(remoteCallId: string, error: HttpErrorResponse, errorMessage: string): void {\n this.logger.error(errorMessage, error);\n this.notifier.notifyError(`${errorMessage}: ${error.message}`);\n this.injector\n .get(Store)\n .dispatchAction(\n new SetRemoteCallAction(remoteCallId, { status: RemoteCallStatus.ko, httpErrorResponse: error, message: errorMessage })\n );\n }\n\n public processRemoteCallSuccess(remoteCallId: string, message: string): void {\n this.logger.information(message);\n this.notifier.notifySuccess(message);\n this.injector.get(Store).dispatchAction(new SetRemoteCallAction(remoteCallId, { status: RemoteCallStatus.done }));\n }\n}\n\n/**\n * Helper method to process http error.\n *\n * Use instead the service RemoteCallResultProcessor.\n *\n * @param error The http error response.\n * @param errorMessage The custom error message.\n * @param remoteCallId The remote call identifier.\n * @param actionDispatcher The action dispatcher.\n * @param logger The logger.\n * @param notifier The message notifier.\n */\nexport const processRemoteCallError = (\n error: HttpErrorResponse,\n errorMessage: string,\n remoteCallId: string,\n actionDispatcher: ActionDispatcher,\n logger: Logger,\n notifier: NgssmNotifierService\n): void => {\n logger.error(errorMessage, error);\n notifier.notifyError(`${errorMessage}: ${error.error?.title}`);\n actionDispatcher.dispatchAction(new SetRemoteCallAction(remoteCallId, { status: RemoteCallStatus.ko, error: error.error }));\n};\n","import { Component, ChangeDetectionStrategy, signal, input, effect } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { createSignal } from 'ngssm-store';\n\nimport { RemoteCall, RemoteCallStatus } from '../remote-call';\nimport { selectNgssmRemoteCallState } from '../ngssm-remote-call.state';\n\n@Component({\n selector: 'ngssm-remote-call-error',\n imports: [CommonModule, MatButtonModule, MatIconModule],\n templateUrl: './ngssm-remote-call-error.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ngssm-remote-call-error'\n }\n})\nexport class NgssmRemoteCallErrorComponent {\n private readonly remoteCalls = createSignal((state) => selectNgssmRemoteCallState(state).remoteCalls);\n\n public readonly remoteCallId = input<string>('');\n\n public readonly errorContainerRendered = signal<boolean>(false);\n public readonly errorDescription = signal<string>('');\n\n constructor() {\n effect(() => {\n const id = this.remoteCallId();\n const remoteCall: RemoteCall = this.remoteCalls()[id];\n this.errorContainerRendered.set(remoteCall?.status === RemoteCallStatus.ko);\n const description: string =\n remoteCall?.status !== RemoteCallStatus.ko\n ? ''\n : remoteCall.message\n ? remoteCall.message\n : remoteCall.httpErrorResponse\n ? JSON.stringify(remoteCall.httpErrorResponse, null, 2)\n : remoteCall.error\n ? JSON.stringify(remoteCall.error, null, 2)\n : 'No error description provided!';\n this.errorDescription.set(description);\n });\n }\n}\n","@if (errorContainerRendered()) {\n <div class=\"ngssm-remote-call-error-container\">\n {{ errorDescription() }}\n\n <button mat-icon-button color=\"warn\" class=\"ngssm-remote-call-error-close-button\" (click)=\"errorContainerRendered.set(false)\">\n <mat-icon class=\"fa-solid fa-square-xmark\"></mat-icon>\n </button>\n </div>\n}\n","/*\n * Public API Surface of ngssm-remote-data\n */\n\nexport * from './lib/remote-data/public-api';\nexport * from './lib/ngssm-remote-call/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i5"],"mappings":";;;;;;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,UAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,UAAA,CAAA,OAAA,CAAA,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CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,6BAA6B,iSCnB1C,+VASA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDGY,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,eAAe,uNAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAO3C,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBATzC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,EAAA,OAAA,EAC1B,CAAC,YAAY,EAAE,eAAe,EAAE,aAAa,CAAC,EAAA,eAAA,EAEtC,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE;AACR,qBAAA,EAAA,QAAA,EAAA,+VAAA,EAAA;;;AEjBH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngssm-remote-data.mjs","sources":["../../../projects/ngssm-remote-data/src/lib/remote-data/model/data-status.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/model/remote-data.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/model/remote-data-provider.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/state/remote-data.state.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/state/selectors.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/actions/remote-data-action-type.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/actions/load-remote-data.action.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/actions/register-loaded-remote-data.action.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/guards/remote-data-loading.guard.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-remote-data-reload-button/ngssm-remote-data-reload-button.component.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-remote-data-reload-button/ngssm-remote-data-reload-button.component.html","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches-display-button/ngssm-caches-display-button.component.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches-display-button/ngssm-caches-display-button.component.html","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches/ngssm-caches.component.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/components/ngssm-caches/ngssm-caches.component.html","../../../projects/ngssm-remote-data/src/lib/remote-data/effects/caches-display.effect.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/effects/remote-data-loading.effect.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/reducers/remote-data.reducer.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/remote-data-state-initializer.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/provide-ngssm-remote-data.ts","../../../projects/ngssm-remote-data/src/lib/remote-data/public-api.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/register-remote-call.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/remote-call.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call.state.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call-state-initializer.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/reducers/remote-call.reducer.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/actions.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/reducers/remote-call-setter.reducer.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/provide-ngssm-remote-call.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/selectors.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/remote-call-result-processor.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call-error/ngssm-remote-call-error.component.ts","../../../projects/ngssm-remote-data/src/lib/ngssm-remote-call/ngssm-remote-call-error/ngssm-remote-call-error.component.html","../../../projects/ngssm-remote-data/src/public-api.ts","../../../projects/ngssm-remote-data/src/ngssm-remote-data.ts"],"sourcesContent":["export enum DataStatus {\n none = 'None',\n loading = 'Loading',\n loaded = 'Loaded',\n notFound = 'NotFound',\n error = 'Error'\n}\n","import { DataStatus } from './data-status';\nimport { RemoteCallError } from './remote-call-error';\nimport { RemoteDataGetterParams } from './remote-data-getter-params';\n\nexport interface RemoteData<TData = unknown, TGetterParams = unknown> {\n status: DataStatus;\n data?: TData;\n timestamp?: Date;\n message?: string;\n error?: RemoteCallError;\n getterParams?: RemoteDataGetterParams<TGetterParams>;\n}\n\nexport const getDefaultRemoteData = <T>(defaultValue?: T, defaultStatus: DataStatus = DataStatus.none): RemoteData<T> => ({\n status: defaultStatus,\n data: defaultValue\n});\n","import { EnvironmentProviders, InjectionToken, Type, makeEnvironmentProviders } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { RemoteDataGetterParams } from './remote-data-getter-params';\n\nexport interface RemoteDataProvider<TData = unknown, TValue = unknown> {\n readonly remoteDataKey: string;\n readonly cacheDurationInSeconds?: number;\n\n get(params?: RemoteDataGetterParams<TValue>): Observable<TData>;\n}\n\nexport const NGSSM_REMOTE_DATA_PROVIDER = new InjectionToken<RemoteDataProvider>('NGSSM_REMOTE_DATA_PROVIDER');\n\nexport const provideRemoteDataProviders = (...providers: Type<RemoteDataProvider>[]): EnvironmentProviders => {\n return makeEnvironmentProviders(providers.map((provider) => ({ provide: NGSSM_REMOTE_DATA_PROVIDER, useClass: provider, multi: true })));\n};\n\nexport type RemoteDataLoadingFunc<TData = unknown, TValue = unknown> = (params?: RemoteDataGetterParams<TValue>) => Observable<TData>;\n\nexport const provideRemoteDataFunc = <TData = unknown, TValue = unknown>(\n remoteDataKey: string,\n remoteDataLoadingFunc: RemoteDataLoadingFunc<TData, TValue>,\n cacheDurationInSeconds?: number\n): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_REMOTE_DATA_PROVIDER,\n useFactory: () => {\n const provider: RemoteDataProvider<TData, TValue> = {\n remoteDataKey,\n cacheDurationInSeconds,\n get: remoteDataLoadingFunc\n };\n return provider;\n },\n multi: true\n }\n ]);\n};\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nimport { RemoteData } from '../model';\n\nexport const selectRemoteDataState = (state: State): RemoteDataState =>\n state[RemoteDataStateSpecification.featureStateKey] as RemoteDataState;\n\nexport const updateRemoteDataState = (state: State, command: Spec<RemoteDataState, never>): State =>\n update(state, {\n [RemoteDataStateSpecification.featureStateKey]: command\n });\n\nexport type RemoteDataState = Record<string, RemoteData<unknown>>;\n\n@NgSsmFeatureState({\n featureStateKey: RemoteDataStateSpecification.featureStateKey,\n initialState: RemoteDataStateSpecification.initialState\n})\nexport class RemoteDataStateSpecification {\n public static readonly featureStateKey = 'remote-data-state';\n public static readonly initialState: RemoteDataState = {};\n}\n","import { State } from 'ngssm-store';\n\nimport { selectRemoteDataState } from './remote-data.state';\nimport { RemoteData } from '../model';\n\nexport const selectRemoteData = <TData = unknown>(state: State, remoteDataKey: string): RemoteData<TData> | undefined =>\n selectRemoteDataState(state)[remoteDataKey] as RemoteData<TData>;\n","export enum RemoteDataActionType {\n loadRemoteData = '[RemoteDataActionType] loadRemoteData',\n registerLoadedRemoteData = '[RemoteDataActionType] registerLoadedRemoteData',\n displayCaches = '[RemoteDataActionType] displayCaches',\n closeCachesComponent = '[RemoteDataActionType] closeCachesComponent'\n}\n","import { Action } from 'ngssm-store';\n\nimport { ReloadParams } from '../model';\nimport { RemoteDataActionType } from './remote-data-action-type';\n\nexport class LoadRemoteDataAction<TValue = unknown> implements Action {\n public readonly type: string = RemoteDataActionType.loadRemoteData;\n\n constructor(\n public readonly remoteDataKey: string,\n public readonly params?: ReloadParams<TValue>\n ) {}\n}\n","import { Action } from 'ngssm-store';\n\nimport { DataStatus, RemoteCallError } from '../model';\nimport { RemoteDataActionType } from './remote-data-action-type';\n\nexport class RegisterLoadedRemoteDataAction<T = unknown> implements Action {\n public readonly type: string = RemoteDataActionType.registerLoadedRemoteData;\n\n constructor(\n public readonly remoteDataKey: string,\n public readonly status: DataStatus,\n public readonly data: T,\n public readonly message?: string,\n public readonly remoteCallError?: RemoteCallError\n ) {}\n}\n","import { inject, Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, UrlTree } from '@angular/router';\nimport { Observable } from 'rxjs';\n\nimport { Store } from 'ngssm-store';\n\nimport { LoadRemoteDataAction } from '../actions';\nimport { ReloadParams } from '../model';\n\nexport interface RemoteDataLoadingGuardItem {\n remoteDataKey: string;\n forceReload?: boolean;\n}\n\nexport interface RemoteDataLoadingGuardParameters {\n remoteDataItems: RemoteDataLoadingGuardItem[];\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RemoteDataLoadingGuard {\n private readonly store = inject(Store);\n\n public canActivate(route: ActivatedRouteSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n const parameters = route.data as RemoteDataLoadingGuardParameters;\n (parameters?.remoteDataItems ?? []).forEach((item) => {\n this.store.dispatchAction(new LoadRemoteDataAction(item.remoteDataKey, { forceReload: item.forceReload === true }));\n });\n\n return true;\n }\n}\n\nexport const ngssmReloadRemoteData = <TData = unknown>(\n remoteDataKey: string,\n params: ReloadParams<TData> = { forceReload: true }\n): (() => boolean) => {\n return () => {\n inject(Store).dispatchAction(new LoadRemoteDataAction(remoteDataKey, params));\n return true;\n };\n};\n","import { Component, ChangeDetectionStrategy, signal, input, inject, effect } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { createSignal, Store } from 'ngssm-store';\n\nimport { LoadRemoteDataAction } from '../../actions';\nimport { selectRemoteDataState } from '../../state';\nimport { DataStatus } from '../../model';\n\nconst datePipe = new DatePipe('en-US');\n\n@Component({\n selector: 'ngssm-remote-data-reload-button',\n imports: [MatIconModule, MatButtonModule, MatTooltipModule, MatProgressSpinnerModule],\n templateUrl: './ngssm-remote-data-reload-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmRemoteDataReloadButtonComponent {\n public readonly tooltipMessage = signal<string>('');\n public readonly disabled = signal<boolean>(true);\n public readonly inLoadingStatus = signal<boolean>(false);\n\n public actionTypes = input<string[]>([]);\n public remoteDataKeys = input<string[]>([]);\n\n private readonly store = inject(Store);\n private readonly remoteDataState = createSignal((state) => selectRemoteDataState(state));\n\n constructor() {\n effect(() => {\n const remoteDataState = this.remoteDataState();\n const keys = this.remoteDataKeys();\n\n this.inLoadingStatus.set(keys.findIndex((v) => remoteDataState[v]?.status === DataStatus.loading) !== -1);\n this.disabled.set(this.inLoadingStatus() === true || keys.findIndex((v) => !!remoteDataState[v]) === -1);\n let timestamp: Date | undefined;\n keys.forEach((key) => {\n const keyTimestamp = remoteDataState[key]?.timestamp;\n if (keyTimestamp) {\n if (!timestamp || timestamp.getTime() > keyTimestamp.getTime()) {\n timestamp = keyTimestamp;\n }\n }\n });\n\n let tooltiMessage = 'Reload data.';\n if (timestamp) {\n tooltiMessage = [tooltiMessage, `Loaded at ${datePipe.transform(timestamp, 'mediumTime')}`].join('\\n');\n }\n this.tooltipMessage.set(tooltiMessage);\n });\n }\n\n public reload(): void {\n this.remoteDataKeys().forEach((key) =>\n this.store.dispatchAction(new LoadRemoteDataAction(key, { forceReload: true, keepStoredGetterParams: true }))\n );\n this.actionTypes().forEach((type) => this.store.dispatchActionType(type));\n }\n}\n","<button\n mat-icon-button\n color=\"primary\"\n (click)=\"reload()\"\n [matTooltip]=\"tooltipMessage()\"\n [disabled]=\"disabled() === true\"\n id=\"reloadButton\">\n @if (inLoadingStatus()) {\n <mat-spinner [diameter]=\"24\" id=\"loadingSpinner\"></mat-spinner>\n } @else {\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n }\n</button>\n","import { Component, ChangeDetectionStrategy, inject } from '@angular/core';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { Store } from 'ngssm-store';\n\nimport { RemoteDataActionType } from '../../actions';\n\n@Component({\n selector: 'ngssm-caches-display-button',\n imports: [MatButtonModule, MatIconModule, MatTooltipModule],\n templateUrl: './ngssm-caches-display-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmCachesDisplayButtonComponent {\n private readonly store = inject(Store);\n\n public displayCaches(): void {\n this.store.dispatchActionType(RemoteDataActionType.displayCaches);\n }\n}\n","<button mat-icon-button matTooltip=\"Display caches\" (click)=\"displayCaches()\">\n <mat-icon class=\"fa-solid fa-cloud-bolt\"></mat-icon>\n</button>\n","import { Component, ChangeDetectionStrategy, inject } from '@angular/core';\n\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTableModule } from '@angular/material/table';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { createSignal, Store } from 'ngssm-store';\n\nimport { RemoteDataActionType, LoadRemoteDataAction } from '../../actions';\nimport { DataStatus, RemoteData } from '../../model';\nimport { selectRemoteDataState } from '../../state';\n\ninterface Cache {\n key: string;\n value: RemoteData;\n}\n\n@Component({\n selector: 'ngssm-caches',\n imports: [MatDialogModule, MatButtonModule, MatTableModule, MatIconModule, MatProgressSpinnerModule],\n templateUrl: './ngssm-caches.component.html',\n styleUrls: ['./ngssm-caches.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmCachesComponent {\n public readonly caches = createSignal<Cache[]>((state) => {\n const remoteDataState = selectRemoteDataState(state);\n return Object.keys(remoteDataState).map((key) => ({\n key,\n value: remoteDataState[key]\n }));\n });\n\n public readonly dataStatus = DataStatus;\n\n private readonly store = inject(Store);\n\n public close(): void {\n this.store.dispatchActionType(RemoteDataActionType.closeCachesComponent);\n }\n\n public reloadCache(cache: Cache): void {\n this.store.dispatchAction(new LoadRemoteDataAction(cache.key, { forceReload: true, keepStoredGetterParams: true }));\n }\n}\n","<h1 mat-dialog-title>List of caches</h1>\n<mat-dialog-content class=\"flex-column-stretch fxFlex\">\n <mat-table [dataSource]=\"caches()\" class=\"fxFlex\">\n <ng-container matColumnDef=\"actions\">\n <mat-header-cell *matHeaderCellDef> </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n <button\n mat-icon-button\n [disabled]=\"element.value.status === dataStatus.loading\"\n (click)=\"reloadCache(element)\"\n color=\"primary\"\n id=\"reload_{{ element.key }}\">\n <mat-icon class=\"fa-solid fa-rotate-right\"></mat-icon>\n </button>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"key\">\n <mat-header-cell *matHeaderCellDef> Key </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.key }} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <mat-header-cell *matHeaderCellDef> Status </mat-header-cell>\n <mat-cell *matCellDef=\"let element\">\n @switch (element.value.status) {\n @case (dataStatus.none) {\n <mat-icon class=\"fa-solid fa-minus\"></mat-icon>\n }\n @case (dataStatus.loaded) {\n <mat-icon class=\"fa-solid fa-check\" color=\"primary\"></mat-icon>\n }\n @case (dataStatus.error) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.notFound) {\n <mat-icon class=\"fa-solid fa-xmark\" color=\"warn\"></mat-icon>\n }\n @case (dataStatus.loading) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n }\n }\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"timestamp\">\n <mat-header-cell *matHeaderCellDef> Timestamp </mat-header-cell>\n <mat-cell *matCellDef=\"let element\"> {{ element.value.timestamp }} </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['actions', 'status', 'key', 'timestamp']; sticky: true\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: ['actions', 'status', 'key', 'timestamp']\"></mat-row>\n </mat-table>\n</mat-dialog-content>\n<mat-dialog-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button (click)=\"close()\" id=\"closeButton\">Close</button>\n</mat-dialog-actions>\n","import { Injectable, inject } from '@angular/core';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\n\nimport { Effect, State, Action, ActionDispatcher } from 'ngssm-store';\nimport { RemoteDataActionType } from '../actions';\nimport { NgssmCachesComponent } from '../components';\n\n@Injectable()\nexport class CachesDisplayEffect implements Effect {\n public readonly processedActions: string[] = [RemoteDataActionType.displayCaches, RemoteDataActionType.closeCachesComponent];\n\n private readonly matDialog = inject(MatDialog);\n\n private dialog: MatDialogRef<NgssmCachesComponent> | undefined;\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n switch (action.type) {\n case RemoteDataActionType.displayCaches: {\n this.dialog = this.matDialog.open(NgssmCachesComponent, {\n disableClose: true\n });\n\n break;\n }\n\n case RemoteDataActionType.closeCachesComponent: {\n this.dialog?.close();\n this.dialog = undefined;\n\n break;\n }\n }\n }\n}\n","import { EnvironmentInjector, Injectable, runInInjectionContext, inject } from '@angular/core';\n\nimport { Effect, State, Action, ActionDispatcher } from 'ngssm-store';\nimport { NgssmNotifierService } from 'ngssm-toolkit';\n\nimport { LoadRemoteDataAction, RegisterLoadedRemoteDataAction, RemoteDataActionType } from '../actions';\nimport { DataStatus, RemoteDataProvider, NGSSM_REMOTE_DATA_PROVIDER } from '../model';\nimport { selectRemoteDataState } from '../state';\n\n@Injectable()\nexport class RemoteDataLoadingEffect implements Effect {\n public readonly processedActions: string[] = [RemoteDataActionType.loadRemoteData];\n\n private readonly remoteDataProviders: RemoteDataProvider[] | null = inject(NGSSM_REMOTE_DATA_PROVIDER, {\n optional: true\n }) as unknown as RemoteDataProvider[];\n private readonly notifierService = inject(NgssmNotifierService);\n private readonly injector = inject(EnvironmentInjector);\n\n private readonly remoteDataProvidersPerKey: Map<string, RemoteDataProvider>;\n\n constructor() {\n this.remoteDataProvidersPerKey = new Map<string, RemoteDataProvider>((this.remoteDataProviders ?? []).map((r) => [r.remoteDataKey, r]));\n }\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n const loadRemoteDataAction = action as LoadRemoteDataAction;\n const item = selectRemoteDataState(state)[loadRemoteDataAction.remoteDataKey];\n const provider = this.remoteDataProvidersPerKey.get(loadRemoteDataAction.remoteDataKey);\n\n if (!item || !provider || item.status !== DataStatus.loading) {\n return;\n }\n\n runInInjectionContext(this.injector, () => {\n provider.get(item.getterParams).subscribe({\n next: (value) => {\n actiondispatcher.dispatchAction(new RegisterLoadedRemoteDataAction(loadRemoteDataAction.remoteDataKey, DataStatus.loaded, value));\n if (item.getterParams?.callbackAction) {\n actiondispatcher.dispatchActionType(item.getterParams.callbackAction);\n }\n },\n error: (error) => {\n console.error(`Unable to load data for '${loadRemoteDataAction.remoteDataKey}'`, error);\n if (item.getterParams?.errorNotificationMessage) {\n this.notifierService.notifyError(item.getterParams.errorNotificationMessage(error?.error));\n }\n\n actiondispatcher.dispatchAction(\n new RegisterLoadedRemoteDataAction(loadRemoteDataAction.remoteDataKey, DataStatus.error, undefined, error?.error)\n );\n }\n });\n });\n }\n}\n","import { Injectable, inject } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { LoadRemoteDataAction, RegisterLoadedRemoteDataAction, RemoteDataActionType } from '../actions';\nimport { DataStatus, RemoteDataProvider, NGSSM_REMOTE_DATA_PROVIDER } from '../model';\nimport { selectRemoteDataState, updateRemoteDataState } from '../state';\n\n@Injectable()\nexport class RemoteDataReducer implements Reducer {\n public readonly processedActions: string[] = [RemoteDataActionType.loadRemoteData, RemoteDataActionType.registerLoadedRemoteData];\n\n private readonly remoteDataProviders: RemoteDataProvider[] | null = inject(NGSSM_REMOTE_DATA_PROVIDER, {\n optional: true\n }) as unknown as RemoteDataProvider[];\n\n private readonly remoteDataProvidersPerKey: Map<string, RemoteDataProvider>;\n\n constructor() {\n this.remoteDataProvidersPerKey = new Map<string, RemoteDataProvider>((this.remoteDataProviders ?? []).map((r) => [r.remoteDataKey, r]));\n }\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case RemoteDataActionType.loadRemoteData: {\n const loadRemoteDataAction = action as LoadRemoteDataAction;\n const item = selectRemoteDataState(state)[loadRemoteDataAction.remoteDataKey];\n if (!item) {\n return state;\n }\n\n const provider = this.remoteDataProvidersPerKey.get(loadRemoteDataAction.remoteDataKey);\n if (!provider) {\n return state;\n }\n\n if (\n !provider.cacheDurationInSeconds ||\n loadRemoteDataAction.params?.forceReload === true ||\n item.status === DataStatus.none ||\n item.status === DataStatus.error ||\n item.status === DataStatus.notFound ||\n !item.timestamp ||\n new Date().getTime() - item.timestamp.getTime() >= 1000 * provider.cacheDurationInSeconds\n ) {\n return updateRemoteDataState(state, {\n [loadRemoteDataAction.remoteDataKey]: {\n status: { $set: DataStatus.loading },\n getterParams: {\n $apply: (value) => {\n if (!loadRemoteDataAction.params || loadRemoteDataAction.params.keepStoredGetterParams !== true) {\n return loadRemoteDataAction.params?.params;\n }\n\n return value;\n }\n }\n }\n });\n }\n\n break;\n }\n\n case RemoteDataActionType.registerLoadedRemoteData: {\n const registerLoadedRemoteDataAction = action as RegisterLoadedRemoteDataAction;\n if (this.remoteDataProvidersPerKey.has(registerLoadedRemoteDataAction.remoteDataKey)) {\n return updateRemoteDataState(state, {\n [registerLoadedRemoteDataAction.remoteDataKey]: {\n status: { $set: registerLoadedRemoteDataAction.status },\n data: { $set: registerLoadedRemoteDataAction.data },\n timestamp: { $set: new Date() },\n message: { $set: registerLoadedRemoteDataAction.message },\n error: { $set: registerLoadedRemoteDataAction.remoteCallError }\n }\n });\n }\n\n break;\n }\n }\n\n return state;\n }\n}\n","import { Injectable, inject } from '@angular/core';\n\nimport { State, StateInitializer } from 'ngssm-store';\n\nimport { DataStatus, RemoteDataProvider, NGSSM_REMOTE_DATA_PROVIDER } from './model';\nimport { updateRemoteDataState } from './state';\n\n@Injectable()\nexport class RemoteDataStateInitializer implements StateInitializer {\n private readonly remoteDataProviders: RemoteDataProvider[] | null = inject(NGSSM_REMOTE_DATA_PROVIDER, {\n optional: true\n }) as unknown as RemoteDataProvider[];\n\n public initializeState(state: State): State {\n const tempState = state;\n return (this.remoteDataProviders ?? []).reduce(\n (s, provider) => updateRemoteDataState(s, { [provider.remoteDataKey]: { $set: { status: DataStatus.none } } }),\n tempState\n );\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { NGSSM_STATE_INITIALIZER, provideEffects, provideReducer } from 'ngssm-store';\n\nimport { CachesDisplayEffect, RemoteDataLoadingEffect } from './effects';\nimport { RemoteDataReducer } from './reducers/remote-data.reducer';\nimport { RemoteDataStateInitializer } from './remote-data-state-initializer';\n\nexport const provideNgssmRemoteData = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideReducer(RemoteDataReducer),\n provideEffects(CachesDisplayEffect, RemoteDataLoadingEffect),\n { provide: NGSSM_STATE_INITIALIZER, useClass: RemoteDataStateInitializer, multi: true }\n ]);\n};\n","/*\n * Public API Surface of ngssm-remote-data\n */\n\nexport * from './model';\nexport * from './state';\nexport * from './actions';\nexport * from './guards';\nexport * from './components';\nexport * from './provide-ngssm-remote-data';\n","import { InjectionToken, Provider } from '@angular/core';\n\nimport { Action } from 'ngssm-store';\n\nimport { RemoteCall } from './remote-call';\n\n/**\n * Represents an action that encapsulates the result of a remote call.\n *\n * This action is typically dispatched when a remote call completes,\n * carrying both the action type and the associated remote call data.\n *\n * @remarks\n * Implements the `Action` interface.\n *\n * @param type - The type of the action.\n * @param remoteCall - The remote call instance containing the result details.\n */\nexport class NgssmRemoteCallResultAction implements Action {\n constructor(\n public readonly type: string,\n public readonly remoteCall: RemoteCall\n ) {}\n}\n\n// Configuration for a remote call, including its identifier and associated action types.\nexport interface RemoteCallConfig {\n id: string; // Unique identifier for the remote call\n triggeredActionTypes: string[]; // Action types that trigger the remote call\n resultActionTypes: string[]; // Action derived from NgssmRemoteCallResultAction that will notify end of call\n}\n\n/**\n * Injection token for providing NGSSM remote call configuration.\n * Used to register and inject RemoteCallConfig objects in Angular's dependency injection system.\n */\nexport const NGSSM_REMOTE_CALL_CONFIG = new InjectionToken<RemoteCallConfig>('NGSSM_REMOTE_CALL_CONFIG');\n\n/**\n * Provides the configuration for NGSSM remote calls as an Angular provider.\n *\n * @param config - The remote call configuration object to be provided.\n * @returns An Angular provider object that supplies the given configuration for NGSSM remote calls.\n *\n * @remarks\n * This function is intended to be used in Angular module providers to register\n * multiple remote call configurations using the `multi: true` option.\n */\nexport const provideNgssmRemoteCallConfig = (config: RemoteCallConfig): Provider => ({\n provide: NGSSM_REMOTE_CALL_CONFIG,\n useValue: config,\n multi: true\n});\n","import { HttpErrorResponse } from '@angular/common/http';\n\n// Represents the possible statuses of a remote call.\nexport enum RemoteCallStatus {\n none = 'None', // No call has been made yet\n inProgress = 'In progress', // The remote call is currently in progress\n done = 'Done', // The remote call completed successfully\n ko = 'Ko' // The remote call failed\n}\n\n/**\n * Describes the state and result of a remote call, including error information if applicable.\n *\n * Note that the property error is only here to ensure compatibility with previous versions. It will be removed in a future release.\n * Only the processRemoteCallError helper sets this property.\n * The service RemoteCallResultProcessor which must be used instead of the helper does not set this property.\n */\nexport interface RemoteCall<TErrorType = unknown> {\n status: RemoteCallStatus; // The current status of the remote call\n httpErrorResponse?: HttpErrorResponse; // Optional HTTP error response if the call failed\n message?: string; // Optional message describing the result or error\n error?: TErrorType; // Error property of HttpErrorResponse => to avoid too many impacts on code using this.\n}\n\n/**\n * Returns a default RemoteCall object with the specified status (defaults to 'none').\n * @param status The status to set for the remote call.\n * @returns A RemoteCall object with the given status.\n */\nexport const getDefaultRemoteCall = (status: RemoteCallStatus = RemoteCallStatus.none): RemoteCall => ({ status });\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nimport { RemoteCall } from './remote-call';\n\nexport const selectNgssmRemoteCallState = (state: State): NgssmRemoteCallState =>\n state[NgssmRemoteCallStateSpecification.featureStateKey] as NgssmRemoteCallState;\n\nexport const updateNgssmRemoteCallState = (state: State, command: Spec<NgssmRemoteCallState, never>): State =>\n update(state, {\n [NgssmRemoteCallStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmRemoteCallState {\n remoteCalls: Record<string, RemoteCall>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmRemoteCallStateSpecification.featureStateKey,\n initialState: NgssmRemoteCallStateSpecification.initialState\n})\nexport class NgssmRemoteCallStateSpecification {\n public static readonly featureStateKey = 'ngssm-remote-call-state';\n public static readonly initialState: NgssmRemoteCallState = {\n remoteCalls: {}\n };\n}\n","import { inject, Injectable } from '@angular/core';\n\nimport { State, StateInitializer } from 'ngssm-store';\n\nimport { NGSSM_REMOTE_CALL_CONFIG, RemoteCallConfig } from './register-remote-call';\nimport { RemoteCallStatus } from './remote-call';\nimport { updateNgssmRemoteCallState } from './ngssm-remote-call.state';\n\n@Injectable()\nexport class NgssmRemoteCallStateInitializer implements StateInitializer {\n private readonly remoteCallConfigs: RemoteCallConfig[] | null = inject(NGSSM_REMOTE_CALL_CONFIG, {\n optional: true\n }) as unknown as RemoteCallConfig[];\n\n public initializeState(state: State): State {\n const tempState = state;\n return (this.remoteCallConfigs ?? []).reduce(\n (s, config) => updateNgssmRemoteCallState(s, { remoteCalls: { [config.id]: { $set: { status: RemoteCallStatus.none } } } }),\n tempState\n );\n }\n}\n","import { inject, Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NGSSM_REMOTE_CALL_CONFIG, NgssmRemoteCallResultAction, RemoteCallConfig } from '../register-remote-call';\nimport { getDefaultRemoteCall, RemoteCallStatus } from '../remote-call';\nimport { updateNgssmRemoteCallState } from '../ngssm-remote-call.state';\n\n@Injectable()\nexport class RemoteCallReducer implements Reducer {\n public readonly processedActions: string[] = [];\n\n private readonly remoteCallConfigs: RemoteCallConfig[] | null = inject(NGSSM_REMOTE_CALL_CONFIG, {\n optional: true\n }) as unknown as RemoteCallConfig[];\n\n constructor() {\n (this.remoteCallConfigs ?? []).forEach((c) => this.processedActions.push(...[...c.triggeredActionTypes, ...c.resultActionTypes]));\n }\n\n public updateState(state: State, action: Action): State {\n const configs = (this.remoteCallConfigs ?? []).filter(\n (c) => c.triggeredActionTypes.includes(action.type) || c.resultActionTypes.includes(action.type)\n );\n let output = state;\n configs.forEach((config) => {\n if (config.triggeredActionTypes.includes(action.type)) {\n output = updateNgssmRemoteCallState(output, {\n remoteCalls: {\n [config.id]: { $set: getDefaultRemoteCall(RemoteCallStatus.inProgress) }\n }\n });\n } else {\n const ngssmRemoteCallResultAction = action as NgssmRemoteCallResultAction;\n output = updateNgssmRemoteCallState(output, {\n remoteCalls: {\n [config.id]: { $set: ngssmRemoteCallResultAction.remoteCall }\n }\n });\n }\n });\n\n return output;\n }\n}\n","import { Action } from 'ngssm-store';\n\nimport { RemoteCall } from './remote-call';\n\nexport enum NgssmRemoteCallActionType {\n setRemoteCall = '[NgssmRemoteCallActionType] setRemoteCall'\n}\n\nexport class SetRemoteCallAction implements Action {\n public readonly type: string = NgssmRemoteCallActionType.setRemoteCall;\n\n constructor(\n public readonly remoteCallId: string,\n public readonly remoteCall: RemoteCall\n ) {}\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmRemoteCallActionType, SetRemoteCallAction } from '../actions';\nimport { updateNgssmRemoteCallState } from '../ngssm-remote-call.state';\n\n@Injectable()\nexport class RemoteCallSetterReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmRemoteCallActionType.setRemoteCall];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmRemoteCallActionType.setRemoteCall: {\n const setRemoteCallAction = action as SetRemoteCallAction;\n return updateNgssmRemoteCallState(state, {\n remoteCalls: {\n [setRemoteCallAction.remoteCallId]: { $set: setRemoteCallAction.remoteCall }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { NGSSM_STATE_INITIALIZER, provideReducers } from 'ngssm-store';\n\nimport { NgssmRemoteCallStateInitializer } from './ngssm-remote-call-state-initializer';\nimport { RemoteCallReducer, RemoteCallSetterReducer } from './reducers';\n\nexport const provideNgssmRemoteCall = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n { provide: NGSSM_STATE_INITIALIZER, useClass: NgssmRemoteCallStateInitializer, multi: true },\n provideReducers(RemoteCallSetterReducer, RemoteCallReducer)\n ]);\n};\n","import { State } from 'ngssm-store';\n\nimport { getDefaultRemoteCall, RemoteCall, RemoteCallStatus } from './remote-call';\nimport { selectNgssmRemoteCallState } from './ngssm-remote-call.state';\n\nexport const selectRemoteCall = (state: State, id: string): RemoteCall =>\n selectNgssmRemoteCallState(state).remoteCalls[id] ?? getDefaultRemoteCall();\n\n/**\n * Returns true if the specified remote call is currently in progress, false otherwise.\n * @param state The global application state.\n * @param remoteCallId The unique id of the remote call.\n */\nexport const isNgssmRemoteCallInProgress = (state: State, remoteCallId: string): boolean =>\n selectRemoteCall(state, remoteCallId)?.status === RemoteCallStatus.inProgress;\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, Injector, inject } from '@angular/core';\n\nimport { ActionDispatcher, Logger, Store } from 'ngssm-store';\nimport { NgssmNotifierService } from 'ngssm-toolkit';\n\nimport { SetRemoteCallAction } from './actions';\nimport { RemoteCallStatus } from './remote-call';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RemoteCallResultProcessor {\n private readonly logger = inject(Logger);\n\n // Inject Injector instead of Store because Effects are injected into Store and this class may be used by Effects\n private readonly injector = inject(Injector);\n private readonly notifier = inject(NgssmNotifierService);\n\n public processRemoteCallError(remoteCallId: string, error: HttpErrorResponse, errorMessage: string): void {\n this.logger.error(errorMessage, error);\n this.notifier.notifyError(`${errorMessage}: ${error.message}`);\n this.injector\n .get(Store)\n .dispatchAction(\n new SetRemoteCallAction(remoteCallId, { status: RemoteCallStatus.ko, httpErrorResponse: error, message: errorMessage })\n );\n }\n\n public processRemoteCallSuccess(remoteCallId: string, message: string): void {\n this.logger.information(message);\n this.notifier.notifySuccess(message);\n this.injector.get(Store).dispatchAction(new SetRemoteCallAction(remoteCallId, { status: RemoteCallStatus.done }));\n }\n}\n\n/**\n * Helper method to process http error.\n *\n * Use instead the service RemoteCallResultProcessor.\n *\n * @param error The http error response.\n * @param errorMessage The custom error message.\n * @param remoteCallId The remote call identifier.\n * @param actionDispatcher The action dispatcher.\n * @param logger The logger.\n * @param notifier The message notifier.\n */\nexport const processRemoteCallError = (\n error: HttpErrorResponse,\n errorMessage: string,\n remoteCallId: string,\n actionDispatcher: ActionDispatcher,\n logger: Logger,\n notifier: NgssmNotifierService\n): void => {\n logger.error(errorMessage, error);\n notifier.notifyError(`${errorMessage}: ${error.error?.title}`);\n actionDispatcher.dispatchAction(new SetRemoteCallAction(remoteCallId, { status: RemoteCallStatus.ko, error: error.error }));\n};\n","import { Component, ChangeDetectionStrategy, signal, input, effect } from '@angular/core';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { createSignal } from 'ngssm-store';\n\nimport { RemoteCall, RemoteCallStatus } from '../remote-call';\nimport { selectNgssmRemoteCallState } from '../ngssm-remote-call.state';\n\n@Component({\n selector: 'ngssm-remote-call-error',\n imports: [MatButtonModule, MatIconModule],\n templateUrl: './ngssm-remote-call-error.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ngssm-remote-call-error'\n }\n})\nexport class NgssmRemoteCallErrorComponent {\n public readonly remoteCallId = input<string>('');\n\n public readonly errorContainerRendered = signal<boolean>(false);\n public readonly errorDescription = signal<string>('');\n\n private readonly remoteCalls = createSignal((state) => selectNgssmRemoteCallState(state).remoteCalls);\n\n constructor() {\n effect(() => {\n const id = this.remoteCallId();\n const remoteCall: RemoteCall = this.remoteCalls()[id];\n this.errorContainerRendered.set(remoteCall?.status === RemoteCallStatus.ko);\n const description: string =\n remoteCall?.status !== RemoteCallStatus.ko\n ? ''\n : remoteCall.message\n ? remoteCall.message\n : remoteCall.httpErrorResponse\n ? JSON.stringify(remoteCall.httpErrorResponse, null, 2)\n : remoteCall.error\n ? JSON.stringify(remoteCall.error, null, 2)\n : 'No error description provided!';\n this.errorDescription.set(description);\n });\n }\n}\n","@if (errorContainerRendered()) {\n <div class=\"ngssm-remote-call-error-container\">\n {{ errorDescription() }}\n\n <button mat-icon-button color=\"warn\" class=\"ngssm-remote-call-error-close-button\" (click)=\"errorContainerRendered.set(false)\">\n <mat-icon class=\"fa-solid fa-square-xmark\"></mat-icon>\n </button>\n </div>\n}\n","/*\n * Public API Surface of ngssm-remote-data\n */\n\nexport * from './lib/remote-data/public-api';\nexport * from './lib/ngssm-remote-call/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2","i1","i3","i4","i5"],"mappings":";;;;;;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,UAAA,CAAA,UAAA,CAAA,GA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AA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,EAAA,YAAA,EAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,yBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECnB1C,+VASA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDGY,eAAe,uNAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAO7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBATzC,SAAS;+BACE,yBAAyB,EAAA,OAAA,EAC1B,CAAC,eAAe,EAAE,aAAa,CAAC,EAAA,eAAA,EAExB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE;AACR,qBAAA,EAAA,QAAA,EAAA,+VAAA,EAAA;;;AEjBH;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngssm-remote-data",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.1.0",
|
|
4
4
|
"description": "NgSsm - Utilities to manage data loaded from remote services with the store.",
|
|
5
5
|
"author": "Lion Marc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"directory": "projects/ngssm-remote-data"
|
|
19
19
|
},
|
|
20
20
|
"module": "fesm2022/ngssm-remote-data.mjs",
|
|
21
|
-
"typings": "
|
|
21
|
+
"typings": "types/ngssm-remote-data.d.ts",
|
|
22
22
|
"exports": {
|
|
23
23
|
"./package.json": {
|
|
24
24
|
"default": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
".": {
|
|
27
|
-
"types": "./
|
|
27
|
+
"types": "./types/ngssm-remote-data.d.ts",
|
|
28
28
|
"default": "./fesm2022/ngssm-remote-data.mjs"
|
|
29
29
|
},
|
|
30
30
|
"./testing": {
|
|
31
|
-
"types": "./testing
|
|
31
|
+
"types": "./types/ngssm-remote-data-testing.d.ts",
|
|
32
32
|
"default": "./fesm2022/ngssm-remote-data-testing.mjs"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
2
|
+
import { InjectionToken, EnvironmentProviders, Type, Provider } from '@angular/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { Spec } from 'immutability-helper';
|
|
5
5
|
import { State, Action, StateInitializer, ActionDispatcher, Logger } from 'ngssm-store';
|
|
@@ -105,13 +105,13 @@ declare class RemoteDataLoadingGuard {
|
|
|
105
105
|
declare const ngssmReloadRemoteData: <TData = unknown>(remoteDataKey: string, params?: ReloadParams<TData>) => (() => boolean);
|
|
106
106
|
|
|
107
107
|
declare class NgssmRemoteDataReloadButtonComponent {
|
|
108
|
-
private readonly store;
|
|
109
|
-
private readonly remoteDataState;
|
|
110
108
|
readonly tooltipMessage: i0.WritableSignal<string>;
|
|
111
109
|
readonly disabled: i0.WritableSignal<boolean>;
|
|
112
110
|
readonly inLoadingStatus: i0.WritableSignal<boolean>;
|
|
113
111
|
actionTypes: i0.InputSignal<string[]>;
|
|
114
112
|
remoteDataKeys: i0.InputSignal<string[]>;
|
|
113
|
+
private readonly store;
|
|
114
|
+
private readonly remoteDataState;
|
|
115
115
|
constructor();
|
|
116
116
|
reload(): void;
|
|
117
117
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgssmRemoteDataReloadButtonComponent, never>;
|
|
@@ -130,9 +130,9 @@ interface Cache {
|
|
|
130
130
|
value: RemoteData;
|
|
131
131
|
}
|
|
132
132
|
declare class NgssmCachesComponent {
|
|
133
|
-
private readonly store;
|
|
134
133
|
readonly caches: i0.Signal<Cache[]>;
|
|
135
134
|
readonly dataStatus: typeof DataStatus;
|
|
135
|
+
private readonly store;
|
|
136
136
|
close(): void;
|
|
137
137
|
reloadCache(cache: Cache): void;
|
|
138
138
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgssmCachesComponent, never>;
|
|
@@ -288,10 +288,10 @@ declare class SetRemoteCallAction implements Action {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
declare class NgssmRemoteCallErrorComponent {
|
|
291
|
-
private readonly remoteCalls;
|
|
292
291
|
readonly remoteCallId: i0.InputSignal<string>;
|
|
293
292
|
readonly errorContainerRendered: i0.WritableSignal<boolean>;
|
|
294
293
|
readonly errorDescription: i0.WritableSignal<string>;
|
|
294
|
+
private readonly remoteCalls;
|
|
295
295
|
constructor();
|
|
296
296
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgssmRemoteCallErrorComponent, never>;
|
|
297
297
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgssmRemoteCallErrorComponent, "ngssm-remote-call-error", never, { "remoteCallId": { "alias": "remoteCallId"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
File without changes
|