@arsedizioni/ars-utils 19.0.92 → 19.0.93

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.
@@ -6,7 +6,7 @@ import { DateInterval, INode, NameValueItem } from '@arsedizioni/ars-utils/core'
6
6
  import { ButtonSelectorComponent, ChipsSelectorComponent } from '@arsedizioni/ars-utils/ui.application';
7
7
  import { ScrollDispatcher } from '@angular/cdk/scrolling';
8
8
  import { ClipperSearchResultManager } from '../search-result-manager/search-result-manager';
9
- import { ClipperChannel, ClipperModule, ClipperSearchParams, ClipperUserInfo, ClipperUserSearch, SectorInfo } from '@arsedizioni/ars-utils/clipper.common';
9
+ import { ClipperChannel, ClipperDocumentInfo, ClipperModule, ClipperSearchParams, ClipperUserInfo, ClipperUserSearch, SectorInfo } from '@arsedizioni/ars-utils/clipper.common';
10
10
  import * as i0 from "@angular/core";
11
11
  export declare class ClipperBrowserComponent extends ClipperSearchResultManager implements OnInit, OnDestroy, AfterViewInit {
12
12
  readonly filterByNumber: Signal<MatInput>;
@@ -54,6 +54,12 @@ export declare class ClipperBrowserComponent extends ClipperSearchResultManager
54
54
  * Get all available modules
55
55
  */
56
56
  private getAllModules;
57
+ /**
58
+ * Return the snapshot document by id
59
+ * @param id : the document id
60
+ * @returns the document or null
61
+ */
62
+ getSnapshotDocument(id: string): ClipperDocumentInfo | null;
57
63
  /**
58
64
  * Load tags
59
65
  */
@@ -2958,6 +2958,14 @@ class ClipperBrowserComponent extends ClipperSearchResultManager {
2958
2958
  this.filterParams.modules = modules;
2959
2959
  return modules;
2960
2960
  }
2961
+ /**
2962
+ * Return the snapshot document by id
2963
+ * @param id : the document id
2964
+ * @returns the document or null
2965
+ */
2966
+ getSnapshotDocument(id) {
2967
+ return this.snapshot.items.find(x => x.documentId === id);
2968
+ }
2961
2969
  /**
2962
2970
  * Load tags
2963
2971
  */
@@ -3844,9 +3852,12 @@ class ClipperBrowserDialogComponent {
3844
3852
  .pipe(takeUntil(this.unsubscribe))
3845
3853
  .subscribe(message => {
3846
3854
  if (message.id === ClipperMessages.DOCUMENT_SELECTED_INNER) {
3847
- this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_SELECTED, message.data);
3848
- this.changeDetector.markForCheck();
3849
- this.dialogRef.close();
3855
+ const document = this.clipperBrowser().getSnapshotDocument(message.data.documentId || message.data.id);
3856
+ if (document) {
3857
+ this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_SELECTED, document);
3858
+ this.changeDetector.markForCheck();
3859
+ this.dialogRef.close();
3860
+ }
3850
3861
  }
3851
3862
  });
3852
3863
  }