@griddo/ax 1.69.9 → 1.72.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/jest/componentsMock.js +0 -26
- package/package.json +4 -3
- package/src/Style/index.tsx +1 -1
- package/src/__tests__/components/ElementsTooltip/ElementsTooltip.test.tsx +97 -0
- package/src/__tests__/components/EmptyState/EmptyState.test.tsx +78 -0
- package/src/__tests__/components/FieldContainer/FieldContainer.test.tsx +82 -0
- package/src/__tests__/components/Fields/AnalyticsField/AnalyticsField.test.tsx +1 -1
- package/src/__tests__/components/Fields/AnalyticsField/PageAnalytics/PageAnalytics.test.tsx +1 -15
- package/src/__tests__/components/Fields/AnalyticsField/StructuredDataAnalytics/StructuredDataAnalytics.test.tsx +1 -16
- package/src/__tests__/components/Fields/ArrayFieldGroup/ArrayFieldGroup.test.tsx +8 -17
- package/src/__tests__/components/Fields/AsyncCheckGroup/AsyncCheckGroup.test.tsx +4 -16
- package/src/__tests__/components/Fields/AsyncSelect/AsyncSelect.test.tsx +2 -20
- package/src/__tests__/components/Fields/CheckField/CheckField.test.tsx +6 -6
- package/src/__tests__/components/Fields/CheckGroup/CheckGroup.test.tsx +15 -15
- package/src/__tests__/components/Fields/ColorPicker/ColorPicker.test.tsx +7 -16
- package/src/__tests__/components/Fields/ComponentArray/ComponentArray.test.tsx +2 -23
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/MixableComponentArray.test.tsx +11 -31
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/PasteModuleButton/PasteModuleButton.test.tsx +15 -21
- package/src/__tests__/components/Fields/ComponentArray/SameComponentArray/SameComponentArray.test.tsx +6 -25
- package/src/__tests__/components/Fields/ComponentContainer/ComponentContainer.test.tsx +559 -0
- package/src/__tests__/components/Fields/ConditionalField/ConditionalField.test.tsx +1 -1
- package/src/__tests__/components/Fields/DateField/DateField.test.tsx +1 -1
- package/src/__tests__/components/Fields/FieldGroup/FieldGroup.test.tsx +1 -1
- package/src/__tests__/components/Fields/FieldsDivider/FieldsDivider.test.tsx +1 -1
- package/src/__tests__/components/Fields/FileField/FileField.test.tsx +3 -3
- package/src/__tests__/components/Fields/HeadingField/HeadingField.test.tsx +6 -6
- package/src/__tests__/components/Fields/HiddenField/HiddenField.test.tsx +2 -8
- package/src/__tests__/components/Fields/ImageField/ImageField.test.tsx +471 -0
- package/src/__tests__/components/Fields/MultiCheckSelect/MultiCheckSelect.test.tsx +2 -16
- package/src/__tests__/components/Fields/MultiCheckSelectGroup/MultiCheckSelectGroup.test.tsx +2 -2
- package/src/__tests__/components/Fields/NoteField/NoteField.test.tsx +2 -7
- package/src/__tests__/components/Fields/NumberField/NumberField.test.tsx +2 -15
- package/src/__tests__/components/Fields/RadioField/RadioField.test.tsx +2 -12
- package/src/__tests__/components/Fields/ReferenceField/ReferenceField.test.tsx +171 -19
- package/src/__tests__/components/Fields/RichText/RichText.test.tsx +2 -13
- package/src/__tests__/components/Fields/Select/Select.test.tsx +3 -23
- package/src/__tests__/components/Fields/SliderField/SliderField.test.tsx +2 -15
- package/src/__tests__/components/Fields/TagField/TagField.test.tsx +4 -4
- package/src/__tests__/components/Fields/TextArea/TextArea.test.tsx +1 -1
- package/src/__tests__/components/Fields/TextField/TextField.test.tsx +6 -6
- package/src/__tests__/components/Fields/TimeField/HourInput/HourInput.test.tsx +142 -0
- package/src/__tests__/components/Fields/TimeField/TimeField.test.tsx +100 -0
- package/src/__tests__/components/Fields/ToggleField/ToggleField.test.tsx +2 -10
- package/src/__tests__/components/Fields/Tooltip/Tooltip.test.tsx +152 -0
- package/src/__tests__/components/Fields/UniqueCheck/UniqueCheck.test.tsx +3 -3
- package/src/__tests__/components/Fields/UrlField/UrlField.test.tsx +4 -4
- package/src/__tests__/components/Fields/VisualUniqueSelection/ImageSelection/ImageSelection.test.tsx +2 -14
- package/src/__tests__/components/Fields/VisualUniqueSelection/ScrollableSelection/ScrollableSelection.test.tsx +6 -20
- package/src/__tests__/components/Fields/VisualUniqueSelection/VisualUniqueSelection.test.tsx +3 -29
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.test.tsx +1 -1
- package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +149 -0
- package/src/__tests__/components/SubNav/SubNav.test.tsx +37 -0
- package/src/__tests__/components/TableCounter/TableCounter.test.tsx +51 -0
- package/src/__tests__/components/TableFilters/CategoryFilter/CategoryFilter.test.tsx +241 -0
- package/src/__tests__/components/TableFilters/CustomizeFilters/CustomizeFilters.test.tsx +131 -0
- package/src/__tests__/components/TableFilters/DateFilter/DateFilter.test.tsx +148 -0
- package/src/__tests__/components/TableFilters/LiveFilter/LiveFilter.test.tsx +266 -0
- package/src/__tests__/components/TableFilters/NameFilter/NameFilter.test.tsx +196 -0
- package/src/__tests__/components/TableFilters/SiteFilter/SiteFilter.test.tsx +318 -0
- package/src/__tests__/components/TableFilters/StatusFilter/StatusFilter.test.tsx +195 -0
- package/src/__tests__/components/TableFilters/TranslationsFilter/TranslationsFilter.test.tsx +157 -0
- package/src/__tests__/components/TableFilters/TypeFilter/TypeFilter.test.tsx +165 -0
- package/src/__tests__/components/TableList/TableList.test.tsx +119 -0
- package/src/__tests__/components/Tabs/Tabs.test.tsx +205 -0
- package/src/__tests__/components/Tag/Tag.test.tsx +140 -0
- package/src/__tests__/components/Toast/Toast.test.tsx +102 -0
- package/src/api/navigation.tsx +1 -1
- package/src/components/Browser/index.tsx +1 -1
- package/src/components/Button/index.tsx +3 -3
- package/src/components/ConfigPanel/NavigationForm/Field/index.tsx +14 -3
- package/src/components/ElementsTooltip/index.tsx +10 -9
- package/src/components/EmptyState/index.tsx +2 -2
- package/src/components/FieldContainer/index.tsx +3 -3
- package/src/components/Fields/ArrayFieldGroup/index.tsx +1 -1
- package/src/components/Fields/AsyncCheckGroup/index.tsx +1 -1
- package/src/components/Fields/AsyncSelect/index.tsx +1 -1
- package/src/components/Fields/CheckField/index.tsx +3 -3
- package/src/components/Fields/CheckGroup/index.tsx +2 -2
- package/src/components/Fields/ComponentContainer/index.tsx +7 -6
- package/src/components/Fields/ComponentContainer/style.tsx +2 -2
- package/src/components/Fields/HeadingField/index.tsx +1 -1
- package/src/components/Fields/HiddenField/index.tsx +1 -1
- package/src/components/Fields/ImageField/index.tsx +10 -5
- package/src/components/Fields/MultiCheckSelect/index.tsx +3 -3
- package/src/components/Fields/NumberField/index.tsx +2 -1
- package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +5 -7
- package/src/components/Fields/ReferenceField/ItemList/Item/style.tsx +2 -2
- package/src/components/Fields/ReferenceField/ItemList/index.tsx +1 -1
- package/src/components/Fields/RichText/index.tsx +10 -6
- package/src/components/Fields/Select/index.tsx +2 -2
- package/src/components/Fields/SliderField/index.tsx +1 -1
- package/src/components/Fields/TextField/index.tsx +2 -7
- package/src/components/Fields/TimeField/HourInput/index.tsx +103 -0
- package/src/components/Fields/TimeField/HourInput/style.tsx +19 -0
- package/src/components/Fields/TimeField/HourInput/utils.tsx +35 -0
- package/src/components/Fields/TimeField/index.tsx +57 -0
- package/src/components/Fields/TimeField/style.tsx +37 -0
- package/src/components/Fields/index.tsx +2 -0
- package/src/components/FieldsBehavior/index.tsx +1 -1
- package/src/components/FloatingMenu/index.tsx +2 -2
- package/src/components/Gallery/GalleryFilters/Type/index.tsx +50 -0
- package/src/components/Gallery/GalleryFilters/Type/style.tsx +39 -0
- package/src/components/Gallery/GalleryPanel/DetailPanel/index.tsx +2 -1
- package/src/components/Gallery/GalleryPanel/GalleryDragAndDrop/style.tsx +3 -3
- package/src/components/Gallery/hooks.tsx +10 -4
- package/src/components/Gallery/index.tsx +2 -0
- package/src/components/Icon/index.tsx +1 -1
- package/src/components/IconAction/index.tsx +1 -1
- package/src/components/Lists/index.tsx +1 -1
- package/src/components/Loading/index.tsx +1 -1
- package/src/components/Pagination/index.tsx +1 -1
- package/src/components/SideModal/SideModalOption/index.tsx +4 -2
- package/src/components/SideModal/index.tsx +1 -1
- package/src/components/SubNav/index.tsx +3 -3
- package/src/components/SubNav/style.tsx +1 -3
- package/src/components/TableCounter/index.tsx +7 -2
- package/src/components/TableFilters/CategoryFilter/index.tsx +2 -2
- package/src/components/TableFilters/CategoryFilter/style.tsx +1 -10
- package/src/components/TableFilters/CustomizeFilters/index.tsx +2 -3
- package/src/components/TableFilters/DateFilter/index.tsx +4 -4
- package/src/components/TableFilters/LiveFilter/index.tsx +1 -1
- package/src/components/TableFilters/LiveFilter/style.tsx +2 -10
- package/src/components/TableFilters/NameFilter/index.tsx +4 -4
- package/src/components/TableFilters/SiteFilter/index.tsx +16 -13
- package/src/components/TableFilters/SiteFilter/style.tsx +1 -10
- package/src/components/TableFilters/StatusFilter/index.tsx +3 -3
- package/src/components/TableFilters/TranslationsFilter/index.tsx +4 -7
- package/src/components/TableFilters/TranslationsFilter/style.tsx +1 -10
- package/src/components/TableFilters/TypeFilter/index.tsx +2 -2
- package/src/components/TableFilters/TypeFilter/style.tsx +1 -10
- package/src/components/TableList/index.tsx +6 -6
- package/src/components/TableList/style.tsx +1 -1
- package/src/components/Tabs/index.tsx +19 -7
- package/src/components/Tag/index.tsx +6 -6
- package/src/components/Toast/index.tsx +4 -4
- package/src/components/Tooltip/index.tsx +5 -3
- package/src/components/index.tsx +2 -0
- package/src/containers/Navigation/Defaults/actions.tsx +10 -5
- package/src/containers/Navigation/Defaults/utils.tsx +13 -4
- package/src/containers/Sites/actions.tsx +7 -0
- package/src/containers/Sites/constants.tsx +1 -0
- package/src/containers/Sites/interfaces.tsx +6 -0
- package/src/containers/Sites/reducer.tsx +4 -0
- package/src/containers/StructuredData/actions.tsx +21 -8
- package/src/containers/StructuredData/constants.tsx +2 -0
- package/src/containers/StructuredData/interfaces.tsx +7 -1
- package/src/containers/StructuredData/reducer.tsx +5 -1
- package/src/helpers/fields.tsx +2 -2
- package/src/helpers/index.tsx +3 -0
- package/src/helpers/parseTheme.js +456 -0
- package/src/helpers/schemas.tsx +2 -2
- package/src/hooks/forms.tsx +2 -1
- package/src/modules/App/Routing/NavMenu/index.tsx +9 -1
- package/src/modules/Content/BulkHeader/TableHeader/index.tsx +1 -1
- package/src/modules/Content/hooks.tsx +19 -12
- package/src/modules/Content/index.tsx +23 -14
- package/src/modules/Navigation/Defaults/DefaultsEditor/Editor/DefaultsBrowser/index.tsx +3 -0
- package/src/modules/Navigation/Defaults/DefaultsEditor/Editor/index.tsx +3 -1
- package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +16 -18
- package/src/modules/Navigation/Defaults/DefaultsEditor/utils.tsx +37 -0
- package/src/modules/StructuredData/Form/ConnectedField/index.tsx +3 -2
- package/src/modules/StructuredData/Form/index.tsx +22 -17
- package/src/modules/StructuredData/StructuredDataList/hooks.tsx +30 -20
- package/src/modules/StructuredData/StructuredDataList/index.tsx +24 -14
- package/src/types/index.tsx +8 -7
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
SET_SAVED_SITE_INFO,
|
|
11
11
|
DEFAULT_PARAMS,
|
|
12
12
|
SET_CURRENT_SITE_ERROR_PAGES,
|
|
13
|
+
SET_CONTENT_FILTERS,
|
|
13
14
|
} from "./constants";
|
|
14
15
|
import {
|
|
15
16
|
ISetSitesAction,
|
|
@@ -21,6 +22,7 @@ import {
|
|
|
21
22
|
ISetCurrentSiteLanguagesAction,
|
|
22
23
|
ISetSavedSiteInfoAction,
|
|
23
24
|
ISetCurrentSiteErrorPages,
|
|
25
|
+
ISetContentFilters,
|
|
24
26
|
} from "./interfaces";
|
|
25
27
|
|
|
26
28
|
import { ISite, IGetSitePagesParams, ISettingsForm, IGetGlobalPagesParams, IPage } from "@ax/types";
|
|
@@ -77,6 +79,10 @@ function setCurrentSiteErrorPages(currentSiteErrorPages: number[]): ISetCurrentS
|
|
|
77
79
|
return { type: SET_CURRENT_SITE_ERROR_PAGES, payload: { currentSiteErrorPages } };
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
function setContentFilters(contentFilters: Record<string, string> | null): ISetContentFilters {
|
|
83
|
+
return { type: SET_CONTENT_FILTERS, payload: { contentFilters } };
|
|
84
|
+
}
|
|
85
|
+
|
|
80
86
|
// TODO: hay que controlar que cuando da error la API borrar los sites ya guardados y sacar el error (ver los siguientes FIXME)
|
|
81
87
|
function getSites(): (dispatch: Dispatch) => Promise<void> {
|
|
82
88
|
return async (dispatch) => {
|
|
@@ -507,4 +513,5 @@ export {
|
|
|
507
513
|
removeUsersBulk,
|
|
508
514
|
setCurrentSiteErrorPages,
|
|
509
515
|
resetCurrentSiteErrorPages,
|
|
516
|
+
setContentFilters,
|
|
510
517
|
};
|
|
@@ -10,6 +10,7 @@ export const SET_CURRENT_SITE_LANGUAGES: string | null = `${NAME}/SET_CURRENT_SI
|
|
|
10
10
|
export const SET_INITIAL_VALUES = `${NAME}/SET_INITIAL_VALUES`;
|
|
11
11
|
export const SET_SAVED_SITE_INFO = `${NAME}/SET_SAVED_SITE_INFO`;
|
|
12
12
|
export const SET_CURRENT_SITE_ERROR_PAGES = `${NAME}/SET_CURRENT_SITE_ERROR_PAGES`;
|
|
13
|
+
export const SET_CONTENT_FILTERS = `${NAME}/SET_CONTENT_FILTERS`;
|
|
13
14
|
|
|
14
15
|
export const ITEMS_PER_PAGE = 50;
|
|
15
16
|
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
SET_INITIAL_VALUES,
|
|
10
10
|
SET_SAVED_SITE_INFO,
|
|
11
11
|
SET_CURRENT_SITE_ERROR_PAGES,
|
|
12
|
+
SET_CONTENT_FILTERS,
|
|
12
13
|
} from "./constants";
|
|
13
14
|
import { ISite } from "@ax/types";
|
|
14
15
|
|
|
@@ -62,4 +63,9 @@ export interface ISetCurrentSiteErrorPages {
|
|
|
62
63
|
payload: { currentSiteErrorPages: number[] };
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
export interface ISetContentFilters {
|
|
67
|
+
type: typeof SET_CONTENT_FILTERS;
|
|
68
|
+
payload: { contentFilters: Record<string,string> | null };
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
export type SitesActionsCreators = ISetSitesAction & ISetCurrentSiteInfoAction;
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
SET_INITIAL_VALUES,
|
|
10
10
|
SET_SAVED_SITE_INFO,
|
|
11
11
|
SET_CURRENT_SITE_ERROR_PAGES,
|
|
12
|
+
SET_CONTENT_FILTERS,
|
|
12
13
|
} from "./constants";
|
|
13
14
|
|
|
14
15
|
import { ISite, IPage, ILanguage } from "@ax/types";
|
|
@@ -26,6 +27,7 @@ export interface ISitesState {
|
|
|
26
27
|
currentSiteLanguages: ILanguage[];
|
|
27
28
|
savedSiteInfo: any;
|
|
28
29
|
currentSiteErrorPages: number[];
|
|
30
|
+
contentFilters: Record<string, string> | null;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export const initialState = {
|
|
@@ -39,6 +41,7 @@ export const initialState = {
|
|
|
39
41
|
currentSiteLanguages: [],
|
|
40
42
|
savedSiteInfo: null,
|
|
41
43
|
currentSiteErrorPages: [],
|
|
44
|
+
contentFilters: null,
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
export function reducer(state = initialState, action: SitesActionsCreators): ISitesState {
|
|
@@ -53,6 +56,7 @@ export function reducer(state = initialState, action: SitesActionsCreators): ISi
|
|
|
53
56
|
case SET_INITIAL_VALUES:
|
|
54
57
|
case SET_SAVED_SITE_INFO:
|
|
55
58
|
case SET_CURRENT_SITE_ERROR_PAGES:
|
|
59
|
+
case SET_CONTENT_FILTERS:
|
|
56
60
|
return { ...state, ...action.payload };
|
|
57
61
|
default:
|
|
58
62
|
return state;
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
SET_SCHEMA_VERSION,
|
|
17
17
|
SET_ERRORS,
|
|
18
18
|
SET_VALIDATED,
|
|
19
|
+
SET_CONTENT_FILTERS,
|
|
19
20
|
} from "./constants";
|
|
20
21
|
|
|
21
22
|
import {
|
|
@@ -30,9 +31,17 @@ import {
|
|
|
30
31
|
ISetSchemaVersion,
|
|
31
32
|
ISetErrors,
|
|
32
33
|
ISetValidated,
|
|
34
|
+
ISetContentFilters,
|
|
33
35
|
} from "./interfaces";
|
|
34
36
|
import { prepareStructuredDataContent, getTaxonomies, filterStructuredDataByID, getTypes } from "./utils";
|
|
35
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
IStructuredData,
|
|
39
|
+
IStructuredDataContent,
|
|
40
|
+
ICategory,
|
|
41
|
+
IGetStructuredDataParams,
|
|
42
|
+
IErrorItem,
|
|
43
|
+
IStructuredDataQueryValues,
|
|
44
|
+
} from "@ax/types";
|
|
36
45
|
import { structuredData } from "@ax/api";
|
|
37
46
|
import { setTotalItems } from "@ax/containers/Sites/actions";
|
|
38
47
|
import { appActions } from "@ax/containers/App";
|
|
@@ -102,30 +111,33 @@ function setValidated(validated: boolean): ISetValidated {
|
|
|
102
111
|
return { type: SET_VALIDATED, payload: { validated } };
|
|
103
112
|
}
|
|
104
113
|
|
|
114
|
+
function setContentFilters(contentFilters: Record<string, IStructuredDataQueryValues> | null): ISetContentFilters {
|
|
115
|
+
return { type: SET_CONTENT_FILTERS, payload: { contentFilters } };
|
|
116
|
+
}
|
|
117
|
+
|
|
105
118
|
function updateFormValue(valueObj: any): (dispatch: Dispatch, getState: any) => void {
|
|
106
119
|
return (dispatch, getState) => {
|
|
107
120
|
const {
|
|
108
121
|
structuredData: { form },
|
|
109
122
|
} = getState();
|
|
110
|
-
const updatedForm = { ...form, content: { ...form
|
|
123
|
+
const updatedForm = { ...form, content: { ...form?.content, ...valueObj } };
|
|
111
124
|
dispatch(updateForm(updatedForm));
|
|
112
125
|
};
|
|
113
126
|
}
|
|
114
127
|
|
|
115
|
-
function resetForm(): (dispatch: Dispatch, getState: any) => void {
|
|
128
|
+
function resetForm(setDefault?: boolean): (dispatch: Dispatch, getState: any) => void {
|
|
116
129
|
return (dispatch, getState) => {
|
|
117
130
|
const {
|
|
118
|
-
structuredData: {
|
|
119
|
-
currentStructuredData: { defaultValues },
|
|
120
|
-
},
|
|
131
|
+
structuredData: { currentStructuredData },
|
|
121
132
|
} = getState();
|
|
122
133
|
|
|
123
|
-
const
|
|
134
|
+
const formContent = setDefault && currentStructuredData ? { content: currentStructuredData.defaultValues } : null;
|
|
124
135
|
|
|
125
136
|
dispatch(setEntity(null));
|
|
126
|
-
dispatch(updateForm(
|
|
137
|
+
dispatch(updateForm(formContent));
|
|
127
138
|
dispatch(setErrors([]));
|
|
128
139
|
dispatch(setValidated(false));
|
|
140
|
+
dispatch(setCurrentDataID(null));
|
|
129
141
|
};
|
|
130
142
|
}
|
|
131
143
|
|
|
@@ -559,4 +571,5 @@ export {
|
|
|
559
571
|
setFilter,
|
|
560
572
|
validateForm,
|
|
561
573
|
deleteError,
|
|
574
|
+
setContentFilters,
|
|
562
575
|
};
|
|
@@ -15,6 +15,7 @@ const SET_FILTER: string | null = `${NAME}/SET_FILTER`;
|
|
|
15
15
|
const SET_SCHEMA_VERSION: string | null = `${NAME}/SET_SCHEMA_VERSION`;
|
|
16
16
|
const SET_ERRORS = `${NAME}/SET_ERRORS`;
|
|
17
17
|
const SET_VALIDATED = `${NAME}/SET_VALIDATED`;
|
|
18
|
+
const SET_CONTENT_FILTERS = `${NAME}/SET_CONTENT_FILTERS`;
|
|
18
19
|
|
|
19
20
|
const ITEMS_PER_PAGE = 50;
|
|
20
21
|
|
|
@@ -45,4 +46,5 @@ export {
|
|
|
45
46
|
SET_SCHEMA_VERSION,
|
|
46
47
|
SET_ERRORS,
|
|
47
48
|
SET_VALIDATED,
|
|
49
|
+
SET_CONTENT_FILTERS,
|
|
48
50
|
};
|
|
@@ -12,9 +12,10 @@ import {
|
|
|
12
12
|
SET_SCHEMA_VERSION,
|
|
13
13
|
SET_ERRORS,
|
|
14
14
|
SET_VALIDATED,
|
|
15
|
+
SET_CONTENT_FILTERS,
|
|
15
16
|
} from "./constants";
|
|
16
17
|
|
|
17
|
-
import { IStructuredData, IStructuredDataContent, ICategory, IErrorItem } from "@ax/types";
|
|
18
|
+
import { IStructuredData, IStructuredDataContent, ICategory, IErrorItem, IStructuredDataQueryValues } from "@ax/types";
|
|
18
19
|
|
|
19
20
|
export interface ISetCategories {
|
|
20
21
|
type: typeof SET_CATEGORIES;
|
|
@@ -80,6 +81,11 @@ export interface ISetValidated {
|
|
|
80
81
|
payload: { validated: boolean };
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
export interface ISetContentFilters {
|
|
85
|
+
type: typeof SET_CONTENT_FILTERS;
|
|
86
|
+
payload: { contentFilters: Record<string, IStructuredDataQueryValues> | null };
|
|
87
|
+
}
|
|
88
|
+
|
|
83
89
|
export type CategoryActionsCreators = ISetCategories & ISetCurrentData;
|
|
84
90
|
|
|
85
91
|
export type StructuredDataActionsCreators = CategoryActionsCreators &
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IStructuredData, IStructuredDataContent, ICategory, IErrorItem } from "@ax/types";
|
|
1
|
+
import { IStructuredData, IStructuredDataContent, ICategory, IErrorItem, IStructuredDataQueryValues } from "@ax/types";
|
|
2
2
|
import {
|
|
3
3
|
SET_CATEGORIES,
|
|
4
4
|
SET_STRUCTURED_DATA,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
SET_SCHEMA_VERSION,
|
|
16
16
|
SET_ERRORS,
|
|
17
17
|
SET_VALIDATED,
|
|
18
|
+
SET_CONTENT_FILTERS,
|
|
18
19
|
} from "./constants";
|
|
19
20
|
|
|
20
21
|
import { StructuredDataActionsCreators } from "./interfaces";
|
|
@@ -34,6 +35,7 @@ export interface IStructuredDataState {
|
|
|
34
35
|
schemaVersion: string;
|
|
35
36
|
errors: IErrorItem[];
|
|
36
37
|
validated: boolean;
|
|
38
|
+
contentFilters: Record<string, IStructuredDataQueryValues> | null;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export const initialState = {
|
|
@@ -51,6 +53,7 @@ export const initialState = {
|
|
|
51
53
|
schemaVersion: "",
|
|
52
54
|
errors: [],
|
|
53
55
|
validated: false,
|
|
56
|
+
contentFilters: null,
|
|
54
57
|
};
|
|
55
58
|
|
|
56
59
|
export function reducer(state = initialState, action: StructuredDataActionsCreators): IStructuredDataState {
|
|
@@ -70,6 +73,7 @@ export function reducer(state = initialState, action: StructuredDataActionsCreat
|
|
|
70
73
|
case SET_SCHEMA_VERSION:
|
|
71
74
|
case SET_ERRORS:
|
|
72
75
|
case SET_VALIDATED:
|
|
76
|
+
case SET_CONTENT_FILTERS:
|
|
73
77
|
return { ...state, ...action.payload };
|
|
74
78
|
default:
|
|
75
79
|
return state;
|
package/src/helpers/fields.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as components from "@ax/components/Fields";
|
|
2
2
|
|
|
3
|
-
const getFieldByPath = (name: string) =>
|
|
3
|
+
const getFieldByPath = (name: string): (() => JSX.Element) => (components as Record<string, any>)[name];
|
|
4
4
|
|
|
5
5
|
export { getFieldByPath };
|
package/src/helpers/index.tsx
CHANGED
|
@@ -99,6 +99,8 @@ import { isDevelopment } from "./environment";
|
|
|
99
99
|
|
|
100
100
|
import { getDefaultTheme } from "./themes";
|
|
101
101
|
|
|
102
|
+
import { parseTheme } from "./parseTheme";
|
|
103
|
+
|
|
102
104
|
export {
|
|
103
105
|
isComponentEmpty,
|
|
104
106
|
setAsContainedComponent,
|
|
@@ -180,4 +182,5 @@ export {
|
|
|
180
182
|
getDefaultNavigationModules,
|
|
181
183
|
isMultipleNavigationModules,
|
|
182
184
|
areEqual,
|
|
185
|
+
parseTheme,
|
|
183
186
|
};
|