Skip to content

Commit

Permalink
Merge branch 'main' into feature/EMP-4205-migrate-spellcheck-and-spel…
Browse files Browse the repository at this point in the history
  • Loading branch information
lauramargar authored Jun 13, 2024
2 parents 0afd78c + b4f8db9 commit b0f5f33
Show file tree
Hide file tree
Showing 48 changed files with 1,170 additions and 793 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ jobs:
runs-on: ubuntu-latest

steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- name: checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
persist-credentials: false

- name: Install
uses: ./.github/actions/install
Expand All @@ -34,4 +42,4 @@ jobs:
uses: ./.github/actions/release-alpha
with:
npm_token: ${{ secrets.NPM_TOKEN_GRANULAR_ACCESS }}
github_token: ${{ secrets.SUPPORT_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}
11 changes: 10 additions & 1 deletion .github/workflows/edocs-dynamic-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ jobs:
connect-with-edocs:
runs-on: ubuntu-latest
steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- name: Checkout X mono-repo
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Get X Components Version
id: package-version
Expand All @@ -23,5 +32,5 @@ jobs:
--url https://api.github.com/repos/empathyco/docs-framework/actions/workflows/93444504/dispatches \
--data '{"ref": "main", "inputs": {"branchName": "${{ env.BRANCH_NAME }}", "version": "${{ steps.package-version.outputs.current-version }}"}}'
env:
GITHUB_TOKEN: ${{ secrets.SUPPORT_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

12 changes: 10 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ jobs:
options: --user 1001

steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
persist-credentials: false

# Install pnpm because it is not included in our container image
- name: install pnpm
Expand Down Expand Up @@ -51,6 +59,6 @@ jobs:
- name: push tags
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.SUPPORT_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}
branch: ${{ github.ref }}
tags: true
12 changes: 10 additions & 2 deletions .github/workflows/release-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ jobs:
options: --user 1001

steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- name: checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
persist-credentials: false

# Install pnpm because it is not included in our container image
- name: install pnpm
Expand All @@ -28,4 +36,4 @@ jobs:
uses: ./.github/actions/release-alpha
with:
npm_token: ${{ secrets.NPM_TOKEN_GRANULAR_ACCESS }}
github_token: ${{ secrets.SUPPORT_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}
36 changes: 36 additions & 0 deletions packages/_vue3-migration-test/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,42 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.0.0-alpha.27](https://github.com/empathyco/x/compare/[email protected]@1.0.0-alpha.27) (2024-06-12)


### Features

* migrate RTs module to composition API (#1498) ([22c5325](https://github.com/empathyco/x/commit/22c5325666441121e8ee64bfaa4c51ddad11939a))



## [1.0.0-alpha.26](https://github.com/empathyco/x/compare/[email protected]@1.0.0-alpha.26) (2024-06-12)


### Features

* migrate `query suggestions` module to composition api (#1497) ([4a9c742](https://github.com/empathyco/x/commit/4a9c742007476367328be6c978d16ec16ae115c1))



## [1.0.0-alpha.25](https://github.com/empathyco/x/compare/[email protected]@1.0.0-alpha.25) (2024-06-12)


### Features

* migrate history queries x module to composition api (#1494) ([cd51e9b](https://github.com/empathyco/x/commit/cd51e9bb2afb77bbb8f935445bfda360dcfaafde))



## [1.0.0-alpha.24](https://github.com/empathyco/x/compare/[email protected]@1.0.0-alpha.24) (2024-06-05)


### Features

* migrate PartialQueryButton and PartialResultsList (#1501) ([5e87123](https://github.com/empathyco/x/commit/5e87123d4a6c1edeb05f83c31ee8f096b5558e0f))



## [1.0.0-alpha.23](https://github.com/empathyco/x/compare/[email protected]@1.0.0-alpha.23) (2024-06-04)


Expand Down
2 changes: 1 addition & 1 deletion packages/_vue3-migration-test/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue3-migration-test",
"private": "true",
"version": "1.0.0-alpha.23",
"version": "1.0.0-alpha.27",
"scripts": {
"dev": "vite",
"preview": "vite preview",
Expand Down
15 changes: 13 additions & 2 deletions packages/_vue3-migration-test/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { XComponentsAdapter } from '@empathyco/x-types';
import { QuerySuggestionsRequest, XComponentsAdapter } from '@empathyco/x-types';
import { Component, configureCompat, createApp } from 'vue';
import { createStore } from 'vuex';
import { xPlugin } from '../../x-components/src/plugins/x-plugin';
import { getRelatedTagsStub } from '../../x-components/src/__stubs__/related-tags-stubs.factory';
import { getQuerySuggestionsStub } from '../../x-components/src/__stubs__/query-suggestions-stubs.factory';
import App from './App.vue';
import router from './router';
import { facetsXModule, nextQueriesXModule, scrollXModule, searchXModule } from './';
Expand All @@ -26,7 +28,16 @@ if (VUE_COMPAT_MODE === 2) {
});
}

const adapter = {} as XComponentsAdapter;
const adapter = {
relatedTags: () =>
new Promise(resolve => {
resolve({ relatedTags: getRelatedTagsStub(10) });
}),
querySuggestions: (request: QuerySuggestionsRequest) =>
new Promise(resolve => {
resolve({ suggestions: getQuerySuggestionsStub(request.query, 5) });
})
} as unknown as XComponentsAdapter;

const store = createStore({});

Expand Down
32 changes: 31 additions & 1 deletion packages/_vue3-migration-test/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ import {
TestSlidingPanel,
TestBaseSuggestions,
TestHighlight,
TestHistoryQueries,
TestMyHistory,
TestBaseResultImages,
TestBasePanel,
TestBaseKeyboardNavigation,
TestRelatedTags,
TestPartialResultsList,
TestBaseEventsModal,
TestBaseIdModal,
TestSpellcheck
TestSpellcheck,
TestQuerySuggestions
} from './';

const routes = [
Expand Down Expand Up @@ -153,6 +158,16 @@ const routes = [
name: 'Highlight',
component: TestHighlight
},
{
path: '/history-queries',
name: 'HistoryQueries',
component: TestHistoryQueries
},
{
path: '/my-history',
name: 'MyHistory',
component: TestMyHistory
},
{
path: '/base-result-images',
name: 'BaseResultImages',
Expand All @@ -168,6 +183,16 @@ const routes = [
name: 'TestBaseKeyboardNavigation',
component: TestBaseKeyboardNavigation
},
{
path: '/related-tags',
name: 'RelatedTags',
component: TestRelatedTags
},
{
path: '/partial-results-list',
name: 'PartialResultsList',
component: TestPartialResultsList
},
{
path: '/base-events-modal',
name: 'BaseEventsModal',
Expand All @@ -182,6 +207,11 @@ const routes = [
path: '/test-spellcheck',
name: 'Spellcheck',
component: TestSpellcheck
},
{
path: '/query-suggestions',
name: 'QuerySuggestions',
component: TestQuerySuggestions
}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as TestHistoryQueries } from './test-history-queries.vue';
export { default as TestMyHistory } from './test-my-history.vue';
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<SearchInput :maxLength="10" />
<ClearSearchInput />

<HistoryQueries :maxItemsToRender="5" />
<ClearHistoryQueries class="x-button--ghost x-button--ghost-start">
<span>Clear previous searches</span>
</ClearHistoryQueries>
</template>

<script setup>
import HistoryQueries from '../../../../../x-components/src/x-modules/history-queries/components/history-queries.vue';
import ClearHistoryQueries from '../../../../../x-components/src/x-modules/history-queries/components/clear-history-queries.vue';
import ClearSearchInput from '../../../../../x-components/src/x-modules/search-box/components/clear-search-input.vue';
import SearchInput from '../../../../../x-components/src/x-modules/search-box/components/search-input.vue';
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<MyHistory v-if="_$x.isHistoryQueriesEnabled && _$x.fullHistoryQueries.length">
<template #date="{ date }">
<div>{{ date }}</div>
</template>

<template #suggestion="{ suggestion, formatTime }">
<HistoryQuery data-test="my-history-query" :suggestion="suggestion">
<div class="flex flex-row gap-8">
<p>{{ suggestion.query }}</p>

<p>
{{ formatTime(suggestion.timestamp) }}
</p>
</div>

<template #remove-button-content>
<span>x</span>
</template>
</HistoryQuery>
</template>
</MyHistory>
</template>

<script setup>
import HistoryQuery from '../../../../../x-components/src/x-modules/history-queries/components/history-query.vue';
import MyHistory from '../../../../../x-components/src/x-modules/history-queries/components/my-history.vue';
import { use$x } from '../../../../../x-components/src/composables/use-$x';
const _$x = use$x();
</script>

<style scoped></style>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components';
3 changes: 3 additions & 0 deletions packages/_vue3-migration-test/src/x-modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ export * from './search';
export * from './search-box';
export { default as TestElementsList } from './test-elements-list.vue';
export * from './scroll';
export * from './related-tags';
export * from './history-queries';
export * from './query-suggestions';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as TestQuerySuggestions } from './test-query-suggestions.vue';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<SearchInput />
<QuerySuggestions />
</template>

<script setup>
import SearchInput from '../../../../../x-components/src/x-modules/search-box/components/search-input.vue';
import QuerySuggestions from '../../../../../x-components/src/x-modules/query-suggestions/components/query-suggestions.vue';
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as TestRelatedTags } from './test-related-tags.vue';
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<span style="display: block">
Query:
<b>{{ query }}</b>
</span>
<SearchInput />
<RelatedTags />
</template>

<script setup>
import SearchInput from '../../../../x-components/src/x-modules/search-box/components/search-input.vue';
import RelatedTags from '../../../../x-components/src/x-modules/related-tags/components/related-tags.vue';
import { useGetter } from '../../../../x-components/src/composables/use-getter';
const { query } = useGetter('relatedTags', ['query']);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { default as TestSortDropdown } from './test-sort-dropdown.vue';
export { default as TestSortList } from './test-sort-list.vue';
export { default as TestSortPickerList } from './test-sort-picker-list.vue';
export { default as TestSpellcheck } from './test-spellcheck.vue';
export { default as TestPartialResultsList } from './test-partial-results-list.vue';
Loading

0 comments on commit b0f5f33

Please sign in to comment.