@griddo/ax 10.2.10 → 10.2.12
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/UrlField/UrlField.test.tsx +1 -1
- package/src/components/Fields/AsyncSelect/index.tsx +12 -8
- package/src/components/Fields/AsyncSelect/style.tsx +58 -1
- package/src/components/Fields/CheckField/index.tsx +15 -2
- package/src/components/Fields/IntegrationsField/IntegrationItem/CustomPanel/index.tsx +49 -47
- package/src/components/Fields/IntegrationsField/IntegrationItem/CustomPanel/style.tsx +6 -1
- package/src/components/Fields/IntegrationsField/IntegrationItem/VariablesPanel/index.tsx +13 -11
- package/src/components/Fields/IntegrationsField/IntegrationItem/VariablesPanel/style.tsx +6 -3
- package/src/components/Fields/MultiCheckSelect/style.tsx +1 -0
- package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +274 -38
- package/src/components/Fields/ReferenceField/AutoPanel/style.tsx +112 -15
- package/src/components/Fields/ReferenceField/Context/index.tsx +18 -10
- package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +9 -30
- package/src/components/Fields/ReferenceField/ItemList/Item/style.tsx +9 -51
- package/src/components/Fields/ReferenceField/ItemList/index.tsx +10 -6
- package/src/components/Fields/ReferenceField/ManualPanel/index.tsx +36 -18
- package/src/components/Fields/ReferenceField/ManualPanel/style.tsx +2 -0
- package/src/components/Fields/ReferenceField/index.tsx +1 -0
- package/src/components/Fields/Select/index.tsx +10 -13
- package/src/components/Fields/Select/style.tsx +13 -7
- package/src/components/Fields/TimeField/index.tsx +1 -0
- package/src/components/Fields/UniqueCheck/index.tsx +3 -1
- package/src/components/Fields/UrlField/index.tsx +3 -1
- package/src/components/Fields/UrlField/style.tsx +6 -1
- package/src/components/FloatingPanel/style.tsx +0 -1
- package/src/components/PageFinder/index.tsx +8 -7
- package/src/components/SearchField/index.tsx +2 -3
- package/src/helpers/arrays.tsx +2 -2
- package/src/modules/Analytics/DimensionPanel/index.tsx +44 -42
- package/src/modules/Analytics/DimensionPanel/style.tsx +6 -1
- package/src/modules/Analytics/GroupPanel/index.tsx +57 -64
- package/src/modules/Analytics/GroupPanel/style.tsx +6 -0
- package/src/modules/Categories/CategoriesList/CategoryPanel/index.tsx +15 -13
- package/src/modules/Categories/CategoriesList/CategoryPanel/style.tsx +11 -4
- package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/index.tsx +20 -18
- package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/style.tsx +6 -1
- package/src/modules/Navigation/Menus/List/Table/ConfigPanel/index.tsx +8 -6
- package/src/modules/Navigation/Menus/List/Table/ConfigPanel/style.tsx +6 -1
- package/src/modules/Navigation/Menus/List/Table/SidePanel/index.tsx +15 -13
- package/src/modules/Navigation/Menus/List/Table/SidePanel/style.tsx +9 -2
- package/src/modules/Redirects/RedirectPanel/index.tsx +33 -31
- package/src/modules/Redirects/RedirectPanel/style.tsx +6 -1
- package/src/modules/Redirects/index.tsx +0 -1
- package/src/modules/Settings/Integrations/IntegrationForm/VariablePanel/index.tsx +63 -61
- package/src/modules/Settings/Integrations/IntegrationForm/VariablePanel/style.tsx +6 -1
- package/src/modules/Settings/Integrations/IntegrationForm/index.tsx +5 -3
- package/src/modules/Settings/Integrations/IntegrationForm/style.tsx +6 -0
- package/src/modules/Settings/Languages/LanguagePanel/index.tsx +14 -12
- package/src/modules/Settings/Languages/LanguagePanel/style.tsx +8 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "10.2.
|
|
4
|
+
"version": "10.2.12",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -231,5 +231,5 @@
|
|
|
231
231
|
"publishConfig": {
|
|
232
232
|
"access": "public"
|
|
233
233
|
},
|
|
234
|
-
"gitHead": "
|
|
234
|
+
"gitHead": "7985f1e2650c017b4fd9873cf942bae0fd1e2670"
|
|
235
235
|
}
|
|
@@ -293,7 +293,7 @@ describe("UrlField component rendering", () => {
|
|
|
293
293
|
const selectComponents = screen.getAllByTestId("select-component");
|
|
294
294
|
|
|
295
295
|
await act(async () => {
|
|
296
|
-
selectComponents[
|
|
296
|
+
selectComponents[2].click();
|
|
297
297
|
});
|
|
298
298
|
|
|
299
299
|
expect(selectComponents).toBeTruthy();
|
|
@@ -23,6 +23,8 @@ const AsyncSelect = (props: IAsyncSelectProps): JSX.Element => {
|
|
|
23
23
|
filter,
|
|
24
24
|
options,
|
|
25
25
|
source,
|
|
26
|
+
type,
|
|
27
|
+
maxWidth,
|
|
26
28
|
} = props;
|
|
27
29
|
|
|
28
30
|
const initialState: { items: IOption[]; hasEmptyOption: boolean } = {
|
|
@@ -110,16 +112,14 @@ const AsyncSelect = (props: IAsyncSelectProps): JSX.Element => {
|
|
|
110
112
|
|
|
111
113
|
// tslint:disable-next-line: no-shadowed-variable
|
|
112
114
|
const getObjectValue = (val: any, options: IOption[]) => {
|
|
113
|
-
if (!val) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
115
|
const fixedVal = Array.isArray(val) ? val[0] : val;
|
|
117
|
-
const selectedValue = typeof fixedVal === "object" ? fixedVal.id : fixedVal;
|
|
116
|
+
const selectedValue = fixedVal && typeof fixedVal === "object" ? fixedVal.id : fixedVal;
|
|
118
117
|
|
|
119
118
|
return options && options.find((option: IOption) => option.value === selectedValue);
|
|
120
119
|
};
|
|
121
120
|
|
|
122
|
-
const className = error ?
|
|
121
|
+
const className = error ? `react-select-error ${type}` : type;
|
|
122
|
+
const searchable = type === "inline" ? false : true;
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
125
|
<div data-testid="asyncSelect">
|
|
@@ -137,6 +137,8 @@ const AsyncSelect = (props: IAsyncSelectProps): JSX.Element => {
|
|
|
137
137
|
className={className}
|
|
138
138
|
mandatory={mandatory}
|
|
139
139
|
hasEmptyOption={state.hasEmptyOption}
|
|
140
|
+
isSearchable={searchable}
|
|
141
|
+
maxWidth={maxWidth}
|
|
140
142
|
/>
|
|
141
143
|
</div>
|
|
142
144
|
);
|
|
@@ -160,14 +162,16 @@ export interface IAsyncSelectProps {
|
|
|
160
162
|
error?: boolean;
|
|
161
163
|
disabled?: boolean;
|
|
162
164
|
onChange: (value: string | number | null) => void;
|
|
163
|
-
site
|
|
164
|
-
lang
|
|
165
|
-
selectedContent
|
|
165
|
+
site?: ISite | null;
|
|
166
|
+
lang?: string;
|
|
167
|
+
selectedContent?: any;
|
|
166
168
|
mandatory?: boolean;
|
|
167
169
|
placeholder?: string;
|
|
168
170
|
filter?: any[];
|
|
169
171
|
options?: any[];
|
|
170
172
|
source?: string;
|
|
173
|
+
type?: string;
|
|
174
|
+
maxWidth?: number;
|
|
171
175
|
}
|
|
172
176
|
|
|
173
177
|
export default AsyncSelect;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import AsyncSelect from "react-select/async";
|
|
3
3
|
|
|
4
|
-
export const StyledSelect = styled(AsyncSelect)<{
|
|
4
|
+
export const StyledSelect = styled(AsyncSelect)<{
|
|
5
|
+
isDisabled: boolean | undefined;
|
|
6
|
+
error: boolean | undefined;
|
|
7
|
+
maxWidth?: number;
|
|
8
|
+
}>`
|
|
5
9
|
${(p) => p.theme.textStyle.fieldContent};
|
|
6
10
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
7
11
|
margin-bottom: ${(p) => p.theme.spacing.xxs};
|
|
@@ -90,4 +94,57 @@ export const StyledSelect = styled(AsyncSelect)<{ isDisabled: boolean | undefine
|
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
}
|
|
97
|
+
|
|
98
|
+
&.inline {
|
|
99
|
+
${(p) => p.theme.textStyle.uiS};
|
|
100
|
+
text-transform: capitalize;
|
|
101
|
+
|
|
102
|
+
.react-select__control {
|
|
103
|
+
background: transparent;
|
|
104
|
+
border: none;
|
|
105
|
+
height: auto;
|
|
106
|
+
justify-content: ${(p) => (p.alignRight ? "flex-end" : "flex-start")};
|
|
107
|
+
min-width: auto;
|
|
108
|
+
|
|
109
|
+
.react-select__value-container {
|
|
110
|
+
flex: 0 1 auto;
|
|
111
|
+
padding: 0;
|
|
112
|
+
.react-select__single-value {
|
|
113
|
+
position: relative;
|
|
114
|
+
transform: none;
|
|
115
|
+
color: ${(p) => (p.error ? p.theme.color.error : p.theme.color.interactive01)};
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
text-overflow: ellipsis;
|
|
118
|
+
max-width: ${(p) => (p.maxWidth ? `${p.maxWidth}px` : `calc(${p.theme.spacing.xl} * 4)`)};
|
|
119
|
+
display: block;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
.react-select__indicator {
|
|
124
|
+
color: ${(p) => (p.error ? p.theme.color.error : p.theme.color.interactive01)};
|
|
125
|
+
padding: 0;
|
|
126
|
+
svg {
|
|
127
|
+
width: ${(p) => p.theme.spacing.s};
|
|
128
|
+
height: ${(p) => p.theme.spacing.s};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.react-select__input {
|
|
132
|
+
input {
|
|
133
|
+
cursor: default;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.react-select__control--is-disabled {
|
|
139
|
+
.react-select__value-container {
|
|
140
|
+
.react-select__single-value {
|
|
141
|
+
color: ${(p) => p.theme.color.interactiveDisabled};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.react-select__menu {
|
|
147
|
+
${(p) => p.theme.textStyle.fieldContent};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
93
150
|
`;
|
|
@@ -5,7 +5,19 @@ import Icon from "@ax/components/Icon";
|
|
|
5
5
|
import * as S from "./style";
|
|
6
6
|
|
|
7
7
|
const CheckField = (props: ICheckFieldProps): JSX.Element => {
|
|
8
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
name,
|
|
10
|
+
title,
|
|
11
|
+
value,
|
|
12
|
+
checked,
|
|
13
|
+
error,
|
|
14
|
+
disabled,
|
|
15
|
+
indeterminate,
|
|
16
|
+
onChange,
|
|
17
|
+
icon,
|
|
18
|
+
className,
|
|
19
|
+
inversed = false,
|
|
20
|
+
} = props;
|
|
9
21
|
|
|
10
22
|
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
11
23
|
const isChecked = e.target.checked;
|
|
@@ -15,7 +27,7 @@ const CheckField = (props: ICheckFieldProps): JSX.Element => {
|
|
|
15
27
|
};
|
|
16
28
|
|
|
17
29
|
return (
|
|
18
|
-
<S.Wrapper>
|
|
30
|
+
<S.Wrapper className={className}>
|
|
19
31
|
<S.Label data-testid="check-field-label" disabled={disabled} inversed={inversed}>
|
|
20
32
|
{icon ? (
|
|
21
33
|
<S.IconLabelWrapper data-testid="check-field-icon-label">
|
|
@@ -60,6 +72,7 @@ export interface ICheckFieldProps {
|
|
|
60
72
|
onChange?: (value: ICheck) => void;
|
|
61
73
|
icon?: string;
|
|
62
74
|
inversed?: boolean;
|
|
75
|
+
className?: string;
|
|
63
76
|
}
|
|
64
77
|
|
|
65
78
|
export default CheckField;
|
|
@@ -40,53 +40,55 @@ const CustomPanel = (props: IProps): JSX.Element => {
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<FloatingPanel title="Add custom code" toggleModal={toggleModal} isOpen={isOpen}>
|
|
43
|
-
<S.
|
|
44
|
-
<S.
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<
|
|
87
|
-
{editButton.
|
|
88
|
-
|
|
89
|
-
|
|
43
|
+
<S.Wrapper>
|
|
44
|
+
<S.ContentWrapper>
|
|
45
|
+
<S.NoteWrapper>
|
|
46
|
+
<NoteField value={{ text: noteText }} />
|
|
47
|
+
</S.NoteWrapper>
|
|
48
|
+
<FieldsBehavior
|
|
49
|
+
title="Name"
|
|
50
|
+
name="name"
|
|
51
|
+
fieldType="TextField"
|
|
52
|
+
value={form.name}
|
|
53
|
+
placeholder="Type a name"
|
|
54
|
+
onChange={(value: string) => handleChange({ name: value })}
|
|
55
|
+
mandatory
|
|
56
|
+
validators={{ mandatory: true }}
|
|
57
|
+
/>
|
|
58
|
+
<FieldsBehavior
|
|
59
|
+
title="Head Code"
|
|
60
|
+
name="contentHead"
|
|
61
|
+
fieldType="TextArea"
|
|
62
|
+
value={form.contentHead}
|
|
63
|
+
placeholder="Enter the code that will be injected into the head’s page."
|
|
64
|
+
onChange={(value: string) => handleChange({ contentHead: value })}
|
|
65
|
+
rows={4}
|
|
66
|
+
/>
|
|
67
|
+
<FieldsBehavior
|
|
68
|
+
title="Body Code"
|
|
69
|
+
name="contentBody"
|
|
70
|
+
fieldType="TextArea"
|
|
71
|
+
value={form.contentBody}
|
|
72
|
+
placeholder="Enter the code that will be injected into the body’s page."
|
|
73
|
+
onChange={(value: string) => handleChange({ contentBody: value })}
|
|
74
|
+
rows={4}
|
|
75
|
+
/>
|
|
76
|
+
<FieldsBehavior
|
|
77
|
+
title="Page body code in:"
|
|
78
|
+
name="contentBodyPosition"
|
|
79
|
+
fieldType="RadioGroup"
|
|
80
|
+
value={form.contentBodyPosition}
|
|
81
|
+
options={bodyCodeOptions}
|
|
82
|
+
onChange={(value: string) => handleChange({ contentBodyPosition: value })}
|
|
83
|
+
disabled={!form.contentBody?.length}
|
|
84
|
+
/>
|
|
85
|
+
</S.ContentWrapper>
|
|
86
|
+
<S.Footer>
|
|
87
|
+
<Button className="button" type="button" onClick={editButton.action} disabled={!form.name?.length}>
|
|
88
|
+
{editButton.label}
|
|
89
|
+
</Button>
|
|
90
|
+
</S.Footer>
|
|
91
|
+
</S.Wrapper>
|
|
90
92
|
</FloatingPanel>
|
|
91
93
|
);
|
|
92
94
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
|
+
const Wrapper = styled.div`
|
|
4
|
+
padding: ${(p) => p.theme.spacing.m};
|
|
5
|
+
height: 100%;
|
|
6
|
+
`;
|
|
7
|
+
|
|
3
8
|
const Footer = styled.div`
|
|
4
9
|
position: absolute;
|
|
5
10
|
bottom: ${(p) => p.theme.spacing.m};
|
|
@@ -20,4 +25,4 @@ const ContentWrapper = styled.div`
|
|
|
20
25
|
padding: 0 ${(p) => p.theme.spacing.m} ${(p) => p.theme.spacing.s} ${(p) => p.theme.spacing.m};
|
|
21
26
|
`;
|
|
22
27
|
|
|
23
|
-
export { Footer, NoteWrapper, ContentWrapper };
|
|
28
|
+
export { Wrapper, Footer, NoteWrapper, ContentWrapper };
|
|
@@ -94,17 +94,19 @@ const VariablesPanel = (props: IProps): JSX.Element => {
|
|
|
94
94
|
|
|
95
95
|
return (
|
|
96
96
|
<FloatingPanel title="Define values" toggleModal={toggleModal} isOpen={isOpen}>
|
|
97
|
-
<S.
|
|
98
|
-
<S.
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<
|
|
105
|
-
{editButton.
|
|
106
|
-
|
|
107
|
-
|
|
97
|
+
<S.Wrapper>
|
|
98
|
+
<S.ContentWrapper>
|
|
99
|
+
<S.NoteWrapper>
|
|
100
|
+
<NoteField value={{ text: noteText }} />
|
|
101
|
+
</S.NoteWrapper>
|
|
102
|
+
{renderVariables()}
|
|
103
|
+
</S.ContentWrapper>
|
|
104
|
+
<S.Footer>
|
|
105
|
+
<Button className="button" type="button" onClick={editButton.action}>
|
|
106
|
+
{editButton.label}
|
|
107
|
+
</Button>
|
|
108
|
+
</S.Footer>
|
|
109
|
+
</S.Wrapper>
|
|
108
110
|
</FloatingPanel>
|
|
109
111
|
);
|
|
110
112
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
|
+
const Wrapper = styled.div`
|
|
4
|
+
padding: ${(p) => p.theme.spacing.m};
|
|
5
|
+
height: 100%;
|
|
6
|
+
`;
|
|
7
|
+
|
|
3
8
|
const Footer = styled.div`
|
|
4
9
|
position: absolute;
|
|
5
10
|
bottom: ${(p) => p.theme.spacing.m};
|
|
@@ -8,9 +13,7 @@ const Footer = styled.div`
|
|
|
8
13
|
|
|
9
14
|
const NoteWrapper = styled.div`
|
|
10
15
|
margin-bottom: ${(p) => p.theme.spacing.m};
|
|
11
|
-
|
|
12
16
|
`
|
|
13
|
-
|
|
14
17
|
const ContentWrapper = styled.div`
|
|
15
18
|
height: calc(100% - ${(p) => p.theme.spacing.s} * 10);
|
|
16
19
|
overflow-y: scroll;
|
|
@@ -20,4 +23,4 @@ const ContentWrapper = styled.div`
|
|
|
20
23
|
padding: 0 ${(p) => p.theme.spacing.m} ${(p) => p.theme.spacing.s} ${(p) => p.theme.spacing.m};
|
|
21
24
|
`;
|
|
22
25
|
|
|
23
|
-
export { Footer, NoteWrapper, ContentWrapper };
|
|
26
|
+
export { Wrapper, Footer, NoteWrapper, ContentWrapper };
|
|
@@ -55,6 +55,7 @@ const DropDown = styled.div<{ floating?: boolean; isOpen: boolean }>`
|
|
|
55
55
|
z-index: 2;
|
|
56
56
|
height: ${(p) => (p.isOpen ? "100%" : 0)};
|
|
57
57
|
max-height: 130px;
|
|
58
|
+
min-height: 100px;
|
|
58
59
|
overflow: ${(p) => (p.isOpen ? "auto" : "hidden")};
|
|
59
60
|
position: ${(p) => (p.floating ? "absolute" : "block")};
|
|
60
61
|
`;
|