@porscheinformatik/clr-addons 19.5.6 → 19.6.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.
@@ -9,15 +9,14 @@ export interface ClrHistoryModel {
9
9
  * The name of the page
10
10
  */
11
11
  pageName: string;
12
+ /**
13
+ * The tenant ID
14
+ */
15
+ tenantId: string;
12
16
  /**
13
17
  * The context of the page
14
18
  */
15
- context: {
16
- applicationName?: string;
17
- tenantid: string;
18
- context?: string;
19
- [key: string]: string | undefined;
20
- };
19
+ context?: string;
21
20
  /**
22
21
  * The title to be displayed.
23
22
  */
@@ -37,12 +36,3 @@ export interface ClrHistorySettingsModel {
37
36
  */
38
37
  username: string;
39
38
  }
40
- export interface ClrHistoryNotificationModel {
41
- username: string;
42
- pageName: string;
43
- applicationName?: string;
44
- tenantId: string;
45
- title: string;
46
- url: string;
47
- context?: string;
48
- }
@@ -1,25 +1,25 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { ClrHistoryModel } from './history-model.interface';
3
3
  import { ClrHistoryService } from './history.service';
4
+ import { Subject } from 'rxjs';
4
5
  import { HistoryProvider } from './history.provider';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class ClrHistoryPinned implements OnInit, OnDestroy {
7
- private historyService;
8
- private historyProvider;
8
+ private readonly historyService;
9
+ private readonly historyProvider;
9
10
  username: string;
10
- context: {
11
- [key: string]: string;
12
- };
11
+ tenantId: string;
12
+ context: string;
13
13
  domain: string;
14
14
  /**
15
15
  * The array of history elements to be displayed.
16
16
  */
17
- historyElements: ClrHistoryModel[];
18
- active: boolean;
17
+ historyElements$: Subject<ClrHistoryModel[]>;
18
+ active$: Subject<boolean>;
19
19
  private settingsSubscription;
20
20
  constructor(historyService: ClrHistoryService, historyProvider: HistoryProvider);
21
21
  ngOnInit(): void;
22
22
  ngOnDestroy(): void;
23
23
  static ɵfac: i0.ɵɵFactoryDeclaration<ClrHistoryPinned, [null, { optional: true; }]>;
24
- static ɵcmp: i0.ɵɵComponentDeclaration<ClrHistoryPinned, "clr-history-pinned", never, { "username": { "alias": "clrUsername"; "required": false; }; "context": { "alias": "clrContext"; "required": false; }; "domain": { "alias": "clrDomain"; "required": false; }; }, {}, never, never, false, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<ClrHistoryPinned, "clr-history-pinned", never, { "username": { "alias": "clrUsername"; "required": false; }; "tenantId": { "alias": "clrTenantId"; "required": false; }; "context": { "alias": "clrContext"; "required": false; }; "domain": { "alias": "clrDomain"; "required": false; }; }, {}, never, never, false, never>;
25
25
  }
@@ -1,15 +1,15 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { ClrHistoryModel } from './history-model.interface';
3
3
  import { ClrHistoryService } from './history.service';
4
+ import { Subject } from 'rxjs';
4
5
  import { HistoryProvider } from './history.provider';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class ClrHistory implements OnInit, OnDestroy {
7
- private historyService;
8
- private historyProvider;
8
+ private readonly historyService;
9
+ private readonly historyProvider;
9
10
  username: string;
10
- context: {
11
- [key: string]: string;
12
- };
11
+ tenantId: string;
12
+ context: string;
13
13
  pinActive: boolean;
14
14
  dropdownHeader: string;
15
15
  dropdownPin: string;
@@ -19,14 +19,14 @@ export declare class ClrHistory implements OnInit, OnDestroy {
19
19
  /**
20
20
  * The array of history elements to be displayed.
21
21
  */
22
- historyElements: ClrHistoryModel[];
22
+ historyElements$: Subject<ClrHistoryModel[]>;
23
23
  pinActivated: boolean;
24
- private onDestroy$;
24
+ private readonly onDestroy$;
25
25
  constructor(historyService: ClrHistoryService, historyProvider: HistoryProvider);
26
26
  ngOnInit(): void;
27
27
  ngOnDestroy(): void;
28
28
  select(history: ClrHistoryModel): void;
29
29
  togglePinHistory(): void;
30
30
  static ɵfac: i0.ɵɵFactoryDeclaration<ClrHistory, [null, { optional: true; }]>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<ClrHistory, "clr-history", never, { "username": { "alias": "clrUsername"; "required": false; }; "context": { "alias": "clrContext"; "required": false; }; "pinActive": { "alias": "clrPinActive"; "required": false; }; "dropdownHeader": { "alias": "clrDropdownHeader"; "required": false; }; "dropdownPin": { "alias": "clrDropdownPin"; "required": false; }; "dropdownUnpin": { "alias": "clrDropdownUnpin"; "required": false; }; "domain": { "alias": "clrDomain"; "required": false; }; "position": { "alias": "clrPosition"; "required": false; }; }, {}, never, never, false, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<ClrHistory, "clr-history", never, { "username": { "alias": "clrUsername"; "required": false; }; "tenantId": { "alias": "clrTenantId"; "required": false; }; "context": { "alias": "clrContext"; "required": false; }; "pinActive": { "alias": "clrPinActive"; "required": false; }; "dropdownHeader": { "alias": "clrDropdownHeader"; "required": false; }; "dropdownPin": { "alias": "clrDropdownPin"; "required": false; }; "dropdownUnpin": { "alias": "clrDropdownUnpin"; "required": false; }; "domain": { "alias": "clrDomain"; "required": false; }; "position": { "alias": "clrPosition"; "required": false; }; }, {}, never, never, false, never>;
32
32
  }
@@ -0,0 +1,16 @@
1
+ import { ClrHistoryModel } from './history-model.interface';
2
+ import { Observable } from 'rxjs';
3
+ import { HttpClient } from '@angular/common/http';
4
+ import { ClrHistoryHttpService } from './history.http.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ClrHistoryHttpImplService implements ClrHistoryHttpService {
7
+ private readonly historyNotificationUrl;
8
+ private readonly httpClient;
9
+ constructor(historyNotificationUrl: string, httpClient: HttpClient);
10
+ addHistoryEntry(historyEntry: ClrHistoryModel): Observable<void>;
11
+ getHistory(username: string, tenantId: string): Observable<ClrHistoryModel[]>;
12
+ removeFromHistory(historyEntry: ClrHistoryModel): Observable<void>;
13
+ private buildGetHistoryUrl;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClrHistoryHttpImplService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClrHistoryHttpImplService>;
16
+ }
@@ -0,0 +1,9 @@
1
+ import { ClrHistoryModel } from './history-model.interface';
2
+ import { Observable } from 'rxjs';
3
+ import { InjectionToken } from '@angular/core';
4
+ export declare const HISTORY_TOKEN: InjectionToken<any>;
5
+ export interface ClrHistoryHttpService {
6
+ addHistoryEntry(historyEntry: ClrHistoryModel): Observable<void>;
7
+ getHistory(username: string, tenantId: string): Observable<ClrHistoryModel[]>;
8
+ removeFromHistory(historyEntry: ClrHistoryModel): Observable<void>;
9
+ }
@@ -1,48 +1,26 @@
1
1
  import { ClrHistoryModel, ClrHistorySettingsModel } from './history-model.interface';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { HttpClient } from '@angular/common/http';
2
+ import { BehaviorSubject, Observable } from 'rxjs';
3
+ import { ClrHistoryHttpService } from './history.http.service';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ClrHistoryService {
6
- private historyNotificationUrl;
7
- private httpClient;
6
+ private readonly historyHttpService;
8
7
  cookieSettings$: BehaviorSubject<ClrHistorySettingsModel[]>;
9
- cookieName: string;
10
8
  cookieNameSettings: string;
11
- private expiryDate;
12
- private maxSize;
13
- private maxUrlSize;
14
- constructor(historyNotificationUrl: string, httpClient: HttpClient);
9
+ private readonly expiryDate;
10
+ constructor(historyHttpService: ClrHistoryHttpService);
15
11
  /**
16
12
  * Add a new history entry
17
13
  * @param historyEntry The entry to be added
18
- * @param domain The optional domain param where the cookie is stored
19
- * @returns true when entry added, otherwise false is returned
20
14
  */
21
- addHistoryEntry(historyEntry: ClrHistoryModel, domain?: string): boolean;
22
- getHistoryDisplay(username: string, context: {
23
- [key: string]: string;
24
- }): ClrHistoryModel[];
25
- getHistory(username: string, context: {
26
- [key: string]: string;
27
- }): ClrHistoryModel[];
28
- /**
29
- * Set history
30
- * @param entries
31
- * @param domain
32
- */
33
- private setHistory;
34
- reduceSize(entries: ClrHistoryModel[]): ClrHistoryModel[];
35
- resetHistory(): void;
36
- removeFromHistory(entry: ClrHistoryModel): void;
37
- private checkEqualContext;
15
+ addHistoryEntry(historyEntry: ClrHistoryModel): Observable<void>;
16
+ getHistory(username: string, tenantId: string): Observable<ClrHistoryModel[]>;
17
+ removeFromHistory(historyEntry: ClrHistoryModel): Observable<void>;
38
18
  initializeCookieSettings(username: string, domain?: string): void;
39
19
  setHistoryPinned(username: string, pin: boolean, domain?: string): void;
40
20
  private getCookieByName;
41
- private encode;
42
- private decode;
43
21
  private setCookie;
22
+ deleteOldCookie(domain?: string): void;
44
23
  private getDomain;
45
- private notifyExternalUrl;
46
- static ɵfac: i0.ɵɵFactoryDeclaration<ClrHistoryService, [{ optional: true; }, { optional: true; }]>;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClrHistoryService, never>;
47
25
  static ɵprov: i0.ɵɵInjectableDeclaration<ClrHistoryService>;
48
26
  }
@@ -3,4 +3,5 @@ export * from './history-pinned';
3
3
  export * from './history.module';
4
4
  export * from './history-model.interface';
5
5
  export * from './history.service';
6
+ export * from './history.http.service';
6
7
  export * from './history.provider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porscheinformatik/clr-addons",
3
- "version": "19.5.6",
3
+ "version": "19.6.0",
4
4
  "description": "Addon components for Clarity Angular",
5
5
  "es2015": "esm2015/clr-addons.js",
6
6
  "homepage": "https://porscheinformatik.github.io/clarity-addons/",