Skip to content

Commit

Permalink
fix: propagate context with ff
Browse files Browse the repository at this point in the history
- fix FF propagation
- update test snapshots
JIRA: LX-183
risk: low
  • Loading branch information
ivan-nejezchleb committed Jun 20, 2024
1 parent 847cc62 commit 6b86d2b
Show file tree
Hide file tree
Showing 11 changed files with 1,668 additions and 4 deletions.
1,464 changes: 1,464 additions & 0 deletions libs/sdk-backend-tiger/tests/integrated/__snapshots__/catalog.test.ts.snap

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions libs/sdk-ui-filters/api/sdk-ui-filters.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,7 @@ export type IAttributeFilterHandlerOptions = ISingleSelectAttributeFilterHandler

// @public
export interface IAttributeFilterHandlerOptionsBase {
// (undocumented)
displayAsLabel: ObjRef;
displayAsLabel?: ObjRef;
enableDuplicatedLabelValuesInAttributeFilter?: boolean;
hiddenElements?: string[];
staticElements?: IAttributeElement[];
Expand Down
5 changes: 4 additions & 1 deletion libs/sdk-ui-filters/src/AttributeFilterHandler/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ export interface IAttributeFilterHandlerOptionsBase {
*/
enableDuplicatedLabelValuesInAttributeFilter?: boolean;

displayAsLabel: ObjRef;
/**
* If specified, the attribute filter will display the elements in specified label form.
*/
displayAsLabel?: ObjRef;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function* loadNextElementsPageSaga(

const result = yield call(elementsSaga, loadOptionsWithExcludePrimaryLabel, cacheId);

yield put(actions.loadNextElementsPageSuccess({ ...result, correlation }));
yield put(actions.loadNextElementsPageSuccess({ ...result, correlation, context }));
} catch (error) {
yield put(
actions.loadNextElementsPageError({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,72 @@ exports[`AttributeFilterHandler > loadCustomElements() that was successful shoul
[
{
"cacheId": undefined,
"context": {
"attributeFilter": {
"positiveAttributeFilter": {
"displayForm": {
"identifier": "label.f_product.product.name",
"type": "displayForm",
},
"in": {
"uris": [
"/gdc/md/referenceworkspace/obj/1054/elements?id=165678",
"/gdc/md/referenceworkspace/obj/1054/elements?id=165847",
],
},
},
},
"backend": {
"authenticate": [Function],
"capabilities": {
"allowsInconsistentRelations": false,
"canCalculateGrandTotals": true,
"canCalculateNativeTotals": true,
"canCalculateSubTotals": true,
"canCalculateTotals": true,
"supportsCsvUploader": true,
"supportsCustomColorPalettes": true,
"supportsElementUris": true,
"supportsElementsQueryParentFiltering": true,
"supportsEveryoneUserGroupForAccessControl": true,
"supportsHierarchicalWorkspaces": false,
"supportsKpiWidget": false,
"supportsOwners": true,
"supportsWidgetEntity": true,
},
"config": {
"attributeElementsFiltering": {
"attributeFilters": {
"label.f_product.product.name": [Function],
},
"dateFilters": {
"dt_snapshotdate_timestamp.day": [Function],
},
"measures": {
"87a053b0-3947-49f3-b0c5-de53fd01f050": [Function],
},
},
},
"currentUser": [Function],
"dataSources": [Function],
"deauthenticate": [Function],
"entitlements": [Function],
"isAuthenticated": [Function],
"onHostname": [Function],
"organization": [Function],
"organizations": [Function],
"withAuthentication": [Function],
"withTelemetry": [Function],
"workspace": [Function],
"workspaces": [Function],
},
"displayAsLabel": undefined,
"enableDuplicatedLabelValuesInAttributeFilter": undefined,
"eventListener": [Function],
"hiddenElements": undefined,
"staticElements": undefined,
"workspace": "testWorkspace",
},
"correlation": "success",
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,72 @@ exports[`AttributeFilterHandler > loadInitialElementsPage() that was successful
[
{
"cacheId": undefined,
"context": {
"attributeFilter": {
"positiveAttributeFilter": {
"displayForm": {
"identifier": "label.f_product.product.name",
"type": "displayForm",
},
"in": {
"uris": [
"/gdc/md/referenceworkspace/obj/1054/elements?id=165678",
"/gdc/md/referenceworkspace/obj/1054/elements?id=165847",
],
},
},
},
"backend": {
"authenticate": [Function],
"capabilities": {
"allowsInconsistentRelations": false,
"canCalculateGrandTotals": true,
"canCalculateNativeTotals": true,
"canCalculateSubTotals": true,
"canCalculateTotals": true,
"supportsCsvUploader": true,
"supportsCustomColorPalettes": true,
"supportsElementUris": true,
"supportsElementsQueryParentFiltering": true,
"supportsEveryoneUserGroupForAccessControl": true,
"supportsHierarchicalWorkspaces": false,
"supportsKpiWidget": false,
"supportsOwners": true,
"supportsWidgetEntity": true,
},
"config": {
"attributeElementsFiltering": {
"attributeFilters": {
"label.f_product.product.name": [Function],
},
"dateFilters": {
"dt_snapshotdate_timestamp.day": [Function],
},
"measures": {
"87a053b0-3947-49f3-b0c5-de53fd01f050": [Function],
},
},
},
"currentUser": [Function],
"dataSources": [Function],
"deauthenticate": [Function],
"entitlements": [Function],
"isAuthenticated": [Function],
"onHostname": [Function],
"organization": [Function],
"organizations": [Function],
"withAuthentication": [Function],
"withTelemetry": [Function],
"workspace": [Function],
"workspaces": [Function],
},
"displayAsLabel": undefined,
"enableDuplicatedLabelValuesInAttributeFilter": undefined,
"eventListener": [Function],
"hiddenElements": undefined,
"staticElements": undefined,
"workspace": "testWorkspace",
},
"correlation": "success",
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,72 @@ exports[`AttributeFilterHandler > loadNextElementsPage() that was successful sho
[
{
"cacheId": undefined,
"context": {
"attributeFilter": {
"positiveAttributeFilter": {
"displayForm": {
"identifier": "label.f_product.product.name",
"type": "displayForm",
},
"in": {
"uris": [
"/gdc/md/referenceworkspace/obj/1054/elements?id=165678",
"/gdc/md/referenceworkspace/obj/1054/elements?id=165847",
],
},
},
},
"backend": {
"authenticate": [Function],
"capabilities": {
"allowsInconsistentRelations": false,
"canCalculateGrandTotals": true,
"canCalculateNativeTotals": true,
"canCalculateSubTotals": true,
"canCalculateTotals": true,
"supportsCsvUploader": true,
"supportsCustomColorPalettes": true,
"supportsElementUris": true,
"supportsElementsQueryParentFiltering": true,
"supportsEveryoneUserGroupForAccessControl": true,
"supportsHierarchicalWorkspaces": false,
"supportsKpiWidget": false,
"supportsOwners": true,
"supportsWidgetEntity": true,
},
"config": {
"attributeElementsFiltering": {
"attributeFilters": {
"label.f_product.product.name": [Function],
},
"dateFilters": {
"dt_snapshotdate_timestamp.day": [Function],
},
"measures": {
"87a053b0-3947-49f3-b0c5-de53fd01f050": [Function],
},
},
},
"currentUser": [Function],
"dataSources": [Function],
"deauthenticate": [Function],
"entitlements": [Function],
"isAuthenticated": [Function],
"onHostname": [Function],
"organization": [Function],
"organizations": [Function],
"withAuthentication": [Function],
"withTelemetry": [Function],
"workspace": [Function],
"workspaces": [Function],
},
"displayAsLabel": undefined,
"enableDuplicatedLabelValuesInAttributeFilter": undefined,
"eventListener": [Function],
"hiddenElements": undefined,
"staticElements": undefined,
"workspace": "testWorkspace",
},
"correlation": "success",
"elements": [
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b86d2b

Please sign in to comment.