-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1522 from empathyco/feature/EMP-4309-migrate-next…
…-queries-x-module-yo-composition-api feat: migrate next queries module to composition api
- Loading branch information
Showing
10 changed files
with
216 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/_vue3-migration-test/src/x-modules/next-queries/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as TestNextQueries } from './test-next-queries.vue'; |
30 changes: 30 additions & 0 deletions
30
packages/_vue3-migration-test/src/x-modules/next-queries/components/test-next-queries.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<div> | ||
<SearchInput /> | ||
|
||
<NextQueryPreview :suggestion="nextQueries[3]"> | ||
<h1>Next query preview:</h1> | ||
<NextQuery :suggestion="nextQueries[3]" data-test="next-query-preview-name"> | ||
<span>{{ nextQueries[3].query }}</span> | ||
</NextQuery> | ||
</NextQueryPreview> | ||
|
||
<NextQueries :max-items-to-render="3"> | ||
<template #suggestion="{ suggestion }"> | ||
<NextQuery :suggestion="suggestion"> | ||
<span>{{ suggestion.query }}</span> | ||
</NextQuery> | ||
</template> | ||
</NextQueries> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import NextQueryPreview from '../../../../../x-components/src/x-modules/next-queries/components/next-query-preview.vue'; | ||
import NextQuery from '../../../../../x-components/src/x-modules/next-queries/components/next-query.vue'; | ||
import NextQueries from '../../../../../x-components/src/x-modules/next-queries/components/next-queries.vue'; | ||
import { useState } from '../../../../../x-components/src/composables/use-state'; | ||
import SearchInput from '../../../../../x-components/src/x-modules/search-box/components/search-input.vue'; | ||
const { nextQueries } = useState('nextQueries', ['nextQueries']); | ||
</script> |
1 change: 1 addition & 0 deletions
1
packages/_vue3-migration-test/src/x-modules/next-queries/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './x-module'; | ||
export * from './components'; |
7 changes: 3 additions & 4 deletions
7
packages/_vue3-migration-test/src/x-modules/next-queries/x-module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import { getNextQueriesStub } from '../../../../x-components/src/__stubs__/next-queries-stubs.factory'; | ||
import { PrivateXModuleOptions } from '../../../../x-components/src/plugins'; | ||
import { NextQueriesXModule } from '../../../../x-components/src/x-modules/next-queries'; | ||
|
||
export const nextQueriesXModule = { | ||
storeModule: { | ||
state: { | ||
query: 'dress', | ||
nextQueries: getNextQueriesStub(), | ||
status: 'success' | ||
config: { | ||
hideSessionQueries: false | ||
} | ||
} | ||
} | ||
} as PrivateXModuleOptions<NextQueriesXModule>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.