Skip to content

Commit

Permalink
JSUI-3402 Added explicit isFieldValueCompatible to all facets (#1879)
Browse files Browse the repository at this point in the history
  • Loading branch information
btaillon-coveo authored May 24, 2022
1 parent 9dee6fb commit d015971
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 31 deletions.
1 change: 1 addition & 0 deletions src/ui/CategoryFacet/CategoryFacet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export class CategoryFacet extends Component implements IAutoLayoutAdjustableIns
public activeCategoryValue: CategoryValue | undefined;
public positionInQuery: number;
public dependsOnManager: DependsOnManager;
public isFieldValueCompatible = false;
public static MAXIMUM_NUMBER_OF_VALUES_BEFORE_TRUNCATING = 15;
public static NUMBER_OF_VALUES_TO_KEEP_AFTER_TRUNCATING = 10;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export class DynamicHierarchicalFacet extends Component implements IDynamicHiera
public position: number;
public dynamicFacetManager: DynamicFacetManager;
public isDynamicFacet = true;
public isFieldValueCompatible = false;

constructor(public element: HTMLElement, options: IDynamicHierarchicalFacetOptions, bindings?: IComponentBindings) {
super(element, 'DynamicHierarchicalFacet', bindings);
Expand Down
1 change: 1 addition & 0 deletions src/ui/FacetSlider/FacetSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ export class FacetSlider extends Component {
public facetHeader: FacetHeader;
public onResize: EventListener;
public isSimpleSliderConfig = false;
public isFieldValueCompatible = false;

private rangeQueryStateAttribute: string;
private isEmpty = false;
Expand Down
1 change: 1 addition & 0 deletions src/ui/HierarchicalFacet/HierarchicalFacet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export class HierarchicalFacet extends Facet implements IComponentBindings {
public facetQueryController: HierarchicalFacetQueryController;
public topLevelHierarchy: IValueHierarchy[];
public shouldReshuffleFacetValuesClientSide = false;
public isFieldValueCompatible = false;

private valueHierarchy: { [facetValue: string]: IValueHierarchy };
private originalNumberOfValuesToShow: number;
Expand Down
42 changes: 11 additions & 31 deletions src/ui/TimespanFacet/TimespanFacet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,56 +76,36 @@ export class TimespanFacet extends Component {
});
};

public isFieldValueCompatible = false;

private rangeValues: IRangeValue[] = [
{
start: moment(0).toDate(),
end: moment()
.endOf('day')
.toDate(),
end: moment().endOf('day').toDate(),
label: l('AllDates'),
endInclusive: false
},
{
start: moment()
.startOf('day')
.subtract(1, 'day')
.toDate(),
end: moment()
.endOf('day')
.toDate(),
start: moment().startOf('day').subtract(1, 'day').toDate(),
end: moment().endOf('day').toDate(),
label: l('WithinLastDay'),
endInclusive: false
},
{
start: moment()
.startOf('day')
.subtract(1, 'week')
.toDate(),
end: moment()
.endOf('day')
.toDate(),
start: moment().startOf('day').subtract(1, 'week').toDate(),
end: moment().endOf('day').toDate(),
label: l('WithinLastWeek'),
endInclusive: false
},
{
start: moment()
.startOf('day')
.subtract(1, 'month')
.toDate(),
end: moment()
.endOf('day')
.toDate(),
start: moment().startOf('day').subtract(1, 'month').toDate(),
end: moment().endOf('day').toDate(),
label: l('WithinLastMonth'),
endInclusive: false
},
{
start: moment()
.startOf('day')
.subtract(1, 'year')
.toDate(),
end: moment()
.endOf('day')
.toDate(),
start: moment().startOf('day').subtract(1, 'year').toDate(),
end: moment().endOf('day').toDate(),
label: l('WithinLastYear'),
endInclusive: false
}
Expand Down

0 comments on commit d015971

Please sign in to comment.