@griddo/ax 1.58.6 → 1.59.2
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/package.json +2 -2
- package/src/GlobalStore.tsx +3 -1
- package/src/api/checkgroups.tsx +1 -1
- package/src/api/domains.tsx +26 -0
- package/src/api/index.tsx +3 -1
- package/src/api/sites.tsx +25 -8
- package/src/api/utils.tsx +1 -1
- package/src/components/Browser/index.tsx +8 -3
- package/src/components/ElementsTooltip/index.tsx +23 -8
- package/src/components/ElementsTooltip/style.tsx +4 -5
- package/src/components/ErrorCenter/index.tsx +11 -1
- package/src/components/ErrorCenter/style.tsx +4 -3
- package/src/components/Fields/CheckGroup/index.tsx +5 -4
- package/src/components/Fields/ComponentArray/MixableComponentArray/AddItemButton/index.tsx +1 -0
- package/src/components/Fields/ReferenceField/Context/index.tsx +10 -6
- package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +2 -2
- package/src/components/Fields/ReferenceField/ItemList/index.tsx +15 -14
- package/src/components/FieldsBehavior/index.tsx +2 -1
- package/src/components/FloatingMenu/index.tsx +3 -1
- package/src/components/FloatingMenu/style.tsx +7 -5
- package/src/components/Gallery/GalleryPanel/DetailPanel/index.tsx +17 -19
- package/src/components/Gallery/GalleryPanel/DetailPanel/style.tsx +32 -19
- package/src/components/Gallery/style.tsx +1 -1
- package/src/components/Icon/components/Category.js +5 -6
- package/src/components/Icon/components/Refresh.js +12 -0
- package/src/components/Icon/svgs/Category.svg +1 -1
- package/src/components/Icon/svgs/Refresh.svg +3 -0
- package/src/components/Lists/style.tsx +10 -9
- package/src/components/MainWrapper/AppBar/index.tsx +16 -5
- package/src/components/MainWrapper/AppBar/style.tsx +2 -1
- package/src/components/SideModal/index.tsx +10 -4
- package/src/components/TableCounter/style.tsx +1 -4
- package/src/components/TableFilters/CategoryFilter/index.tsx +92 -0
- package/src/{modules/Content/HeaderMenus/Translations → components/TableFilters/CategoryFilter}/style.tsx +4 -3
- package/src/components/TableFilters/CustomizeFilters/index.tsx +52 -0
- package/src/components/TableFilters/CustomizeFilters/style.tsx +28 -0
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Live → components/TableFilters/LiveFilter}/index.tsx +18 -6
- package/src/{modules/Content/HeaderMenus/Live → components/TableFilters/LiveFilter}/style.tsx +0 -0
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Name → components/TableFilters/NameFilter}/index.tsx +18 -9
- package/src/{modules/Content/HeaderMenus/Name → components/TableFilters/NameFilter}/style.tsx +0 -0
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Site → components/TableFilters/SiteFilter}/index.tsx +3 -3
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Site → components/TableFilters/SiteFilter}/style.tsx +1 -1
- package/src/{modules/Content/HeaderMenus/Status → components/TableFilters/StatusFilter}/index.tsx +7 -4
- package/src/{modules/Content/HeaderMenus/Status → components/TableFilters/StatusFilter}/style.tsx +0 -0
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Translations → components/TableFilters/TranslationsFilter}/index.tsx +4 -4
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Translations → components/TableFilters/TranslationsFilter}/style.tsx +0 -0
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Types → components/TableFilters/TypeFilter}/index.tsx +13 -9
- package/src/{modules/StructuredData/StructuredDataList/HeaderMenus/Types → components/TableFilters/TypeFilter}/style.tsx +1 -1
- package/src/components/TableFilters/index.tsx +19 -0
- package/src/components/Tag/index.tsx +1 -1
- package/src/components/Tag/style.tsx +10 -11
- package/src/components/index.tsx +19 -0
- package/src/containers/Domains/actions.tsx +51 -0
- package/src/containers/Domains/constants.tsx +5 -0
- package/src/containers/Domains/index.tsx +4 -0
- package/src/containers/Domains/interfaces.tsx +9 -0
- package/src/containers/Domains/reducer.tsx +22 -0
- package/src/containers/Gallery/actions.tsx +0 -1
- package/src/containers/PageEditor/actions.tsx +7 -0
- package/src/containers/PageEditor/utils.tsx +1 -1
- package/src/containers/Settings/Languages/constants.tsx +3 -3
- package/src/containers/Settings/Languages/index.tsx +2 -5
- package/src/containers/Sites/actions.tsx +3 -2
- package/src/containers/StructuredData/actions.tsx +62 -3
- package/src/containers/StructuredData/constants.tsx +4 -0
- package/src/containers/StructuredData/interfaces.tsx +13 -1
- package/src/containers/StructuredData/reducer.tsx +9 -1
- package/src/forms/editor.tsx +4 -0
- package/src/forms/elements.tsx +2 -5
- package/src/forms/index.tsx +2 -1
- package/src/forms/validators.tsx +12 -5
- package/src/helpers/arrays.tsx +12 -1
- package/src/helpers/index.tsx +4 -1
- package/src/helpers/strings.tsx +7 -0
- package/src/hooks/content.tsx +41 -0
- package/src/hooks/index.tsx +3 -1
- package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/style.tsx +9 -9
- package/src/modules/Content/BulkHeader/TableHeader/index.tsx +95 -24
- package/src/modules/Content/BulkHeader/TableHeader/style.tsx +6 -19
- package/src/modules/Content/BulkHeader/index.tsx +16 -0
- package/src/modules/Content/ContentFilters/index.tsx +4 -4
- package/src/modules/Content/OptionTable/style.tsx +1 -1
- package/src/modules/Content/PageItem/atoms.tsx +28 -0
- package/src/modules/Content/PageItem/index.tsx +67 -24
- package/src/modules/Content/PageItem/style.tsx +14 -7
- package/src/modules/Content/hooks.tsx +27 -17
- package/src/modules/Content/index.tsx +53 -6
- package/src/modules/GlobalEditor/index.tsx +5 -11
- package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/index.tsx +61 -0
- package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/style.tsx +30 -0
- package/src/modules/GlobalSettings/Robots/Item/index.tsx +33 -0
- package/src/modules/GlobalSettings/Robots/Item/style.tsx +28 -0
- package/src/modules/GlobalSettings/Robots/index.tsx +120 -0
- package/src/modules/GlobalSettings/Robots/style.tsx +32 -0
- package/src/modules/GlobalSettings/index.tsx +26 -0
- package/src/modules/PageEditor/index.tsx +2 -5
- package/src/modules/Settings/Globals/style.tsx +1 -1
- package/src/modules/StructuredData/Form/ConnectedField/index.tsx +10 -2
- package/src/modules/StructuredData/Form/index.tsx +48 -9
- package/src/modules/StructuredData/Form/style.tsx +3 -6
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/index.tsx +84 -35
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/style.tsx +6 -25
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/index.tsx +10 -1
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/atoms.tsx +24 -3
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +53 -22
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/style.tsx +16 -9
- package/src/modules/StructuredData/StructuredDataList/OptionTable/style.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/hooks.tsx +9 -2
- package/src/modules/StructuredData/StructuredDataList/index.tsx +45 -5
- package/src/routes/multisite.tsx +8 -0
- package/src/types/index.tsx +28 -11
- package/src/modules/Content/HeaderMenus/Live/index.tsx +0 -93
- package/src/modules/Content/HeaderMenus/Name/index.tsx +0 -52
- package/src/modules/Content/HeaderMenus/Translations/index.tsx +0 -62
- package/src/modules/Content/HeaderMenus/Types/index.tsx +0 -73
- package/src/modules/Content/HeaderMenus/Types/style.tsx +0 -34
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Live/style.tsx +0 -37
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Name/style.tsx +0 -29
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Status/index.tsx +0 -47
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Status/style.tsx +0 -30
|
@@ -15,25 +15,24 @@ const CheckCell = styled(Cell)`
|
|
|
15
15
|
const NameCell = styled(Cell)`
|
|
16
16
|
${(p) => p.theme.textStyle.uiL};
|
|
17
17
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
18
|
-
width: 20%;
|
|
19
18
|
flex-grow: 1;
|
|
20
19
|
`;
|
|
21
20
|
|
|
22
21
|
const TypeCell = styled(Cell)`
|
|
23
|
-
width: 230px;
|
|
24
22
|
align-items: center;
|
|
23
|
+
flex: 0 0 170px;
|
|
25
24
|
`;
|
|
26
25
|
|
|
27
26
|
const SiteCell = styled(Cell)`
|
|
28
|
-
|
|
27
|
+
flex: 0 0 170px;
|
|
29
28
|
align-items: center;
|
|
30
29
|
`;
|
|
31
30
|
|
|
32
31
|
const ActionsCell = styled(Cell)`
|
|
33
|
-
|
|
32
|
+
flex: 0 0 100px;
|
|
34
33
|
`;
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
const ActionsWrapper = styled.div`
|
|
37
36
|
opacity: 0;
|
|
38
37
|
transition: opacity 0.1s;
|
|
39
38
|
text-align: right;
|
|
@@ -41,13 +40,13 @@ export const ActionsWrapper = styled.div`
|
|
|
41
40
|
|
|
42
41
|
const TransCell = styled(Cell)`
|
|
43
42
|
${(p) => p.theme.textStyle.uiXS};
|
|
44
|
-
width: 115px;
|
|
45
43
|
align-items: center;
|
|
46
44
|
position: relative;
|
|
45
|
+
flex: 0 0 115px;
|
|
47
46
|
`;
|
|
48
47
|
|
|
49
48
|
const LiveCell = styled(Cell)`
|
|
50
|
-
|
|
49
|
+
flex: 0 0 80px;
|
|
51
50
|
align-items: center;
|
|
52
51
|
svg {
|
|
53
52
|
width: ${(p) => p.theme.spacing.m};
|
|
@@ -56,7 +55,7 @@ const LiveCell = styled(Cell)`
|
|
|
56
55
|
`;
|
|
57
56
|
|
|
58
57
|
const StatusCell = styled(Cell)`
|
|
59
|
-
|
|
58
|
+
flex: 0 0 170px;
|
|
60
59
|
align-items: center;
|
|
61
60
|
div:nth-child(2) {
|
|
62
61
|
margin-top: ${(p) => p.theme.spacing.xs};
|
|
@@ -75,6 +74,12 @@ const StyledActionMenu = styled(ActionMenu)`
|
|
|
75
74
|
margin-left: auto;
|
|
76
75
|
`;
|
|
77
76
|
|
|
77
|
+
const CategoryCell = styled(Cell)`
|
|
78
|
+
flex: 0 0 150px;
|
|
79
|
+
align-items: center;
|
|
80
|
+
position: relative;
|
|
81
|
+
`;
|
|
82
|
+
|
|
78
83
|
const StructuredDataRow = styled(Row)<{ disabled: boolean }>`
|
|
79
84
|
cursor: ${(p) => (p.disabled ? "default" : "pointer")};
|
|
80
85
|
&:hover {
|
|
@@ -96,7 +101,7 @@ const FlagsWrapper = styled.div`
|
|
|
96
101
|
|
|
97
102
|
const SeoCell = styled(Cell)`
|
|
98
103
|
${(p) => p.theme.textStyle.uiXS};
|
|
99
|
-
|
|
104
|
+
flex: 0 0 124px;
|
|
100
105
|
`;
|
|
101
106
|
|
|
102
107
|
const StyledSeo = styled.div`
|
|
@@ -150,6 +155,7 @@ export {
|
|
|
150
155
|
CheckCell,
|
|
151
156
|
NameCell,
|
|
152
157
|
ActionsCell,
|
|
158
|
+
ActionsWrapper,
|
|
153
159
|
StyledActionMenu,
|
|
154
160
|
TransCell,
|
|
155
161
|
LiveCell,
|
|
@@ -165,4 +171,5 @@ export {
|
|
|
165
171
|
StyledClose,
|
|
166
172
|
FloatingSeo,
|
|
167
173
|
ModalContent,
|
|
174
|
+
CategoryCell,
|
|
168
175
|
};
|
|
@@ -43,7 +43,7 @@ export const ThumbnailWrapper = styled.div`
|
|
|
43
43
|
export const Thumbnail = styled.div<{ backgroundUrl: string | boolean }>`
|
|
44
44
|
background: ${(p) => (p.backgroundUrl ? `url(${p.backgroundUrl}) no-repeat` : "")};
|
|
45
45
|
background-size: cover;
|
|
46
|
-
background-position:
|
|
46
|
+
background-position: top;
|
|
47
47
|
border-radius: 4px;
|
|
48
48
|
min-width: calc(${(p) => p.theme.spacing.l} * 3);
|
|
49
49
|
height: 100%;
|
|
@@ -24,12 +24,13 @@ const useFilterQuery = (): IUseFilterQuery => {
|
|
|
24
24
|
liveStatus: "all",
|
|
25
25
|
order: "",
|
|
26
26
|
filterSites: "all",
|
|
27
|
+
categories: "all",
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
const [query, setQuery] = useState(initialQueryValues);
|
|
30
31
|
|
|
31
32
|
const setFilterQuery = (filterValues: IStructuredDataQueryValues) => {
|
|
32
|
-
const { types, translated, liveStatus, order, filterSites } = filterValues;
|
|
33
|
+
const { types, translated, liveStatus, order, filterSites, categories } = filterValues;
|
|
33
34
|
let filterQuery = "";
|
|
34
35
|
|
|
35
36
|
const currentQuery = (pointer: string, values: string) => {
|
|
@@ -45,12 +46,13 @@ const useFilterQuery = (): IUseFilterQuery => {
|
|
|
45
46
|
if (isNotInitialValue("liveStatus")) filterQuery = currentQuery("liveStatus", liveStatus);
|
|
46
47
|
if (isNotInitialValue("order")) filterQuery = currentQuery("order", order);
|
|
47
48
|
if (isNotInitialValue("filterSites")) filterQuery = currentQuery("filterSites", filterSites);
|
|
49
|
+
if (isNotInitialValue("categories")) filterQuery = currentQuery("categories", categories);
|
|
48
50
|
|
|
49
51
|
return filterQuery;
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
const setFiltersSelection = (pointer: string, filter: string, isAscendent?: boolean) => {
|
|
53
|
-
const { types, translated, liveStatus, order, filterSites } = query;
|
|
55
|
+
const { types, translated, liveStatus, order, filterSites, categories } = query;
|
|
54
56
|
const orderMethod = isAscendent ? "asc" : "desc";
|
|
55
57
|
const filterValues = {
|
|
56
58
|
types: pointer === "types" ? filter : types,
|
|
@@ -58,6 +60,7 @@ const useFilterQuery = (): IUseFilterQuery => {
|
|
|
58
60
|
liveStatus: pointer === "liveStatus" ? filter : liveStatus,
|
|
59
61
|
order: pointer === "order" ? `${filter}-${orderMethod}` : order,
|
|
60
62
|
filterSites: pointer === "filterSites" ? filter : filterSites,
|
|
63
|
+
categories: pointer === "categories" ? filter : categories,
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
setQuery(filterValues);
|
|
@@ -65,9 +68,12 @@ const useFilterQuery = (): IUseFilterQuery => {
|
|
|
65
68
|
return filterValues;
|
|
66
69
|
};
|
|
67
70
|
|
|
71
|
+
const resetFilterQuery = () => setQuery(initialQueryValues);
|
|
72
|
+
|
|
68
73
|
return {
|
|
69
74
|
setFiltersSelection,
|
|
70
75
|
setFilterQuery,
|
|
76
|
+
resetFilterQuery,
|
|
71
77
|
filterValues: query,
|
|
72
78
|
};
|
|
73
79
|
};
|
|
@@ -80,6 +86,7 @@ interface IUseSortedListStatus {
|
|
|
80
86
|
interface IUseFilterQuery {
|
|
81
87
|
setFiltersSelection(pointer: string, filter: string, isAscendent?: boolean): IStructuredDataQueryValues;
|
|
82
88
|
setFilterQuery(filterValues: IStructuredDataQueryValues): string;
|
|
89
|
+
resetFilterQuery(): void;
|
|
83
90
|
filterValues: IStructuredDataQueryValues;
|
|
84
91
|
}
|
|
85
92
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
IGetGlobalPagesParams,
|
|
16
16
|
IPage,
|
|
17
17
|
ICheck,
|
|
18
|
+
IColumn,
|
|
18
19
|
} from "@ax/types";
|
|
19
20
|
import {
|
|
20
21
|
ISetCurrentPageIDAction,
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
ISetCurrentPageNameAction,
|
|
23
24
|
pageStatus,
|
|
24
25
|
} from "@ax/containers/PageEditor/interfaces";
|
|
25
|
-
import { useBulkSelection, useModal, useToast } from "@ax/hooks";
|
|
26
|
+
import { useBulkSelection, useModal, useToast, useCategoryColors } from "@ax/hooks";
|
|
26
27
|
import { appActions } from "@ax/containers/App";
|
|
27
28
|
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
28
29
|
import { sitesActions } from "@ax/containers/Sites";
|
|
@@ -99,13 +100,14 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
99
100
|
const { isOpen: isNewOpen, toggleModal: toggleNewModal } = useModal();
|
|
100
101
|
const { isOpen: isDeleteOpen, toggleModal: toggleDeleteModal } = useModal();
|
|
101
102
|
const { sortedListStatus, setSortedListStatus } = useSortedListStatus();
|
|
102
|
-
const { setFiltersSelection, setFilterQuery, filterValues } = useFilterQuery();
|
|
103
|
+
const { setFiltersSelection, setFilterQuery, filterValues, resetFilterQuery } = useFilterQuery();
|
|
103
104
|
const [currentFilterQuery, setCurrentFilterQuery] = useState("");
|
|
104
105
|
const history = useHistory();
|
|
105
106
|
const [isFirstRender, setIsFirstRender] = useState(true);
|
|
106
107
|
const [deleteAllVersions, setDeleteAllVersions] = useState(false);
|
|
107
108
|
const [arePagesTranslated, setArePagesTranslated] = useState(false);
|
|
108
109
|
const { state: locationState } = useLocation<{ isFromEditor: boolean }>();
|
|
110
|
+
const { categoryColors, addCategoryColors } = useCategoryColors();
|
|
109
111
|
|
|
110
112
|
const scope = currentSiteID ? "site" : "global";
|
|
111
113
|
const isDataEditable = !currentStructuredData || currentStructuredData.editable;
|
|
@@ -116,6 +118,30 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
116
118
|
? currentSitePages.map((page: IPage) => page.id)
|
|
117
119
|
: currentDataContent.map((data: IStructuredDataContent) => data.id);
|
|
118
120
|
|
|
121
|
+
const categoryColumns =
|
|
122
|
+
currentStructuredData && currentStructuredData.schema
|
|
123
|
+
? currentStructuredData.schema.fields.filter((field: any) => field.showList)
|
|
124
|
+
: [];
|
|
125
|
+
|
|
126
|
+
const defaultColumns: Record<string, IColumn> = {
|
|
127
|
+
live: { title: "Live", show: true },
|
|
128
|
+
status: { title: "Status", show: true },
|
|
129
|
+
translation: { title: "Trans.", show: true },
|
|
130
|
+
seo: { title: "SEO", show: true },
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const extraColumns = categoryColumns.reduce((acc: Record<string, IColumn>, cur: any) => {
|
|
134
|
+
acc[cur.key] = { title: cur.title, show: false };
|
|
135
|
+
return acc;
|
|
136
|
+
}, {});
|
|
137
|
+
|
|
138
|
+
const allColumns = { type: { title: "Types", show: true }, ...extraColumns, ...defaultColumns };
|
|
139
|
+
const filterColumns = { site: { title: "Site", show: true }, ...extraColumns, ...defaultColumns };
|
|
140
|
+
|
|
141
|
+
const initialColumns = isAllPages ? allColumns : filterColumns;
|
|
142
|
+
|
|
143
|
+
const [columnsState, setColumnsState] = useState(initialColumns);
|
|
144
|
+
|
|
119
145
|
const {
|
|
120
146
|
resetBulkSelection,
|
|
121
147
|
selectedItems,
|
|
@@ -144,10 +170,10 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
144
170
|
(id: string, filterQuery?: string) => {
|
|
145
171
|
const params: IGetStructuredDataParams = { ...getParams(), dataID: null };
|
|
146
172
|
params.dataID = id;
|
|
147
|
-
|
|
173
|
+
params.filterQuery = filterQuery;
|
|
148
174
|
getStructuredDataContents(params);
|
|
149
175
|
},
|
|
150
|
-
[getParams,
|
|
176
|
+
[getParams, getStructuredDataContents]
|
|
151
177
|
);
|
|
152
178
|
|
|
153
179
|
const handleGetGlobalPages = () => {
|
|
@@ -157,7 +183,7 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
157
183
|
};
|
|
158
184
|
|
|
159
185
|
const handleGetData = () => {
|
|
160
|
-
isStructuredDataFromPage ? handleGetGlobalPages() : getStructuredData(filter);
|
|
186
|
+
isStructuredDataFromPage ? handleGetGlobalPages() : getStructuredData(filter, currentFilterQuery);
|
|
161
187
|
};
|
|
162
188
|
|
|
163
189
|
const resetFilter = () => {
|
|
@@ -180,6 +206,11 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
180
206
|
filterItems("filterSites", "all");
|
|
181
207
|
}
|
|
182
208
|
unselectAllItems();
|
|
209
|
+
if (filter === "all-pages") {
|
|
210
|
+
setColumnsState(filter === "all-pages" ? allColumns : filterColumns);
|
|
211
|
+
} else {
|
|
212
|
+
setColumnsState({ site: { title: "Site", show: true }, ...extraColumns, ...initialColumns });
|
|
213
|
+
}
|
|
183
214
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
215
|
}, [filter]);
|
|
185
216
|
|
|
@@ -232,6 +263,8 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
232
263
|
};
|
|
233
264
|
|
|
234
265
|
const handleMenuClick = (dataID: string) => {
|
|
266
|
+
resetFilterQuery();
|
|
267
|
+
setCurrentFilterQuery("");
|
|
235
268
|
setPage(firstPage);
|
|
236
269
|
setSelectedStructuredData(dataID, scope);
|
|
237
270
|
};
|
|
@@ -359,6 +392,9 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
359
392
|
filterItems={filterItems}
|
|
360
393
|
filterValues={filterValues}
|
|
361
394
|
isAllPages={isAllPages}
|
|
395
|
+
categoryColumns={categoryColumns}
|
|
396
|
+
columns={columnsState}
|
|
397
|
+
setColumns={setColumnsState}
|
|
362
398
|
/>
|
|
363
399
|
);
|
|
364
400
|
|
|
@@ -447,6 +483,10 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
447
483
|
getGlobalPages={handleGetGlobalPages}
|
|
448
484
|
toggleToast={togglePageToast}
|
|
449
485
|
setDeletedItem={setDeletedItem}
|
|
486
|
+
categoryColumns={categoryColumns}
|
|
487
|
+
columns={columnsState}
|
|
488
|
+
categoryColors={categoryColors}
|
|
489
|
+
addCategoryColors={addCategoryColors}
|
|
450
490
|
/>
|
|
451
491
|
);
|
|
452
492
|
});
|
package/src/routes/multisite.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import Profile from "../modules/Users/Profile";
|
|
|
7
7
|
import UserCreate from "../modules/Users/UserCreate";
|
|
8
8
|
import UserEdit from "../modules/Users/UserEdit";
|
|
9
9
|
import Editor from "./../modules/GlobalEditor";
|
|
10
|
+
import GlobalSettings from "./../modules/GlobalSettings";
|
|
10
11
|
|
|
11
12
|
export default [
|
|
12
13
|
{ path: "/sites", component: Sites, name: "Sites", showInNav: true, icon: "Project" },
|
|
@@ -25,4 +26,11 @@ export default [
|
|
|
25
26
|
showInNav: false,
|
|
26
27
|
hideNav: true,
|
|
27
28
|
},
|
|
29
|
+
{
|
|
30
|
+
path: `/settings/robots`,
|
|
31
|
+
component: GlobalSettings,
|
|
32
|
+
name: "Settings",
|
|
33
|
+
showInNav: true,
|
|
34
|
+
icon: "Settings",
|
|
35
|
+
},
|
|
28
36
|
];
|
package/src/types/index.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { ILanguageState } from "@ax/containers/Settings/Languages/reducer";
|
|
|
8
8
|
import { IDataPacksState } from "@ax/containers/Settings/DataPacks/reducer";
|
|
9
9
|
import { IUsersState } from "@ax/containers/Users/reducer";
|
|
10
10
|
import { IGalleryState } from "@ax/containers/Gallery/reducer";
|
|
11
|
+
import { IDomainsState } from "@ax/containers/Domains/reducer";
|
|
11
12
|
|
|
12
13
|
export interface IBreadcrumbItem {
|
|
13
14
|
editorID: number;
|
|
@@ -179,6 +180,7 @@ export interface IRootState {
|
|
|
179
180
|
social: ISocialState;
|
|
180
181
|
users: IUsersState;
|
|
181
182
|
gallery: IGalleryState;
|
|
183
|
+
domains: IDomainsState;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
export interface IStyledProps {
|
|
@@ -415,6 +417,8 @@ export interface IRelatedPage {
|
|
|
415
417
|
origin: string;
|
|
416
418
|
pageId: number;
|
|
417
419
|
url: string;
|
|
420
|
+
originalPageId: number;
|
|
421
|
+
originalStructuredDataId: number;
|
|
418
422
|
}
|
|
419
423
|
|
|
420
424
|
export interface IStructuredDataContent {
|
|
@@ -592,6 +596,7 @@ export interface IStructuredDataQueryValues {
|
|
|
592
596
|
liveStatus: string;
|
|
593
597
|
order: string;
|
|
594
598
|
filterSites: string;
|
|
599
|
+
categories: string;
|
|
595
600
|
}
|
|
596
601
|
|
|
597
602
|
export interface IDataPackConfigImportCategory {
|
|
@@ -634,6 +639,11 @@ export interface IImageForm {
|
|
|
634
639
|
tags: string[];
|
|
635
640
|
}
|
|
636
641
|
|
|
642
|
+
export interface IColumn {
|
|
643
|
+
title: string;
|
|
644
|
+
show: boolean;
|
|
645
|
+
}
|
|
646
|
+
|
|
637
647
|
export interface IGlobalLanguage {
|
|
638
648
|
id: number;
|
|
639
649
|
locale: string;
|
|
@@ -643,17 +653,24 @@ export interface IGlobalLanguage {
|
|
|
643
653
|
}
|
|
644
654
|
|
|
645
655
|
export interface IContentType {
|
|
646
|
-
clone: any
|
|
647
|
-
dataPacks: string[]
|
|
648
|
-
defaultValues: any
|
|
649
|
-
editable: boolean
|
|
650
|
-
fromPage: boolean
|
|
651
|
-
id: string
|
|
652
|
-
local: false
|
|
653
|
-
schema: any
|
|
654
|
-
taxonomy: boolean
|
|
655
|
-
title: string
|
|
656
|
-
translate: boolean
|
|
656
|
+
clone: any;
|
|
657
|
+
dataPacks: string[];
|
|
658
|
+
defaultValues: any;
|
|
659
|
+
editable: boolean;
|
|
660
|
+
fromPage: boolean;
|
|
661
|
+
id: string;
|
|
662
|
+
local: false;
|
|
663
|
+
schema: any;
|
|
664
|
+
taxonomy: boolean;
|
|
665
|
+
title: string;
|
|
666
|
+
translate: boolean;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export interface IDomainRobot {
|
|
670
|
+
id: number;
|
|
671
|
+
path: string;
|
|
672
|
+
fullUrl: string;
|
|
673
|
+
content: string;
|
|
657
674
|
}
|
|
658
675
|
|
|
659
676
|
export type Field =
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
import { CheckGroup, Icon, FloatingMenu, ListTitle } from "@ax/components";
|
|
4
|
-
import { checkgroups } from "@ax/api";
|
|
5
|
-
import { areEquals, isReqOk } from "@ax/helpers";
|
|
6
|
-
import { IPageLiveStatus } from "@ax/types";
|
|
7
|
-
|
|
8
|
-
import * as S from "./style";
|
|
9
|
-
|
|
10
|
-
const Live = (props: ILiveProps): JSX.Element => {
|
|
11
|
-
const { filterItems } = props;
|
|
12
|
-
|
|
13
|
-
const filters: Array<{ name: string; value: string; title: string; icon?: string }> = [
|
|
14
|
-
{
|
|
15
|
-
name: "all",
|
|
16
|
-
value: "all",
|
|
17
|
-
title: "All",
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const initialState = ["all"];
|
|
22
|
-
const selectAllOption = "all";
|
|
23
|
-
const [selectedValue, setSelectedValue] = useState(initialState);
|
|
24
|
-
const [options, setOptions] = useState(filters);
|
|
25
|
-
|
|
26
|
-
const getLiveStatusValues = async () => {
|
|
27
|
-
try {
|
|
28
|
-
const items = await checkgroups.getLiveStatusItems();
|
|
29
|
-
if (items && isReqOk(items.status)) {
|
|
30
|
-
return items.data;
|
|
31
|
-
}
|
|
32
|
-
} catch (e) {
|
|
33
|
-
console.log(e);
|
|
34
|
-
}
|
|
35
|
-
return false;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
getLiveStatusValues()
|
|
40
|
-
.then((items) => {
|
|
41
|
-
items.forEach((item: IPageLiveStatus) => {
|
|
42
|
-
const newFilter = {
|
|
43
|
-
name: item.status,
|
|
44
|
-
value: item.status,
|
|
45
|
-
title: item.title,
|
|
46
|
-
icon: item.status,
|
|
47
|
-
};
|
|
48
|
-
filters.push(newFilter);
|
|
49
|
-
});
|
|
50
|
-
setOptions(filters);
|
|
51
|
-
})
|
|
52
|
-
.catch((apiError) => console.log(apiError));
|
|
53
|
-
|
|
54
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
-
}, []);
|
|
56
|
-
|
|
57
|
-
const setQuery = (selection: any) => {
|
|
58
|
-
if (!selection.length) {
|
|
59
|
-
selection = initialState;
|
|
60
|
-
}
|
|
61
|
-
setSelectedValue(selection);
|
|
62
|
-
const queryFilters = selection.join(",");
|
|
63
|
-
const pointer = "liveStatus";
|
|
64
|
-
filterItems(pointer, queryFilters);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const isActive = !areEquals(selectedValue, initialState);
|
|
68
|
-
const Header = () => (
|
|
69
|
-
<S.MenuWrapper>
|
|
70
|
-
<S.LiveOptions isActive={isActive}>
|
|
71
|
-
Live
|
|
72
|
-
<S.IconsWrapper>
|
|
73
|
-
<Icon name="Filter" size="16" />
|
|
74
|
-
</S.IconsWrapper>
|
|
75
|
-
</S.LiveOptions>
|
|
76
|
-
</S.MenuWrapper>
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<FloatingMenu Button={Header} position="left" closeOnSelect={false}>
|
|
81
|
-
<ListTitle>Filter by status</ListTitle>
|
|
82
|
-
<S.ChecksWrapper>
|
|
83
|
-
<CheckGroup options={options} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
|
|
84
|
-
</S.ChecksWrapper>
|
|
85
|
-
</FloatingMenu>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
interface ILiveProps {
|
|
90
|
-
filterItems(pointer: string, filter: string): void;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default Live;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { Icon, FloatingMenu, ListTitle, ListItem } from "@ax/components";
|
|
4
|
-
|
|
5
|
-
import * as S from "./style";
|
|
6
|
-
|
|
7
|
-
const NameHeader = ({ sortItems, sortedState }: INameHeaderProps) => {
|
|
8
|
-
const { isAscending, sortedByTitle, sortedByURL } = sortedState;
|
|
9
|
-
const sortByName = (isAscending: boolean) => sortItems("title", isAscending);
|
|
10
|
-
const sortAscendingURL = () => sortItems("slug", true);
|
|
11
|
-
const sortAscendingName = () => sortByName(true);
|
|
12
|
-
const sortDescendingName = () => sortByName(false);
|
|
13
|
-
|
|
14
|
-
const SortedStateArrow = () =>
|
|
15
|
-
isAscending ? <Icon name="FullArrowUp" size="16" /> : <Icon name="FullArrowDown" size="16" />;
|
|
16
|
-
const isActive = sortedByTitle || sortedByURL;
|
|
17
|
-
|
|
18
|
-
const Header = () => (
|
|
19
|
-
<S.NameHeader isActive={isActive}>
|
|
20
|
-
Name & URL
|
|
21
|
-
<S.IconsWrapper>
|
|
22
|
-
{(sortedByTitle || sortedByURL) && <SortedStateArrow />}
|
|
23
|
-
<S.InteractiveArrow>
|
|
24
|
-
<Icon name="DownArrow" size="16" />
|
|
25
|
-
</S.InteractiveArrow>
|
|
26
|
-
</S.IconsWrapper>
|
|
27
|
-
</S.NameHeader>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<FloatingMenu Button={Header} position="left">
|
|
32
|
-
<ListTitle>Name Sorting</ListTitle>
|
|
33
|
-
<ListItem isSelected={sortedByTitle && isAscending} onClick={sortAscendingName}>
|
|
34
|
-
Ascendent
|
|
35
|
-
</ListItem>
|
|
36
|
-
<ListItem isSelected={sortedByTitle && !isAscending} onClick={sortDescendingName}>
|
|
37
|
-
Descendent
|
|
38
|
-
</ListItem>
|
|
39
|
-
<ListTitle>URL Sorting</ListTitle>
|
|
40
|
-
<ListItem isSelected={sortedByURL} onClick={sortAscendingURL}>
|
|
41
|
-
Ascendent
|
|
42
|
-
</ListItem>
|
|
43
|
-
</FloatingMenu>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
interface INameHeaderProps {
|
|
48
|
-
sortedState: any;
|
|
49
|
-
sortItems(orderPointer: string, isAscendent: boolean): any;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default NameHeader;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import { CheckGroup, FloatingMenu, Icon, ListTitle } from "@ax/components";
|
|
4
|
-
|
|
5
|
-
import { areEquals } from "@ax/helpers";
|
|
6
|
-
|
|
7
|
-
import * as S from "./style";
|
|
8
|
-
|
|
9
|
-
const Translations = ({ filterItems }: ITranslationsProps) => {
|
|
10
|
-
const filters = [
|
|
11
|
-
{
|
|
12
|
-
name: "all",
|
|
13
|
-
value: "all",
|
|
14
|
-
title: "All",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "no",
|
|
18
|
-
value: "no",
|
|
19
|
-
title: "Not translated content",
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
const initialState = ["all"];
|
|
24
|
-
const selectAllOption = "all";
|
|
25
|
-
const [selectedValue, setSelectedValue] = useState(initialState);
|
|
26
|
-
|
|
27
|
-
const setQuery = (selection: any) => {
|
|
28
|
-
if (!selection.length) {
|
|
29
|
-
selection = initialState;
|
|
30
|
-
}
|
|
31
|
-
setSelectedValue(selection);
|
|
32
|
-
const queryFilters = selection.join("&");
|
|
33
|
-
const pointer = "translated";
|
|
34
|
-
filterItems(pointer, queryFilters);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const isActive = !areEquals(selectedValue, initialState);
|
|
38
|
-
|
|
39
|
-
const Header = () => (
|
|
40
|
-
<S.Translations isActive={isActive}>
|
|
41
|
-
Trans.
|
|
42
|
-
<S.IconsWrapper>
|
|
43
|
-
<Icon name="Filter" size="16" />
|
|
44
|
-
</S.IconsWrapper>
|
|
45
|
-
</S.Translations>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<FloatingMenu Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
|
|
50
|
-
<ListTitle>Filter by translations</ListTitle>
|
|
51
|
-
<S.ChecksWrapper>
|
|
52
|
-
<CheckGroup options={filters} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
|
|
53
|
-
</S.ChecksWrapper>
|
|
54
|
-
</FloatingMenu>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
interface ITranslationsProps {
|
|
59
|
-
filterItems(pointer: string, filter: string): void;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default Translations;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import { CheckGroup, FloatingMenu, Icon, ListTitle } from "@ax/components";
|
|
4
|
-
|
|
5
|
-
import { areEquals } from "@ax/helpers";
|
|
6
|
-
|
|
7
|
-
import * as S from "./style";
|
|
8
|
-
|
|
9
|
-
const Types = ({ filterItems }: ITypesProps) => {
|
|
10
|
-
const filters = [
|
|
11
|
-
{
|
|
12
|
-
name: "all",
|
|
13
|
-
value: "all",
|
|
14
|
-
title: "All content",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "unique",
|
|
18
|
-
value: "unique",
|
|
19
|
-
title: "Basic templates",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: "structuredData",
|
|
23
|
-
value: "structuredData",
|
|
24
|
-
title: "Content types",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const initialState = ["all"];
|
|
29
|
-
const selectAllOption = "all";
|
|
30
|
-
const [selectedValue, setSelectedValue] = useState(initialState);
|
|
31
|
-
|
|
32
|
-
const setFilterQuery = (selection: any) => {
|
|
33
|
-
if (!selection.length) {
|
|
34
|
-
selection = initialState;
|
|
35
|
-
}
|
|
36
|
-
setSelectedValue(selection);
|
|
37
|
-
const queryFilters = selection.join("&");
|
|
38
|
-
const pointer = "type";
|
|
39
|
-
filterItems(pointer, queryFilters);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const isActive = !areEquals(selectedValue, initialState);
|
|
43
|
-
|
|
44
|
-
const Header = () => (
|
|
45
|
-
<S.Types isActive={isActive}>
|
|
46
|
-
Types
|
|
47
|
-
<S.IconsWrapper>
|
|
48
|
-
<Icon name="Filter" size="16" />
|
|
49
|
-
</S.IconsWrapper>
|
|
50
|
-
</S.Types>
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<FloatingMenu Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
|
|
55
|
-
<ListTitle>Filter by types</ListTitle>
|
|
56
|
-
<S.ChecksWrapper>
|
|
57
|
-
<CheckGroup
|
|
58
|
-
options={filters}
|
|
59
|
-
value={selectedValue}
|
|
60
|
-
onChange={setFilterQuery}
|
|
61
|
-
selectAllOption={selectAllOption}
|
|
62
|
-
multipleSelection={false}
|
|
63
|
-
/>
|
|
64
|
-
</S.ChecksWrapper>
|
|
65
|
-
</FloatingMenu>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
interface ITypesProps {
|
|
70
|
-
filterItems(pointer: string, filter: string): void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default Types;
|