@sinequa/atomic-angular 0.4.20-dev.1 → 0.4.22

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.
@@ -7,7 +7,7 @@ import highlightWords from 'highlight-words';
7
7
  import { ActivatedRoute, Router, NavigationEnd, RouterLink, RouterModule } from '@angular/router';
8
8
  import { withDevtools } from '@angular-architects/ngrx-toolkit';
9
9
  import { signalStore, signalStoreFeature, withState, withMethods, patchState, getState, withComputed } from '@ngrx/signals';
10
- import { globalConfig, EngineType, extraColumns, sysLang, getQueryParamsFromUrl, logout, login, info, warn, notify, error, setGlobalConfig, addConcepts, queryParamsFromUrl, patchUserSettings, deleteUserSettings, fetchUserSettings, buildPathsAndLevels, escapeExpr, isAuthenticated, isExpired, debug, fetchSuggest, isObject, Audit, getMetadata, bisect, isNotInputEvent, fetchSponsoredLinks, fetchQuery, translateAggregationToDateOptions, aggItemRegex, parseValueAndOperatorFromItem, fetchSuggestField, fetchSimilarDocuments, fetchChangePassword, fetchSendPasswordResetEmail, expiresSoon, suggestionsToTreeAggregationNodes, labels, fetchLabels, guid, getRelativeDate, createUserProfile, deleteUserProfileProperty, patchUserProfile, isJsonable, addAuditAdditionalInfo, getToken, setToken, createHeaders } from '@sinequa/atomic';
10
+ import { globalConfig, EngineType, extraColumns, sysLang, getQueryParamsFromUrl, logout, login, info, warn, error, setGlobalConfig, notify, addConcepts, queryParamsFromUrl, patchUserSettings, deleteUserSettings, fetchUserSettings, buildPathsAndLevels, escapeExpr, isAuthenticated, isExpired, debug, fetchSuggest, isObject, Audit, getMetadata, bisect, isNotInputEvent, fetchSponsoredLinks, fetchQuery, translateAggregationToDateOptions, aggItemRegex, parseValueAndOperatorFromItem, fetchSuggestField, fetchSimilarDocuments, fetchChangePassword, fetchSendPasswordResetEmail, expiresSoon, suggestionsToTreeAggregationNodes, labels, fetchLabels, guid, getRelativeDate, createUserProfile, deleteUserProfileProperty, patchUserProfile, isJsonable, addAuditAdditionalInfo, getToken, setToken, createHeaders } from '@sinequa/atomic';
11
11
  import { HttpClient, HttpParams, httpResource, HttpResponse, HttpHeaders, HttpContextToken } from '@angular/common/http';
12
12
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
13
13
  import { DatePipe, DATE_PIPE_DEFAULT_TIMEZONE, DATE_PIPE_DEFAULT_OPTIONS, Location, NgTemplateOutlet, NgStyle, NgClass, NgComponentOutlet } from '@angular/common';
@@ -1569,9 +1569,6 @@ async function signIn() {
1569
1569
  if (!response) {
1570
1570
  warn("No response from login, redirecting to login page", response);
1571
1571
  }
1572
- else {
1573
- notify.info("Successfully signed in");
1574
- }
1575
1572
  }
1576
1573
  catch (err) {
1577
1574
  error("Error during login", err);
@@ -12800,9 +12797,10 @@ class AggregationTreeComponent {
12800
12797
  error("The aggregation tree component does not support list aggregations. Please use the <Aggregation /> component instead.");
12801
12798
  }
12802
12799
  // overrides "expandedLevel" from custom JSON file
12803
- const expandedLevel = this.expandedLevel() ?? agg.expandedLevel ?? 0;
12804
- console.log(`${agg.name} expandedlLevel`, this.expandedLevel(), agg.expandedLevel, expandedLevel);
12805
- this.expandItems(agg.items, expandedLevel);
12800
+ const expandedLevel = this.expandedLevel() ?? agg.expandedLevel;
12801
+ if (expandedLevel) {
12802
+ this.expandItems(agg.items, expandedLevel);
12803
+ }
12806
12804
  // overrides "searchable" properties with the input if any
12807
12805
  agg.searchable = this.searchable() ?? agg.searchable;
12808
12806
  return agg;
@@ -13287,9 +13285,9 @@ class AggregationTreeComponent {
13287
13285
  if (!node.$opened && node.items?.length >= 0 && level < expandedLevel) {
13288
13286
  node.$opened = true;
13289
13287
  }
13290
- if (node.$opened && level >= expandedLevel) {
13291
- node.$opened = false;
13292
- }
13288
+ // if(node.$opened && level >= expandedLevel) {
13289
+ // node.$opened = false;
13290
+ // }
13293
13291
  return false;
13294
13292
  });
13295
13293
  }
@@ -15401,12 +15399,12 @@ class UserProfileDialog {
15401
15399
  dialog = viewChild(DialogComponent, ...(ngDevMode ? [{ debugName: "dialog" }] : []));
15402
15400
  opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : []));
15403
15401
  open() {
15404
- this.dialog()?.showModal();
15402
+ this.dialog()?.open();
15405
15403
  this.opened.set(true);
15406
15404
  }
15407
15405
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: UserProfileDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
15408
15406
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: UserProfileDialog, isStandalone: true, selector: "user-profile-dialog, userprofiledialog, UserProfileDialog", providers: [provideTranslocoScope("user-profile")], viewQueries: [{ propertyName: "dialog", first: true, predicate: DialogComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
15409
- <dialog #dialog>
15407
+ <div dialog #dialog="dialog">
15410
15408
  <DialogContent class="max-h-11/12 overflow-auto">
15411
15409
  <DialogHeader>
15412
15410
  <DialogTitle>{{ 'userProfile.title' | transloco }}</DialogTitle>
@@ -15415,9 +15413,8 @@ class UserProfileDialog {
15415
15413
  @if (opened()) {
15416
15414
  <user-profile-form />
15417
15415
  }
15418
-
15419
- </DialogContent>
15420
- </dialog>
15416
+ </DialogContent>
15417
+ </div>
15421
15418
  `, isInline: true, dependencies: [{ kind: "component", type: DialogComponent, selector: "dialog, [dialog]", outputs: ["closed"], exportAs: ["dialog"] }, { kind: "component", type: DialogHeaderComponent, selector: "DialogHeader" }, { kind: "directive", type: DialogContentComponent, selector: "DialogContent", inputs: ["class"] }, { kind: "component", type: UserProfileFormComponent, selector: "user-profile-form, UserProfileForm, userprofileform", inputs: ["value", "currentLanguage"], outputs: ["valueChange", "currentLanguageChange"] }, { kind: "directive", type: DialogTitleComponent, selector: "DialogTitle", inputs: ["class"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
15422
15419
  }
15423
15420
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: UserProfileDialog, decorators: [{
@@ -15435,7 +15432,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
15435
15432
  ],
15436
15433
  providers: [provideTranslocoScope("user-profile")],
15437
15434
  template: `
15438
- <dialog #dialog>
15435
+ <div dialog #dialog="dialog">
15439
15436
  <DialogContent class="max-h-11/12 overflow-auto">
15440
15437
  <DialogHeader>
15441
15438
  <DialogTitle>{{ 'userProfile.title' | transloco }}</DialogTitle>
@@ -15444,9 +15441,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
15444
15441
  @if (opened()) {
15445
15442
  <user-profile-form />
15446
15443
  }
15447
-
15448
- </DialogContent>
15449
- </dialog>
15444
+ </DialogContent>
15445
+ </div>
15450
15446
  `
15451
15447
  }]
15452
15448
  }], propDecorators: { dialog: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DialogComponent), { isSignal: true }] }] } });
@@ -15612,6 +15608,9 @@ const toastInterceptorFn = (request, next) => {
15612
15608
  }
15613
15609
  }
15614
15610
  if ([400, 403, 500, 503].includes(status)) {
15611
+ if (status === 400 && url.includes("api/v2/user-profile")) {
15612
+ return next(request);
15613
+ }
15615
15614
  // Avoid showing error toasts for preview requests
15616
15615
  if (url.includes("api/v1/preview") === false) {
15617
15616
  const { errorMessage = err.statusText, errorCodeText = `Error ${status}` } = error;