-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create related prompts module #1642
Conversation
* feat(x-installer): update to vue3 and adapt x-installer * feat(x-installer): simplify internal createApp fn * feat(scroll): fix import path * feat(component): keep injector const export * feat(mixins): removing deprecated mixins
BREAKING-CHANGE: refactors the GlobalXBus to use a prop to receive the listeners instead of relying on attributes.
This PR resolves several warnings when running the internal demo app: - Initial warning about overwriting the store modules. - Warnings about `v-on="listeners"` deprecation. - Removal of `v-bind="attrs"` and `inheritAttrs=false`, because Vue3 implemented by default the attributes inheritance. - Fixing warning on `attrs` inheritance in RenderlessFilter. - Fixing some components that throw warnings because the render function was incorrect.
…rective and deprecated layouts (#1576) * get rid of deprecated `MultiColumnMaxWidthLayout` * Revert "get rid of deprecated `MultiColumnMaxWidthLayout`" This reverts commit 7fd0374. * fix(list-components): fix list components, migrate infinite-scroll directive and deprecated layouts * fix(list-components): avoid injecting undefined default value since Vue does it
* refactor(animation-factory): fix Vue3 breaking changes * refactor(animation-factory): await animation to load * refactor(animation-factory): improve type infer * refactor(animations): Vue3 transition class breaking change
* test(components): propsData is now props * test(components): revert skip on test cases * test(components): fix duplicated bus instance * test(components): provide moved inside global property * test(components): remove useless nextTick() * test(components): update jsdoc for installNewXPlugin()
Co-authored-by: Diego Pascual <[email protected]>
…on (#1578) Co-authored-by: Jose A. Cabaneros <[email protected]>
Co-authored-by: Diego Pascual <[email protected]>
BREAKING CHANGE: @empathyco/x-archetype-utils is only compatible with vue 3
…1607) Co-authored-by: Víctor CG <[email protected]>
BREAKING CHANGE: @empathyco/x-components v6 and @empathyco/x-archetype-utils v2 are only compatible with Vue 3 and if you are looking for the Vue 2 versions, take look at the main brach.
- [email protected] - @empathyco/[email protected] - @empathyco/[email protected] - @empathyco/[email protected]
* test: fix experience-controls and tagging tests * test: fix scroll module and clear-search-input tests * test:fix related-tag test * test: fix tests in search module * test: fix tests in history-queries module * test: fix x-modules tests * tests: QueryPreview * test: fix semantic queries test * test: fix semantic query test * test: fix x-modules tests * test: query preview button test * test: use queries preview composable * test: queries preview getter * fix e2e tests * fix e2e tests * test: rm unneeded reset in queries preview composable * test: query preview actions test * test: query preview utils test * test: fix x-modules tests * test: fix x-modules tests * test: query preview list test * test: fix facets module tests * test: adjust some filters lists tests * test: facets getter test * test: use-filters-injection composable * test: fix facets module tests * test: test facets-service * test: adapt some filters tests * test: rm localVue from url module's utils * test: fix tagging actions test * test: fix pdp-add-to-cart service * test: fix search button test * test: fix semantics module tests * test: fix experience-controls getter test * test: adjust selected-filters-list test * test: fix getters-proxy.spec.ts * test: fix search input test * test: fix search input placeholder test * test: fix search box module actions test * test: fix facets-provider.spec.ts * test: adjust preselected-filters test * test: fix base-event-button and use-x-bus test sheets * test: fix test sheets of filter components * test: fix highlight and result-variants-provider-and-selector tests --------- Co-authored-by: Diego Pascual <[email protected]> Co-authored-by: albertjcuac <[email protected]> Co-authored-by: acondal <[email protected]> Co-authored-by: Jose Antonio Cabañeros <[email protected]>
- @empathyco/[email protected]
- @empathyco/[email protected]
c364d7b
to
45ae37d
Compare
…ed-prompts-adapter
@@ -0,0 +1,80 @@ | |||
<template> | |||
<div | |||
class="x-related-prompt x-bg-neutral-10 x-p-24 x-flex x-flex-col x-gap-16" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the styling. Usually we don't add those styles to the x-component and we leave it to the consumer to style it as desired.
v-for="(nextQuery, index) in relatedPrompt.nextQueries" | ||
:key="index" | ||
@click="onClick(nextQuery)" | ||
class="x-button x-button-lead x-button-sm x-button-outlined x-rounded-sm x-border-lead-50 x-text-neutral-75 hover:x-text-neutral-0 selected:x-text-neutral-0 selected:hover:x-bg-lead-50" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Probably is better to have a prop to pass the desired classes. This way is easier from the outside customize the UI
@@ -390,8 +390,9 @@ | |||
|
|||
<template #related-prompts-group="{ item: { relatedPrompts } }"> | |||
<RelatedPrompt | |||
class="x-flex x-flex-col x-pt-24" | |||
class="x-bg-neutral-10 x-flex x-flex-col x-gap-16 x-pt-24" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, maybe this background is another possible customizable style for customers, maybe we could add a containerClass
in the component to handle this attribute, which could also be used to add the gap & other spacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can already achieve this by attribute inheritance. Those classes will fall to the root element inside RelatedPrompt
, just like is done here.
:relatedPrompt="relatedPrompts[0]" | ||
nextQueryButtonClass="x-button x-button-lead x-button-sm x-button-outlined" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, IMO the x-button
class would rely on the component itself, the rest of them ok here
<button | ||
v-for="(nextQuery, index) in relatedPrompt.nextQueries" | ||
:key="index" | ||
@click="onClick(nextQuery)" | ||
class="x-button x-button-lead x-button-sm x-button-outlined x-rounded-sm x-border-lead-50 x-text-neutral-75 hover:x-text-neutral-0 selected:x-text-neutral-0 selected:hover:x-bg-lead-50" | ||
:class="{ 'x-selected': selectedNextQuery === nextQuery }" | ||
:class="[{ 'x-selected': selectedNextQuery === nextQuery }, nextQueryButtonClass]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I would name it buttonClass
so it is shorter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more than one button, I think it's better to have a more clear name for this
class="x-whitespace-nowrap" | ||
:class=" | ||
selectedNextQuery === nextQuery ? 'x-title3 x-title3-md' : 'x-text1 x-text1-lg' | ||
" | ||
> | ||
{{ nextQuery }} | ||
</span> | ||
<span>{{ nextQuery }}</span> | ||
<CrossTinyIcon v-if="selectedNextQuery === nextQuery" class="x-icon" /> | ||
<PlusIcon v-else class="x-icon" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is worth also adding a slot for the item
Hi @victorcg88! Great job! |
Pull request template
The Related Prompts module. Includes:
header
,next queries
, andquery-preview
.Motivation and context
Type of change
What is the destination branch of this PR?
Main
How has this been tested?
Tests performed according to testing guidelines:
Checklist: