@griddo/ax 10.6.6 → 10.6.8
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/components/MenuGroup/index.tsx +9 -2
- package/src/components/MenuGroup/style.tsx +12 -2
- package/src/components/Notification/index.tsx +7 -1
- package/src/components/Notification/style.tsx +4 -0
- package/src/modules/Content/ContentFilters/utils.tsx +1 -0
- package/src/modules/Content/index.tsx +10 -2
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/utils.tsx +2 -1
- package/src/modules/StructuredData/StructuredDataList/index.tsx +8 -0
- package/src/types/index.tsx +2 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "10.6.
|
|
4
|
+
"version": "10.6.8",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -233,5 +233,5 @@
|
|
|
233
233
|
"publishConfig": {
|
|
234
234
|
"access": "public"
|
|
235
235
|
},
|
|
236
|
-
"gitHead": "
|
|
236
|
+
"gitHead": "a622dc1b913fd26805bbbeea654314a0438630c5"
|
|
237
237
|
}
|
|
@@ -47,7 +47,7 @@ const MenuGroup = (props: IProps): JSX.Element => {
|
|
|
47
47
|
<S.Dropdown isOpen={isOpen}>
|
|
48
48
|
{filter.items &&
|
|
49
49
|
filter.items.map((filter) => {
|
|
50
|
-
const { label, value, fromPage, firstTemplate, editable } = filter;
|
|
50
|
+
const { label, value, fromPage, firstTemplate, editable, isPrivate } = filter;
|
|
51
51
|
|
|
52
52
|
const isSelected = value === current;
|
|
53
53
|
const selectedClass = isSelected ? "selected" : "";
|
|
@@ -60,7 +60,14 @@ const MenuGroup = (props: IProps): JSX.Element => {
|
|
|
60
60
|
className={selectedClass}
|
|
61
61
|
>
|
|
62
62
|
<NavLink to="#">
|
|
63
|
-
<S.Link
|
|
63
|
+
<S.Link>
|
|
64
|
+
<S.Text active={isSelected}>{label}</S.Text>
|
|
65
|
+
{isPrivate && (
|
|
66
|
+
<S.Icon>
|
|
67
|
+
<Icon name="lock" size="16" />
|
|
68
|
+
</S.Icon>
|
|
69
|
+
)}
|
|
70
|
+
</S.Link>
|
|
64
71
|
</NavLink>
|
|
65
72
|
</MenuItem>
|
|
66
73
|
);
|
|
@@ -38,9 +38,19 @@ const Dropdown = styled.ul<{ isOpen: boolean }>`
|
|
|
38
38
|
margin-bottom: ${(p) => p.theme.spacing.s};
|
|
39
39
|
`;
|
|
40
40
|
|
|
41
|
-
const Link = styled.div
|
|
41
|
+
const Link = styled.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const Icon = styled.div`
|
|
47
|
+
margin-left: ${(p) => p.theme.spacing.xs};
|
|
48
|
+
margin-right: ${(p) => p.theme.spacing.xs};
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const Text = styled.div<{ active: boolean }>`
|
|
42
52
|
${(p) => p.theme.textStyle.uiS};
|
|
43
53
|
color: ${(p) => (p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis)};
|
|
44
54
|
`;
|
|
45
55
|
|
|
46
|
-
export { Item, NavLink, Title, Arrow, Dropdown, Link };
|
|
56
|
+
export { Item, NavLink, Title, Arrow, Dropdown, Link, Icon, Text };
|
|
@@ -31,6 +31,12 @@ const Notification = (props: INotificationProps): JSX.Element => {
|
|
|
31
31
|
<Icon name="warning" />
|
|
32
32
|
</S.IconWrapper>
|
|
33
33
|
);
|
|
34
|
+
case "private":
|
|
35
|
+
return (
|
|
36
|
+
<S.IconWrapper data-testid="private-icon">
|
|
37
|
+
<Icon name="lock" />
|
|
38
|
+
</S.IconWrapper>
|
|
39
|
+
);
|
|
34
40
|
}
|
|
35
41
|
};
|
|
36
42
|
|
|
@@ -85,7 +91,7 @@ const Notification = (props: INotificationProps): JSX.Element => {
|
|
|
85
91
|
|
|
86
92
|
export interface INotificationProps {
|
|
87
93
|
text: string;
|
|
88
|
-
type: "error" | "info" | "success" | "warning";
|
|
94
|
+
type: "error" | "info" | "success" | "warning" | "private";
|
|
89
95
|
resetError?: () => void;
|
|
90
96
|
btnText?: string;
|
|
91
97
|
onClick?: () => void;
|
|
@@ -17,6 +17,9 @@ const Wrapper = styled.div<{ isVisible: boolean }>`
|
|
|
17
17
|
&.warning {
|
|
18
18
|
background-color: ${(p) => p.theme.colors.warning};
|
|
19
19
|
}
|
|
20
|
+
&.private {
|
|
21
|
+
background-color: ${(p) => p.theme.colors.info};
|
|
22
|
+
}
|
|
20
23
|
`;
|
|
21
24
|
|
|
22
25
|
const NotificationWrapper = styled.div`
|
|
@@ -41,6 +44,7 @@ const Row = styled.div`
|
|
|
41
44
|
height: ${(p) => p.theme.spacing.m};
|
|
42
45
|
path {
|
|
43
46
|
fill: ${(p) => p.theme.color.textHighEmphasisInverse};
|
|
47
|
+
fill-opacity: 1;
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
`;
|
|
@@ -9,6 +9,7 @@ const getDynamicFilters = (values: IStructuredData[]): IDynamicFilter[] =>
|
|
|
9
9
|
fromPage: value.fromPage,
|
|
10
10
|
editable: value.editable ? value.editable : false,
|
|
11
11
|
firstTemplate: value.schema.templates ? value.schema.templates[0] : null,
|
|
12
|
+
isPrivate: value.private !== undefined ? value.private : false,
|
|
12
13
|
}));
|
|
13
14
|
|
|
14
15
|
const getFilters = (dynamicValues: IStructuredData[]): IContentFilter[] => {
|
|
@@ -168,6 +168,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
168
168
|
const isStructuredData = filter !== "unique-pages" && !checkFromPage;
|
|
169
169
|
const isGlobalPages = filter !== "unique-pages" && checkFromPage;
|
|
170
170
|
const isDataEditable = !isStructuredData || (currentStructuredData && currentStructuredData.editable);
|
|
171
|
+
const isDataPrivate = currentStructuredData?.private || false;
|
|
171
172
|
const isDataExportable = currentStructuredData?.exportable || false;
|
|
172
173
|
|
|
173
174
|
const pagesIds = currentSitePages && currentSitePages.map((page: any) => page.id);
|
|
@@ -400,7 +401,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
400
401
|
|
|
401
402
|
const addNewData = () => {
|
|
402
403
|
resetForm(true);
|
|
403
|
-
const path = `/sites/data/${currentStructuredData
|
|
404
|
+
const path = `/sites/data/${currentStructuredData?.id}/editor`;
|
|
404
405
|
setHistoryPush(path, false);
|
|
405
406
|
};
|
|
406
407
|
|
|
@@ -842,6 +843,8 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
842
843
|
const notEditableText =
|
|
843
844
|
"Sorry, this content cannot be edited because it comes from an external source or belongs to a preconfigured system.";
|
|
844
845
|
|
|
846
|
+
const isPrivateText = "This content is private and will not be available for display in any distributor.";
|
|
847
|
+
|
|
845
848
|
const filterLabels = {
|
|
846
849
|
liveStatus: "Live",
|
|
847
850
|
translated: "Translated",
|
|
@@ -877,6 +880,11 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
877
880
|
<Notification type="info" text={notEditableText} closeButton={false} />
|
|
878
881
|
</S.NotificationWrapper>
|
|
879
882
|
)}
|
|
883
|
+
{isDataPrivate && (
|
|
884
|
+
<S.NotificationWrapper>
|
|
885
|
+
<Notification type="private" text={isPrivateText} closeButton={false} />
|
|
886
|
+
</S.NotificationWrapper>
|
|
887
|
+
)}
|
|
880
888
|
{templateInstanceError.error && (
|
|
881
889
|
<Notification
|
|
882
890
|
type="error"
|
|
@@ -1080,7 +1088,7 @@ interface IPagesProps {
|
|
|
1080
1088
|
errors: IErrorItem[];
|
|
1081
1089
|
siteLanguages: any[];
|
|
1082
1090
|
structuredData: IStructuredData[];
|
|
1083
|
-
currentStructuredData:
|
|
1091
|
+
currentStructuredData: IStructuredData | null;
|
|
1084
1092
|
currentDataContent: IStructuredDataContent[];
|
|
1085
1093
|
isFromEditor: boolean;
|
|
1086
1094
|
activatedDataPacks: IDataPack[];
|
|
@@ -7,8 +7,9 @@ const getDynamicFilters = (values: IStructuredData[]): IDynamicFilter[] =>
|
|
|
7
7
|
label: value.title,
|
|
8
8
|
value: value.id,
|
|
9
9
|
fromPage: value.fromPage,
|
|
10
|
-
editable: value.editable ? value.editable : false,
|
|
10
|
+
editable: value.editable !== undefined ? value.editable : false,
|
|
11
11
|
firstTemplate: null,
|
|
12
|
+
isPrivate: value.private !== undefined ? value.private : false,
|
|
12
13
|
}));
|
|
13
14
|
|
|
14
15
|
const getFilters = (dynamicValues: IStructuredData[]): IContentFilter[] => {
|
|
@@ -155,6 +155,7 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
155
155
|
const isDataTranslatable = currentStructuredData && currentStructuredData.translate;
|
|
156
156
|
const isAllPages = filter === "all-pages";
|
|
157
157
|
const isStructuredDataFromPage = !!currentStructuredData?.fromPage || isAllPages;
|
|
158
|
+
const isPrivateData = currentStructuredData?.private || false;
|
|
158
159
|
const isDataExportable = currentStructuredData?.exportable || false;
|
|
159
160
|
const dataIds = isStructuredDataFromPage
|
|
160
161
|
? currentSitePages.map((page: IPage) => page.id)
|
|
@@ -526,6 +527,8 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
526
527
|
const notEditableText =
|
|
527
528
|
"Sorry, this content cannot be edited because it comes from an external source or belongs to a preconfigured system.";
|
|
528
529
|
|
|
530
|
+
const isPrivateText = "This content is private and will not be available for display in any distributor.";
|
|
531
|
+
|
|
529
532
|
const languageProps = {
|
|
530
533
|
globalLangs: isAllPages || isDataTranslatable ? globalLangs : null,
|
|
531
534
|
lang: isAllPages || isDataTranslatable ? lang : null,
|
|
@@ -634,6 +637,11 @@ const StructuredDataList = (props: IProps): JSX.Element => {
|
|
|
634
637
|
<Notification type="info" text={notEditableText} closeButton={false} />
|
|
635
638
|
</S.NotificationWrapper>
|
|
636
639
|
)}
|
|
640
|
+
{isPrivateData && (
|
|
641
|
+
<S.NotificationWrapper>
|
|
642
|
+
<Notification type="private" text={isPrivateText} closeButton={false} />
|
|
643
|
+
</S.NotificationWrapper>
|
|
644
|
+
)}
|
|
637
645
|
<ErrorToast />
|
|
638
646
|
{!!currentSiteErrorPages.length && <Notification type="error" text={errorPagesText} />}
|
|
639
647
|
{notification && (
|
package/src/types/index.tsx
CHANGED
|
@@ -451,6 +451,7 @@ export interface IStructuredData {
|
|
|
451
451
|
structuredData?: string;
|
|
452
452
|
editable: boolean;
|
|
453
453
|
dataPacks: string[];
|
|
454
|
+
private?: boolean;
|
|
454
455
|
exportable?: boolean;
|
|
455
456
|
}
|
|
456
457
|
|
|
@@ -1060,6 +1061,7 @@ export interface IDynamicFilter {
|
|
|
1060
1061
|
fromPage: boolean;
|
|
1061
1062
|
firstTemplate: string | null;
|
|
1062
1063
|
editable?: boolean;
|
|
1064
|
+
isPrivate?: boolean;
|
|
1063
1065
|
}
|
|
1064
1066
|
|
|
1065
1067
|
export interface IGriddoTheme {
|