Skip to content

Commit

Permalink
Merge branch 'main' into feature/EMP-3079-allow-queries-preview-with-…
Browse files Browse the repository at this point in the history
  • Loading branch information
annacv authored Jan 15, 2024
2 parents b7a39a2 + e524962 commit a2da941
Show file tree
Hide file tree
Showing 48 changed files with 1,056 additions and 440 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ We are working on many key features to consolidate Interface X, including these
Recommendations
[![Release Docs](https://img.shields.io/badge/Released-October%202023-brightgreen)](https://docs.empathy.co/explore-empathy-platform/experience-search-and-discovery/history-queries.html)
- **Experience Controls**: Add capability of loading configurations from an external service
[![Release Docs](https://img.shields.io/badge/In%20Progress-yellow)](https://vuejs.org/)
[![Release Docs](https://img.shields.io/badge/Released-November%202023-brightgreen)](https://vuejs.org/)
- **Vue 3 Migration**.
[![Release Docs](https://img.shields.io/badge/In%20Progress-yellow)](https://vuejs.org/)
- **Network Request failure transparency**.
Expand Down
25 changes: 25 additions & 0 deletions packages/x-adapter-platform/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.1.0-alpha.0](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2024-01-12)


### Features

* **search:** handle display tagging from search response (#1388) ([b6b5d86](https://github.com/empathyco/x/commit/b6b5d8657947b8510f9d23530d709e757e5e3ecf))



## [1.0.3-alpha.2](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2024-01-11)

**Note:** Version bump only for package @empathyco/x-adapter-platform





## [1.0.3-alpha.1](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-12-27)

**Note:** Version bump only for package @empathyco/x-adapter-platform





## [1.0.3-alpha.0](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-11-29)

**Note:** Version bump only for package @empathyco/x-adapter-platform
Expand Down
6 changes: 3 additions & 3 deletions packages/x-adapter-platform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@empathyco/x-adapter-platform",
"version": "1.0.3-alpha.0",
"version": "1.1.0-alpha.0",
"description": "A search client for the Empathy Platform API",
"author": "Empathy Systems Corporation S.L.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -42,13 +42,13 @@
},
"dependencies": {
"@empathyco/x-adapter": "^8.0.3-alpha.0",
"@empathyco/x-types": "^10.0.3-alpha.0",
"@empathyco/x-types": "^10.1.0-alpha.1",
"@empathyco/x-utils": "^1.0.3-alpha.0",
"tslib": "~2.6.0"
},
"devDependencies": {
"@microsoft/api-documenter": "~7.23.0",
"@microsoft/api-extractor": "~7.38.0",
"@microsoft/api-extractor": "~7.39.0",
"@types/jest": "~27.5.0",
"concurrently": "~8.2.0",
"jest": "~27.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export const platformSearchResponse = {
}
],
tagging: {
display:
'https://api.staging.empathy.co/tagging/v1/track/empathy/display?q=jeans&lang=en&scope=desktop&totalHits=686&page=1&origin=url%3Aexternal&filtered=true&spellcheck=false',
query:
'https://api.staging.empathy.co/tagging/v1/track/empathy/query?q=jeans&lang=en&scope=desktop&totalHits=686&page=1&origin=url%3Aexternal&filtered=true&spellcheck=false'
},
Expand Down
12 changes: 8 additions & 4 deletions packages/x-adapter-platform/src/mappers/__tests__/url.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { extractUrlParameters, getDisplayClickTagging, getTaggingInfoFromUrl } from '../url.utils';
import {
extractUrlParameters,
getDisplayTaggingInfoFromUrl,
getTaggingInfoFromUrl
} from '../url.utils';

describe('url utils methods tests', () => {
describe('extractUrlParameters', () => {
Expand Down Expand Up @@ -45,14 +49,14 @@ describe('url utils methods tests', () => {

describe('getDisplayClickTagging', () => {
it('should not break when dealing with bad urls', () => {
expect(getDisplayClickTagging('null')).toStrictEqual({
expect(getDisplayTaggingInfoFromUrl('null')).toStrictEqual({
url: 'null',
params: { displayId: 'no_query', follow: false }
});
});

it('should retrieve the tagging info from the url, replacing q with displayId', () => {
const { url, params } = getDisplayClickTagging(
const { url, params } = getDisplayTaggingInfoFromUrl(
'https://api.empathy.co/?q=chips&env=mobile&lang=english&lang=spanish'
);
expect(url).toBe('https://api.empathy.co/');
Expand All @@ -65,7 +69,7 @@ describe('url utils methods tests', () => {
});

it('should set no_query tagging info when no q param exist as in topclicked response', () => {
const { url, params } = getDisplayClickTagging(
const { url, params } = getDisplayTaggingInfoFromUrl(
'https://api.empathy.co/?env=mobile&lang=english&lang=spanish'
);
expect(url).toBe('https://api.empathy.co/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ Object {
"url": "https://assets.empathy.co/",
},
],
"displayTagging": Object {
"params": Object {
"displayId": "jeans",
"filtered": "true",
"follow": false,
"lang": "en",
"origin": "url:external",
"page": "1",
"scope": "desktop",
"spellcheck": "false",
"totalHits": "686",
},
"url": "https://api.staging.empathy.co/tagging/v1/track/empathy/display",
},
"facets": Array [
Object {
"filters": Array [
Expand Down
12 changes: 6 additions & 6 deletions packages/x-adapter-platform/src/mappers/url.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ export function getTaggingInfoFromUrl(taggingUrl: string): TaggingRequest {
*
* @public
*/
export function getDisplayClickTagging(displayTaggingUrl: string): TaggingRequest {
const displayClickTagging = getTaggingInfoFromUrl(displayTaggingUrl);
const displayClickTaggingParams = displayClickTagging.params;
export function getDisplayTaggingInfoFromUrl(displayTaggingUrl: string): TaggingRequest {
const displayTagging = getTaggingInfoFromUrl(displayTaggingUrl);
const displayTaggingParams = displayTagging.params;

displayClickTaggingParams.displayId = displayClickTaggingParams.q ?? 'no_query';
delete displayClickTaggingParams.q;
displayTaggingParams.displayId = displayTaggingParams.q ?? 'no_query';
delete displayTaggingParams.q;

return displayClickTagging;
return displayTagging;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createMutableSchema } from '@empathyco/x-adapter';
import { Result } from '@empathyco/x-types';
import { getDisplayClickTagging, getTaggingInfoFromUrl } from '../../mappers/url.utils';
import { getDisplayTaggingInfoFromUrl, getTaggingInfoFromUrl } from '../../mappers/url.utils';
import { PlatformResult } from '../../types/models/result.model';

/**
Expand Down Expand Up @@ -36,7 +36,7 @@ export const resultSchema = createMutableSchema<PlatformResult, Result>({
add2cart: ({ add2cart }) => getTaggingInfoFromUrl(add2cart),
checkout: ({ checkout }) => getTaggingInfoFromUrl(checkout),
click: ({ click }) => getTaggingInfoFromUrl(click),
displayClick: ({ displayClick }) => getDisplayClickTagging(displayClick)
displayClick: ({ displayClick }) => getDisplayTaggingInfoFromUrl(displayClick)
}
}
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createMutableSchema } from '@empathyco/x-adapter';
import { SearchResponse } from '@empathyco/x-types';
import { getTaggingInfoFromUrl } from '../../mappers/url.utils';
import { getDisplayTaggingInfoFromUrl, getTaggingInfoFromUrl } from '../../mappers/url.utils';
import { PlatformSearchResponse } from '../../types/responses/search-response.model';
import { bannerSchema } from '../models/banner.schema';
import { facetSchema } from '../models/facet.schema';
Expand Down Expand Up @@ -41,5 +41,6 @@ export const searchResponseSchema = createMutableSchema<PlatformSearchResponse,
$path: 'catalog.partials',
$subSchema: partialResultsSchema
},
queryTagging: ({ catalog }) => getTaggingInfoFromUrl(catalog?.tagging?.query)
queryTagging: ({ catalog }) => getTaggingInfoFromUrl(catalog?.tagging?.query),
displayTagging: ({ catalog }) => getDisplayTaggingInfoFromUrl(catalog?.tagging?.display)
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface PlatformSearchResponse {
partials: PlatformPartialResult[];
tagging: {
query: string;
display: string;
};
};
direct: {
Expand Down
17 changes: 17 additions & 0 deletions packages/x-archetype-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.1.0-alpha.0](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2024-01-11)


### Features

* update to rollup 4 (#1370) ([a5c471b](https://github.com/empathyco/x/commit/a5c471b7d139393b7c2c0dffd88973029f2ced31))



## [1.0.3-alpha.1](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-12-27)

**Note:** Version bump only for package @empathyco/x-archetype-utils





## [1.0.3-alpha.0](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-11-29)

**Note:** Version bump only for package @empathyco/x-archetype-utils
Expand Down
8 changes: 4 additions & 4 deletions packages/x-archetype-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@empathyco/x-archetype-utils",
"version": "1.0.3-alpha.0",
"version": "1.1.0-alpha.0",
"description": "Utilities for x-archetype",
"author": "Empathy Systems Corporation S.L.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -37,17 +37,17 @@
},
"dependencies": {
"@empathyco/x-deep-merge": "^2.0.3-alpha.0",
"@empathyco/x-utils": "workspace:^1.0.3-alpha.0",
"tslib": "~2.6.0",
"vue-i18n": "~8.28.2"
},
"devDependencies": {
"@empathyco/x-utils": "^1.0.3-alpha.0",
"@types/jest": "~27.5.0",
"@types/node": "~18.18.0",
"@types/node": "~18.19.0",
"@vue/test-utils": "~1.0.3",
"jest": "~27.5.0",
"rimraf": "~3.0.2",
"rollup": "~2.79.1",
"rollup": "~4.9.1",
"rollup-plugin-copy": "~3.5.0",
"rollup-plugin-delete": "~2.0.0",
"rollup-plugin-typescript2": "~0.36.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import typescript from 'rollup-plugin-typescript2';

export default {
input: 'src/index.ts',
preserveModules: true,
output: [
{
format: 'cjs',
dir: 'dist/cjs'
dir: 'dist/cjs',
preserveModules: true
},
{
format: 'esm',
dir: 'dist/esm'
dir: 'dist/esm',
preserveModules: true
}
],
external: ['@empathyco/x-deep-merge', '@empathyco/x-utils', 'vue-i18n'],
plugins: [
del({ targets: 'dist' }),
copy({
Expand Down
61 changes: 61 additions & 0 deletions packages/x-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,67 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.1.0-alpha.7](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2024-01-12)


### Features

* **search:** handle display tagging from search response (#1388) ([b6b5d86](https://github.com/empathyco/x/commit/b6b5d8657947b8510f9d23530d709e757e5e3ecf))



## [4.1.0-alpha.6](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2024-01-11)


### Features

* update to rollup 4 (#1370) ([a5c471b](https://github.com/empathyco/x/commit/a5c471b7d139393b7c2c0dffd88973029f2ced31))



## [4.1.0-alpha.5](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2024-01-03)


### Documentation

* **integration:** add getSnippetConfig info (#1387) ([622286b](https://github.com/empathyco/x/commit/622286be7b9e552f3dd1e5563a295c7bd267cc49))



## [4.1.0-alpha.4](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-12-29)


### Features

* **x-plugin:** add snippet config getter to XAPI (#1378) ([a76e1b7](https://github.com/empathyco/x/commit/a76e1b716b9aa86fc6853bcf4d1bb7aaa9478f4a))



## [4.1.0-alpha.3](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-12-29)


### Documentation

* optimize images for SEO (#1379) ([b115a08](https://github.com/empathyco/x/commit/b115a08caa450447f0515532c3d9c9fd1125a1a4))



## [4.1.0-alpha.2](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-12-28)

**Note:** Version bump only for package @empathyco/x-components





## [4.1.0-alpha.1](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-12-27)

**Note:** Version bump only for package @empathyco/x-components





## [4.1.0-alpha.0](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2023-12-11)


Expand Down
2 changes: 1 addition & 1 deletion packages/x-components/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ async function build(): Promise<any> {
* Function for deleting useless folders.
*/
function removeTempFiles(): void {
fs.rmdirSync(path.join(rootDir, 'temp'), { recursive: true });
fs.rmSync(path.join(rootDir, 'temp'), { recursive: true });
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function importTokens(): Plugin {
* This function returns a {@link Plugin | RollupJS Plugin} to omit the `.js` files from the
* output generation. This is necessary because the `rollup-plugin-styles` plugin outputs `.js`
* files together with the `.css`, to import them as module. It has a mode to only "emit" CSS,
* but it needs another plugin (lintcss) and is failing right now.
* but it needs another plugin (litcss) and is failing right now.
*
* @returns The plugin object to use in the Rollup config.
* @internal
Expand Down
10 changes: 5 additions & 5 deletions packages/x-components/build/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const rollupConfig = createRollupOptions({
* Because of that, when rollup detects a circular dependency (it emits a warning), we stop
* the build with an error */
if (warning.code === 'CIRCULAR_DEPENDENCY') {
throw Error(`Circular dependency found: ${warning.cycle?.join(' ') as string}`);
throw Error(`Circular dependency found: ${warning.ids?.join(' ') as string}`);
}
},
external(id) {
Expand Down Expand Up @@ -119,7 +119,7 @@ export const rollupConfig = createRollupOptions({
copy({
targets: [
{
src: ['build-helpers', 'CHANGELOG.md', 'package.json', 'README.md', 'docs'],
src: ['CHANGELOG.md', 'package.json', 'README.md', 'docs'],
dest: buildPath
}
],
Expand All @@ -136,9 +136,9 @@ export const rollupConfig = createRollupOptions({
const commonCssOptions = createRollupOptions({
output: {
dir: cssOutputDirectory,
assetFileNames: '[name][extname]'
},
preserveModules: true
assetFileNames: '[name][extname]',
preserveModules: true
}
});

/**
Expand Down
Loading

0 comments on commit a2da941

Please sign in to comment.