Skip to content

Commit

Permalink
feat(atomic): add identifier on atomic commerce generated facets (#4112)
Browse files Browse the repository at this point in the history
https://coveord.atlassian.net/browse/KIT-3336

---------

Co-authored-by: GitHub Actions Bot <>
  • Loading branch information
olamothe authored Jun 21, 2024
1 parent 9ab7ba5 commit b2a4406
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/atomic/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ export namespace Components {
* The category facet controller instance.
*/
"facet": CategoryFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand All @@ -293,6 +297,10 @@ export namespace Components {
* The facet controller instance.
*/
"facet": RegularFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand Down Expand Up @@ -404,6 +412,10 @@ export namespace Components {
* The numeric facet controller instance.
*/
"facet": NumericFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand Down Expand Up @@ -676,6 +688,10 @@ export namespace Components {
* The date facet controller instance.
*/
"facet": DateFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand Down Expand Up @@ -5687,6 +5703,10 @@ declare namespace LocalJSX {
* The category facet controller instance.
*/
"facet": CategoryFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand All @@ -5706,6 +5726,10 @@ declare namespace LocalJSX {
* The facet controller instance.
*/
"facet": RegularFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand Down Expand Up @@ -5806,6 +5830,10 @@ declare namespace LocalJSX {
* The numeric facet controller instance.
*/
"facet": NumericFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand Down Expand Up @@ -6050,6 +6078,10 @@ declare namespace LocalJSX {
* The date facet controller instance.
*/
"facet": DateFacet;
/**
* The field identifier for this facet.
*/
"field"?: string;
/**
* Specifies whether the facet is collapsed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export class AtomicCategoryFacet implements InitializableComponent<Bindings> {
* Specifies whether the facet is collapsed.
*/
@Prop({reflect: true, mutable: true}) public isCollapsed = false;
/**
* The field identifier for this facet.
*/
@Prop({reflect: true}) field?: string;

@BindStateToController('facet')
@State()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export class AtomicCommerceFacet implements InitializableComponent<Bindings> {
* Specifies whether the facet is collapsed.
*/
@Prop({reflect: true, mutable: true}) public isCollapsed = false;
/**
* The field identifier for this facet.
*/
@Prop({reflect: true}) field?: string;

@BindStateToController('facet')
@State()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class AtomicCommerceFacets implements InitializableComponent<Bindings> {
isCollapsed: this.shouldCollapseFacet(index),
summary: this.summary,
facet: facet as T,
field: facet.state.field,
});

switch (facet.state.type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export class AtomicCommerceNumericFacet
* Specifies whether the facet is collapsed.
*/
@Prop({reflect: true, mutable: true}) public isCollapsed = false;
/**
* The field identifier for this facet.
*/
@Prop({reflect: true}) field?: string;

private headerFocus?: FocusTargetController;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export class AtomicCommerceTimeframeFacet
* Specifies whether the facet is collapsed.
*/
@Prop({reflect: true, mutable: true}) public isCollapsed = false;
/**
* The field identifier for this facet.
*/
@Prop({reflect: true}) field?: string;

@BindStateToController('facet')
@State()
Expand Down

0 comments on commit b2a4406

Please sign in to comment.