@fluid-topics/ft-search-context 2.0.13 → 2.0.15

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.
@@ -11,6 +11,7 @@ export declare class FtSearchStateManager extends FtStateManager {
11
11
  readonly service: FtSearchService;
12
12
  errorHandler?: (e: Error) => void;
13
13
  ignoreEmptyQuery: boolean;
14
+ canUpdateUiLocale: boolean;
14
15
  openExternalDocumentInNewTab: boolean;
15
16
  protected readonly searchWatcher: ReduxWatcher<FtSearchPageState, FtSearchRequest>;
16
17
  protected readonly suggestWatcher: ReduxWatcher<FtSearchPageState, FtSuggestRequest>;
@@ -50,6 +51,7 @@ export declare class FtSearchStateManager extends FtStateManager {
50
51
  setOtherQueryParams(params: Record<string, string>): void;
51
52
  setIgnoreEmptyQuery(ignoreEmptyQuery: boolean): void;
52
53
  setOpenExternalDocumentInNewTab(openExternalDocumentInNewTab: boolean): void;
54
+ setCanUpdateUiLocale(canUpdateUiLocale: boolean): void;
53
55
  private localesDebouncer;
54
56
  updateLocales(): Promise<boolean>;
55
57
  private searchDebouncer;
@@ -4,6 +4,7 @@ import { createSearchPageStore, } from "./redux";
4
4
  import { FtSearchKeywordMatch, FtSearchScope, FtVirtualField, } from "@fluid-topics/public-api";
5
5
  import { FtSearchService } from "./utils/FtSearchService";
6
6
  import { ClearAllFiltersEvent } from "../utils";
7
+ import { ftAppStateManager } from "@fluid-topics/ft-app-context";
7
8
  export const searchInDocumentTitlesOnlySelector = (s) => s.request.virtualField === FtVirtualField.TITLE_ONLY
8
9
  && s.request.scope === FtSearchScope.DOCUMENTS;
9
10
  export const keywordMatchSelector = (s) => s.request.keywordMatch == FtSearchKeywordMatch.MANDATORY;
@@ -15,6 +16,7 @@ export class FtSearchStateManager extends FtStateManager {
15
16
  super();
16
17
  this.store = store;
17
18
  this.ignoreEmptyQuery = false;
19
+ this.canUpdateUiLocale = false;
18
20
  this.openExternalDocumentInNewTab = false;
19
21
  this.onNewNeededRequest = (neededRequest) => {
20
22
  if (neededRequest == FtSearchStateResourceRequest.CLUSTERED_SEARCH) {
@@ -71,7 +73,7 @@ export class FtSearchStateManager extends FtStateManager {
71
73
  this.store.actions.setPageNumber(1);
72
74
  }
73
75
  setContentLocale(contentLocale) {
74
- var _a;
76
+ var _a, _b;
75
77
  const locales = (_a = this.store.getState().locales) !== null && _a !== void 0 ? _a : [];
76
78
  const previousContentLocale = this.store.getState().request.contentLocale;
77
79
  if (contentLocale != previousContentLocale) {
@@ -84,6 +86,9 @@ export class FtSearchStateManager extends FtStateManager {
84
86
  this.store.actions.setRequestContentLocale(contentLocale);
85
87
  this.store.actions.setPageNumber(1);
86
88
  this.store.actions.setRequestFilters([]);
89
+ if (this.canUpdateUiLocale && ((_b = ftAppStateManager.localesConfiguration) === null || _b === void 0 ? void 0 : _b.searchLanguageSetsUiLanguage) && contentLocale) {
90
+ ftAppStateManager.requestUiLocaleUpdate(contentLocale);
91
+ }
87
92
  }
88
93
  return contentLocale;
89
94
  }
@@ -267,6 +272,9 @@ export class FtSearchStateManager extends FtStateManager {
267
272
  setOpenExternalDocumentInNewTab(openExternalDocumentInNewTab) {
268
273
  this.openExternalDocumentInNewTab = openExternalDocumentInNewTab;
269
274
  }
275
+ setCanUpdateUiLocale(canUpdateUiLocale) {
276
+ this.canUpdateUiLocale = canUpdateUiLocale;
277
+ }
270
278
  updateLocales() {
271
279
  return this.localesDebouncer.run(async () => this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales));
272
280
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-context",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "Context block for integrated search components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "2.0.13",
23
- "@fluid-topics/ft-wc-utils": "2.0.13",
22
+ "@fluid-topics/ft-app-context": "2.0.15",
23
+ "@fluid-topics/ft-wc-utils": "2.0.15",
24
24
  "lit": "3.1.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@fluid-topics/public-api": "1.0.118"
27
+ "@fluid-topics/public-api": "1.0.120"
28
28
  },
29
- "gitHead": "8fff94f7df8ec1feca0f92b763d01d9745f6b975"
29
+ "gitHead": "4ccf89e835f22f2689fc0fe3f97c46671debe98d"
30
30
  }