@sinequa/atomic-angular 1.0.2 → 1.0.4

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, 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';
10
+ import { globalConfig, EngineType, extraColumns, sysLang, getQueryParamsFromUrl, clearSessionTokens, login, info, warn, error, setGlobalConfig, notify, addConcepts, queryParamsFromUrl, patchUserSettings, deleteUserSettings, fetchUserSettings, buildPathsAndLevels, escapeExpr, isAuthenticated, isExpired, debug, AuditEventType, fetchSuggest, isObject, Audit, getMetadata, bisect, isNotInputEvent, fetchSponsoredLinks, fetchQuery, translateAggregationToDateOptions, aggItemRegex, parseValueAndOperatorFromItem, fetchSuggestField, fetchSimilarDocuments, logout, 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, toSignal } 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';
@@ -1556,8 +1556,8 @@ async function signIn() {
1556
1556
  const router = inject(Router);
1557
1557
  const lastUrlAfterNavigation = inject(NavigationService).urlAfterNavigation;
1558
1558
  const { useCredentials, loginPath, useSSO } = globalConfig;
1559
- // Always log out first to clear any existing session
1560
- await logout();
1559
+ // Always clear authentication tokens first to clear any existing session
1560
+ clearSessionTokens();
1561
1561
  // If credentials are used and user override is not active, redirect to the login page
1562
1562
  if (useCredentials) {
1563
1563
  router.navigate([loginPath], { queryParams: { returnUrl: lastUrlAfterNavigation } });
@@ -3821,7 +3821,7 @@ class AuditService {
3821
3821
  // Second event triggered when we come back
3822
3822
  document.addEventListener('visibilitychange', () => {
3823
3823
  if (document.visibilityState === 'visible') {
3824
- this.notify({ type: "Navigation_Return" /* AuditEventType.Navigation_Return */ });
3824
+ this.notify({ type: AuditEventType.Navigation_Return });
3825
3825
  }
3826
3826
  }, { once: true });
3827
3827
  }
@@ -4191,7 +4191,7 @@ class PreviewService {
4191
4191
  this.passageOffset.set(undefined);
4192
4192
  const detail = this.getAuditPreviewDetail(id, query);
4193
4193
  const auditEvent = {
4194
- type: "Preview_Close" /* AuditEventType.Preview_Close */,
4194
+ type: AuditEventType.Preview_Close,
4195
4195
  detail
4196
4196
  };
4197
4197
  Audit.notify(auditEvent);
@@ -5785,7 +5785,7 @@ class ExportService {
5785
5785
  exportedColumns: exportedColumns,
5786
5786
  selection: (selection ?? []).length > 0 ? selection : undefined,
5787
5787
  $auditRecord: {
5788
- type: "Search_ExportCSV" /* AuditEventType.Search_ExportCSV */,
5788
+ type: AuditEventType.Search_ExportCSV,
5789
5789
  detail: {
5790
5790
  resultid: results ? results.id : undefined
5791
5791
  }
@@ -9079,6 +9079,9 @@ class AggregationDateComponent extends AggregationListComponent {
9079
9079
  };
9080
9080
  this.form.setValue(formValue);
9081
9081
  }
9082
+ toEndOfDay(dateStr) {
9083
+ return `${new Date(dateStr).toLocaleDateString("en-CA", options)} 23:59:59`;
9084
+ }
9082
9085
  getFormValueFilter() {
9083
9086
  const value = this.form.value;
9084
9087
  // value.option is null
@@ -9131,7 +9134,7 @@ class AggregationDateComponent extends AggregationListComponent {
9131
9134
  {
9132
9135
  field: column,
9133
9136
  operator: "lte",
9134
- value: new Date(value.customRange.to).toLocaleDateString("en-CA", options)
9137
+ value: this.toEndOfDay(value.customRange.to)
9135
9138
  }
9136
9139
  ];
9137
9140
  }
@@ -9141,7 +9144,7 @@ class AggregationDateComponent extends AggregationListComponent {
9141
9144
  }
9142
9145
  else if (value.customRange.to) {
9143
9146
  filter.operator = "lte";
9144
- filter.value = new Date(value.customRange.to).toLocaleDateString("en-CA", options);
9147
+ filter.value = this.toEndOfDay(value.customRange.to);
9145
9148
  }
9146
9149
  else {
9147
9150
  throw new Error("filters.customRangeInvalid");