@griddo/ax 10.6.0 → 10.6.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/package.json +2 -2
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/MixableComponentArray.test.tsx +3 -3
- package/src/components/Button/style.tsx +1 -1
- package/src/components/ConfigPanel/Form/ConnectedField/NavConnectedField/index.tsx +2 -2
- package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/TemplateManager/index.tsx +2 -2
- package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/index.tsx +3 -3
- package/src/components/Fields/ComponentArray/MixableComponentArray/index.tsx +4 -3
- package/src/components/Fields/ImageField/index.tsx +19 -2
- package/src/components/Gallery/GalleryPanel/DetailPanel/index.tsx +8 -5
- package/src/components/Gallery/GalleryPanel/GalleryDragAndDrop/index.tsx +15 -5
- package/src/components/Gallery/GalleryPanel/GalleryDragAndDrop/style.tsx +1 -0
- package/src/components/Gallery/GalleryPanel/index.tsx +2 -11
- package/src/components/MenuGroup/index.tsx +81 -0
- package/src/components/MenuGroup/style.tsx +46 -0
- package/src/components/MenuItem/index.tsx +14 -7
- package/src/components/MenuItem/style.tsx +48 -26
- package/src/components/Nav/index.tsx +2 -2
- package/src/components/SideModal/index.tsx +2 -1
- package/src/components/Tooltip/index.tsx +1 -1
- package/src/components/index.tsx +2 -0
- package/src/containers/Gallery/actions.tsx +10 -2
- package/src/containers/Sites/actions.tsx +27 -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/helpers/index.tsx +2 -2
- package/src/helpers/themes.tsx +18 -13
- package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/index.tsx +2 -2
- package/src/modules/Content/BulkHeader/TableHeader/index.tsx +1 -5
- package/src/modules/Content/BulkHeader/TableHeader/style.tsx +6 -0
- package/src/modules/Content/ContentFilters/index.tsx +66 -41
- package/src/modules/Content/ContentFilters/style.tsx +4 -38
- package/src/modules/Content/ContentFilters/utils.tsx +47 -10
- package/src/modules/Content/OptionTable/index.tsx +13 -14
- package/src/modules/Content/index.tsx +26 -7
- package/src/modules/Content/utils.tsx +5 -5
- package/src/modules/Navigation/Defaults/Nav/index.tsx +4 -6
- package/src/modules/Navigation/Menus/List/Nav/index.tsx +2 -2
- package/src/modules/Settings/ContentTypes/DataPacks/Nav/index.tsx +6 -10
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/index.tsx +1 -6
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/style.tsx +6 -0
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/index.tsx +33 -41
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/style.tsx +4 -38
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/utils.tsx +44 -11
- package/src/modules/StructuredData/StructuredDataList/OptionTable/index.tsx +5 -5
- package/src/modules/StructuredData/StructuredDataList/index.tsx +1 -2
- package/src/modules/Users/UserForm/index.tsx +13 -27
- package/src/routes/multisite.tsx +1 -1
- package/src/routes/site.tsx +1 -1
- package/src/types/index.tsx +15 -0
- package/src/modules/Content/ContentFilters/constants.tsx +0 -15
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/constants.tsx +0 -21
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
ISiteRoles,
|
|
22
22
|
IPageLanguage,
|
|
23
23
|
IQueryValue,
|
|
24
|
+
IStructuredData,
|
|
24
25
|
} from "@ax/types";
|
|
25
26
|
import {
|
|
26
27
|
MainWrapper,
|
|
@@ -70,6 +71,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
70
71
|
filter,
|
|
71
72
|
template,
|
|
72
73
|
currentSitePages,
|
|
74
|
+
allSitePages,
|
|
73
75
|
totalItems,
|
|
74
76
|
lang,
|
|
75
77
|
siteLanguages,
|
|
@@ -79,6 +81,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
79
81
|
setCurrentPageName,
|
|
80
82
|
addTemplate,
|
|
81
83
|
getSitePages,
|
|
84
|
+
getAllSitePages,
|
|
82
85
|
updatePageStatus,
|
|
83
86
|
deletePage,
|
|
84
87
|
setLanguage,
|
|
@@ -160,7 +163,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
160
163
|
const pagesIds = currentSitePages && currentSitePages.map((page: any) => page.id);
|
|
161
164
|
const dataIds = currentDataContent && currentDataContent.map((data: any) => data.id);
|
|
162
165
|
const contentIds = isStructuredData ? dataIds : pagesIds;
|
|
163
|
-
const currentSitePagesTemplatesIds =
|
|
166
|
+
const currentSitePagesTemplatesIds = allSitePages && allSitePages.map((page: any) => page.templateId);
|
|
164
167
|
const currentSitesByLang = sitesByLang?.filter((site: ISite) =>
|
|
165
168
|
user?.roles.find((siteRole: ISiteRoles) => siteRole.siteId === site.id || siteRole.siteId === "all")
|
|
166
169
|
);
|
|
@@ -236,7 +239,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
236
239
|
} = useToast();
|
|
237
240
|
|
|
238
241
|
const getParams = useCallback(() => {
|
|
239
|
-
const siteID = currentSiteInfo
|
|
242
|
+
const siteID = currentSiteInfo.id;
|
|
240
243
|
const params = isStructuredData
|
|
241
244
|
? {
|
|
242
245
|
siteID,
|
|
@@ -259,7 +262,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
259
262
|
};
|
|
260
263
|
|
|
261
264
|
return params;
|
|
262
|
-
}, [filter, currentSiteInfo, isStructuredData, page, currentSearch
|
|
265
|
+
}, [filter, currentSiteInfo, isStructuredData, page, currentSearch]);
|
|
263
266
|
|
|
264
267
|
const getPages = async (params: any, filterQuery?: any) => {
|
|
265
268
|
const isStructuredDataPage = filter !== "unique-pages";
|
|
@@ -361,6 +364,11 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
361
364
|
}
|
|
362
365
|
}, [error]);
|
|
363
366
|
|
|
367
|
+
useEffect(() => {
|
|
368
|
+
const params = getParams();
|
|
369
|
+
getAllSitePages(params);
|
|
370
|
+
}, [lang]);
|
|
371
|
+
|
|
364
372
|
const bulkFilter = (bulkSelection: number[]) => filterByStatus(bulkSelection, currentSitePages);
|
|
365
373
|
|
|
366
374
|
const handleAddToBulk = (item: ICheck) => {
|
|
@@ -731,7 +739,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
731
739
|
|
|
732
740
|
const languageActions = isStructuredData ? dataLanguageActions : pageLanguageActions;
|
|
733
741
|
|
|
734
|
-
const title = currentSiteInfo ?
|
|
742
|
+
const title = currentSiteInfo ? currentSiteInfo.name : `Site Content`;
|
|
735
743
|
|
|
736
744
|
const options = {
|
|
737
745
|
filters: getOptionFilters(structuredData, activatedDataPacks),
|
|
@@ -819,7 +827,6 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
819
827
|
"Sorry, this content cannot be edited because it comes from an external source or belongs to a preconfigured system.";
|
|
820
828
|
|
|
821
829
|
const filterLabels = {
|
|
822
|
-
type: "Type",
|
|
823
830
|
liveStatus: "Live",
|
|
824
831
|
translated: "Translated",
|
|
825
832
|
categories: "Category",
|
|
@@ -837,7 +844,15 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
837
844
|
searchValue={currentSearch}
|
|
838
845
|
>
|
|
839
846
|
<S.ContentListWrapper>
|
|
840
|
-
<ContentFilters
|
|
847
|
+
<ContentFilters
|
|
848
|
+
current={filter}
|
|
849
|
+
dynamicValues={structuredData}
|
|
850
|
+
resetFilter={resetFilter}
|
|
851
|
+
setFilter={filterItems}
|
|
852
|
+
isAllowedToCreate={isAllowedToCreatePages}
|
|
853
|
+
addNew={addNewAction}
|
|
854
|
+
typeFilters={filterValues.type}
|
|
855
|
+
/>
|
|
841
856
|
<S.TableWrapper>
|
|
842
857
|
<ErrorToast ref={errorRef} />
|
|
843
858
|
{!isDataEditable && (
|
|
@@ -926,6 +941,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
926
941
|
const mapStateToProps = (state: IRootState) => ({
|
|
927
942
|
currentSiteInfo: state.sites.currentSiteInfo,
|
|
928
943
|
currentSitePages: state.sites.currentSitePages,
|
|
944
|
+
allSitePages: state.sites.allSitePages,
|
|
929
945
|
filter: state.sites.currentFilter,
|
|
930
946
|
template: state.pageEditor.template,
|
|
931
947
|
totalItems: state.sites.totalItems,
|
|
@@ -958,6 +974,7 @@ interface IDispatchProps {
|
|
|
958
974
|
setCurrentPageName(currentPageName: string): ISetCurrentPageNameAction;
|
|
959
975
|
addTemplate(template: string): void;
|
|
960
976
|
getSitePages(params: IGetSitePagesParams, structuredData?: string | undefined, filterQuery?: string): Promise<void>;
|
|
977
|
+
getAllSitePages(params: IGetSitePagesParams): Promise<void>;
|
|
961
978
|
updatePageStatus(ids: number[], status: string, updatePageStatus?: boolean): Promise<boolean>;
|
|
962
979
|
deletePage(params?: ISavePageParams): Promise<boolean>;
|
|
963
980
|
setHistoryPush(page: string, isEditor: boolean): Promise<void>;
|
|
@@ -994,6 +1011,7 @@ const mapDispatchToProps = {
|
|
|
994
1011
|
setHistoryPush: appActions.setHistoryPush,
|
|
995
1012
|
setLanguage: appActions.setLanguage,
|
|
996
1013
|
getSitePages: sitesActions.getSitePages,
|
|
1014
|
+
getAllSitePages: sitesActions.getAllSitePages,
|
|
997
1015
|
setCurrentPageID: pageEditorActions.setCurrentPageID,
|
|
998
1016
|
setCurrentPageStatus: pageEditorActions.setCurrentPageStatus,
|
|
999
1017
|
setCurrentPageName: pageEditorActions.setCurrentPageName,
|
|
@@ -1033,6 +1051,7 @@ interface IPagesProps {
|
|
|
1033
1051
|
isData: boolean;
|
|
1034
1052
|
currentSiteInfo: ISite | null;
|
|
1035
1053
|
currentSitePages: IPage[];
|
|
1054
|
+
allSitePages: IPage[];
|
|
1036
1055
|
filter: any;
|
|
1037
1056
|
template: string;
|
|
1038
1057
|
totalItems: number;
|
|
@@ -1041,7 +1060,7 @@ interface IPagesProps {
|
|
|
1041
1060
|
pageLanguages: any[];
|
|
1042
1061
|
errors: IErrorItem[];
|
|
1043
1062
|
siteLanguages: any[];
|
|
1044
|
-
structuredData:
|
|
1063
|
+
structuredData: IStructuredData[];
|
|
1045
1064
|
currentStructuredData: any;
|
|
1046
1065
|
currentDataContent: IStructuredDataContent[];
|
|
1047
1066
|
isFromEditor: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { schemas } from "components";
|
|
2
2
|
import { filterDuplicatedValues, getActivatedDataPacksIds } from "@ax/helpers";
|
|
3
3
|
import { pageStatus } from "@ax/containers/PageEditor/interfaces";
|
|
4
|
-
import { IDataPack, IPage,
|
|
4
|
+
import { IDataPack, IPage, IStructuredData } from "@ax/types";
|
|
5
5
|
|
|
6
6
|
const getTemplatesFilters = (activatedDataPacks: IDataPack[]) => {
|
|
7
7
|
const filters: { label: string; value: string; mode: string }[] = [];
|
|
@@ -52,7 +52,7 @@ const mapStructuredOptions = (options: any[]) => {
|
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const getOptionValues = (options:
|
|
55
|
+
const getOptionValues = (options: IStructuredData[]) => {
|
|
56
56
|
const templatesOptionsValues: any = [];
|
|
57
57
|
const { templates } = schemas;
|
|
58
58
|
|
|
@@ -76,12 +76,12 @@ const getOptionValues = (options: any) => {
|
|
|
76
76
|
return [...templatesOptionsValues, ...mapStructuredOptions(options)];
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
const getOptionFilters = (options:
|
|
80
|
-
const pureOptions = options.filter((option:
|
|
79
|
+
const getOptionFilters = (options: IStructuredData[], activatedDataPacks: IDataPack[]) => {
|
|
80
|
+
const pureOptions = options.filter((option: IStructuredData) => !option.fromPage);
|
|
81
81
|
const templateFilters = getTemplatesFilters(activatedDataPacks);
|
|
82
82
|
const activatedDataPacksIds = getActivatedDataPacksIds(activatedDataPacks);
|
|
83
83
|
|
|
84
|
-
const mappedOptions = pureOptions.flatMap((option:
|
|
84
|
+
const mappedOptions = pureOptions.flatMap((option: IStructuredData) =>
|
|
85
85
|
option.dataPacks.reduce((acc: { label: string; value: string; isData: boolean }[], current: string) => {
|
|
86
86
|
if (activatedDataPacksIds.includes(current)) {
|
|
87
87
|
const currentDataPack = activatedDataPacks.find(
|
|
@@ -3,7 +3,7 @@ import { NavLink } from "react-router-dom";
|
|
|
3
3
|
|
|
4
4
|
import { SubNav, MenuItem } from "@ax/components";
|
|
5
5
|
|
|
6
|
-
import * as S from
|
|
6
|
+
import * as S from "./style";
|
|
7
7
|
|
|
8
8
|
const DefaultNav = (props: IProps): JSX.Element => {
|
|
9
9
|
const { current, defaultTypes, onClick } = props;
|
|
@@ -16,11 +16,9 @@ const DefaultNav = (props: IProps): JSX.Element => {
|
|
|
16
16
|
const selectedClass = isSelected ? "selected" : "";
|
|
17
17
|
const handleClick = () => onClick(type);
|
|
18
18
|
return (
|
|
19
|
-
<MenuItem key={key} onClick={handleClick}>
|
|
20
|
-
<NavLink to="#"
|
|
21
|
-
<S.Link active={isSelected}>
|
|
22
|
-
{type}
|
|
23
|
-
</S.Link>
|
|
19
|
+
<MenuItem key={key} onClick={handleClick} className={selectedClass}>
|
|
20
|
+
<NavLink to="#">
|
|
21
|
+
<S.Link active={isSelected}>{type}</S.Link>
|
|
24
22
|
</NavLink>
|
|
25
23
|
</MenuItem>
|
|
26
24
|
);
|
|
@@ -35,8 +35,8 @@ const Nav = (props: INav): JSX.Element => {
|
|
|
35
35
|
const selectedClass = isSelected ? "selected" : "";
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<MenuItem onClick={_handleClick} key={category.name}>
|
|
39
|
-
<NavLink to="#"
|
|
38
|
+
<MenuItem onClick={_handleClick} key={category.name} className={selectedClass}>
|
|
39
|
+
<NavLink to="#">
|
|
40
40
|
<S.Link active={isSelected}>{category.title}</S.Link>
|
|
41
41
|
</NavLink>
|
|
42
42
|
</MenuItem>
|
|
@@ -42,11 +42,9 @@ const Nav = (props: IProps): JSX.Element => {
|
|
|
42
42
|
<SubNav>
|
|
43
43
|
<S.Item>
|
|
44
44
|
<S.Heading>Your packages</S.Heading>
|
|
45
|
-
<MenuItem onClick={resetFilter}>
|
|
46
|
-
<NavLink to="#"
|
|
47
|
-
<S.Link active={!selected}>
|
|
48
|
-
Activated packages
|
|
49
|
-
</S.Link>
|
|
45
|
+
<MenuItem onClick={resetFilter} className={selectedClass}>
|
|
46
|
+
<NavLink to="#">
|
|
47
|
+
<S.Link active={!selected}>Activated packages</S.Link>
|
|
50
48
|
</NavLink>
|
|
51
49
|
</MenuItem>
|
|
52
50
|
</S.Item>
|
|
@@ -64,12 +62,10 @@ const Nav = (props: IProps): JSX.Element => {
|
|
|
64
62
|
isDirty ? toggleModal() : selectPack(id);
|
|
65
63
|
};
|
|
66
64
|
return (
|
|
67
|
-
<MenuItem key={key} onClick={_handleClick}>
|
|
68
|
-
<NavLink to="#"
|
|
65
|
+
<MenuItem key={key} onClick={_handleClick} className={selectedClass}>
|
|
66
|
+
<NavLink to="#">
|
|
69
67
|
<S.LinkWrapper>
|
|
70
|
-
<S.Link active={isSelected}>
|
|
71
|
-
{title}
|
|
72
|
-
</S.Link>
|
|
68
|
+
<S.Link active={isSelected}>{title}</S.Link>
|
|
73
69
|
{isFromPage && !config && <InformativeMenu {...infoMenuProps} />}
|
|
74
70
|
</S.LinkWrapper>
|
|
75
71
|
</NavLink>
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
CustomizeFilters,
|
|
7
7
|
CategoryFilter,
|
|
8
8
|
NameFilter,
|
|
9
|
-
TypeFilter,
|
|
10
9
|
StatusFilter,
|
|
11
10
|
SiteFilter,
|
|
12
11
|
LiveFilter,
|
|
@@ -70,11 +69,7 @@ const TableHeader = (props: IProps): JSX.Element => {
|
|
|
70
69
|
<S.NameWrapper>
|
|
71
70
|
<NameFilter sortItems={sortItems} sortedState={sortedListStatus} urlSorting={true} />
|
|
72
71
|
</S.NameWrapper>
|
|
73
|
-
{isAllPages && activeColumns.includes("type") &&
|
|
74
|
-
<S.HeaderWrapper>
|
|
75
|
-
<TypeFilter filterItems={filterItems} filters={typeFilters} value={filterValues.types} pointer="types" />
|
|
76
|
-
</S.HeaderWrapper>
|
|
77
|
-
)}
|
|
72
|
+
{isAllPages && activeColumns.includes("type") && <S.TypeHeader>Type</S.TypeHeader>}
|
|
78
73
|
{!isAllPages && activeColumns.includes("site") && (
|
|
79
74
|
<S.HeaderWrapper>
|
|
80
75
|
<SiteFilter filterItems={filterItems} value={filterValues} pointer="filterSites" />
|
|
@@ -33,6 +33,11 @@ const StatusHeader = styled(Header)`
|
|
|
33
33
|
justify-content: center;
|
|
34
34
|
`;
|
|
35
35
|
|
|
36
|
+
const TypeHeader = styled(Header)`
|
|
37
|
+
width: 170px;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
`;
|
|
40
|
+
|
|
36
41
|
const TransHeader = styled(Header)`
|
|
37
42
|
width: 115px;
|
|
38
43
|
justify-content: center;
|
|
@@ -70,4 +75,5 @@ export {
|
|
|
70
75
|
NameWrapper,
|
|
71
76
|
HeaderWrapper,
|
|
72
77
|
SeoHeader,
|
|
78
|
+
TypeHeader,
|
|
73
79
|
};
|
|
@@ -3,60 +3,52 @@ import { connect } from "react-redux";
|
|
|
3
3
|
import { NavLink } from "react-router-dom";
|
|
4
4
|
|
|
5
5
|
import { IStructuredData } from "@ax/types";
|
|
6
|
-
import {
|
|
7
|
-
import { MenuItem, SubNav } from "@ax/components";
|
|
6
|
+
import { MenuGroup, MenuItem, SubNav } from "@ax/components";
|
|
8
7
|
import { pageEditorActions } from "@ax/containers/PageEditor";
|
|
9
8
|
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
10
9
|
|
|
11
|
-
import { filterStructure } from "./constants";
|
|
12
10
|
import { getFilters } from "./utils";
|
|
13
11
|
|
|
14
12
|
import * as S from "./style";
|
|
15
13
|
|
|
16
14
|
const ContentFilters = (props: IProps): JSX.Element => {
|
|
17
15
|
const { setFilter, current, dynamicValues, onClick, addNew, isAllowedToCreate } = props;
|
|
18
|
-
const clonedStructure = deepClone(filterStructure);
|
|
19
|
-
const filters = getFilters(clonedStructure, dynamicValues);
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
<SubNav>
|
|
23
|
-
{filters.map((category: any, key: number) => {
|
|
24
|
-
return (
|
|
25
|
-
<S.Item key={key}>
|
|
26
|
-
<S.Heading>{category.title}</S.Heading>
|
|
27
|
-
{category.filters &&
|
|
28
|
-
category.filters.map((filter: any, filterKey: number) => {
|
|
29
|
-
const { name, value, editable } = filter;
|
|
30
|
-
|
|
31
|
-
const handleClick = () => {
|
|
32
|
-
onClick(value);
|
|
33
|
-
setFilter(value);
|
|
34
|
-
};
|
|
17
|
+
const filters = getFilters(dynamicValues);
|
|
35
18
|
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
const handleClick = (value: string) => {
|
|
20
|
+
onClick(value);
|
|
21
|
+
setFilter(value);
|
|
22
|
+
};
|
|
38
23
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
return (
|
|
25
|
+
<SubNav>
|
|
26
|
+
<S.Wrapper>
|
|
27
|
+
{filters.map((filter) => {
|
|
28
|
+
const isSelected = filter.value === current;
|
|
29
|
+
const selectedClass = isSelected ? "selected" : "";
|
|
44
30
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
31
|
+
return (
|
|
32
|
+
<React.Fragment key={filter.value}>
|
|
33
|
+
{!filter.items ? (
|
|
34
|
+
<MenuItem className={selectedClass} onClick={() => handleClick(filter.value)}>
|
|
35
|
+
<NavLink to="#">
|
|
36
|
+
<S.Link active={isSelected}>{filter.label}</S.Link>
|
|
37
|
+
</NavLink>
|
|
38
|
+
</MenuItem>
|
|
39
|
+
) : (
|
|
40
|
+
<MenuGroup
|
|
41
|
+
filter={filter}
|
|
42
|
+
current={current}
|
|
43
|
+
onClick={handleClick}
|
|
44
|
+
addNew={addNew}
|
|
45
|
+
isAllowedToCreate={isAllowedToCreate}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
48
|
+
</React.Fragment>
|
|
49
|
+
);
|
|
50
|
+
})}
|
|
51
|
+
</S.Wrapper>
|
|
60
52
|
</SubNav>
|
|
61
53
|
);
|
|
62
54
|
};
|
|
@@ -1,43 +1,9 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
${p => p.theme.textStyle.headingXXS};
|
|
5
|
-
color: ${p => p.theme.color.textLowEmphasis};
|
|
6
|
-
margin-bottom: ${p => p.theme.spacing.xs};
|
|
7
|
-
cursor: default;
|
|
3
|
+
const Wrapper = styled.ul``;
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
5
|
+
const Link = styled.div<{ active: boolean }>`
|
|
6
|
+
color: ${(p) => (p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis)};
|
|
12
7
|
`;
|
|
13
8
|
|
|
14
|
-
export
|
|
15
|
-
display: block;
|
|
16
|
-
${p => p.theme.textStyle.uiM};
|
|
17
|
-
color: ${p => p.theme.color.textHighEmphasis};
|
|
18
|
-
clear: both;
|
|
19
|
-
width: 100%;
|
|
20
|
-
|
|
21
|
-
&:hover {
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
> a {
|
|
26
|
-
display: flex;
|
|
27
|
-
padding: ${p => p.theme.spacing.xs};
|
|
28
|
-
border-radius: ${p => p.theme.radii.s};
|
|
29
|
-
color: inherit;
|
|
30
|
-
|
|
31
|
-
&:hover {
|
|
32
|
-
background: ${p => p.theme.color.overlayHoverPrimary};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
export const Item = styled.div`
|
|
38
|
-
margin-bottom: ${p => p.theme.spacing.m};
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
export const Link = styled.div<{ active: boolean }>`
|
|
42
|
-
color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
|
|
43
|
-
`;
|
|
9
|
+
export { Wrapper, Link };
|
|
@@ -1,21 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IContentFilter, IDynamicFilter, IStructuredData } from "@ax/types";
|
|
3
|
+
|
|
4
|
+
const getDynamicFilters = (values: IStructuredData[]): IDynamicFilter[] =>
|
|
2
5
|
values &&
|
|
3
|
-
values.map((value
|
|
4
|
-
|
|
6
|
+
values.map((value) => ({
|
|
7
|
+
label: value.title,
|
|
5
8
|
value: value.id,
|
|
6
9
|
fromPage: value.fromPage,
|
|
7
10
|
editable: value.editable ? value.editable : false,
|
|
11
|
+
firstTemplate: null,
|
|
8
12
|
}));
|
|
9
13
|
|
|
10
|
-
const getFilters = (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const getFilters = (dynamicValues: IStructuredData[]): IContentFilter[] => {
|
|
15
|
+
const filters: IContentFilter[] = [{ label: "All Content", value: "all-pages" }];
|
|
16
|
+
|
|
17
|
+
const pageTypes = dynamicValues.filter((value) => value.fromPage);
|
|
18
|
+
const simpleTypes = dynamicValues.filter((value) => !value.fromPage);
|
|
19
|
+
|
|
20
|
+
if (pageTypes.length) {
|
|
21
|
+
filters.push({
|
|
22
|
+
label: "Page Content Types",
|
|
23
|
+
value: "pages",
|
|
24
|
+
items: getDynamicFilters(pageTypes),
|
|
25
|
+
description: (
|
|
26
|
+
<>
|
|
27
|
+
Content shown in a page. Data is filled
|
|
28
|
+
<br />
|
|
29
|
+
on a page and has a URL.
|
|
30
|
+
</>
|
|
31
|
+
),
|
|
17
32
|
});
|
|
18
|
-
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (simpleTypes.length) {
|
|
36
|
+
filters.push({
|
|
37
|
+
label: "Simple Content Types",
|
|
38
|
+
value: "simple",
|
|
39
|
+
items: getDynamicFilters(simpleTypes),
|
|
40
|
+
description: (
|
|
41
|
+
<>
|
|
42
|
+
Pageless content. Data is entered on a<br />
|
|
43
|
+
form and consumed in lists and
|
|
44
|
+
<br />
|
|
45
|
+
distributors.
|
|
46
|
+
</>
|
|
47
|
+
),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return filters;
|
|
19
52
|
};
|
|
20
53
|
|
|
21
54
|
export { getDynamicFilters, getFilters };
|
|
@@ -79,8 +79,8 @@ const OptionTable = (props: IOptionTableProps): JSX.Element => {
|
|
|
79
79
|
const isSelected = item.value === state.selectedType;
|
|
80
80
|
const selectedClass = isSelected ? "selected" : "";
|
|
81
81
|
return (
|
|
82
|
-
<MenuItem key={`${item.value}${i}`}>
|
|
83
|
-
<S.NavLink
|
|
82
|
+
<MenuItem key={`${item.value}${i}`} className={selectedClass} onClick={displayFilteredOptions}>
|
|
83
|
+
<S.NavLink>
|
|
84
84
|
<S.Link active={isSelected}>{item.label}</S.Link>
|
|
85
85
|
</S.NavLink>
|
|
86
86
|
</MenuItem>
|
|
@@ -97,8 +97,8 @@ const OptionTable = (props: IOptionTableProps): JSX.Element => {
|
|
|
97
97
|
</S.ThumbnailWrapper>
|
|
98
98
|
)}
|
|
99
99
|
<S.Actions>
|
|
100
|
-
<SecondaryActionButton onClick={secondaryAction.onClick} title={secondaryAction.title}/>
|
|
101
|
-
<MainActionButton onClick={mainAction.onClick} title={mainAction.title}/>
|
|
100
|
+
<SecondaryActionButton onClick={secondaryAction.onClick} title={secondaryAction.title} />
|
|
101
|
+
<MainActionButton onClick={mainAction.onClick} title={mainAction.title} />
|
|
102
102
|
</S.Actions>
|
|
103
103
|
</S.Column>
|
|
104
104
|
</S.Table>
|
|
@@ -119,4 +119,4 @@ interface IOptionTableProps {
|
|
|
119
119
|
secondaryAction: IAction;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export default OptionTable;
|
|
122
|
+
export default OptionTable;
|
|
@@ -597,7 +597,6 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
597
597
|
const labelCategory = isStructuredDataFromPage ? { categories: "Category" } : { related: "Category " };
|
|
598
598
|
|
|
599
599
|
const filterLabels = {
|
|
600
|
-
types: "Type",
|
|
601
600
|
liveStatus: "Live",
|
|
602
601
|
translated: "Translated",
|
|
603
602
|
filterSites: "Site",
|
|
@@ -606,7 +605,7 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
606
605
|
|
|
607
606
|
return (
|
|
608
607
|
<MainWrapper
|
|
609
|
-
title="Global
|
|
608
|
+
title="Global Content"
|
|
610
609
|
rightButton={rightButtonProps}
|
|
611
610
|
availableLanguages={languageProps.globalLangs}
|
|
612
611
|
language={languageProps.lang}
|
|
@@ -2,9 +2,9 @@ import React, { useState, useEffect } from "react";
|
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
|
|
4
4
|
import { appActions } from "@ax/containers/App";
|
|
5
|
-
import { Button, ErrorToast, FieldsBehavior, SearchField
|
|
5
|
+
import { Button, ErrorToast, FieldsBehavior, SearchField } from "@ax/components";
|
|
6
6
|
import { IImage, IRootState, IUser, ISite, IRole, ISiteRoles } from "@ax/types";
|
|
7
|
-
import { useModal
|
|
7
|
+
import { useModal } from "@ax/hooks";
|
|
8
8
|
import { RouteLeavingGuard } from "@ax/guards";
|
|
9
9
|
|
|
10
10
|
import { timezones } from "../../Settings/Globals/constants";
|
|
@@ -45,16 +45,11 @@ const UserForm = (props: IProps) => {
|
|
|
45
45
|
const [sitesList, setSiteList] = useState(sortedByNameSites);
|
|
46
46
|
const [showMore, setShowMore] = useState(false);
|
|
47
47
|
|
|
48
|
-
const isAllowedToAccessSiteGallery = usePermission("mediaGallery.accessToSiteGallery");
|
|
49
|
-
const isAllowedToAccessGlobalGallery = usePermission("global.mediaGallery.accessToGlobalGallery");
|
|
50
|
-
|
|
51
48
|
const allowedRoutes = ["/profile"];
|
|
52
49
|
const { isDirty } = shouldBeSaved(user, form);
|
|
53
50
|
|
|
54
51
|
const isSameUser = currentUser && currentUser.id === user.id;
|
|
55
52
|
const isEditDisabled = currentUser && !currentUser.isSuperAdmin && isSiteView && !isSameUser;
|
|
56
|
-
const isAvatarDisabled =
|
|
57
|
-
(isSiteView && !isAllowedToAccessSiteGallery) || (!isSiteView && !isAllowedToAccessGlobalGallery);
|
|
58
53
|
|
|
59
54
|
useEffect(() => {
|
|
60
55
|
if (form.roles.length === 0) {
|
|
@@ -189,19 +184,6 @@ const UserForm = (props: IProps) => {
|
|
|
189
184
|
const rolesGlobal = form.roles.find((roleSite: ISiteRoles) => roleSite.siteId === "global");
|
|
190
185
|
const globalDescription = "Global data will be accessible to the user based on the permissions assigned to the role.";
|
|
191
186
|
|
|
192
|
-
const AvatarField = () => (
|
|
193
|
-
<FieldsBehavior
|
|
194
|
-
title="Avatar profile"
|
|
195
|
-
name="image"
|
|
196
|
-
value={image}
|
|
197
|
-
fieldType="ImageField"
|
|
198
|
-
onChange={handleImageChange}
|
|
199
|
-
helptext="Customize how people see you."
|
|
200
|
-
disabled={isEditDisabled || isAvatarDisabled}
|
|
201
|
-
site={site}
|
|
202
|
-
/>
|
|
203
|
-
);
|
|
204
|
-
|
|
205
187
|
return (
|
|
206
188
|
<>
|
|
207
189
|
<RouteLeavingGuard when={isDirty} action={action} text={text} allowedRoutes={allowedRoutes} />
|
|
@@ -209,13 +191,17 @@ const UserForm = (props: IProps) => {
|
|
|
209
191
|
<S.Wrapper>
|
|
210
192
|
<S.SubTitle>USER DATA</S.SubTitle>
|
|
211
193
|
<S.NameTitle>{user.name}</S.NameTitle>
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
194
|
+
<FieldsBehavior
|
|
195
|
+
title="Avatar profile"
|
|
196
|
+
name="image"
|
|
197
|
+
value={image}
|
|
198
|
+
fieldType="ImageField"
|
|
199
|
+
onChange={handleImageChange}
|
|
200
|
+
helptext="Customize how people see you."
|
|
201
|
+
disabled={isEditDisabled}
|
|
202
|
+
site={site}
|
|
203
|
+
noGallery={true}
|
|
204
|
+
/>
|
|
219
205
|
<FieldsBehavior
|
|
220
206
|
title="Name"
|
|
221
207
|
name="name"
|
package/src/routes/multisite.tsx
CHANGED
package/src/routes/site.tsx
CHANGED
package/src/types/index.tsx
CHANGED
|
@@ -1044,6 +1044,21 @@ export interface IBulkAction {
|
|
|
1044
1044
|
action: () => void;
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
1047
|
+
export interface IContentFilter {
|
|
1048
|
+
label: string;
|
|
1049
|
+
value: string;
|
|
1050
|
+
description?: JSX.Element | string;
|
|
1051
|
+
items?: IDynamicFilter[];
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
export interface IDynamicFilter {
|
|
1055
|
+
label: string;
|
|
1056
|
+
value: string;
|
|
1057
|
+
fromPage: boolean;
|
|
1058
|
+
firstTemplate: string | null;
|
|
1059
|
+
editable?: boolean;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1047
1062
|
export interface IGriddoTheme {
|
|
1048
1063
|
label: string;
|
|
1049
1064
|
value: string;
|