@griddo/ax 10.1.4 → 10.1.5
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/Avatar/__snapshots__/Avatar.test.tsx.snap +10 -10
- package/src/__tests__/components/Fields/IntegrationsField/IntegrationsField.test.tsx +23 -8
- package/src/components/Fields/IntegrationsField/IntegrationItem/VariablesPanel/index.tsx +1 -1
- package/src/components/Fields/IntegrationsField/IntegrationItem/atoms.tsx +1 -1
- package/src/components/Fields/IntegrationsField/IntegrationItem/index.tsx +1 -1
- package/src/components/Fields/IntegrationsField/SideModal/index.tsx +1 -1
- package/src/components/Fields/IntegrationsField/index.tsx +4 -3
- package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +3 -2
- package/src/components/Fields/ReferenceField/index.tsx +4 -1
- package/src/modules/Categories/CategoriesList/index.tsx +1 -1
- package/src/modules/Settings/Integrations/IntegrationForm/index.tsx +1 -1
- package/src/modules/Settings/Integrations/IntegrationItem/CopyModal/index.tsx +3 -3
- package/src/modules/Settings/Integrations/IntegrationItem/index.tsx +8 -8
- package/src/modules/Settings/Integrations/atoms.tsx +3 -3
- package/src/modules/Settings/Integrations/index.tsx +8 -8
- package/src/modules/Settings/Integrations/utils.tsx +2 -2
- package/src/routes/site.tsx +6 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "10.1.
|
|
4
|
+
"version": "10.1.5",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -230,5 +230,5 @@
|
|
|
230
230
|
"publishConfig": {
|
|
231
231
|
"access": "public"
|
|
232
232
|
},
|
|
233
|
-
"gitHead": "
|
|
233
|
+
"gitHead": "0cd7e08b1541b6157760681d82ded3bdda7d2762"
|
|
234
234
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Avatar component rendering should render the component only with name 1`] = `
|
|
4
4
|
<div
|
|
5
|
-
className="sc-
|
|
5
|
+
className="sc-ejdXBC fORGYU"
|
|
6
6
|
data-testid="avatar-wrapper"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
|
-
className="sc-
|
|
9
|
+
className="sc-ldFCYb iNdtRr"
|
|
10
10
|
data-testid="avatar"
|
|
11
11
|
/>
|
|
12
12
|
</div>
|
|
@@ -14,11 +14,11 @@ exports[`Avatar component rendering should render the component only with name 1
|
|
|
14
14
|
|
|
15
15
|
exports[`Avatar component rendering should render the component with a wrong image url 1`] = `
|
|
16
16
|
<div
|
|
17
|
-
className="sc-
|
|
17
|
+
className="sc-ejdXBC fORGYU"
|
|
18
18
|
data-testid="avatar-wrapper"
|
|
19
19
|
>
|
|
20
20
|
<div
|
|
21
|
-
className="sc-
|
|
21
|
+
className="sc-ldFCYb cpyHnO"
|
|
22
22
|
data-testid="avatar"
|
|
23
23
|
/>
|
|
24
24
|
</div>
|
|
@@ -26,11 +26,11 @@ exports[`Avatar component rendering should render the component with a wrong ima
|
|
|
26
26
|
|
|
27
27
|
exports[`Avatar component rendering should render the component with an empty string as name 1`] = `
|
|
28
28
|
<div
|
|
29
|
-
className="sc-
|
|
29
|
+
className="sc-ejdXBC fORGYU"
|
|
30
30
|
data-testid="avatar-wrapper"
|
|
31
31
|
>
|
|
32
32
|
<div
|
|
33
|
-
className="sc-
|
|
33
|
+
className="sc-ldFCYb iXxXyw"
|
|
34
34
|
data-testid="avatar"
|
|
35
35
|
/>
|
|
36
36
|
</div>
|
|
@@ -38,11 +38,11 @@ exports[`Avatar component rendering should render the component with an empty st
|
|
|
38
38
|
|
|
39
39
|
exports[`Avatar component rendering should render the component with image null 1`] = `
|
|
40
40
|
<div
|
|
41
|
-
className="sc-
|
|
41
|
+
className="sc-ejdXBC fORGYU"
|
|
42
42
|
data-testid="avatar-wrapper"
|
|
43
43
|
>
|
|
44
44
|
<div
|
|
45
|
-
className="sc-
|
|
45
|
+
className="sc-ldFCYb Tmium"
|
|
46
46
|
data-testid="avatar"
|
|
47
47
|
/>
|
|
48
48
|
</div>
|
|
@@ -50,11 +50,11 @@ exports[`Avatar component rendering should render the component with image null
|
|
|
50
50
|
|
|
51
51
|
exports[`Avatar component rendering should render the component without name or image 1`] = `
|
|
52
52
|
<div
|
|
53
|
-
className="sc-
|
|
53
|
+
className="sc-ejdXBC fORGYU"
|
|
54
54
|
data-testid="avatar-wrapper"
|
|
55
55
|
>
|
|
56
56
|
<div
|
|
57
|
-
className="sc-
|
|
57
|
+
className="sc-ldFCYb iXxXyw"
|
|
58
58
|
data-testid="avatar"
|
|
59
59
|
/>
|
|
60
60
|
</div>
|
|
@@ -127,6 +127,21 @@ const initialStore = {
|
|
|
127
127
|
],
|
|
128
128
|
relatedPages: [],
|
|
129
129
|
},
|
|
130
|
+
{
|
|
131
|
+
id: 6,
|
|
132
|
+
name: "Page custom",
|
|
133
|
+
description: "This is the integration page custom",
|
|
134
|
+
site: 86,
|
|
135
|
+
contentHead: "<script>console.log('Hello')</script>",
|
|
136
|
+
contentBody: "",
|
|
137
|
+
contentBodyPosition: "start",
|
|
138
|
+
contentPresence: {
|
|
139
|
+
presenceType: "page-custom",
|
|
140
|
+
relatedPages: null,
|
|
141
|
+
},
|
|
142
|
+
active: true,
|
|
143
|
+
relatedPages: [],
|
|
144
|
+
},
|
|
130
145
|
],
|
|
131
146
|
totalItems: 3,
|
|
132
147
|
integrationCopy: null,
|
|
@@ -157,7 +172,7 @@ describe("IntegrationsField component rendering", () => {
|
|
|
157
172
|
);
|
|
158
173
|
});
|
|
159
174
|
|
|
160
|
-
expect(screen.getByText("
|
|
175
|
+
expect(screen.getByText("Add-ons")).toBeTruthy();
|
|
161
176
|
});
|
|
162
177
|
|
|
163
178
|
test("should render the component IntegrationsField with integrations", async () => {
|
|
@@ -183,7 +198,7 @@ describe("IntegrationsField component rendering", () => {
|
|
|
183
198
|
);
|
|
184
199
|
});
|
|
185
200
|
|
|
186
|
-
expect(screen.getAllByTestId("integration-item").length).toBe(
|
|
201
|
+
expect(screen.getAllByTestId("integration-item").length).toBe(4);
|
|
187
202
|
});
|
|
188
203
|
|
|
189
204
|
test("should render the component IntegrationsField with custom code integration", async () => {
|
|
@@ -218,7 +233,7 @@ describe("IntegrationsField component rendering", () => {
|
|
|
218
233
|
);
|
|
219
234
|
});
|
|
220
235
|
|
|
221
|
-
expect(screen.getAllByTestId("integration-item").length).toBe(
|
|
236
|
+
expect(screen.getAllByTestId("integration-item").length).toBe(5);
|
|
222
237
|
});
|
|
223
238
|
});
|
|
224
239
|
|
|
@@ -247,17 +262,17 @@ describe("Events", () => {
|
|
|
247
262
|
);
|
|
248
263
|
});
|
|
249
264
|
|
|
250
|
-
expect(screen.getAllByTestId("integration-item").length).toBe(
|
|
265
|
+
expect(screen.getAllByTestId("integration-item").length).toBe(4);
|
|
251
266
|
|
|
252
267
|
const floatingMenuButtons = screen.getAllByTestId("floating-menu-button");
|
|
253
268
|
fireEvent.click(floatingMenuButtons[1]);
|
|
254
|
-
const actionMenu = screen.
|
|
255
|
-
fireEvent.click(actionMenu);
|
|
269
|
+
const actionMenu = screen.getAllByTestId("action-menu-item");
|
|
270
|
+
fireEvent.click(actionMenu[1]);
|
|
256
271
|
|
|
257
272
|
const buttonsDefault = screen.getAllByTestId("button-default");
|
|
258
|
-
fireEvent.click(buttonsDefault[
|
|
273
|
+
fireEvent.click(buttonsDefault[4]);
|
|
259
274
|
|
|
260
|
-
const integrationsWithDeletion = initialStore.integrations.integrations.slice(0,
|
|
275
|
+
const integrationsWithDeletion = initialStore.integrations.integrations.slice(0,3);
|
|
261
276
|
|
|
262
277
|
expect(onChange).toHaveBeenLastCalledWith(integrationsWithDeletion);
|
|
263
278
|
});
|
|
@@ -35,7 +35,7 @@ const VariablesPanel = (props: IProps): JSX.Element => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
const noteText =
|
|
38
|
-
"This
|
|
38
|
+
"This add-on has some variables assigned. You can define its values to customize some properties.";
|
|
39
39
|
|
|
40
40
|
const Variable = ({ variable }: { variable: IIntegrationVariable }) => {
|
|
41
41
|
const handleChange = (value: string) => setVariableValueRef.current(variable.id, value);
|
|
@@ -12,7 +12,7 @@ const DeleteModal = (props: IModal & { integrationName: string | undefined }): J
|
|
|
12
12
|
<Modal
|
|
13
13
|
isOpen={isOpen}
|
|
14
14
|
hide={toggleModal}
|
|
15
|
-
title={`Remove ${integrationName}
|
|
15
|
+
title={`Remove ${integrationName} add-on`}
|
|
16
16
|
secondaryAction={secondaryModalAction}
|
|
17
17
|
mainAction={mainModalAction}
|
|
18
18
|
size="S"
|
|
@@ -60,7 +60,7 @@ const IntegrationItem = (props: IProps): JSX.Element => {
|
|
|
60
60
|
const integrationName = isCustom ? "Custom Code" : integration.name;
|
|
61
61
|
|
|
62
62
|
const mainDeleteModalAction = {
|
|
63
|
-
title: "Remove
|
|
63
|
+
title: "Remove add-on",
|
|
64
64
|
onClick: removeItem,
|
|
65
65
|
};
|
|
66
66
|
const secondaryDeleteModalAction = { title: "Cancel", onClick: toggleModalDelete };
|
|
@@ -25,7 +25,7 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
|
|
|
25
25
|
? createPortal(
|
|
26
26
|
<S.Wrapper ref={node}>
|
|
27
27
|
<S.Header>
|
|
28
|
-
<S.Title>
|
|
28
|
+
<S.Title>Add-ons</S.Title>
|
|
29
29
|
<S.ButtonWrapper>
|
|
30
30
|
<IconAction icon="close" onClick={toggleModal} />
|
|
31
31
|
</S.ButtonWrapper>
|
|
@@ -65,7 +65,8 @@ const IntegrationsField = (props: IIntegrationsFieldProps): JSX.Element => {
|
|
|
65
65
|
|
|
66
66
|
const timeSinceIntegrationCopy = !!integrationCopy && differenceInSeconds(new Date(), new Date(integrationCopy.date));
|
|
67
67
|
const eightHoursInSeconds = 8 * 60 * 60;
|
|
68
|
-
const showPasteIntegrationButton =
|
|
68
|
+
const showPasteIntegrationButton =
|
|
69
|
+
!disabled && !!integrationCopy && timeSinceIntegrationCopy < eightHoursInSeconds;
|
|
69
70
|
|
|
70
71
|
const pasteIntegration = () => {
|
|
71
72
|
integrationCopy && handleAdd(integrationCopy.integration);
|
|
@@ -73,14 +74,14 @@ const IntegrationsField = (props: IIntegrationsFieldProps): JSX.Element => {
|
|
|
73
74
|
|
|
74
75
|
return (
|
|
75
76
|
<S.Wrapper>
|
|
76
|
-
<S.Title>
|
|
77
|
+
<S.Title>Add-ons</S.Title>
|
|
77
78
|
<S.ItemRow>
|
|
78
79
|
<S.Subtitle>{state?.length || 0} items</S.Subtitle>
|
|
79
80
|
<S.ActionsWrapper>
|
|
80
81
|
{showPasteIntegrationButton && <PasteIntegrationButton pasteIntegration={pasteIntegration} />}
|
|
81
82
|
{!disabled && (
|
|
82
83
|
<>
|
|
83
|
-
<Tooltip content="Add
|
|
84
|
+
<Tooltip content="Add Add-on" hideOnClick>
|
|
84
85
|
<IconAction icon="add" onClick={toggleModal} />
|
|
85
86
|
</Tooltip>
|
|
86
87
|
<SideModal
|
|
@@ -8,7 +8,7 @@ import AutoItem from "./AutoItem";
|
|
|
8
8
|
import * as S from "./style";
|
|
9
9
|
|
|
10
10
|
const AutoPanel = (props: IProps): JSX.Element => {
|
|
11
|
-
const { onChange, site, structuredData, validators } = props;
|
|
11
|
+
const { onChange, site, structuredData, validators, categories } = props;
|
|
12
12
|
|
|
13
13
|
const { state, setState } = useReference();
|
|
14
14
|
|
|
@@ -199,7 +199,7 @@ const AutoPanel = (props: IProps): JSX.Element => {
|
|
|
199
199
|
filter={sourceFilters}
|
|
200
200
|
addFilter={handleAddFilter}
|
|
201
201
|
site={site}
|
|
202
|
-
structuredDataSite={structuredData.site}
|
|
202
|
+
structuredDataSite={[...structuredData.site, ...categories.site]}
|
|
203
203
|
/>
|
|
204
204
|
);
|
|
205
205
|
})}
|
|
@@ -241,6 +241,7 @@ const AutoPanel = (props: IProps): JSX.Element => {
|
|
|
241
241
|
|
|
242
242
|
interface IProps {
|
|
243
243
|
structuredData: { global: IStructuredData[]; site: IStructuredData[] };
|
|
244
|
+
categories: { global: IStructuredData[]; site: IStructuredData[] };
|
|
244
245
|
onChange: (value: any) => void;
|
|
245
246
|
site: ISite;
|
|
246
247
|
validators?: Record<string, unknown>;
|
|
@@ -28,6 +28,7 @@ const ReferenceField = (props: IReferenceFieldProps) => {
|
|
|
28
28
|
site,
|
|
29
29
|
selectionType,
|
|
30
30
|
structuredDataValues,
|
|
31
|
+
categories,
|
|
31
32
|
validators,
|
|
32
33
|
maxItems,
|
|
33
34
|
resetValidation,
|
|
@@ -170,7 +171,7 @@ const ReferenceField = (props: IReferenceFieldProps) => {
|
|
|
170
171
|
|
|
171
172
|
const getPanel = () =>
|
|
172
173
|
isAuto ? (
|
|
173
|
-
<AutoPanel structuredData={structuredDataValues} onChange={handleOnChange} site={site} validators={validators} />
|
|
174
|
+
<AutoPanel structuredData={structuredDataValues} categories={categories} onChange={handleOnChange} site={site} validators={validators} />
|
|
174
175
|
) : (
|
|
175
176
|
<ManualPanel
|
|
176
177
|
onChange={handleOnChange}
|
|
@@ -229,6 +230,7 @@ export interface IReferenceFieldProps {
|
|
|
229
230
|
site: ISite;
|
|
230
231
|
selectionType?: string[];
|
|
231
232
|
structuredDataValues: { global: IStructuredData[]; site: IStructuredData[] };
|
|
233
|
+
categories: { global: IStructuredData[]; site: IStructuredData[] };
|
|
232
234
|
validators?: Record<string, unknown>;
|
|
233
235
|
maxItems?: number;
|
|
234
236
|
resetValidation?: () => void;
|
|
@@ -239,6 +241,7 @@ export interface IReferenceFieldProps {
|
|
|
239
241
|
|
|
240
242
|
const mapStateToProps = (state: IRootState) => ({
|
|
241
243
|
structuredDataValues: state.structuredData.structuredData,
|
|
244
|
+
categories: state.structuredData.categories,
|
|
242
245
|
});
|
|
243
246
|
|
|
244
247
|
export default connect(mapStateToProps, null)(ReferenceFieldWithProvider);
|
|
@@ -81,7 +81,7 @@ const CategoriesList = (props: IProps): JSX.Element => {
|
|
|
81
81
|
useEffect(() => {
|
|
82
82
|
currentStructuredData && getContents(currentStructuredData.id);
|
|
83
83
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
84
|
-
}, [lang, currentStructuredData]);
|
|
84
|
+
}, [lang, currentStructuredData, page]);
|
|
85
85
|
|
|
86
86
|
const handleClick = (dataID: string) => {
|
|
87
87
|
setSelectedCategory(dataID, scope);
|
|
@@ -80,7 +80,7 @@ const IntegrationForm = (props: IProps) => {
|
|
|
80
80
|
action: handleSave,
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
const pageTitle = form.name.trim().length > 0 ? form.name : "New
|
|
83
|
+
const pageTitle = form.name.trim().length > 0 ? form.name : "New Add-on";
|
|
84
84
|
|
|
85
85
|
const bodyOptions = [
|
|
86
86
|
{
|
|
@@ -10,7 +10,7 @@ const CopyModal = (props: ICopyModalProps): JSX.Element => {
|
|
|
10
10
|
const [site, setSite] = useState();
|
|
11
11
|
|
|
12
12
|
const mainCopyModalAction = {
|
|
13
|
-
title: "Copy
|
|
13
|
+
title: "Copy add-on",
|
|
14
14
|
onClick: () => site && action(site),
|
|
15
15
|
disabled: !site,
|
|
16
16
|
};
|
|
@@ -21,14 +21,14 @@ const CopyModal = (props: ICopyModalProps): JSX.Element => {
|
|
|
21
21
|
<Modal
|
|
22
22
|
isOpen={isOpen}
|
|
23
23
|
hide={hide}
|
|
24
|
-
title="Copy
|
|
24
|
+
title="Copy add-on in another site"
|
|
25
25
|
secondaryAction={secondaryCopyModalAction}
|
|
26
26
|
mainAction={mainCopyModalAction}
|
|
27
27
|
size="S"
|
|
28
28
|
overflow="visible"
|
|
29
29
|
>
|
|
30
30
|
<S.ModalContent>
|
|
31
|
-
<S.Title>Select a site to copy this
|
|
31
|
+
<S.Title>Select a site to copy this add-on.</S.Title>
|
|
32
32
|
<FieldsBehavior name="language" fieldType="AsyncSelect" value={site} entity="sites" onChange={setSite} />
|
|
33
33
|
</S.ModalContent>
|
|
34
34
|
</Modal>
|
|
@@ -79,14 +79,14 @@ const IntegrationItem = (props: IIntegrationItemProps): JSX.Element => {
|
|
|
79
79
|
];
|
|
80
80
|
|
|
81
81
|
const mainDeleteModalAction = {
|
|
82
|
-
title: "Delete
|
|
82
|
+
title: "Delete add-on",
|
|
83
83
|
onClick: removeItem,
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
const secondaryDeleteModalAction = { title: "Cancel", onClick: toggleModalDelete };
|
|
87
87
|
|
|
88
88
|
const mainChangeStateModalAction = {
|
|
89
|
-
title: `${integration.active ? "Disable" : "Enable"}
|
|
89
|
+
title: `${integration.active ? "Disable" : "Enable"} add-on`,
|
|
90
90
|
onClick: handleChangeState,
|
|
91
91
|
};
|
|
92
92
|
|
|
@@ -94,7 +94,7 @@ const IntegrationItem = (props: IIntegrationItemProps): JSX.Element => {
|
|
|
94
94
|
|
|
95
95
|
const copyToastProps = {
|
|
96
96
|
setIsVisible: setIsVisibleCopy,
|
|
97
|
-
message: "1
|
|
97
|
+
message: "1 Add-on copied to another Site",
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
const copyIntegration = async (site: number) => {
|
|
@@ -108,7 +108,7 @@ const IntegrationItem = (props: IIntegrationItemProps): JSX.Element => {
|
|
|
108
108
|
const handleClick = () => {
|
|
109
109
|
const { setCurrentIntegration, setHistoryPush } = props;
|
|
110
110
|
setCurrentIntegration(integration);
|
|
111
|
-
setHistoryPush("
|
|
111
|
+
setHistoryPush("addons/edit");
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
return (
|
|
@@ -136,27 +136,27 @@ const IntegrationItem = (props: IIntegrationItemProps): JSX.Element => {
|
|
|
136
136
|
<Modal
|
|
137
137
|
isOpen={isOpenDelete}
|
|
138
138
|
hide={toggleModalDelete}
|
|
139
|
-
title="Delete
|
|
139
|
+
title="Delete add-on"
|
|
140
140
|
secondaryAction={secondaryDeleteModalAction}
|
|
141
141
|
mainAction={mainDeleteModalAction}
|
|
142
142
|
size="S"
|
|
143
143
|
>
|
|
144
144
|
<S.ModalContent>
|
|
145
|
-
Are you sure you want to delete <strong>{integration.name}
|
|
145
|
+
Are you sure you want to delete <strong>{integration.name} add-on</strong>? This action{" "}
|
|
146
146
|
<strong>cannot be undone</strong>.
|
|
147
147
|
</S.ModalContent>
|
|
148
148
|
</Modal>
|
|
149
149
|
<Modal
|
|
150
150
|
isOpen={isOpenChangeState}
|
|
151
151
|
hide={toggleModalChangeState}
|
|
152
|
-
title={`${integration.active ? "Disable" : "Enable"}
|
|
152
|
+
title={`${integration.active ? "Disable" : "Enable"} Add-on`}
|
|
153
153
|
secondaryAction={secondaryChangeStateModalAction}
|
|
154
154
|
mainAction={mainChangeStateModalAction}
|
|
155
155
|
size="S"
|
|
156
156
|
>
|
|
157
157
|
<S.ModalContent>
|
|
158
158
|
Are you sure you want to {integration.active ? "disable" : "enable"}{" "}
|
|
159
|
-
<strong>{integration.name}
|
|
159
|
+
<strong>{integration.name} add-on</strong>? This add-on will {integration.active ? "stop" : "start"}{" "}
|
|
160
160
|
working in the pages previously added.
|
|
161
161
|
</S.ModalContent>
|
|
162
162
|
</Modal>
|
|
@@ -13,7 +13,7 @@ const DeleteModal = (props: IModal & { integrations: IIntegration[]; selectedIds
|
|
|
13
13
|
<Modal
|
|
14
14
|
isOpen={isOpen}
|
|
15
15
|
hide={toggleModal}
|
|
16
|
-
title="Delete
|
|
16
|
+
title="Delete Add-ons"
|
|
17
17
|
secondaryAction={secondaryModalAction}
|
|
18
18
|
mainAction={mainModalAction}
|
|
19
19
|
size="S"
|
|
@@ -33,13 +33,13 @@ const DeactivateModal = (props: IModal & { integrations: IIntegration[]; selecte
|
|
|
33
33
|
<Modal
|
|
34
34
|
isOpen={isOpen}
|
|
35
35
|
hide={toggleModal}
|
|
36
|
-
title="Deactivate
|
|
36
|
+
title="Deactivate Add-ons"
|
|
37
37
|
secondaryAction={secondaryModalAction}
|
|
38
38
|
mainAction={mainModalAction}
|
|
39
39
|
size="S"
|
|
40
40
|
>
|
|
41
41
|
<S.ModalContent>
|
|
42
|
-
Are you sure you want to disable {getIntegrationsNames(integrations, selectedIds)}? These
|
|
42
|
+
Are you sure you want to disable {getIntegrationsNames(integrations, selectedIds)}? These add-ons will stop
|
|
43
43
|
working in the pages previously added.
|
|
44
44
|
</S.ModalContent>
|
|
45
45
|
</Modal>
|
|
@@ -53,9 +53,9 @@ const Integrations = (props: IIntegrationsProps): JSX.Element => {
|
|
|
53
53
|
} = useToast();
|
|
54
54
|
|
|
55
55
|
const noElementsProps: IEmptyStateProps = {
|
|
56
|
-
message: "To start using
|
|
56
|
+
message: "To start using add-ons in your site, create as many Custom Code as you need.",
|
|
57
57
|
button: "Create custom code",
|
|
58
|
-
action: () => setHistoryPush(`/sites/settings/
|
|
58
|
+
action: () => setHistoryPush(`/sites/settings/addons/new`),
|
|
59
59
|
};
|
|
60
60
|
const fetchState = { isLoading, isFiltered };
|
|
61
61
|
const { isEmpty, emptyStateProps } = useEmptyState(integrations, fetchState, { noElementsProps });
|
|
@@ -164,37 +164,37 @@ const Integrations = (props: IIntegrationsProps): JSX.Element => {
|
|
|
164
164
|
};
|
|
165
165
|
|
|
166
166
|
const mainDeleteModalAction = {
|
|
167
|
-
title: "Delete
|
|
167
|
+
title: "Delete add-ons",
|
|
168
168
|
onClick: bulkDelete,
|
|
169
169
|
};
|
|
170
170
|
const secondaryDeleteModalAction = { title: "Cancel", onClick: toggleModalDelete };
|
|
171
171
|
|
|
172
172
|
const mainDeactivateModalAction = {
|
|
173
|
-
title: "Deactivate
|
|
173
|
+
title: "Deactivate add-ons",
|
|
174
174
|
onClick: bulkDeactivate,
|
|
175
175
|
};
|
|
176
176
|
const secondaryDeactivateModalAction = { title: "Cancel", onClick: toggleModalDeactivate };
|
|
177
177
|
|
|
178
178
|
const deletedToastProps = {
|
|
179
179
|
setIsVisible: setIsVisibleDelete,
|
|
180
|
-
message: stateToastDelete?.total > 1 ? `${stateToastDelete?.total}
|
|
180
|
+
message: stateToastDelete?.total > 1 ? `${stateToastDelete?.total} add-ons deleted` : "Add-on deleted",
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
const changedToastProps = {
|
|
184
184
|
setIsVisible: setIsVisibleChange,
|
|
185
|
-
message: `${stateToastChange?.total}
|
|
185
|
+
message: `${stateToastChange?.total} add-on${stateToastChange?.total > 1 ? "s" : ""} ${
|
|
186
186
|
stateToastChange?.active ? "enabled" : "disabled"
|
|
187
187
|
}`,
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
const rightButtonProps = {
|
|
191
191
|
label: "New Custom Code",
|
|
192
|
-
action: () => setHistoryPush(`/sites/settings/
|
|
192
|
+
action: () => setHistoryPush(`/sites/settings/addons/new`),
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
return (
|
|
196
196
|
<>
|
|
197
|
-
<MainWrapper backLink={false} title="
|
|
197
|
+
<MainWrapper backLink={false} title="Add-ons" rightButton={rightButtonProps}>
|
|
198
198
|
<S.Wrapper data-testid="integrations-main-wrapper">
|
|
199
199
|
<S.ContentWrapper>
|
|
200
200
|
<ErrorToast />
|
|
@@ -24,13 +24,13 @@ const getIntegrationsNames = (integrations: IIntegration[], ids: number[]) => {
|
|
|
24
24
|
return (
|
|
25
25
|
<>
|
|
26
26
|
<strong>{namesString.substring(0, lastCommaIndex - 1)}</strong> and
|
|
27
|
-
<strong>{namesString.substring(lastCommaIndex + 1)}</strong>
|
|
27
|
+
<strong>{namesString.substring(lastCommaIndex + 1)}</strong> add-ons
|
|
28
28
|
</>
|
|
29
29
|
);
|
|
30
30
|
} else {
|
|
31
31
|
return (
|
|
32
32
|
<>
|
|
33
|
-
<strong>{namesString}</strong>
|
|
33
|
+
<strong>{namesString}</strong> add-on
|
|
34
34
|
</>
|
|
35
35
|
);
|
|
36
36
|
}
|
package/src/routes/site.tsx
CHANGED
|
@@ -104,24 +104,24 @@ export default [
|
|
|
104
104
|
name: "SEO & Analytics",
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
path: `${BASE_PATH}/settings/
|
|
107
|
+
path: `${BASE_PATH}/settings/addons`,
|
|
108
108
|
component: Integrations,
|
|
109
|
-
name: "
|
|
109
|
+
name: "Add-ons",
|
|
110
110
|
},
|
|
111
111
|
],
|
|
112
112
|
},
|
|
113
113
|
],
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
|
-
path: `${BASE_PATH}/settings/
|
|
116
|
+
path: `${BASE_PATH}/settings/addons/new`,
|
|
117
117
|
component: IntegrationForm,
|
|
118
|
-
name: "New
|
|
118
|
+
name: "New Add-on",
|
|
119
119
|
showInNav: false,
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
|
-
path: `${BASE_PATH}/settings/
|
|
122
|
+
path: `${BASE_PATH}/settings/addons/edit`,
|
|
123
123
|
component: IntegrationForm,
|
|
124
|
-
name: "Edit
|
|
124
|
+
name: "Edit Add-on",
|
|
125
125
|
showInNav: false,
|
|
126
126
|
},
|
|
127
127
|
{ path: `${BASE_PATH}/settings/languages`, component: Settings, name: "Languages", showInNav: false },
|