diff --git a/packages/quantic/force-app/main/default/lwc/quanticNotifications/quanticNotifications.js b/packages/quantic/force-app/main/default/lwc/quanticNotifications/quanticNotifications.js
index d2b5329f6ce..d9f8302e01c 100644
--- a/packages/quantic/force-app/main/default/lwc/quanticNotifications/quanticNotifications.js
+++ b/packages/quantic/force-app/main/default/lwc/quanticNotifications/quanticNotifications.js
@@ -13,6 +13,7 @@ import {LightningElement, api} from 'lwc';
/**
* The `QuanticNotifications` component is responsible for displaying notifications generated by the Coveo Search API (see [Trigger](https://docs.coveo.com/en/1458)).
* @category Search
+ * @category Insight Panel
* @example
*
*/
@@ -47,8 +48,8 @@ export default class QuanticNotifications extends LightningElement {
initialize = (engine) => {
this.headless = getHeadlessBundle(this.engineId);
this.notifyTrigger = this.headless.buildNotifyTrigger(engine);
- this.unsubscribe = this.notifyTrigger.subscribe(() => this.updateState());
this.ariaLiveNotificationsRegion = AriaLiveRegion('notifications', this);
+ this.unsubscribe = this.notifyTrigger.subscribe(() => this.updateState());
};
disconnectedCallback() {
From 9dc3af1663438fc0c51f5ad4785a6123b0a89daa Mon Sep 17 00:00:00 2001
From: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com>
Date: Wed, 23 Oct 2024 15:55:34 -0400
Subject: [PATCH 08/57] feat(atomic, headless): leverage
totalNumberOfChildResults in folded results (#4513)
https://coveord.atlassian.net/browse/KIT-3546
---------
Co-authored-by: developer-experience-bot[bot] <91079284+developer-experience-bot[bot]@users.noreply.github.com>
---
.../atomic-folded-result-list.new.stories.tsx | 1 -
.../e2e/atomic-folded-result-list.e2e.ts | 92 ++++++++++++++++++-
.../e2e/page-object.ts | 24 +++++
.../atomic-result-children.tsx | 65 ++++++++-----
.../src/features/folding/folding-slice.ts | 4 +-
.../src/test/mock-result-with-folding.ts | 1 +
.../folded-result-list/exampleResult.json | 3 +-
7 files changed, 160 insertions(+), 30 deletions(-)
diff --git a/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.new.stories.tsx b/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.new.stories.tsx
index a8acd775546..2a7b167ac3c 100644
--- a/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.new.stories.tsx
+++ b/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.new.stories.tsx
@@ -133,7 +133,6 @@ const meta: Meta = {
component: 'atomic-folded-result-list',
title: 'Atomic/FoldedResultList',
id: 'atomic-folded-result-list',
-
render: renderComponent,
decorators: [decorator],
parameters,
diff --git a/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/atomic-folded-result-list.e2e.ts b/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/atomic-folded-result-list.e2e.ts
index a474654e4f9..8199a604bca 100644
--- a/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/atomic-folded-result-list.e2e.ts
+++ b/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/atomic-folded-result-list.e2e.ts
@@ -1,10 +1,94 @@
import {test, expect} from './fixture';
-// TODO: KIT-3546 - Make this test pass
-test.describe('When no child results', () => {
- test.fixme('should show a "no results" label', async ({foldedResultList}) => {
+test.describe('when more results are NOT available & there are NO result children', () => {
+ test.beforeEach(async ({foldedResultList}) => {
await foldedResultList.load({story: 'with-no-result-children'});
- await foldedResultList.loadAllResultsButton.click();
+ });
+
+ test('should show a "no results" label', async ({foldedResultList}) => {
await expect(foldedResultList.noResultsLabel.first()).toBeVisible();
});
+
+ test('should NOT show the "load all results" button', async ({
+ foldedResultList,
+ }) => {
+ await expect(
+ foldedResultList.loadAllResultsButton.first()
+ ).not.toBeVisible();
+ });
+
+ test('should NOT show result children', async ({foldedResultList}) => {
+ await expect(foldedResultList.resultChildren.first()).not.toBeVisible();
+ });
+});
+
+test.describe('when more results are NOT available & there are result children', () => {
+ test.beforeEach(async ({foldedResultList}) => {
+ await foldedResultList.withATotalNumberOfChildResults(1);
+ await foldedResultList.load();
+ });
+
+ test('should show result children', async ({foldedResultList}) => {
+ await expect(foldedResultList.resultChildren.first()).toBeVisible();
+ });
+
+ test('should NOT show a "no results" label', async ({foldedResultList}) => {
+ await expect(foldedResultList.noResultsLabel.first()).not.toBeVisible();
+ });
+
+ test('should NOT show "load all results" button', async ({
+ foldedResultList,
+ }) => {
+ await expect(
+ foldedResultList.loadAllResultsButton.first()
+ ).not.toBeVisible();
+ });
+});
+
+test.describe('when more results are available & there are result children', () => {
+ test.beforeEach(async ({foldedResultList}) => {
+ await foldedResultList.load();
+ });
+
+ test('should show the "load all results" button', async ({
+ foldedResultList,
+ }) => {
+ await expect(foldedResultList.loadAllResultsButton.first()).toBeVisible();
+ });
+
+ test('should show the "Collapse results" button after loading all results', async ({
+ foldedResultList,
+ }) => {
+ await foldedResultList.loadAllResultsButton.first().click();
+ await expect(foldedResultList.collapseResultsButton.first()).toBeVisible();
+ });
+
+ test('should show result children', async ({foldedResultList}) => {
+ await expect(foldedResultList.resultChildren.first()).toBeVisible();
+ });
+
+ test('should NOT show the "no results" label', async ({foldedResultList}) => {
+ await expect(foldedResultList.noResultsLabel.first()).not.toBeVisible();
+ });
+});
+
+test.describe('when more results are available & there are NO result children', () => {
+ test.beforeEach(async ({foldedResultList}) => {
+ await foldedResultList.withATotalNumberOfChildResults(10);
+ await foldedResultList.load({story: 'with-no-result-children'});
+ });
+
+ test('should show the "load all results" button', async ({
+ foldedResultList,
+ }) => {
+ await expect(foldedResultList.loadAllResultsButton.first()).toBeVisible();
+ });
+
+ test('should NOT show result children', async ({foldedResultList}) => {
+ await expect(foldedResultList.resultChildren.first()).not.toBeVisible();
+ });
+
+ test('should NOT show the "no results" label', async ({foldedResultList}) => {
+ await expect(foldedResultList.noResultsLabel.first()).not.toBeVisible();
+ });
});
diff --git a/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/page-object.ts b/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/page-object.ts
index 870788e58de..7e580b531c2 100644
--- a/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/page-object.ts
+++ b/packages/atomic/src/components/search/result-lists/atomic-folded-result-list/e2e/page-object.ts
@@ -13,4 +13,28 @@ export class AtomicFoldedResultListPageObject extends BasePageObject<'atomic-fol
get loadAllResultsButton() {
return this.page.getByRole('button', {name: 'Load all results'});
}
+
+ get collapseResultsButton() {
+ return this.page.getByRole('button', {name: 'Collapse results'});
+ }
+
+ get resultChildren() {
+ return this.page.locator('[part="children-root"]');
+ }
+
+ async withATotalNumberOfChildResults(total: number) {
+ await this.page.route(
+ '**/search/v2?organizationId=searchuisamples',
+ async (route) => {
+ const response = await route.fetch();
+ const body = await response.json();
+ body.results[0].totalNumberOfChildResults = total;
+
+ await route.fulfill({
+ response,
+ json: body,
+ });
+ }
+ );
+ }
}
diff --git a/packages/atomic/src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx b/packages/atomic/src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx
index 581b7882080..e4a81e5e9af 100644
--- a/packages/atomic/src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx
+++ b/packages/atomic/src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx
@@ -4,7 +4,15 @@ import {
FoldedResultList,
FoldedResultListState,
} from '@coveo/headless';
-import {Component, Element, State, h, Listen, Prop} from '@stencil/core';
+import {
+ Component,
+ Element,
+ State,
+ h,
+ Listen,
+ Prop,
+ Fragment,
+} from '@stencil/core';
import {buildCustomEvent} from '../../../../utils/event-utils';
import {
InitializableComponent,
@@ -163,6 +171,7 @@ export class AtomicResultChildren implements InitializableComponent {
});
}
private loadFullCollection() {
+ this.loadedFullCollection = true;
this.host.dispatchEvent(
buildCustomEvent('atomic/loadCollection', this.collection)
);
@@ -177,6 +186,8 @@ export class AtomicResultChildren implements InitializableComponent {
this.showInitialChildren = !this.showInitialChildren;
};
+ @State() private loadedFullCollection = false;
+
private renderCollection() {
const collection = this.collection!;
@@ -184,30 +195,38 @@ export class AtomicResultChildren implements InitializableComponent {
? this.initialChildren
: collection.children;
+ const showShouldButtons =
+ this.loadedFullCollection || collection.moreResultsAvailable;
+
return (
-
0}
- numberOfChildren={collection.children.length}
- density={this.displayConfig.density}
- imageSize={this.imageSize || this.displayConfig.imageSize}
- noResultText={this.bindings.i18n.t(this.noResultText)}
- >
-
+ {showShouldButtons && (
+ this.loadFullCollection()}
+ showInitialChildren={this.showInitialChildren}
+ toggleShowInitialChildren={this.toggleShowInitialChildren}
+ loadAllResults={this.bindings.i18n.t('load-all-results')}
+ collapseResults={this.bindings.i18n.t('collapse-results')}
+ />
+ )}
+
+ this.loadFullCollection()}
- showInitialChildren={this.showInitialChildren}
- toggleShowInitialChildren={this.toggleShowInitialChildren}
- loadAllResults={this.bindings.i18n.t('load-all-results')}
- collapseResults={this.bindings.i18n.t('collapse-results')}
- >
- 0}>
- {children.map((child, i) =>
- this.renderChild(child, i === children.length - 1)
- )}
-
-
+ hasChildren={collection.children.length > 0}
+ numberOfChildren={collection.children.length}
+ density={this.displayConfig.density}
+ imageSize={this.imageSize || this.displayConfig.imageSize}
+ noResultText={this.bindings.i18n.t(this.noResultText)}
+ >
+
0}>
+ {children.map((child, i) =>
+ this.renderChild(child, i === children.length - 1)
+ )}
+
+
+
);
}
diff --git a/packages/headless/src/features/folding/folding-slice.ts b/packages/headless/src/features/folding/folding-slice.ts
index a5f40e67cd6..a0364db8b92 100644
--- a/packages/headless/src/features/folding/folding-slice.ts
+++ b/packages/headless/src/features/folding/folding-slice.ts
@@ -20,6 +20,7 @@ import {getAllIncludedResultsFrom} from './folding-utils.js';
export interface ResultWithFolding extends Result {
parentResult: ResultWithFolding | null;
childResults: ResultWithFolding[];
+ totalNumberOfChildResults: number;
}
function getCollectionField(result: ResultWithFolding, fields: FoldingFields) {
@@ -117,7 +118,8 @@ function createCollectionFromResult(
resultsInCollection,
fields
),
- moreResultsAvailable: true,
+ // To understand why "1" instead of "0", see here : https://coveord.atlassian.net/browse/SEARCHAPI-11075. totalNumberOfChildResults is off by 1 by the index design.
+ moreResultsAvailable: relevantResult.totalNumberOfChildResults > 1,
isLoadingMoreResults: false,
};
}
diff --git a/packages/headless/src/test/mock-result-with-folding.ts b/packages/headless/src/test/mock-result-with-folding.ts
index 4634008a7ce..8ff21b80220 100644
--- a/packages/headless/src/test/mock-result-with-folding.ts
+++ b/packages/headless/src/test/mock-result-with-folding.ts
@@ -8,6 +8,7 @@ export function buildMockResultWithFolding(
...buildMockResult(config),
parentResult: null,
childResults: [],
+ totalNumberOfChildResults: 1,
...config,
};
}
diff --git a/packages/quantic/cypress/fixtures/folded-result-list/exampleResult.json b/packages/quantic/cypress/fixtures/folded-result-list/exampleResult.json
index afcc94cba6b..433ef079ab3 100644
--- a/packages/quantic/cypress/fixtures/folded-result-list/exampleResult.json
+++ b/packages/quantic/cypress/fixtures/folded-result-list/exampleResult.json
@@ -49,7 +49,8 @@
"foldingchild": ["leaf2"],
"foldingparent": "node1",
"urihash": "#1"
- }
+ },
+ "totalNumberOfChildResults": 2
}
],
"hierarchy": [
From d28800a27a8de970fe34366b611bc6800e490a24 Mon Sep 17 00:00:00 2001
From: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com>
Date: Wed, 23 Oct 2024 16:00:18 -0400
Subject: [PATCH 09/57] test: add package compatibility tests using publint
(#4446)
https://coveord.atlassian.net/browse/KIT-3596
---------
Co-authored-by: Louis Bompart
Co-authored-by: Frederic Beaudoin
---
.github/workflows/prbot.yml | 8 +++
package-lock.json | 28 +++++++++--
package.json | 2 +
scripts/ci/package-compatibility.mjs | 73 ++++++++++++++++++++++++++++
4 files changed, 108 insertions(+), 3 deletions(-)
create mode 100644 scripts/ci/package-compatibility.mjs
diff --git a/.github/workflows/prbot.yml b/.github/workflows/prbot.yml
index e6a26d19641..68b0a948148 100644
--- a/.github/workflows/prbot.yml
+++ b/.github/workflows/prbot.yml
@@ -70,6 +70,14 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ./.github/actions/setup
- run: npm test
+ package-compatibility:
+ name: 'Verify compatibility of packages'
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
+ - uses: ./.github/actions/setup
+ - run: npm run package-compatibility
e2e-atomic-csp-test:
name: 'Run e2e tests on Atomic CSP'
needs: build
diff --git a/package-lock.json b/package-lock.json
index d6cd7332cbe..b5967515f6b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -86,6 +86,7 @@
"patch-package": "8.0.0",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "0.6.5",
+ "publint": "0.2.11",
"react-syntax-highlighter": "15.5.0",
"rimraf": "5.0.9",
"semver": "7.6.3",
@@ -24626,10 +24627,11 @@
}
},
"node_modules/cli-table3": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz",
- "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==",
+ "version": "0.6.5",
+ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz",
+ "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"string-width": "^4.2.0"
},
@@ -45720,6 +45722,26 @@
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==",
"dev": true
},
+ "node_modules/publint": {
+ "version": "0.2.11",
+ "resolved": "https://registry.npmjs.org/publint/-/publint-0.2.11.tgz",
+ "integrity": "sha512-/kxbd+sD/uEG515N/ZYpC6gYs8h89cQ4UIsAq1y6VT4qlNh8xmiSwcP2xU2MbzXFl8J0l2IdONKFweLfYoqhcA==",
+ "dev": true,
+ "dependencies": {
+ "npm-packlist": "^5.1.3",
+ "picocolors": "^1.1.0",
+ "sade": "^1.8.1"
+ },
+ "bin": {
+ "publint": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "funding": {
+ "url": "https://bjornlu.com/sponsor"
+ }
+ },
"node_modules/pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
diff --git a/package.json b/package.json
index 1bfadb68ef5..5d4446dcd2d 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
"e2e": "nx run-many --target=e2e",
"lint:check": "eslint . && cspell **/*.md --no-progress --show-suggestions --show-context && prettier --check '**/*.{css,pcss,html,md,yml,ts,tsx,js,mjs,json}'",
"lint:fix": "eslint --fix . && prettier --write '**/*.{css,pcss,html,md,yml,ts,tsx,js,mjs,json}'",
+ "package-compatibility": "node ./scripts/ci/package-compatibility.mjs",
"pr:report": "node ./scripts/reports/pr-report.mjs",
"report:bundle-size:time-series": "node ./scripts/reports/bundle-size/time-series.mjs",
"commit": "git-cz",
@@ -83,6 +84,7 @@
"patch-package": "8.0.0",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "0.6.5",
+ "publint": "0.2.11",
"react-syntax-highlighter": "15.5.0",
"rimraf": "5.0.9",
"semver": "7.6.3",
diff --git a/scripts/ci/package-compatibility.mjs b/scripts/ci/package-compatibility.mjs
new file mode 100644
index 00000000000..3870bbdf467
--- /dev/null
+++ b/scripts/ci/package-compatibility.mjs
@@ -0,0 +1,73 @@
+import {EOL} from 'os';
+import {publint} from 'publint';
+
+let exitCode = 0;
+
+const pkgDirs = [
+ 'packages/atomic',
+ 'packages/headless',
+ 'packages/atomic-react',
+];
+
+const issues = await Promise.all(
+ pkgDirs.map(async (pkgDir) => {
+ const {messages} = await publint({
+ pkgDir,
+ level: 'suggestion',
+ strict: false,
+ });
+
+ const suggestions = [];
+ const warnings = [];
+ const errors = [];
+
+ for (const message of messages) {
+ switch (message.type) {
+ case 'suggestion':
+ suggestions.push(message);
+ break;
+ case 'warning':
+ warnings.push(message);
+ break;
+ case 'error':
+ errors.push(message);
+ break;
+ }
+ }
+
+ return {
+ pkgDir,
+ suggestions,
+ warnings,
+ errors,
+ };
+ })
+);
+
+function prettyPrintJSON(label, jsonObject, logFunction) {
+ logFunction(`${label}:`, EOL);
+ logFunction(JSON.stringify(jsonObject, null, 2), EOL);
+}
+
+if (issues.length > 0) {
+ console.info('The publint scan detected compatibility issues:\n');
+
+ for (const {errors, warnings, suggestions, pkgDir} of issues) {
+ console.group(`\n********** ${pkgDir} **********\n`);
+ if (errors.length > 0) {
+ exitCode = 1;
+ prettyPrintJSON('Errors', errors, console.error);
+ }
+ if (warnings.length > 0) {
+ prettyPrintJSON('Warnings', warnings, console.warn);
+ }
+ if (suggestions.length > 0) {
+ prettyPrintJSON('Suggestions', suggestions, console.info);
+ }
+ console.groupEnd();
+ }
+} else {
+ console.info('No compatibility issues found by publint.');
+}
+
+process.exit(exitCode);
From 50dd308cbda32279068654d5e4a2521ccb08ad02 Mon Sep 17 00:00:00 2001
From: Olivier Lamothe
Date: Wed, 23 Oct 2024 16:06:14 -0400
Subject: [PATCH 10/57] fix(headless): export missing types for ssr facet
generator (#4384)
These types can be useful for implementers.
For example, in Barca, could use them to create custom react hook
(something like `useHydratedFacet()`) and have the hook properly typed.
https://coveord.atlassian.net/browse/KIT-3461
Co-authored-by: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com>
---
.../facets/generator/headless-commerce-facet-generator.ssr.ts | 4 ++--
packages/headless/src/ssr-commerce.index.ts | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/packages/headless/src/controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.ts b/packages/headless/src/controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.ts
index 83449e62d2c..b3f40e33964 100644
--- a/packages/headless/src/controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.ts
+++ b/packages/headless/src/controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.ts
@@ -85,9 +85,9 @@ export type {
export type FacetGeneratorState = MappedFacetStates;
-type MappedFacetStates = Array;
+export type MappedFacetStates = Array;
-type MappedFacetState = {
+export type MappedFacetState = {
[T in FacetType]: T extends 'numericalRange'
? NumericFacetState
: T extends 'regular'
diff --git a/packages/headless/src/ssr-commerce.index.ts b/packages/headless/src/ssr-commerce.index.ts
index cc10e3af4a4..708fd963785 100644
--- a/packages/headless/src/ssr-commerce.index.ts
+++ b/packages/headless/src/ssr-commerce.index.ts
@@ -73,6 +73,8 @@ export type {
RegularFacet,
RegularFacetState,
RegularFacetValue,
+ MappedFacetStates,
+ MappedFacetState,
} from './controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.js';
export {defineFacetGenerator} from './controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.js';
From 6069c5db66aa31c97c9fa392d6c55d053a57360d Mon Sep 17 00:00:00 2001
From: mmitiche <86681870+mmitiche@users.noreply.github.com>
Date: Wed, 23 Oct 2024 16:26:08 -0400
Subject: [PATCH 11/57] test(quantic): fixed quantic e2e after salesforce 25
winter release (#4559)
## [SFINT-5769](https://coveord.atlassian.net/browse/SFINT-5769)
- Fixed E2E tests for the refine modal content and the timeframe facet.
- Timeframe facet tests failed because of changes that came up with the
new SF winter 25 release, the way of displaying errors on the timeframe
inputs was changed by SF and caused the failure of some of our tests.
- The refine modal content tests failed because we were trying to select
a a standard facet value after applying a timeframe facet filter, the
issue was that with this timeframe filter no facet value of the standard
facet was found so the facet was not displayed, to fix this I added a
command to clear all filter before testing the standard facet.
[SFINT-5769]:
https://coveord.atlassian.net/browse/SFINT-5769?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
---
.../refine-modal-content.cypress.ts | 3 ++-
.../timeframe-facet/timeframe-facet-selectors.ts | 5 ++++-
.../timeframe-facet/timeframe-facet.cypress.ts | 10 +++++-----
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/packages/quantic/cypress/e2e/default-1/refine-modal-content/refine-modal-content.cypress.ts b/packages/quantic/cypress/e2e/default-1/refine-modal-content/refine-modal-content.cypress.ts
index 6a035daaeb6..bd059dce328 100644
--- a/packages/quantic/cypress/e2e/default-1/refine-modal-content/refine-modal-content.cypress.ts
+++ b/packages/quantic/cypress/e2e/default-1/refine-modal-content/refine-modal-content.cypress.ts
@@ -54,7 +54,7 @@ describe('quantic-refine-content', () => {
}
describe('when using default options', () => {
- it.skip('should render the duplicated facets and the sort component', () => {
+ it('should render the duplicated facets and the sort component', () => {
visitRefineContent();
scope('when loading the page', () => {
@@ -77,6 +77,7 @@ describe('quantic-refine-content', () => {
Expect.displayClearAllFiltersButton(true);
Expect.displayDuplicatedTimeframeFacetClearFiltersButton(true);
Expect.displayTimeframeFacetClearFiltersButton(true);
+ Actions.clickClearAllFilters();
Actions.clickDuplicatedFacetExpandButton();
Actions.clickDuplicatedFacetFirstOption();
Expect.displayClearAllFiltersButton(true);
diff --git a/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet-selectors.ts b/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet-selectors.ts
index 613bd47d36e..45e598b1287 100644
--- a/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet-selectors.ts
+++ b/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet-selectors.ts
@@ -58,5 +58,8 @@ export const TimeframeFacetSelectors: TimeframeFacetSelector = {
applyButton: () =>
TimeframeFacetSelectors.get().find('.timeframe-facet__apply'),
form: () => TimeframeFacetSelectors.get().find('form'),
- validationError: () => TimeframeFacetSelectors.form().find('.slds-has-error'),
+ validationError: () =>
+ TimeframeFacetSelectors.form().find(
+ '.slds-form-element__help[data-error-message]'
+ ),
};
diff --git a/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet.cypress.ts b/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet.cypress.ts
index 61bbab28eb5..2bdc4073fd2 100644
--- a/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet.cypress.ts
+++ b/packages/quantic/cypress/e2e/facets-2/timeframe-facet/timeframe-facet.cypress.ts
@@ -252,7 +252,7 @@ describe('quantic-timeframe-facet', () => {
});
describe('with with-date-picker', () => {
- it.skip('should activate manual range', () => {
+ it('should activate manual range', () => {
visitTimeframeFacet({
withDatePicker: true,
useCase: param.useCase,
@@ -314,7 +314,7 @@ describe('quantic-timeframe-facet', () => {
Actions.submitForm();
Expect.numberOfValidationErrors(2);
- Expect.validationError('Complete this field.');
+ Expect.validationError('Complete this field');
});
scope('when entering then erasing dates', () => {
@@ -322,7 +322,7 @@ describe('quantic-timeframe-facet', () => {
Actions.submitForm();
Expect.numberOfValidationErrors(1);
- Expect.validationError('Complete this field.');
+ Expect.validationError('Complete this field');
Actions.typeEndDate(validRange.end);
Actions.submitForm();
@@ -343,7 +343,7 @@ describe('quantic-timeframe-facet', () => {
Expect.numberOfValidationErrors(1);
Expect.validationError(
- 'Your entry does not match the allowed format yyyy-MM-dd.'
+ 'Your entry does not match the allowed format'
);
});
@@ -352,7 +352,7 @@ describe('quantic-timeframe-facet', () => {
Expect.numberOfValidationErrors(1);
Expect.validationError(
- 'Your entry does not match the allowed format yyyy-MM-dd.'
+ 'Your entry does not match the allowed format'
);
});
From 4dd0cf74fd88b5ad3a971c17962d0fe8ae4a6b77 Mon Sep 17 00:00:00 2001
From: jpmarceau <39384459+jpmarceau@users.noreply.github.com>
Date: Wed, 23 Oct 2024 16:53:53 -0400
Subject: [PATCH 12/57] docs(headless): link to proxy docs and remove long
proxy comments (#4535)
Link to headless proxy docs and remove long proxy comments
https://coveord.atlassian.net/browse/KIT-3563
---
.../case-assist-engine-configuration.ts | 12 +----
.../commerce-engine-configuration.ts | 17 +------
.../headless/src/app/engine-configuration.ts | 31 +-----------
.../insight-engine-configuration.ts | 14 +-----
.../recommendation-engine-configuration.ts | 16 +------
.../search-engine-configuration.ts | 16 +------
.../case-assist-configuration-actions.ts | 12 +----
.../case-assist-configuration-state.ts | 12 +----
.../configuration/configuration-actions.ts | 17 +------
.../configuration/configuration-actions.ts | 47 +------------------
10 files changed, 11 insertions(+), 183 deletions(-)
diff --git a/packages/headless/src/app/case-assist-engine/case-assist-engine-configuration.ts b/packages/headless/src/app/case-assist-engine/case-assist-engine-configuration.ts
index 61600c2dced..4ae5b4da020 100644
--- a/packages/headless/src/app/case-assist-engine/case-assist-engine-configuration.ts
+++ b/packages/headless/src/app/case-assist-engine/case-assist-engine-configuration.ts
@@ -35,17 +35,7 @@ export interface CaseAssistEngineConfiguration extends EngineConfiguration {
* This is an advanced option that you should only set if you need to proxy Coveo case assist requests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo case assist requests are sent directly to the Coveo platform through the
- * [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e., `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and different from
- * `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the case assist
- * engine will not work properly:
- *
- * - `POST` `/classify` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//caseassists//classify`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Case-Assist/operation/postClassify)
- * - `POST` `/documents/suggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//caseassists//documents/suggest`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Case-Assist/operation/getSuggestDocument)
+ * See [Headless proxy: Case Assist](https://docs.coveo.com/en/headless/latest/usage/proxy#case-assist).
*/
proxyBaseUrl?: string;
}
diff --git a/packages/headless/src/app/commerce-engine/commerce-engine-configuration.ts b/packages/headless/src/app/commerce-engine/commerce-engine-configuration.ts
index 204c4ca4fb0..4f3d1c7c3d3 100644
--- a/packages/headless/src/app/commerce-engine/commerce-engine-configuration.ts
+++ b/packages/headless/src/app/commerce-engine/commerce-engine-configuration.ts
@@ -38,22 +38,7 @@ export interface CommerceEngineConfiguration extends EngineConfiguration {
* This is an advanced option that you should only set if you need to proxy Coveo commerce requests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo commerce requests are sent directly to the Coveo platform through the
- * platform [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e.,
- * `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and
- * different from `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the
- * commerce engine will not work properly:
- *
- * - `POST` `/facet` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/facet`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Facet/operation/facet)
- * - `POST` `/listing` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/listing`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Listings/operation/getListing)
- * - `POST` `/productSuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/productSuggest`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Search/operation/productSuggest)
- * - `POST` `/querySuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/querySuggest`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Search/operation/querySuggest)
- * - `POST` `/recommendations` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/recommendations`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Recommendations/operation/recommendations)
- * - `POST` `/search` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/search`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Search/operation/search)
+ * See [Headless proxy: Commerce](https://docs.coveo.com/en/headless/latest/usage/proxy#commerce).
**/
proxyBaseUrl?: string;
}
diff --git a/packages/headless/src/app/engine-configuration.ts b/packages/headless/src/app/engine-configuration.ts
index 2f61479c10c..6811471acae 100644
--- a/packages/headless/src/app/engine-configuration.ts
+++ b/packages/headless/src/app/engine-configuration.ts
@@ -146,36 +146,7 @@ export interface AnalyticsConfiguration {
* This is an advanced option that you should only set if you need to proxy Coveo analytics requests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo analytics requests are sent directly to the Coveo platform through the
- * analytics [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e.,
- * `https://.analytics.org.coveo.com` or
- * `https://.analytics.org.coveo.com`, if the `environment` values is specified and
- * different from `prod`).
- *
- * If you set this option, you must also implement the correct proxy endpoints on your server, depending on the
- * `analyticsMode` you are using.
- *
- * If you are using the `next` analytics mode, you must implement the following proxy endpoints:
- *
- * - `POST` `/` to proxy requests to [`POST https://.analytics.org.coveo.com/rest/organizations/{organizationId}/events/v1`](https://platform.cloud.coveo.com/docs?urls.primaryName=Event#/Event%20API/rest_organizations_paramId_events_v1_post)
- * - `POST` `/validate` to proxy requests to [`POST https://.analytics.org.coveo.com/rest/organizations/{organizationId}/events/v1/validate`](https://platform.cloud.coveo.com/docs?urls.primaryName=Event#/Event%20API/rest_organizations_paramId_events_v1_validate_post)
- *
- * The [Event Protocol Reference](https://docs.coveo.com/en/n9da0377) provides documentation on the analytics event
- * schemas that can be passed as request bodies to the above endpoints.
- *
- * If your are using the `legacy` analytics mode, your `proxyBaseUrl` must end with `/rest/v15/analytics`, and you must implement the following proxy endpoints:
- *
- * - `POST` `/click` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/click`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_click)
- * - `POST` `/collect` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/collect`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_collect)
- * - `POST` `/custom` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/custom`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_custom)
- * - `GET` `/monitoring/health` to proxy requests to [`GET` `https://.analytics.org.coveo.com/rest/v15/analytics/monitoring/health`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/get__v15_analytics_monitoring_health)
- * - `POST` `/search` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/search`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_search)
- * - `POST` `/searches` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/searches`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_searches)
- * - `GET` `/status` to proxy requests to [`GET` `https://.analytics.org.coveo.com/rest/v15/analytics/status`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/get__v15_analytics_status)
- * - `POST` `/view` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/view`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_view)
- * - `DELETE` `/visit` to proxy requests to [`DELETE` `https://.analytics.org.coveo.com/rest/v15/analytics/visit`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/delete__v15_analytics_visit)
- * - `GET` `/visit` to proxy requests to [`GET` `https://.analytics.org.coveo.com/rest/v15/analytics/visit`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/get__v15_analytics_visit)
+ * See [Headless proxy: Analytics](https://docs.coveo.com/en/headless/latest/usage/proxy#analytics).
*/
proxyBaseUrl?: string;
}
diff --git a/packages/headless/src/app/insight-engine/insight-engine-configuration.ts b/packages/headless/src/app/insight-engine/insight-engine-configuration.ts
index 27feda12fc6..745f35b2681 100644
--- a/packages/headless/src/app/insight-engine/insight-engine-configuration.ts
+++ b/packages/headless/src/app/insight-engine/insight-engine-configuration.ts
@@ -41,19 +41,7 @@ export interface InsightEngineSearchConfigurationOptions {
* This is an advanced option that you should only set if you need to proxy Coveo insight requests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo insight requests are sent directly to the Coveo platform through the
- * [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e., `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and different from
- * `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the insight
- * engine will not work properly:
- *
- * - `GET` `/interface` to proxy requests to [`GET` `https://.org.coveo.com/rest/organizations//insight/v1/configs//interface`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Insight-Panel/operation/insight-panel-interface-get)
- * - `POST` `/querySuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//insight/v1/configs//querySuggest`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Insight-Panel/operation/insight-panel-query-suggest)
- * - `GET` `/quickview` to proxy requests to [`GET` `https://.org.coveo.com/rest/organizations//insight/v1/configs//quickview`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Insight-Panel/operation/insight-panel-quickview)
- * - `POST` `/search` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//insight/v1/configs//search`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Insight-Panel/operation/insight-panel-search)
+ * See [Headless proxy: Insight engine](https://docs.coveo.com/en/headless/latest/usage/proxy#insight-engine).
*/
proxyBaseUrl?: string;
}
diff --git a/packages/headless/src/app/recommendation-engine/recommendation-engine-configuration.ts b/packages/headless/src/app/recommendation-engine/recommendation-engine-configuration.ts
index c01dde9e850..410e2f5394c 100644
--- a/packages/headless/src/app/recommendation-engine/recommendation-engine-configuration.ts
+++ b/packages/headless/src/app/recommendation-engine/recommendation-engine-configuration.ts
@@ -51,21 +51,7 @@ export interface RecommendationEngineConfiguration extends EngineConfiguration {
* This is an advanced option that you should only set if you need to proxy Coveo search requests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo Search API requests are sent directly to the Coveo platform through the
- * search [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e., `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and different from
- * `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the recommendation
- * engine will not work properly:
- *
- * - `POST` `/` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/searchUsingPost)
- * - `POST` `/plan` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/plan`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/planSearchUsingPost)
- * - `POST` `/querySuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/querySuggest`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/querySuggestPost)
- * - `POST` `/facet` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/facet`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/facetSearch)
- * - `POST` `/html` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/html`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/htmlPost)
- * - `GET` `/fields` to proxy requests to [`GET` `https://.org.coveo.com/rest/search/v2/fields`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/fields)
+ * See [Headless proxy: Recommendation engine](https://docs.coveo.com/en/headless/latest/usage/proxy#recommendation-engine).
*/
proxyBaseUrl?: string;
}
diff --git a/packages/headless/src/app/search-engine/search-engine-configuration.ts b/packages/headless/src/app/search-engine/search-engine-configuration.ts
index 4e6ce41658d..2ffc7f27e0a 100644
--- a/packages/headless/src/app/search-engine/search-engine-configuration.ts
+++ b/packages/headless/src/app/search-engine/search-engine-configuration.ts
@@ -77,21 +77,7 @@ export interface SearchConfigurationOptions {
* This is an advanced option that you should only set if you need to proxy Coveo searchrequests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo Search API requests are sent directly to the Coveo platform through the
- * search [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e., `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and different from
- * `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the search
- * engine will not work properly:
- *
- * - `POST` `/` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/searchUsingPost)
- * - `POST` `/plan` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/plan`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/planSearchUsingPost)
- * - `POST` `/querySuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/querySuggest`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/querySuggestPost)
- * - `POST` `/facet` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/facet`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/facetSearch)
- * - `POST` `/html` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/html`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/htmlPost)
- * - `GET` `/fields` to proxy requests to [`GET` `https://.org.coveo.com/rest/search/v2/fields`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/fields)
+ * See [Headless proxy: Search](https://docs.coveo.com/en/headless/latest/usage/proxy#search).
*/
proxyBaseUrl?: string;
}
diff --git a/packages/headless/src/features/case-assist-configuration/case-assist-configuration-actions.ts b/packages/headless/src/features/case-assist-configuration/case-assist-configuration-actions.ts
index 5dc403df0f9..a3ae1f85d3f 100644
--- a/packages/headless/src/features/case-assist-configuration/case-assist-configuration-actions.ts
+++ b/packages/headless/src/features/case-assist-configuration/case-assist-configuration-actions.ts
@@ -21,17 +21,7 @@ export interface SetCaseAssistConfigurationActionCreatorPayload {
* This is an advanced option that you should only set if you need to proxy Coveo case assist through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo case assist requests are sent directly to the Coveo platform through the
- * [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e., `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and different from
- * `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the case assist
- * engine will not work properly:
- *
- * - `POST` `/classify` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//caseassists//classify`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Case-Assist/operation/postClassify)
- * - `POST` `/documents/suggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//caseassists//documents/suggest`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Case-Assist/operation/getSuggestDocument)
+ * See [Headless proxy: Case Assist](https://docs.coveo.com/en/headless/latest/usage/proxy#case-assist).
*/
proxyBaseUrl?: string;
}
diff --git a/packages/headless/src/features/case-assist-configuration/case-assist-configuration-state.ts b/packages/headless/src/features/case-assist-configuration/case-assist-configuration-state.ts
index 8ce8ac1f694..1ac1f0f9672 100644
--- a/packages/headless/src/features/case-assist-configuration/case-assist-configuration-state.ts
+++ b/packages/headless/src/features/case-assist-configuration/case-assist-configuration-state.ts
@@ -19,17 +19,7 @@ export interface CaseAssistConfigurationState {
* This is an advanced option that you should only set if you need to proxy Coveo case assist through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo case assist requests are sent directly to the Coveo platform through the
- * [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e., `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and different from
- * `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the case assist
- * engine will not work properly:
- *
- * - `POST` `/classify` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//caseassists//classify`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Case-Assist/operation/postClassify)
- * - `POST` `/documents/suggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//caseassists//documents/suggest`](https://docs.coveo.com/en/3430/api-reference/customer-service-api#tag/Case-Assist/operation/getSuggestDocument)
+ * See [Headless proxy: Case Assist](https://docs.coveo.com/en/headless/latest/usage/proxy#case-assist).
*/
apiBaseUrl?: string;
}
diff --git a/packages/headless/src/features/commerce/configuration/configuration-actions.ts b/packages/headless/src/features/commerce/configuration/configuration-actions.ts
index e4d1ee35e83..86912862e6f 100644
--- a/packages/headless/src/features/commerce/configuration/configuration-actions.ts
+++ b/packages/headless/src/features/commerce/configuration/configuration-actions.ts
@@ -34,22 +34,7 @@ export type UpdateProxyBaseUrlPayload = {
* This is an advanced option that you should only set if you need to proxy Coveo commerce requests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo commerce requests are sent directly to the Coveo platform through the
- * platform [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e.,
- * `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and
- * different from `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the
- * commerce engine will not work properly:
- *
- * - `POST` `/facet` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/facet`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Facet/operation/facet)
- * - `POST` `/listing` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/listing`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Listings/operation/getListing)
- * - `POST` `/productSuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/productSuggest`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Search/operation/productSuggest)
- * - `POST` `/querySuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/querySuggest`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Search/operation/querySuggest)
- * - `POST` `/recommendations` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/recommendations`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Recommendations/operation/recommendations)
- * - `POST` `/search` to proxy requests to [`POST` `https://.org.coveo.com/rest/organizations//commerce/v2/search`](https://docs.coveo.com/en/103/api-reference/commerce-api#tag/Search/operation/search)
+ * See [Headless proxy: Commerce](https://docs.coveo.com/en/headless/latest/usage/proxy#commerce).
**/
proxyBaseUrl?: string;
};
diff --git a/packages/headless/src/features/configuration/configuration-actions.ts b/packages/headless/src/features/configuration/configuration-actions.ts
index ededa64288b..ecbec336052 100644
--- a/packages/headless/src/features/configuration/configuration-actions.ts
+++ b/packages/headless/src/features/configuration/configuration-actions.ts
@@ -60,21 +60,7 @@ export interface UpdateSearchConfigurationActionCreatorPayload {
* This is an advanced option that you should only set if you need to proxy Coveo searchrequests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo Search API requests are sent directly to the Coveo platform through the
- * search [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e., `https://.org.coveo.com` or
- * `https://.org.coveo.com`, if the `environment` values is specified and different from
- * `prod`).
- *
- * If you set this option, you must also implement the following proxy endpoints on your server, otherwise the search
- * engine will not work properly:
- *
- * - `POST` `/` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/searchUsingPost)
- * - `POST` `/facet` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/facet`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/facetSearch)
- * - `GET` `/fields` to proxy requests to [`GET` `https://.org.coveo.com/rest/search/v2/fields`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/fields)
- * - `POST` `/html` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/html`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/htmlPost)
- * - `POST` `/plan` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/plan`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/planSearchUsingPost)
- * - `POST` `/querySuggest` to proxy requests to [`POST` `https://.org.coveo.com/rest/search/v2/querySuggest`](https://docs.coveo.com/en/13/api-reference/search-api#tag/Search-V2/operation/querySuggestPost)
+ * See [Headless proxy: Search](https://docs.coveo.com/en/headless/latest/usage/proxy#search).
*/
proxyBaseUrl?: string;
@@ -152,36 +138,7 @@ export interface UpdateAnalyticsConfigurationActionCreatorPayload {
* This is an advanced option that you should only set if you need to proxy Coveo analytics requests through your own
* server. In most cases, you should not set this option.
*
- * By default, no proxy is used and the Coveo analytics requests are sent directly to the Coveo platform through the
- * analytics [organization endpoint](https://docs.coveo.com/en/mcc80216) resolved from the `organizationId` and
- * `environment` values provided in your engine configuration (i.e.,
- * `https://.analytics.org.coveo.com` or
- * `https://.analytics.org.coveo.com`, if the `environment` values is specified and
- * different from `prod`).
- *
- * If you set this option, you must also implement the correct proxy endpoints on your server, depending on the
- * `analyticsMode` you are using.
- *
- * If you are using the `next` analytics mode, you must implement the following proxy endpoints:
- *
- * - `POST` `/` to proxy requests to [`POST https://.analytics.org.coveo.com/rest/organizations/{organizationId}/events/v1`](https://platform.cloud.coveo.com/docs?urls.primaryName=Event#/Event%20API/rest_organizations_paramId_events_v1_post)
- * - `POST` `/validate` to proxy requests to [`POST https://.analytics.org.coveo.com/rest/organizations/{organizationId}/events/v1/validate`](https://platform.cloud.coveo.com/docs?urls.primaryName=Event#/Event%20API/rest_organizations_paramId_events_v1_validate_post)
- *
- * The [Event Protocol Reference](https://docs.coveo.com/en/n9da0377) provides documentation on the analytics event
- * schemas that can be passed as request bodies to the above endpoints.
- *
- * If your are using the `legacy` analytics mode, your `proxyBaseUrl` must end with `/rest/v15/analytics`, and you must implement the following proxy endpoints:
- *
- * - `POST` `/click` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/click`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_click)
- * - `POST` `/collect` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/collect`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_collect)
- * - `POST` `/custom` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/custom`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_custom)
- * - `GET` `/monitoring/health` to proxy requests to [`GET` `https://.analytics.org.coveo.com/rest/v15/analytics/monitoring/health`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/get__v15_analytics_monitoring_health)
- * - `POST` `/search` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/search`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_search)
- * - `POST` `/searches` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/searches`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_searches)
- * - `GET` `/status` to proxy requests to [`GET` `https://.analytics.org.coveo.com/rest/v15/analytics/status`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/get__v15_analytics_status)
- * - `POST` `/view` to proxy requests to [`POST` `https://.analytics.org.coveo.com/rest/v15/analytics/view`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/post__v15_analytics_view)
- * - `DELETE` `/visit` to proxy requests to [`DELETE` `https://.analytics.org.coveo.com/rest/v15/analytics/visit`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/delete__v15_analytics_visit)
- * - `GET` `/visit` to proxy requests to [`GET` `https://.analytics.org.coveo.com/rest/v15/analytics/visit`](https://docs.coveo.com/en/18/api-reference/usage-analytics-write-api#tag/Analytics-API-Version-15/operation/get__v15_analytics_visit)
+ * See [Headless proxy: Analytics](https://docs.coveo.com/en/headless/latest/usage/proxy#analytics).
*/
proxyBaseUrl?: string;
From b579cb06c0f29410aff34f9cbdae2f7c80443b7a Mon Sep 17 00:00:00 2001
From: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com>
Date: Wed, 23 Oct 2024 17:03:47 -0400
Subject: [PATCH 13/57] fix(atomic): allow atomic loader to be deployed to the
CDN (#4568)
https://coveord.atlassian.net/browse/KIT-3666
This PR allows the `defineCustomElements()` function to be deployed to
the CDN by simply adding it into the `/dist` folder instead of it's
custom folder.
It causes a problem in atomic-react where the `defineCustomElements`
import becomes `"import { defineCustomElements } from
'@coveo/atomic/dist/loader';"`.
That import is invalid because of the added `exports` field in atomic
V3. To fix this, we need to change the import back to how it was. I
created a script to do this. It changes it back to `"import {
defineCustomElements } from '@coveo/atomic/loader';"`.
---
.prettierignore | 1 -
packages/atomic-react/package.json | 1 +
packages/atomic-react/project.json | 1 +
.../scripts/fix-loader-import-paths.js | 29 +++++++++++++++++
packages/atomic/.eslintrc.cjs | 1 -
packages/atomic/package.json | 9 +++---
packages/atomic/project.json | 2 +-
packages/atomic/stencil.config.ts | 1 -
packages/samples/stencil/stencil.config.ts | 32 +++++++++++++++++++
9 files changed, 68 insertions(+), 9 deletions(-)
create mode 100644 packages/atomic-react/scripts/fix-loader-import-paths.js
diff --git a/.prettierignore b/.prettierignore
index 6603d0cf302..d8fb45a0552 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -14,7 +14,6 @@ utils/**/.storybook/**
scripts/deploy/execute-deployment-pipeline.mjs
**/staticresources/**
packages/atomic-hosted-page/loader/**/*
-packages/atomic/loader/**/*
packages/atomic/docs/**/*
packages/atomic/dist-storybook/**/*
packages/atomic/src/components/search/atomic-search-interface/lang/*.json
diff --git a/packages/atomic-react/package.json b/packages/atomic-react/package.json
index aa67cb59b7f..07b567cf679 100644
--- a/packages/atomic-react/package.json
+++ b/packages/atomic-react/package.json
@@ -12,6 +12,7 @@
"scripts": {
"build": "nx build",
"clean": "rimraf -rf dist",
+ "build:fixLoaderImportPaths": "node ./scripts/fix-loader-import-paths.js",
"build:fixGeneratedImportPaths": "fix-esm-import-path src/components/stencil-generated",
"build:bundles:esm": "tsc -p tsconfig.esm.json",
"build:bundles:iife-cjs": "rollup --config rollup.config.mjs --bundleConfigAsCjs",
diff --git a/packages/atomic-react/project.json b/packages/atomic-react/project.json
index 5af3ade9955..7c26443d165 100644
--- a/packages/atomic-react/project.json
+++ b/packages/atomic-react/project.json
@@ -8,6 +8,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
+ "npm run build:fixLoaderImportPaths",
"npm run build:fixGeneratedImportPaths",
"npm run build:bundles",
"npm run build:assets"
diff --git a/packages/atomic-react/scripts/fix-loader-import-paths.js b/packages/atomic-react/scripts/fix-loader-import-paths.js
new file mode 100644
index 00000000000..0a8283afaae
--- /dev/null
+++ b/packages/atomic-react/scripts/fix-loader-import-paths.js
@@ -0,0 +1,29 @@
+import {promises as fs} from 'fs';
+import path from 'path';
+
+const files = [
+ path.resolve('src/components/stencil-generated/commerce/index.ts'),
+ path.resolve('src/components/stencil-generated/search/index.ts'),
+];
+
+const oldImport =
+ "import { defineCustomElements } from '@coveo/atomic/dist/loader';";
+const newImport =
+ "import { defineCustomElements } from '@coveo/atomic/loader';";
+
+const updateFiles = async () => {
+ await Promise.all(
+ files.map(async (filePath) => {
+ try {
+ let data = await fs.readFile(filePath, 'utf8');
+ const updatedData = data.replace(oldImport, newImport);
+ await fs.writeFile(filePath, updatedData, 'utf8');
+ console.log(`File updated: ${filePath}`);
+ } catch (err) {
+ console.error(`Error updating file: ${filePath}`, err);
+ }
+ })
+ );
+};
+
+updateFiles();
diff --git a/packages/atomic/.eslintrc.cjs b/packages/atomic/.eslintrc.cjs
index 5078021b491..3226298d692 100644
--- a/packages/atomic/.eslintrc.cjs
+++ b/packages/atomic/.eslintrc.cjs
@@ -13,7 +13,6 @@ module.exports = {
'src/external-builds/**/*',
'dist/**/*',
'www/**/*',
- 'loader/**/*',
'docs/**/*',
'dist-storybook',
],
diff --git a/packages/atomic/package.json b/packages/atomic/package.json
index 1009084f0c3..3fd3c084fd9 100644
--- a/packages/atomic/package.json
+++ b/packages/atomic/package.json
@@ -14,9 +14,9 @@
"types": "dist/types/index.d.ts",
"exports": {
"./loader": {
- "types": "./loader/index.d.ts",
- "import": "./loader/index.js",
- "require": "./loader/index.cjs.js"
+ "types": "./dist/loader/index.d.ts",
+ "import": "./dist/loader/index.js",
+ "require": "./dist/loader/index.cjs.js"
},
".": {
"types": "./dist/types/index.d.ts",
@@ -39,8 +39,7 @@
"files": [
"dist/",
"docs/",
- "licenses/",
- "loader/"
+ "licenses/"
],
"scripts": {
"clean": "rimraf -rf dist/* dist-storybook/* www/* docs/* loader/* playwright-report/*",
diff --git a/packages/atomic/project.json b/packages/atomic/project.json
index 6b1ab3fa7a9..e0f4e24627b 100644
--- a/packages/atomic/project.json
+++ b/packages/atomic/project.json
@@ -152,7 +152,7 @@
"dependsOn": ["^build", "cached:build:stencil"],
"executor": "nx:run-commands",
"options": {
- "command": "rm ./loader/package.json",
+ "command": "rm ./dist/loader/package.json",
"cwd": "packages/atomic"
}
}
diff --git a/packages/atomic/stencil.config.ts b/packages/atomic/stencil.config.ts
index fd92aada780..2873c7fea7a 100644
--- a/packages/atomic/stencil.config.ts
+++ b/packages/atomic/stencil.config.ts
@@ -155,7 +155,6 @@ export const config: Config = {
{
type: 'dist',
collectionDir: null,
- esmLoaderPath: '../loader',
copy: [
{src: 'themes'},
{
diff --git a/packages/samples/stencil/stencil.config.ts b/packages/samples/stencil/stencil.config.ts
index a29e147a5f8..38fe68af107 100644
--- a/packages/samples/stencil/stencil.config.ts
+++ b/packages/samples/stencil/stencil.config.ts
@@ -1,4 +1,6 @@
import {Config} from '@stencil/core';
+import {readFileSync} from 'fs';
+import {join} from 'path';
import html from 'rollup-plugin-html';
// https://stenciljs.com/docs/config
@@ -36,6 +38,36 @@ export const config: Config = {
html({
include: 'src/components/**/*.html',
}),
+ resolveAtomicPaths(),
],
},
};
+
+function resolveAtomicPaths() {
+ return {
+ resolveId(source: string) {
+ if (source.startsWith('@coveo/atomic/')) {
+ const nodeModulesLocation = '../../../node_modules';
+
+ const packageJsonPath = join(
+ process.cwd(),
+ nodeModulesLocation,
+ '@coveo',
+ 'atomic',
+ 'package.json'
+ );
+
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
+
+ const subPath = './' + source.replace('@coveo/atomic/', '');
+ const subPathImport = packageJson.exports[subPath].import;
+
+ const id = `${nodeModulesLocation}/@coveo/atomic/${subPathImport}`;
+ return {
+ id,
+ };
+ }
+ return null;
+ },
+ };
+}
From 2dbad7864c5f3aa31ca9c5736628de36676f7a5c Mon Sep 17 00:00:00 2001
From: jpmarceau <39384459+jpmarceau@users.noreply.github.com>
Date: Wed, 23 Oct 2024 17:20:22 -0400
Subject: [PATCH 14/57] fix(atomic-numeric-facet storybook): storybook bug fix
for numeric facet (#4565)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
https://coveord.atlassian.net/browse/KIT-3665
Fixes this:
https://static.cloud.coveo.com/atomic/v3.3/storybook/index.html?path=/story/atomic-numeric-facet--default
Before:
![Screenshot 2024-10-21 at 1 39
30 PM](https://github.com/user-attachments/assets/15cd3cb5-18e9-4499-bbc5-dfce2b9f8d88)
After:
![Screenshot 2024-10-21 at 1 39
48 PM](https://github.com/user-attachments/assets/e39562fe-8b20-47b2-8b3c-37a4a97c81b2)
---
.../atomic-numeric-facet/atomic-numeric-facet.new.stories.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/atomic/src/components/search/facets/atomic-numeric-facet/atomic-numeric-facet.new.stories.tsx b/packages/atomic/src/components/search/facets/atomic-numeric-facet/atomic-numeric-facet.new.stories.tsx
index 2b4149e7801..dde2a58afb8 100644
--- a/packages/atomic/src/components/search/facets/atomic-numeric-facet/atomic-numeric-facet.new.stories.tsx
+++ b/packages/atomic/src/components/search/facets/atomic-numeric-facet/atomic-numeric-facet.new.stories.tsx
@@ -31,6 +31,6 @@ export const Default: Story = {
name: 'atomic-numeric-facet',
decorators: [facetDecorator],
args: {
- field: 'ytviewcount',
+ 'attributes-field': 'ytviewcount',
},
};
From b316b88aeeb1164f92f741917aa45736b92fd963 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 23 Oct 2024 21:38:54 +0000
Subject: [PATCH 15/57] chore(deps): bump express from 4.19.2 to 4.20.0 in
/packages/samples/headless-react (#4590)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [express](https://github.com/expressjs/express) from 4.19.2 to
4.20.0.
Release notes
Sourced from express's
releases.
4.20.0
What's Changed
Important
- IMPORTANT: The default
depth
level for parsing
URL-encoded data is now 32
(previously was
Infinity
)
- Remove link renderization in html while using
res.redirect
Other Changes
New Contributors
Full Changelog: https://github.com/expressjs/express/compare/4.19.1...4.20.0
Changelog
Sourced from express's
changelog.
4.20.0 / 2024-09-10
- deps: serve-static@0.16.0
- Remove link renderization in html while redirecting
- deps: send@0.19.0
- Remove link renderization in html while redirecting
- deps: body-parser@0.6.0
- add
depth
option to customize the depth level in the
parser
- IMPORTANT: The default
depth
level for parsing
URL-encoded data is now 32
(previously was
Infinity
)
- Remove link renderization in html while using
res.redirect
- deps: path-to-regexp@0.1.10
- Adds support for named matching groups in the routes using a
regex
- Adds backtracking protection to parameters without regexes
defined
- deps: encodeurl@~2.0.0
- Removes encoding of
\
, |
, and
^
to align better with URL spec
- Deprecate passing
options.maxAge
and
options.expires
to res.clearCookie
- Will be ignored in v5, clearCookie will set a cookie with an expires
in the past to instruct clients to delete the cookie
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=express&package-manager=npm_and_yarn&previous-version=4.19.2&new-version=4.20.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/coveo/ui-kit/network/alerts).
---------
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felix Perron-Brault
---
package-lock.json | 328 ++++++++++++++++++-
packages/samples/headless-react/package.json | 2 +-
2 files changed, 322 insertions(+), 8 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index b5967515f6b..9a5a0eb7715 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -23691,6 +23691,7 @@
"version": "1.20.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
"integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==",
+ "dev": true,
"dependencies": {
"bytes": "3.1.2",
"content-type": "~1.0.5",
@@ -23714,6 +23715,7 @@
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
"dependencies": {
"ms": "2.0.0"
}
@@ -23722,6 +23724,7 @@
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
@@ -23732,12 +23735,14 @@
"node_modules/body-parser/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "dev": true
},
"node_modules/body-parser/node_modules/qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "dev": true,
"dependencies": {
"side-channel": "^1.0.4"
},
@@ -31189,6 +31194,7 @@
"version": "4.19.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
"integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==",
+ "dev": true,
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
@@ -31230,6 +31236,7 @@
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
"dependencies": {
"ms": "2.0.0"
}
@@ -31237,12 +31244,14 @@
"node_modules/express/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "dev": true
},
"node_modules/express/node_modules/qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "dev": true,
"dependencies": {
"side-channel": "^1.0.4"
},
@@ -40813,7 +40822,8 @@
"node_modules/merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
- "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
+ "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==",
+ "dev": true
},
"node_modules/merge-stream": {
"version": "2.0.0",
@@ -44339,7 +44349,8 @@
"node_modules/path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
- "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
+ "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==",
+ "dev": true
},
"node_modules/path-type": {
"version": "4.0.0",
@@ -47877,6 +47888,7 @@
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
"integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
+ "dev": true,
"dependencies": {
"debug": "2.6.9",
"depd": "2.0.0",
@@ -47900,6 +47912,7 @@
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
"dependencies": {
"ms": "2.0.0"
}
@@ -47907,12 +47920,14 @@
"node_modules/send/node_modules/debug/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "dev": true
},
"node_modules/send/node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "dev": true,
"bin": {
"mime": "cli.js"
},
@@ -47923,7 +47938,8 @@
"node_modules/send/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true
},
"node_modules/sentence-case": {
"version": "3.0.4",
@@ -48230,6 +48246,7 @@
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
"integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
+ "dev": true,
"dependencies": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
@@ -62322,7 +62339,7 @@
"@types/react-router-dom": "5.3.3",
"dayjs": "1.11.12",
"escape-html": "1.0.3",
- "express": "4.19.2",
+ "express": "4.20.0",
"filesize": "10.1.4",
"react": "18.3.1",
"react-dom": "18.3.1",
@@ -63572,6 +63589,60 @@
"node": ">=12"
}
},
+ "packages/samples/headless-react/node_modules/body-parser": {
+ "version": "1.20.3",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
+ "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "content-type": "~1.0.5",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "http-errors": "2.0.0",
+ "iconv-lite": "0.4.24",
+ "on-finished": "2.4.1",
+ "qs": "6.13.0",
+ "raw-body": "2.5.2",
+ "type-is": "~1.6.18",
+ "unpipe": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "packages/samples/headless-react/node_modules/body-parser/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "packages/samples/headless-react/node_modules/body-parser/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "license": "MIT"
+ },
+ "packages/samples/headless-react/node_modules/body-parser/node_modules/qs": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
+ "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "side-channel": "^1.0.6"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"packages/samples/headless-react/node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -63781,6 +63852,15 @@
"dev": true,
"license": "ISC"
},
+ "packages/samples/headless-react/node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"packages/samples/headless-react/node_modules/esbuild": {
"version": "0.21.5",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
@@ -63843,6 +63923,63 @@
"url": "https://opencollective.com/eslint"
}
},
+ "packages/samples/headless-react/node_modules/express": {
+ "version": "4.20.0",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz",
+ "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==",
+ "license": "MIT",
+ "dependencies": {
+ "accepts": "~1.3.8",
+ "array-flatten": "1.1.1",
+ "body-parser": "1.20.3",
+ "content-disposition": "0.5.4",
+ "content-type": "~1.0.4",
+ "cookie": "0.6.0",
+ "cookie-signature": "1.0.6",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "finalhandler": "1.2.0",
+ "fresh": "0.5.2",
+ "http-errors": "2.0.0",
+ "merge-descriptors": "1.0.3",
+ "methods": "~1.1.2",
+ "on-finished": "2.4.1",
+ "parseurl": "~1.3.3",
+ "path-to-regexp": "0.1.10",
+ "proxy-addr": "~2.0.7",
+ "qs": "6.11.0",
+ "range-parser": "~1.2.1",
+ "safe-buffer": "5.2.1",
+ "send": "0.19.0",
+ "serve-static": "1.16.0",
+ "setprototypeof": "1.2.0",
+ "statuses": "2.0.1",
+ "type-is": "~1.6.18",
+ "utils-merge": "1.0.1",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
+ "packages/samples/headless-react/node_modules/express/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "packages/samples/headless-react/node_modules/express/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "license": "MIT"
+ },
"packages/samples/headless-react/node_modules/filesize": {
"version": "10.1.4",
"resolved": "https://registry.npmjs.org/filesize/-/filesize-10.1.4.tgz",
@@ -63885,6 +64022,18 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "packages/samples/headless-react/node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"packages/samples/headless-react/node_modules/is-ci": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz",
@@ -63926,6 +64075,27 @@
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
+ "packages/samples/headless-react/node_modules/merge-descriptors": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "packages/samples/headless-react/node_modules/mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "license": "MIT",
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
"packages/samples/headless-react/node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@@ -64006,6 +64176,12 @@
"node": ">=4"
}
},
+ "packages/samples/headless-react/node_modules/path-to-regexp": {
+ "version": "0.1.10",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
+ "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==",
+ "license": "MIT"
+ },
"packages/samples/headless-react/node_modules/pathval": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz",
@@ -64045,6 +64221,21 @@
"node": "^10 || ^12 || >=14"
}
},
+ "packages/samples/headless-react/node_modules/qs": {
+ "version": "6.11.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
+ "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"packages/samples/headless-react/node_modules/rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -64057,6 +64248,129 @@
"rimraf": "bin.js"
}
},
+ "packages/samples/headless-react/node_modules/send": {
+ "version": "0.19.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
+ "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "0.5.2",
+ "http-errors": "2.0.0",
+ "mime": "1.6.0",
+ "ms": "2.1.3",
+ "on-finished": "2.4.1",
+ "range-parser": "~1.2.1",
+ "statuses": "2.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "packages/samples/headless-react/node_modules/send/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "packages/samples/headless-react/node_modules/send/node_modules/debug/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "license": "MIT"
+ },
+ "packages/samples/headless-react/node_modules/send/node_modules/encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "packages/samples/headless-react/node_modules/send/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "packages/samples/headless-react/node_modules/serve-static": {
+ "version": "1.16.0",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz",
+ "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==",
+ "license": "MIT",
+ "dependencies": {
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.3",
+ "send": "0.18.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "packages/samples/headless-react/node_modules/serve-static/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "packages/samples/headless-react/node_modules/serve-static/node_modules/debug/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "license": "MIT"
+ },
+ "packages/samples/headless-react/node_modules/serve-static/node_modules/encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "packages/samples/headless-react/node_modules/serve-static/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "packages/samples/headless-react/node_modules/serve-static/node_modules/send": {
+ "version": "0.18.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
+ "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "0.5.2",
+ "http-errors": "2.0.0",
+ "mime": "1.6.0",
+ "ms": "2.1.3",
+ "on-finished": "2.4.1",
+ "range-parser": "~1.2.1",
+ "statuses": "2.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
"packages/samples/headless-react/node_modules/shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
diff --git a/packages/samples/headless-react/package.json b/packages/samples/headless-react/package.json
index cd47471f5f7..12edb0a74fe 100644
--- a/packages/samples/headless-react/package.json
+++ b/packages/samples/headless-react/package.json
@@ -21,7 +21,7 @@
"@types/react-router-dom": "5.3.3",
"dayjs": "1.11.12",
"escape-html": "1.0.3",
- "express": "4.19.2",
+ "express": "4.20.0",
"filesize": "10.1.4",
"react": "18.3.1",
"react-dom": "18.3.1",
From c7478548d559c5dba046f55ccdc4c52de25c6ee3 Mon Sep 17 00:00:00 2001
From: Boris Bera
Date: Thu, 24 Oct 2024 08:02:10 -0400
Subject: [PATCH 16/57] chore(renovate): migrate to standard renovate config
[CIA-611] (#4555)
:wave: This is an automated pull request to Migrate this repository's
renovate config to the latest and greatest recommended settings.
### :pray: __Please approve and merge this PR yourself promptly.__
:pray:
https://coveord.atlassian.net/browse/CIA-611
This PR is part of a migration effort from the Platform Engineering unit
that aims to standardize everyone's Renovate config for the better. The
main goal of this PR is to ensure that everyone uses our [standard
renovate
preset](https://devportal.dep.cloud.coveo.com/docs/default/component/renovate/configuration/available-presets/default-json.gen/).
On top of this, we're also tweaking and adjusting some options to make
sure that things work a little better.
## What does the standard preset do?
Our standard preset
([`github>{...}/renovate-presets`](https://devportal.dep.cloud.coveo.com/docs/default/component/renovate/configuration/available-presets/default-json.gen/))
does a lot of things out of the box for you. These are settings that we
believe should apply to everyone. Note that some of these settings are
meant to act as default sane values and can be overwritten in your own
renovate config.
Summary of the standard renovate preset
- Groups all non major Javascript & Typescript package updates together
- Groups all non major Python package updates together
- Includes the official `config:recommended` preset
- Enables the Dependency Dashboard
- Ignores common module and test directories
- Groups monorepo package updates together
- Groups related package updates together (list curated by renovate)
- Applies package replacement rules (ex: a package changes name)
- Applies crowd-sourced workarounds for known problems with packages
- Groups python version updates in their own PR
- Schedules renovate to create PRs weekly (Tuesday morning, to avoid
holidays and long weekends)
- Adds "merge confidence" badges to table in the pull request body
- Enables updating TGF
- Enables updating container image reference in `.deployment.config*`
- Disables updates for untrusted and
[low-trust](https://github.com/coveo-platform/gha-infra/tree/main?tab=readme-ov-file#low-trust-actions)
GitHub actions
- Enables semantic commits for PR titles and commits. (ex: `chore(deps):
update ...`)
- Disables major updates for the Spring Framework
- Pins hashes for docker dependencies
- Assigns PR reviewers from the `CODEOWNERS` file
- Sets standard labels for renovate PRs
- Sets a standard timezone so renovate works on our timezone
(`America/Toronto`)
- Waits for a version to be at least 7 days old before attempting an
update. (Except for internal dependencies, we don't wait for those.)
## Explanation of Changes
If you're curious as to what changes we've made and why we've made them,
this section will go into detail on those. This list contains all the
possible changes it's likely that only some of these apply to this PR.
Add our standard preset
If your repository doesn't already use our preset, we have added to for
as the first item in `extends: [...]`. This preset must be the first in
the list to allow you to override its settings with other presets.
Remove now redundant presets
We have removed some presets from your config because they have been
made redundant by our standard preset. To be specific, these presets
were removed from your config because they're already included in the
standard preset and because their ordering in `extends: [...]` doesn't
matter.
Replace the github>coveo-platform/platform-tools
preset
This preset was originally put in place by the platform foundation team
for Java projects. We have replaced this project by a combination of our
standard preset and our auto-merge preset. The standard preset is the
first in the list and the auto-merge preset is the last in the list.
You'll notice some formatting changes to renovate's PRs as well as the
names of renovate's branches.
Update preset references
Over time, we have moved and renamed some presets. To avoid breaking
everyone's renovate config, we have configured renovate to apply those
changes at runtime. We are now applying these changes to your config.
This makes it easier to look up the presets that you're using since they
won't be pointing to old presets that no longer exist.
Reorder presets
We have switched around the order of some presets. The order in
`extends: [...]` matters to renovate as presets that are later in the
list override the ones that are earlier in the list. We've made two key
ordering changes:
- Our standard preset is now the first in the list. This allows your
other presets to override it.
- Our auto-merge preset is now last in the list. This allows it to
override groupings from all other presets.
Remove auto-approve workflow
In the past, if you wanted renovate to auto-merge certain updates, you
needed a bot to approve some of renovate's PRs. The approval requirement
for renovate's auto-merge functionality is now gone and renovate can
auto-merge certain PRs without the need for an approval. Because of this
change, the auto-approve workflow is now redundant and has been removed.
Note that we've also adjusted all branch protection rules and rulesets
in your repository's settings to allow renovate to bypass them.
Remove non-recommended options (repositories,
prConcurrentLimit, enabledManagers)
There are certain renovate options that we believe should not be set as
they do more harm than good:
- `repositories`: This option is not valid in a repository config.
Removing this will also removes a warning from your Dependency
Dashboard.
- `prConcurrentLimit`: This option used to be set to a pretty low
number. This can block renovate from auto-merging certain updates
because it can't open any more PRs.
- `enabledManagers`: The option tells renovate that it should enable the
given managers and disable all other ones. By default renovate has most,
if not all, managers enabled. If you want to disable a manager, you're
better off setting `{my-manager}.enabled = false`.
Remove redundant options (prHeader, rebaseWhen, branchPrefix,
reviewersFromCodeOwners)
We have removed these options because they were either set to their
default value or set to the value already specified in our standard
preset. Removing these options makes it easier to change them in the
future if need be.
---------
Co-authored-by: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com>
---
renovate.json | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/renovate.json b/renovate.json
index c36aa7db7d6..5e7265ba91d 100644
--- a/renovate.json
+++ b/renovate.json
@@ -1,9 +1,8 @@
{
"enabled": false,
"extends": [
- ":semanticPrefixFixDepsChoreOthers",
- "helpers:pinGitHubActionDigests",
- "schedule:earlyMondays"
+ "github>coveo/renovate-presets",
+ "helpers:pinGitHubActionDigests"
],
"labels": ["dependencies"],
"packageRules": [
@@ -155,6 +154,5 @@
"commitMessageSuffix": "J:KIT-282",
"vulnerabilityAlerts": {
"enabled": false
- },
- "ignoreDeps": ["@monaco-editor/react"]
+ }
}
From 47a9758fa410f7f74f9550264bef187c5156675e Mon Sep 17 00:00:00 2001
From: Nico Labarre
Date: Thu, 24 Oct 2024 08:13:41 -0400
Subject: [PATCH 17/57] feat(commerce): add breadcrumbs and parameters support
for location facets (#4571)
See https://github.com/coveo/ui-kit/pull/4562
https://github.com/user-attachments/assets/e3ace74e-f014-4866-92a4-b54c2547ba3b
[COMHUB-247]
[COMHUB-247]:
https://coveord.atlassian.net/browse/COMHUB-247?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
---
.../headless-core-breadcrumb-manager.test.ts | 38 ++++++++++++++++++-
.../headless-core-breadcrumb-manager.ts | 25 +++++++-----
.../facets/facet-set/facet-set-reducers.ts | 28 +++++++++-----
.../facets/facet-set/facet-set-slice.test.ts | 38 +++++++++++++++++++
.../commerce/parameters/parameters-actions.ts | 6 +++
.../commerce/parameters/parameters-schema.ts | 1 +
.../parameters/parameters-selectors.ts | 14 +++++++
.../parameters/parameters-serializer.test.ts | 2 +
.../parameters/parameters-serializer.ts | 9 ++++-
.../facet-order/facet-order-slice.test.ts | 6 +++
.../facets/facet-order/facet-order-slice.ts | 1 +
.../search-parameter-serializer.ts | 9 +++--
12 files changed, 153 insertions(+), 24 deletions(-)
diff --git a/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.test.ts b/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.test.ts
index 513c11e6103..bb82474d915 100644
--- a/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.test.ts
+++ b/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.test.ts
@@ -14,9 +14,14 @@ import {
AnyFacetValueResponse,
CategoryFacetValue,
DateFacetValue,
+ LocationFacetValue,
NumericFacetValue,
RegularFacetValue,
} from '../../../../features/commerce/facets/facet-set/interfaces/response.js';
+import {
+ toggleExcludeLocationFacetValue,
+ toggleSelectLocationFacetValue,
+} from '../../../../features/commerce/facets/location-facet/location-facet-actions.js';
import {
toggleExcludeNumericFacetValue,
toggleSelectNumericFacetValue,
@@ -32,6 +37,7 @@ import {buildMockCommerceFacetRequest} from '../../../../test/mock-commerce-face
import {
buildMockCategoryFacetResponse,
buildMockCommerceDateFacetResponse,
+ buildMockCommerceLocationFacetResponse,
buildMockCommerceNumericFacetResponse,
buildMockCommerceRegularFacetResponse,
} from '../../../../test/mock-commerce-facet-response.js';
@@ -55,10 +61,12 @@ vi.mock(
'../../../../features/commerce/facets/numeric-facet/numeric-facet-actions'
);
vi.mock('../../../../features/commerce/facets/date-facet/date-facet-actions');
-
vi.mock(
'../../../../features/commerce/facets/regular-facet/regular-facet-actions'
);
+vi.mock(
+ '../../../../features/commerce/facets/location-facet/location-facet-actions'
+);
describe('core breadcrumb manager', () => {
let engine: MockedCommerceEngine;
@@ -240,6 +248,34 @@ describe('core breadcrumb manager', () => {
])('#deselect when facet is %s', generateDeselectionTestCases(breadcrumb));
});
+ describe('location facet breadcrumbs', () => {
+ const breadcrumb = {
+ value: 'Corp Corp Quarters',
+ state: 'selected',
+ } as LocationFacetValue;
+
+ beforeEach(() => {
+ setFacetsState(
+ buildMockCommerceLocationFacetResponse({
+ facetId,
+ values: [
+ {value: 'Acme', state: 'idle'},
+ breadcrumb,
+ ] as LocationFacetValue[],
+ })
+ );
+ });
+
+ it('generates breadcrumbs', () => {
+ expectBreadcrumbToBePresentInState(breadcrumb);
+ });
+
+ describe.each([
+ ['selected', toggleSelectLocationFacetValue],
+ ['excluded', toggleExcludeLocationFacetValue],
+ ])('#deselect when facet is %s', generateDeselectionTestCases(breadcrumb));
+ });
+
describe('numeric facet breadcrumbs', () => {
const breadcrumb = {
start: 100,
diff --git a/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.ts b/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.ts
index 9a34e1d17d9..070a9a37e5c 100644
--- a/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.ts
+++ b/packages/headless/src/controllers/commerce/core/breadcrumb-manager/headless-core-breadcrumb-manager.ts
@@ -25,6 +25,10 @@ import {
NumericFacetResponse,
RegularFacetResponse,
} from '../../../../features/commerce/facets/facet-set/interfaces/response.js';
+import {
+ toggleExcludeLocationFacetValue,
+ toggleSelectLocationFacetValue,
+} from '../../../../features/commerce/facets/location-facet/location-facet-actions.js';
import {
toggleExcludeNumericFacetValue,
toggleSelectNumericFacetValue,
@@ -117,12 +121,15 @@ interface ActionCreators {
const facetTypeWithoutExcludeAction: FacetType = 'hierarchical';
-// TODO: COMHUB-247 add support for location facet
-const actions: Record, ActionCreators> = {
+const actions: Record = {
regular: {
toggleSelectActionCreator: toggleSelectFacetValue,
toggleExcludeActionCreator: toggleExcludeFacetValue,
},
+ location: {
+ toggleSelectActionCreator: toggleSelectLocationFacetValue,
+ toggleExcludeActionCreator: toggleExcludeLocationFacetValue,
+ },
numericalRange: {
toggleSelectActionCreator: toggleSelectNumericFacetValue,
toggleExcludeActionCreator: toggleExcludeNumericFacetValue,
@@ -155,10 +162,7 @@ export function buildCoreBreadcrumbManager(
const controller = buildController(engine);
const {dispatch} = engine;
- // TODO: COMHUB-247 add support for location facet
- const createBreadcrumb = (
- facet: Exclude
- ) => ({
+ const createBreadcrumb = (facet: AnyFacetResponse) => ({
facetId: facet.facetId,
facetDisplayName: facet.displayName,
field: facet.field,
@@ -170,7 +174,11 @@ export function buildCoreBreadcrumbManager(
});
const getValuesForNonCategoryFacet = (
- facet: RegularFacetResponse | NumericFacetResponse | DateFacetResponse
+ facet:
+ | RegularFacetResponse
+ | NumericFacetResponse
+ | DateFacetResponse
+ | LocationFacetResponse
) => {
return facet.values
.filter((value) => value.state !== 'idle')
@@ -259,8 +267,7 @@ export function buildCoreBreadcrumbManager(
const breadcrumbs = facetOrder.flatMap((facetId) => {
const facet = options.facetResponseSelector(engine[stateKey], facetId);
- // TODO: COMHUB-247 add support for location facet
- if (hasActiveValue(facet) && facet.type !== 'location') {
+ if (hasActiveValue(facet)) {
return [createBreadcrumb(facet)];
}
return [];
diff --git a/packages/headless/src/features/commerce/facets/facet-set/facet-set-reducers.ts b/packages/headless/src/features/commerce/facets/facet-set/facet-set-reducers.ts
index f63567aa9cd..8222db59aff 100644
--- a/packages/headless/src/features/commerce/facets/facet-set/facet-set-reducers.ts
+++ b/packages/headless/src/features/commerce/facets/facet-set/facet-set-reducers.ts
@@ -1,4 +1,5 @@
import {FacetValueState} from '../../../facets/facet-api/value.js';
+import {FacetValueRequest} from '../../../facets/facet-set/interfaces/request.js';
import {DateRangeRequest} from '../../../facets/range-facets/date-facet-set/interfaces/request.js';
import {NumericRangeRequest} from '../../../facets/range-facets/numeric-facet-set/interfaces/request.js';
import {Parameters} from '../../parameters/parameters-actions.js';
@@ -7,10 +8,9 @@ import {
CategoryFacetRequest,
CategoryFacetValueRequest,
DateFacetRequest,
+ LocationFacetValueRequest,
NumericFacetRequest,
- RegularFacetRequest,
} from './interfaces/request.js';
-import {RegularFacetValue} from './interfaces/response.js';
export function restoreFromParameters(
state: CommerceFacetSetState,
@@ -21,7 +21,10 @@ export function restoreFromParameters(
}
if (action.payload.f) {
- restoreRegularFacets(state, action.payload.f);
+ restoreFacets(state, action.payload.f, 'regular');
+ }
+ if (action.payload.lf) {
+ restoreFacets(state, action.payload.lf, 'location');
}
if (action.payload.nf) {
restoreRangeFacets(state, action.payload.nf, 'numericalRange');
@@ -34,23 +37,30 @@ export function restoreFromParameters(
}
}
-function restoreRegularFacets(
+function restoreFacets(
state: CommerceFacetSetState,
- parameterFacets: Record
+ parameterFacets: Record,
+ type: 'regular' | 'location'
) {
const entries = Object.entries(parameterFacets);
for (const [facetId, values] of entries) {
state[facetId] = {
request: {
...restoreFacet(facetId),
- type: 'regular',
- values: values.map((value): RegularFacetValue => {
- return {
+ type,
+ values: values.map((value) => {
+ const facetValue = {
...restoreFacetValue(),
value,
};
+ switch (type) {
+ case 'regular':
+ return facetValue as FacetValueRequest;
+ case 'location':
+ return facetValue as LocationFacetValueRequest;
+ }
}),
- } as RegularFacetRequest,
+ },
};
}
}
diff --git a/packages/headless/src/features/commerce/facets/facet-set/facet-set-slice.test.ts b/packages/headless/src/features/commerce/facets/facet-set/facet-set-slice.test.ts
index 3e24102dd3a..2925314e154 100644
--- a/packages/headless/src/features/commerce/facets/facet-set/facet-set-slice.test.ts
+++ b/packages/headless/src/features/commerce/facets/facet-set/facet-set-slice.test.ts
@@ -2926,6 +2926,44 @@ describe('commerceFacetSetReducer', () => {
);
});
+ it('populates location facet requests', () => {
+ const finalState = commerceFacetSetReducer(
+ state,
+ action({
+ lf: {
+ location_facet_1: ['1a', '1b'],
+ location_facet_2: ['2a'],
+ },
+ })
+ );
+
+ const firstRequest = finalState['location_facet_1'].request;
+ expect(firstRequest.type).toEqual('location');
+ expect(firstRequest.values).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ value: '1a',
+ state: 'selected',
+ }),
+ expect.objectContaining({
+ value: '1b',
+ state: 'selected',
+ }),
+ ])
+ );
+
+ const secondRequest = finalState['location_facet_2'].request;
+ expect(secondRequest.type).toEqual('location');
+ expect(secondRequest.values).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ value: '2a',
+ state: 'selected',
+ }),
+ ])
+ );
+ });
+
it('populates numeric facet requests', () => {
const finalState = commerceFacetSetReducer(
state,
diff --git a/packages/headless/src/features/commerce/parameters/parameters-actions.ts b/packages/headless/src/features/commerce/parameters/parameters-actions.ts
index 05cd644f0d3..d931a290e5d 100644
--- a/packages/headless/src/features/commerce/parameters/parameters-actions.ts
+++ b/packages/headless/src/features/commerce/parameters/parameters-actions.ts
@@ -8,6 +8,11 @@ export interface Parameters {
*/
f?: Record;
+ /**
+ * A record of the location facets, where the key is the facet id, and value is an array containing the selected values.
+ */
+ lf?: Record;
+
/**
* A record of the category facets, where the key is the facet id, and value is an array containing the parts of the selected path.
*/
@@ -22,6 +27,7 @@ export interface Parameters {
* A record of the numeric facets, where the key is the facet id, and value is an array containing the numeric ranges to request.
*/
nf?: Record;
+
/**
* A record of manual numeric facets, where the key is the facet id, and the value is an array containing the numeric ranges to request.
*/
diff --git a/packages/headless/src/features/commerce/parameters/parameters-schema.ts b/packages/headless/src/features/commerce/parameters/parameters-schema.ts
index ea1da74a221..b949b0e7232 100644
--- a/packages/headless/src/features/commerce/parameters/parameters-schema.ts
+++ b/packages/headless/src/features/commerce/parameters/parameters-schema.ts
@@ -2,6 +2,7 @@ import {NumberValue, RecordValue} from '@coveo/bueno';
export const parametersDefinition = {
f: new RecordValue(),
+ lf: new RecordValue(),
cf: new RecordValue(),
nf: new RecordValue(),
mnf: new RecordValue(),
diff --git a/packages/headless/src/features/commerce/parameters/parameters-selectors.ts b/packages/headless/src/features/commerce/parameters/parameters-selectors.ts
index a29f7b8cfb8..49a1b4ddb1a 100644
--- a/packages/headless/src/features/commerce/parameters/parameters-selectors.ts
+++ b/packages/headless/src/features/commerce/parameters/parameters-selectors.ts
@@ -11,6 +11,7 @@ import {
AnyFacetRequest,
CategoryFacetRequest,
DateFacetRequest,
+ LocationFacetRequest,
NumericFacetRequest,
RegularFacetRequest,
} from '../facets/facet-set/interfaces/request.js';
@@ -40,6 +41,7 @@ export function initialParametersSelector(
mnf: {},
df: {},
f: {},
+ lf: {},
};
}
@@ -68,6 +70,12 @@ export function activeParametersSelector(
getSelectedValues,
'f'
),
+ ...getFacets(
+ state.commerceFacetSet,
+ facetIsOfType(state, 'location'),
+ getSelectedLocationValues,
+ 'lf'
+ ),
...getFacets(
state.commerceFacetSet,
facetIsOfType(state, 'hierarchical'),
@@ -134,6 +142,12 @@ function getSelectedValues(request: AnyFacetRequest) {
.map((fv) => fv.value);
}
+function getSelectedLocationValues(request: AnyFacetRequest) {
+ return (request as LocationFacetRequest).values
+ .filter((fv) => fv.state === 'selected')
+ .map((fv) => fv.value);
+}
+
function getSelectedRangeValues(request: AnyFacetRequest) {
return (request as NumericFacetRequest | DateFacetRequest).values.filter(
(fv) => fv.state === 'selected'
diff --git a/packages/headless/src/features/commerce/parameters/parameters-serializer.test.ts b/packages/headless/src/features/commerce/parameters/parameters-serializer.test.ts
index 757617e4fb7..4a805c0b231 100644
--- a/packages/headless/src/features/commerce/parameters/parameters-serializer.test.ts
+++ b/packages/headless/src/features/commerce/parameters/parameters-serializer.test.ts
@@ -79,6 +79,7 @@ describe('searchSerializer', () => {
it('can serialize and deserialize all search parameters', () => {
const f = {author: ['a', 'b']};
+ const lf = {store: ['a']};
const cf = {geography: ['a', 'b']};
const nf = {
size: [buildNumericRange({start: 0, end: 10, state: 'selected'})],
@@ -104,6 +105,7 @@ describe('searchSerializer', () => {
const parameters: Required = {
q: 'some query',
f,
+ lf,
cf,
nf,
mnf,
diff --git a/packages/headless/src/features/commerce/parameters/parameters-serializer.ts b/packages/headless/src/features/commerce/parameters/parameters-serializer.ts
index 57d11dae033..159e5d3bb7a 100644
--- a/packages/headless/src/features/commerce/parameters/parameters-serializer.ts
+++ b/packages/headless/src/features/commerce/parameters/parameters-serializer.ts
@@ -27,6 +27,7 @@ import {Parameters} from './parameters-actions.js';
const sortFieldAndDirectionSeparator = ' ';
const sortFieldsJoiner = ',';
+const commerceFacetsRegex = /^(f|fExcluded|cf|nf|df|sf|af|mnf|lf)-(.+)$/;
export interface Serializer {
serialize: (parameters: T) => string;
@@ -46,11 +47,15 @@ export const productListingSerializer = {
} as Serializer;
type ParametersKey = keyof CommerceSearchParameters;
-type FacetParameters = keyof Pick;
+type FacetParameters = keyof Pick<
+ Parameters,
+ 'f' | 'lf' | 'cf' | 'nf' | 'df' | 'mnf'
+>;
type FacetKey = keyof typeof supportedFacetParameters;
const supportedFacetParameters: Record = {
f: true,
+ lf: true,
cf: true,
nf: true,
df: true,
@@ -153,7 +158,7 @@ function deserialize(fragment: string): T {
const parts = fragment.split(delimiter);
const keyValuePairs = parts
.map(splitOnFirstEqual)
- .map(preprocessObjectPairs)
+ .map((parts) => preprocessObjectPairs(parts, commerceFacetsRegex))
.filter(isValidPair)
.map(cast);
diff --git a/packages/headless/src/features/facets/facet-order/facet-order-slice.test.ts b/packages/headless/src/features/facets/facet-order/facet-order-slice.test.ts
index 7594197f4b2..9290fa81def 100644
--- a/packages/headless/src/features/facets/facet-order/facet-order-slice.test.ts
+++ b/packages/headless/src/features/facets/facet-order/facet-order-slice.test.ts
@@ -126,6 +126,10 @@ describe('facet-order slice', () => {
regular_facet_1: [],
regular_facet_2: [],
},
+ lf: {
+ location_facet_1: [],
+ location_facet_2: [],
+ },
nf: {
numeric_facet_1: [],
numeric_facet_2: [],
@@ -144,6 +148,8 @@ describe('facet-order slice', () => {
expect(state).toEqual([
'regular_facet_1',
'regular_facet_2',
+ 'location_facet_1',
+ 'location_facet_2',
'numeric_facet_1',
'numeric_facet_2',
'date_facet_1',
diff --git a/packages/headless/src/features/facets/facet-order/facet-order-slice.ts b/packages/headless/src/features/facets/facet-order/facet-order-slice.ts
index 163af49782d..8c38cee9471 100644
--- a/packages/headless/src/features/facets/facet-order/facet-order-slice.ts
+++ b/packages/headless/src/features/facets/facet-order/facet-order-slice.ts
@@ -41,6 +41,7 @@ function handleRestoreParameters(
) {
return [
...Object.keys(action.payload.f ?? {}),
+ ...Object.keys(action.payload.lf ?? {}),
...Object.keys(action.payload.nf ?? {}),
...Object.keys(action.payload.df ?? {}),
...Object.keys(action.payload.cf ?? {}),
diff --git a/packages/headless/src/features/search-parameters/search-parameter-serializer.ts b/packages/headless/src/features/search-parameters/search-parameter-serializer.ts
index 18db4e40d83..5c9bf16dcfa 100644
--- a/packages/headless/src/features/search-parameters/search-parameter-serializer.ts
+++ b/packages/headless/src/features/search-parameters/search-parameter-serializer.ts
@@ -191,7 +191,7 @@ function deserialize(fragment: string): SearchParameters {
const parts = fragment.split(delimiter);
const keyValuePairs = parts
.map((part) => splitOnFirstEqual(part))
- .map(preprocessObjectPairs)
+ .map((parts) => preprocessObjectPairs(parts))
.filter(isValidPair)
.map((pair) => cast(pair));
@@ -214,9 +214,12 @@ export function splitOnFirstEqual(str: string) {
return [first, second];
}
-export function preprocessObjectPairs(pair: string[]) {
+export function preprocessObjectPairs(
+ pair: string[],
+ regex = facetSearchParamRegex
+) {
const [key, val] = pair;
- const result = facetSearchParamRegex.exec(key);
+ const result = regex.exec(key);
if (!result) {
return pair;
From 7a33a0bea1d7fbf4a372e7304a9c48aa6163cab9 Mon Sep 17 00:00:00 2001
From: Nico Labarre
Date: Thu, 24 Oct 2024 08:13:55 -0400
Subject: [PATCH 18/57] feat(commerce): support setting latitude and longitude
on context controller (#4572)
See https://github.com/coveo/ui-kit/pull/4562
[COMHUB-247]
[COMHUB-247]:
https://coveord.atlassian.net/browse/COMHUB-247?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
---
.../src/api/commerce/commerce-api-params.ts | 2 +
packages/headless/src/commerce.index.ts | 1 +
.../commerce/context/headless-context.ssr.ts | 3 +-
.../commerce/context/headless-context.test.ts | 9 +++++
.../commerce/context/headless-context.ts | 16 ++++++++
.../features/commerce/common/actions.test.ts | 40 ++++++++++++++++++-
.../src/features/commerce/common/actions.ts | 15 ++++---
.../context/context-actions-loader.ts | 13 +++++-
.../commerce/context/context-actions.ts | 15 ++++++-
.../commerce/context/context-slice.test.ts | 12 +++++-
.../commerce/context/context-slice.ts | 5 ++-
.../commerce/context/context-state.ts | 10 ++++-
.../commerce/context/context-validation.ts | 11 ++++-
.../query-suggest/query-suggest-actions.ts | 13 +++---
packages/headless/src/ssr-commerce.index.ts | 1 +
15 files changed, 143 insertions(+), 23 deletions(-)
diff --git a/packages/headless/src/api/commerce/commerce-api-params.ts b/packages/headless/src/api/commerce/commerce-api-params.ts
index d2edabe1d36..dbb97998f72 100644
--- a/packages/headless/src/api/commerce/commerce-api-params.ts
+++ b/packages/headless/src/api/commerce/commerce-api-params.ts
@@ -46,6 +46,8 @@ export interface ViewParams {
export type UserParams = {
userAgent?: string;
+ latitude?: number;
+ longitude?: number;
};
export interface CartItemParam {
diff --git a/packages/headless/src/commerce.index.ts b/packages/headless/src/commerce.index.ts
index e07be674a09..7ffb92f001e 100644
--- a/packages/headless/src/commerce.index.ts
+++ b/packages/headless/src/commerce.index.ts
@@ -78,6 +78,7 @@ export {buildController} from './controllers/controller/headless-controller.js';
export type {
ContextOptions,
View,
+ UserLocation,
ContextProps,
Context,
ContextState,
diff --git a/packages/headless/src/controllers/commerce/context/headless-context.ssr.ts b/packages/headless/src/controllers/commerce/context/headless-context.ssr.ts
index 4a215dce86f..92716a392b2 100644
--- a/packages/headless/src/controllers/commerce/context/headless-context.ssr.ts
+++ b/packages/headless/src/controllers/commerce/context/headless-context.ssr.ts
@@ -5,10 +5,11 @@ import {
ContextProps,
ContextOptions,
View,
+ UserLocation,
} from './headless-context.js';
export type {ContextState, Context, ContextProps} from './headless-context.js';
-export type {View, ContextOptions};
+export type {View, UserLocation, ContextOptions};
export interface ContextDefinition
extends UniversalControllerDefinitionWithoutProps {}
diff --git a/packages/headless/src/controllers/commerce/context/headless-context.test.ts b/packages/headless/src/controllers/commerce/context/headless-context.test.ts
index edceb9a756e..dcb994e3f88 100644
--- a/packages/headless/src/controllers/commerce/context/headless-context.test.ts
+++ b/packages/headless/src/controllers/commerce/context/headless-context.test.ts
@@ -1,5 +1,6 @@
import {
setContext,
+ setLocation,
setView,
} from '../../../features/commerce/context/context-actions.js';
import {contextReducer} from '../../../features/commerce/context/context-slice.js';
@@ -82,4 +83,12 @@ describe('headless commerce context', () => {
});
expect(setView).toHaveBeenCalled();
});
+
+ it('setLocation dispatches #setLocation', () => {
+ context.setLocation({
+ latitude: 27.1127,
+ longitude: 109.3497,
+ });
+ expect(setLocation).toHaveBeenCalled();
+ });
});
diff --git a/packages/headless/src/controllers/commerce/context/headless-context.ts b/packages/headless/src/controllers/commerce/context/headless-context.ts
index a0a3cfb6323..dc12600295f 100644
--- a/packages/headless/src/controllers/commerce/context/headless-context.ts
+++ b/packages/headless/src/controllers/commerce/context/headless-context.ts
@@ -3,6 +3,7 @@ import {CommerceEngine} from '../../../app/commerce-engine/commerce-engine.js';
import {stateKey} from '../../../app/state-key.js';
import {
setContext,
+ setLocation,
setView,
} from '../../../features/commerce/context/context-actions.js';
import {contextReducer as commerceContext} from '../../../features/commerce/context/context-slice.js';
@@ -19,12 +20,18 @@ export interface ContextOptions {
country: string;
currency: CurrencyCodeISO4217;
view: View;
+ location?: UserLocation;
}
export interface View {
url: string;
}
+export interface UserLocation {
+ latitude: number;
+ longitude: number;
+}
+
export interface ContextProps {
/**
* The initial options that should be applied to this `Context` controller.
@@ -60,6 +67,12 @@ export interface Context extends Controller {
*/
setView(view: View): void;
+ /**
+ * Sets the location.
+ * @param location - The new location.
+ */
+ setLocation(location: UserLocation): void;
+
/**
* A scoped and simplified part of the headless state that is relevant to the `Context` controller.
*/
@@ -71,6 +84,7 @@ export interface ContextState {
country: string;
currency: CurrencyCodeISO4217;
view: View;
+ location?: UserLocation;
}
/**
@@ -129,6 +143,8 @@ export function buildContext(
),
setView: (view: View) => dispatch(setView(view)),
+
+ setLocation: (location: UserLocation) => dispatch(setLocation(location)),
};
}
diff --git a/packages/headless/src/features/commerce/common/actions.test.ts b/packages/headless/src/features/commerce/common/actions.test.ts
index f1b5012186d..24d31f72d6a 100644
--- a/packages/headless/src/features/commerce/common/actions.test.ts
+++ b/packages/headless/src/features/commerce/common/actions.test.ts
@@ -54,6 +54,7 @@ describe('commerce common actions', () => {
country: 'CA',
currency: 'CAD',
clientId: 'client_id',
+ page: 0,
context: {
user: {
userAgent: 'user_agent',
@@ -93,15 +94,26 @@ describe('commerce common actions', () => {
};
});
+ it('given a basic state, returns the expected base request', () => {
+ const request = Actions.buildBaseCommerceAPIRequest(
+ state,
+ navigatorContext
+ );
+
+ expect(request).toEqual(expected);
+ });
+
it('given a state with no commercePagination section, returns the expected base request', () => {
delete state.commercePagination;
+ const {page, ...expectedWithoutPagination} = expected;
+
const request = Actions.buildBaseCommerceAPIRequest(
state,
navigatorContext
);
- expect(request).toEqual({...expected});
+ expect(request).toEqual(expectedWithoutPagination);
});
it('given a state that has the commercePagination section, returns expected base request with expected #page and #perPage', () => {
@@ -155,6 +167,32 @@ describe('commerce common actions', () => {
expect(request).toEqual(expectedWithPagination);
});
+
+ it('given a state that has latitude and longitude, returns expected base request with expected #latitude and #longitude', () => {
+ state.commerceContext.location = {
+ latitude: 48.8566,
+ longitude: 2.3522,
+ };
+
+ const expectedWithLatitudeAndLongitude: CommerceAPIRequest = {
+ ...expected,
+ context: {
+ ...expected.context,
+ user: {
+ ...expected.context.user,
+ latitude: state.commerceContext.location.latitude,
+ longitude: state.commerceContext.location.longitude,
+ },
+ },
+ };
+
+ const request = Actions.buildBaseCommerceAPIRequest(
+ state,
+ navigatorContext
+ );
+
+ expect(request).toEqual(expectedWithLatitudeAndLongitude);
+ });
});
describe('#buildCommerceAPIRequest', () => {
diff --git a/packages/headless/src/features/commerce/common/actions.ts b/packages/headless/src/features/commerce/common/actions.ts
index c0cb7025290..8bb744d5991 100644
--- a/packages/headless/src/features/commerce/common/actions.ts
+++ b/packages/headless/src/features/commerce/common/actions.ts
@@ -59,7 +59,7 @@ export const buildBaseCommerceAPIRequest = (
navigatorContext: NavigatorContext,
slotId?: string
): BaseCommerceAPIRequest => {
- const {view, ...restOfContext} = state.commerceContext;
+ const {view, location, ...restOfContext} = state.commerceContext;
return {
accessToken: state.configuration.accessToken,
url:
@@ -75,13 +75,12 @@ export const buildBaseCommerceAPIRequest = (
? {clientId: navigatorContext.clientId}
: {}),
context: {
- ...(navigatorContext.userAgent
- ? {
- user: {
- userAgent: navigatorContext.userAgent,
- },
- }
- : {}),
+ user: {
+ ...location,
+ ...(navigatorContext.userAgent
+ ? {userAgent: navigatorContext.userAgent}
+ : {}),
+ },
view: {
...view,
...(navigatorContext.referrer
diff --git a/packages/headless/src/features/commerce/context/context-actions-loader.ts b/packages/headless/src/features/commerce/context/context-actions-loader.ts
index 0cfdf54d905..ac59f5eac0f 100644
--- a/packages/headless/src/features/commerce/context/context-actions-loader.ts
+++ b/packages/headless/src/features/commerce/context/context-actions-loader.ts
@@ -5,10 +5,12 @@ import {
SetViewPayload,
setContext,
setView,
+ SetLocationPayload,
+ setLocation,
} from './context-actions.js';
import {contextReducer as commerceContext} from './context-slice.js';
-export type {SetContextPayload, SetViewPayload};
+export type {SetContextPayload, SetViewPayload, SetLocationPayload};
/**
* The context action creators.
@@ -29,6 +31,14 @@ export interface ContextActionCreators {
* @returns A dispatchable action.
*/
setView(payload: SetViewPayload): PayloadAction;
+
+ /**
+ * Sets the location context property without modifying any other context properties.
+ *
+ * @param payload - The action creator payload.
+ * @returns A dispatchable action.
+ */
+ setLocation(payload: SetLocationPayload): PayloadAction;
}
/**
@@ -44,5 +54,6 @@ export function loadContextActions(
return {
setContext,
setView,
+ setLocation,
};
}
diff --git a/packages/headless/src/features/commerce/context/context-actions.ts b/packages/headless/src/features/commerce/context/context-actions.ts
index 43cddaae078..76564d56c7a 100644
--- a/packages/headless/src/features/commerce/context/context-actions.ts
+++ b/packages/headless/src/features/commerce/context/context-actions.ts
@@ -2,13 +2,19 @@ import {CurrencyCodeISO4217} from '@coveo/relay-event-types';
import {createAction} from '@reduxjs/toolkit';
import {ViewParams} from '../../../api/commerce/commerce-api-params.js';
import {validatePayload} from '../../../utils/validate-payload.js';
-import {contextDefinition, viewDefinition} from './context-validation.js';
+import {LocationState} from './context-state.js';
+import {
+ contextDefinition,
+ locationDefinition,
+ viewDefinition,
+} from './context-validation.js';
export interface SetContextPayload {
language: string;
country: string;
currency: CurrencyCodeISO4217;
view: SetViewPayload;
+ location?: SetLocationPayload;
}
export const setContext = createAction(
@@ -22,3 +28,10 @@ export const setView = createAction(
'commerce/context/setView',
(payload: SetViewPayload) => validatePayload(payload, viewDefinition)
);
+
+export type SetLocationPayload = LocationState;
+
+export const setLocation = createAction(
+ 'commerce/context/setLocation',
+ (payload: SetLocationPayload) => validatePayload(payload, locationDefinition)
+);
diff --git a/packages/headless/src/features/commerce/context/context-slice.test.ts b/packages/headless/src/features/commerce/context/context-slice.test.ts
index dad406a0ae8..08e334ccb3b 100644
--- a/packages/headless/src/features/commerce/context/context-slice.test.ts
+++ b/packages/headless/src/features/commerce/context/context-slice.test.ts
@@ -1,4 +1,4 @@
-import {setContext, setView} from './context-actions.js';
+import {setContext, setLocation, setView} from './context-actions.js';
import {contextReducer} from './context-slice.js';
import {CommerceContextState, getContextInitialState} from './context-state.js';
@@ -43,4 +43,14 @@ describe('context-slice', () => {
};
expect(contextReducer(state, setView(view)).view).toEqual(view);
});
+
+ it('should allow to set the location', () => {
+ const location = {
+ latitude: -10.2,
+ longitude: 20.1,
+ };
+ expect(contextReducer(state, setLocation(location)).location).toEqual(
+ location
+ );
+ });
});
diff --git a/packages/headless/src/features/commerce/context/context-slice.ts b/packages/headless/src/features/commerce/context/context-slice.ts
index e4212ef276b..b18510d2b68 100644
--- a/packages/headless/src/features/commerce/context/context-slice.ts
+++ b/packages/headless/src/features/commerce/context/context-slice.ts
@@ -1,5 +1,5 @@
import {createReducer} from '@reduxjs/toolkit';
-import {setContext, setView} from './context-actions.js';
+import {setContext, setLocation, setView} from './context-actions.js';
import {getContextInitialState} from './context-state.js';
export const contextReducer = createReducer(
@@ -12,6 +12,9 @@ export const contextReducer = createReducer(
})
.addCase(setView, (state, {payload}) => {
state.view = payload;
+ })
+ .addCase(setLocation, (state, {payload}) => {
+ state.location = payload;
});
}
);
diff --git a/packages/headless/src/features/commerce/context/context-state.ts b/packages/headless/src/features/commerce/context/context-state.ts
index 2d867b3f46a..1535b32f31a 100644
--- a/packages/headless/src/features/commerce/context/context-state.ts
+++ b/packages/headless/src/features/commerce/context/context-state.ts
@@ -1,11 +1,19 @@
import {CurrencyCodeISO4217} from '@coveo/relay-event-types';
-import {ViewParams} from '../../../api/commerce/commerce-api-params.js';
+import {
+ UserParams,
+ ViewParams,
+} from '../../../api/commerce/commerce-api-params.js';
+
+export type LocationState = Required<
+ Pick
+>;
export interface CommerceContextState {
language: string;
country: string;
currency: CurrencyCodeISO4217;
view: ViewParams;
+ location?: LocationState;
}
export const getContextInitialState = (): CommerceContextState => ({
diff --git a/packages/headless/src/features/commerce/context/context-validation.ts b/packages/headless/src/features/commerce/context/context-validation.ts
index 36e425900ae..b55ff12347f 100644
--- a/packages/headless/src/features/commerce/context/context-validation.ts
+++ b/packages/headless/src/features/commerce/context/context-validation.ts
@@ -1,4 +1,4 @@
-import {RecordValue, Schema, StringValue} from '@coveo/bueno';
+import {NumberValue, RecordValue, Schema, StringValue} from '@coveo/bueno';
import {CurrencyCodeISO4217} from '@coveo/relay-event-types';
import {requiredNonEmptyString} from '../../../utils/validate-payload.js';
@@ -14,6 +14,11 @@ export const viewDefinition = {
url: requiredNonEmptyString,
};
+export const locationDefinition = {
+ latitude: new NumberValue({min: -90, max: 90, required: true}),
+ longitude: new NumberValue({min: -180, max: 180, required: true}),
+};
+
export const contextDefinition = {
language: requiredNonEmptyString,
country: requiredNonEmptyString,
@@ -22,6 +27,10 @@ export const contextDefinition = {
options: {required: true},
values: viewDefinition,
}),
+ location: new RecordValue({
+ options: {required: false},
+ values: locationDefinition,
+ }),
};
export const contextSchema = new Schema(contextDefinition);
diff --git a/packages/headless/src/features/commerce/query-suggest/query-suggest-actions.ts b/packages/headless/src/features/commerce/query-suggest/query-suggest-actions.ts
index 426624232bd..f7a2adbe748 100644
--- a/packages/headless/src/features/commerce/query-suggest/query-suggest-actions.ts
+++ b/packages/headless/src/features/commerce/query-suggest/query-suggest-actions.ts
@@ -139,13 +139,12 @@ export const buildQuerySuggestRequest = (
? {clientId: navigatorContext.clientId}
: {}),
context: {
- ...(navigatorContext.userAgent
- ? {
- user: {
- userAgent: navigatorContext.userAgent,
- },
- }
- : {}),
+ user: {
+ ...location,
+ ...(navigatorContext.userAgent
+ ? {userAgent: navigatorContext.userAgent}
+ : {}),
+ },
view: {
...view,
...(navigatorContext.referrer
diff --git a/packages/headless/src/ssr-commerce.index.ts b/packages/headless/src/ssr-commerce.index.ts
index 708fd963785..2c655885859 100644
--- a/packages/headless/src/ssr-commerce.index.ts
+++ b/packages/headless/src/ssr-commerce.index.ts
@@ -126,6 +126,7 @@ export type {
ContextProps,
ContextState,
View,
+ UserLocation,
ContextDefinition,
} from './controllers/commerce/context/headless-context.ssr.js';
export {defineContext} from './controllers/commerce/context/headless-context.ssr.js';
From dc2faafdfd03a42cbc9b08b82bd16d2a4acc07e7 Mon Sep 17 00:00:00 2001
From: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com>
Date: Thu, 24 Oct 2024 08:30:35 -0400
Subject: [PATCH 19/57] fix(atomic-angular): add @Prop decorator to @MapProp
props so they are generated in the angular-output (#4548)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
https://coveord.atlassian.net/browse/KIT-3663
If you look in …/atomic-angular/…/stencil-generated/component.ts and
look for atomic-field-condition, you can find that mustMatch and
mustNotMatch are not in “inputs”.
A solution for this is to add @Prop before every @MapProp, I will see if
I can try to add the Prop decorator behavior inside of the @MapProp
code.
---
.../src/lib/stencil-generated/components.ts | 24 +--
packages/atomic/src/components.d.ts | 196 ++++++++++++++++++
.../atomic-product-field-condition.tsx | 14 +-
...tomic-insight-result-children-template.tsx | 11 +-
.../atomic-insight-result-template.tsx | 11 +-
.../atomic-recs-result-template.tsx | 11 +-
.../atomic-field-condition.tsx | 14 +-
.../atomic-result-localized-text.ts | 2 +-
.../atomic-result-children-template.tsx | 19 +-
.../atomic-result-template.tsx | 19 +-
10 files changed, 289 insertions(+), 32 deletions(-)
diff --git a/packages/atomic-angular/projects/atomic-angular/src/lib/stencil-generated/components.ts b/packages/atomic-angular/projects/atomic-angular/src/lib/stencil-generated/components.ts
index d57c6c8a5c9..5fa2cee9ec5 100644
--- a/packages/atomic-angular/projects/atomic-angular/src/lib/stencil-generated/components.ts
+++ b/packages/atomic-angular/projects/atomic-angular/src/lib/stencil-generated/components.ts
@@ -873,14 +873,14 @@ export declare interface AtomicFacetManager extends Components.AtomicFacetManage
@ProxyCmp({
- inputs: ['ifDefined', 'ifNotDefined']
+ inputs: ['ifDefined', 'ifNotDefined', 'mustMatch', 'mustNotMatch']
})
@Component({
selector: 'atomic-field-condition',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
- inputs: ['ifDefined', 'ifNotDefined'],
+ inputs: ['ifDefined', 'ifNotDefined', 'mustMatch', 'mustNotMatch'],
})
export class AtomicFieldCondition {
protected el: HTMLElement;
@@ -1300,14 +1300,14 @@ export declare interface AtomicProductDescription extends Components.AtomicProdu
@ProxyCmp({
- inputs: ['ifDefined', 'ifNotDefined']
+ inputs: ['ifDefined', 'ifNotDefined', 'mustMatch', 'mustNotMatch']
})
@Component({
selector: 'atomic-product-field-condition',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
- inputs: ['ifDefined', 'ifNotDefined'],
+ inputs: ['ifDefined', 'ifNotDefined', 'mustMatch', 'mustNotMatch'],
})
export class AtomicProductFieldCondition {
protected el: HTMLElement;
@@ -1893,7 +1893,7 @@ export declare interface AtomicRecsResult extends Components.AtomicRecsResult {}
@ProxyCmp({
- inputs: ['conditions', 'ifDefined', 'ifNotDefined'],
+ inputs: ['conditions', 'ifDefined', 'ifNotDefined', 'mustMatch', 'mustNotMatch'],
methods: ['getTemplate']
})
@Component({
@@ -1901,7 +1901,7 @@ export declare interface AtomicRecsResult extends Components.AtomicRecsResult {}
changeDetection: ChangeDetectionStrategy.OnPush,
template: '',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
- inputs: ['conditions', 'ifDefined', 'ifNotDefined'],
+ inputs: ['conditions', 'ifDefined', 'ifNotDefined', 'mustMatch', 'mustNotMatch'],
})
export class AtomicRecsResultTemplate {
protected el: HTMLElement;
@@ -2052,7 +2052,7 @@ export declare interface AtomicResultChildren extends Components.AtomicResultChi
@ProxyCmp({
- inputs: ['conditions'],
+ inputs: ['conditions', 'mustMatch', 'mustNotMatch'],
methods: ['getTemplate']
})
@Component({
@@ -2060,7 +2060,7 @@ export declare interface AtomicResultChildren extends Components.AtomicResultChi
changeDetection: ChangeDetectionStrategy.OnPush,
template: '',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
- inputs: ['conditions'],
+ inputs: ['conditions', 'mustMatch', 'mustNotMatch'],
})
export class AtomicResultChildrenTemplate {
protected el: HTMLElement;
@@ -2228,14 +2228,14 @@ export declare interface AtomicResultList extends Components.AtomicResultList {}
@ProxyCmp({
- inputs: ['fieldCount', 'localeKey']
+ inputs: ['field', 'fieldCount', 'localeKey']
})
@Component({
selector: 'atomic-result-localized-text',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
- inputs: ['fieldCount', 'localeKey'],
+ inputs: ['field', 'fieldCount', 'localeKey'],
})
export class AtomicResultLocalizedText {
protected el: HTMLElement;
@@ -2528,7 +2528,7 @@ export declare interface AtomicResultSectionVisual extends Components.AtomicResu
@ProxyCmp({
- inputs: ['conditions'],
+ inputs: ['conditions', 'mustMatch', 'mustNotMatch'],
methods: ['getTemplate']
})
@Component({
@@ -2536,7 +2536,7 @@ export declare interface AtomicResultSectionVisual extends Components.AtomicResu
changeDetection: ChangeDetectionStrategy.OnPush,
template: '',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
- inputs: ['conditions'],
+ inputs: ['conditions', 'mustMatch', 'mustNotMatch'],
})
export class AtomicResultTemplate {
protected el: HTMLElement;
diff --git a/packages/atomic/src/components.d.ts b/packages/atomic/src/components.d.ts
index 1e258dc0818..2e10e6ee458 100644
--- a/packages/atomic/src/components.d.ts
+++ b/packages/atomic/src/components.d.ts
@@ -946,6 +946,16 @@ export namespace Components {
* Verifies whether the specified fields are not defined.
*/
"ifNotDefined"?: string;
+ /**
+ * Verifies whether the specified fields match the specified values.
+ * @type {Record}
+ */
+ "mustMatch": Record;
+ /**
+ * Verifies whether the specified fields do not match the specified values.
+ * @type {Record}
+ */
+ "mustNotMatch": Record