@griddo/ax 10.2.11 → 10.2.13

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.
Files changed (56) hide show
  1. package/package.json +2 -2
  2. package/src/__tests__/components/Fields/ReferenceField/ReferenceField.test.tsx +1 -1
  3. package/src/__tests__/components/Fields/UrlField/UrlField.test.tsx +1 -1
  4. package/src/components/Fields/AsyncSelect/index.tsx +12 -8
  5. package/src/components/Fields/AsyncSelect/style.tsx +58 -1
  6. package/src/components/Fields/CheckField/index.tsx +15 -2
  7. package/src/components/Fields/IntegrationsField/IntegrationItem/CustomPanel/index.tsx +49 -47
  8. package/src/components/Fields/IntegrationsField/IntegrationItem/CustomPanel/style.tsx +6 -1
  9. package/src/components/Fields/IntegrationsField/IntegrationItem/VariablesPanel/index.tsx +13 -11
  10. package/src/components/Fields/IntegrationsField/IntegrationItem/VariablesPanel/style.tsx +6 -3
  11. package/src/components/Fields/MultiCheckSelect/style.tsx +1 -0
  12. package/src/components/Fields/ReferenceField/AutoPanel/AutoItem/index.tsx +6 -5
  13. package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +277 -40
  14. package/src/components/Fields/ReferenceField/AutoPanel/style.tsx +117 -15
  15. package/src/components/Fields/ReferenceField/Context/index.tsx +18 -10
  16. package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +9 -30
  17. package/src/components/Fields/ReferenceField/ItemList/Item/style.tsx +9 -51
  18. package/src/components/Fields/ReferenceField/ItemList/index.tsx +14 -18
  19. package/src/components/Fields/ReferenceField/ManualPanel/Item/index.tsx +1 -1
  20. package/src/components/Fields/ReferenceField/ManualPanel/Item/style.tsx +25 -26
  21. package/src/components/Fields/ReferenceField/ManualPanel/index.tsx +91 -36
  22. package/src/components/Fields/ReferenceField/ManualPanel/style.tsx +29 -1
  23. package/src/components/Fields/ReferenceField/index.tsx +18 -11
  24. package/src/components/Fields/Select/index.tsx +10 -13
  25. package/src/components/Fields/Select/style.tsx +13 -7
  26. package/src/components/Fields/TimeField/index.tsx +1 -0
  27. package/src/components/Fields/UniqueCheck/index.tsx +3 -1
  28. package/src/components/Fields/UrlField/index.tsx +3 -1
  29. package/src/components/Fields/UrlField/style.tsx +6 -1
  30. package/src/components/FloatingPanel/style.tsx +0 -1
  31. package/src/components/PageFinder/index.tsx +8 -7
  32. package/src/components/SearchField/index.tsx +2 -3
  33. package/src/helpers/arrays.tsx +2 -2
  34. package/src/modules/Analytics/DimensionPanel/index.tsx +44 -42
  35. package/src/modules/Analytics/DimensionPanel/style.tsx +6 -1
  36. package/src/modules/Analytics/GroupPanel/index.tsx +57 -64
  37. package/src/modules/Analytics/GroupPanel/style.tsx +6 -0
  38. package/src/modules/Categories/CategoriesList/CategoryPanel/index.tsx +15 -13
  39. package/src/modules/Categories/CategoriesList/CategoryPanel/style.tsx +11 -4
  40. package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/index.tsx +20 -18
  41. package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/style.tsx +6 -1
  42. package/src/modules/Navigation/Menus/List/Table/ConfigPanel/index.tsx +8 -6
  43. package/src/modules/Navigation/Menus/List/Table/ConfigPanel/style.tsx +6 -1
  44. package/src/modules/Navigation/Menus/List/Table/SidePanel/index.tsx +15 -13
  45. package/src/modules/Navigation/Menus/List/Table/SidePanel/style.tsx +9 -2
  46. package/src/modules/PublicPreview/index.tsx +1 -1
  47. package/src/modules/Redirects/RedirectPanel/index.tsx +33 -31
  48. package/src/modules/Redirects/RedirectPanel/style.tsx +6 -1
  49. package/src/modules/Redirects/index.tsx +0 -1
  50. package/src/modules/Settings/Integrations/IntegrationForm/VariablePanel/index.tsx +63 -61
  51. package/src/modules/Settings/Integrations/IntegrationForm/VariablePanel/style.tsx +6 -1
  52. package/src/modules/Settings/Integrations/IntegrationForm/index.tsx +5 -3
  53. package/src/modules/Settings/Integrations/IntegrationForm/style.tsx +6 -0
  54. package/src/modules/Settings/Languages/LanguagePanel/index.tsx +14 -12
  55. package/src/modules/Settings/Languages/LanguagePanel/style.tsx +8 -1
  56. package/src/types/index.tsx +1 -1
@@ -28,25 +28,27 @@ const RobotsPanel = (props: IProps): JSX.Element => {
28
28
 
29
29
  return (
30
30
  <FloatingPanel title={title} toggleModal={toggleModal} isOpen={isOpen}>
31
- <S.Item>
32
- <S.ItemHeader>You are editing</S.ItemHeader>
33
- <S.ItemContent>{item.fullUrl}</S.ItemContent>
34
- </S.Item>
35
- <FieldsBehavior
36
- fieldType="TextArea"
37
- onChange={setValue}
38
- value={value}
39
- title="Robots.txt"
40
- placeholder={placeholder}
41
- />
42
- <Button buttonStyle="text" type="button" icon="refresh" disabled={!value} onClick={resetItem}>
43
- Reset to default
44
- </Button>
45
- <S.Footer>
46
- <Button className="button" type="button" onClick={editButton.action}>
47
- {editButton.label}
31
+ <S.Wrapper>
32
+ <S.Item>
33
+ <S.ItemHeader>You are editing</S.ItemHeader>
34
+ <S.ItemContent>{item.fullUrl}</S.ItemContent>
35
+ </S.Item>
36
+ <FieldsBehavior
37
+ fieldType="TextArea"
38
+ onChange={setValue}
39
+ value={value}
40
+ title="Robots.txt"
41
+ placeholder={placeholder}
42
+ />
43
+ <Button buttonStyle="text" type="button" icon="refresh" disabled={!value} onClick={resetItem}>
44
+ Reset to default
48
45
  </Button>
49
- </S.Footer>
46
+ <S.Footer>
47
+ <Button className="button" type="button" onClick={editButton.action}>
48
+ {editButton.label}
49
+ </Button>
50
+ </S.Footer>
51
+ </S.Wrapper>
50
52
  </FloatingPanel>
51
53
  );
52
54
  };
@@ -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 Item = styled.div`
4
9
  background-color: ${(p) => p.theme.color.uiBarBackground};
5
10
  padding: ${(p) => p.theme.spacing.s};
@@ -27,4 +32,4 @@ const Footer = styled.div`
27
32
  right: ${(p) => p.theme.spacing.m};
28
33
  `;
29
34
 
30
- export { Item, ItemHeader, ItemContent, Footer };
35
+ export { Wrapper, Item, ItemHeader, ItemContent, Footer };
@@ -31,12 +31,14 @@ const ConfigPanel = (props: IProps): JSX.Element => {
31
31
 
32
32
  return (
33
33
  <FloatingPanel title="Subsection Config" toggleModal={toggleModal} isOpen={isOpen}>
34
- <Form form={form} setForm={setForm} />
35
- <S.Footer>
36
- <Button className="button" type="button" onClick={editButton.action}>
37
- {editButton.label}
38
- </Button>
39
- </S.Footer>
34
+ <S.Wrapper>
35
+ <Form form={form} setForm={setForm} />
36
+ <S.Footer>
37
+ <Button className="button" type="button" onClick={editButton.action}>
38
+ {editButton.label}
39
+ </Button>
40
+ </S.Footer>
41
+ </S.Wrapper>
40
42
  </FloatingPanel>
41
43
  );
42
44
  };
@@ -1,9 +1,14 @@
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};
6
11
  right: ${(p) => p.theme.spacing.m};
7
12
  `;
8
13
 
9
- export { Footer };
14
+ export { Wrapper, Footer };
@@ -68,19 +68,21 @@ const SidePanel = (props: IProps): JSX.Element => {
68
68
  closeOnOutsideClick={!isGalleryOpened}
69
69
  handlePanel={toggleSecondaryPanel}
70
70
  >
71
- <S.FormWrapper>
72
- <Form toggleSecondaryPanel={toggleSecondaryPanel} setIsGalleryOpened={setIsOpenedGallery} />
73
- </S.FormWrapper>
74
- <S.Footer>
75
- <Button
76
- className="button"
77
- type="button"
78
- onClick={edit ? editButton.action : addButton.action}
79
- disabled={edit ? editButton.disabled : addButton.disabled}
80
- >
81
- {edit ? editButton.label : addButton.label}
82
- </Button>
83
- </S.Footer>
71
+ <S.Wrapper>
72
+ <S.FormWrapper>
73
+ <Form toggleSecondaryPanel={toggleSecondaryPanel} setIsGalleryOpened={setIsOpenedGallery} />
74
+ </S.FormWrapper>
75
+ <S.Footer>
76
+ <Button
77
+ className="button"
78
+ type="button"
79
+ onClick={edit ? editButton.action : addButton.action}
80
+ disabled={edit ? editButton.disabled : addButton.disabled}
81
+ >
82
+ {edit ? editButton.label : addButton.label}
83
+ </Button>
84
+ </S.Footer>
85
+ </S.Wrapper>
84
86
  </FloatingPanel>
85
87
  );
86
88
  };
@@ -1,6 +1,11 @@
1
1
  import styled from "styled-components";
2
2
 
3
- export const Footer = styled.div`
3
+ const Wrapper = styled.div`
4
+ padding: ${(p) => p.theme.spacing.m};
5
+ height: 100%;
6
+ `;
7
+
8
+ const Footer = styled.div`
4
9
  position: absolute;
5
10
  bottom: 0;
6
11
  width: 100%;
@@ -15,9 +20,11 @@ export const Footer = styled.div`
15
20
  }
16
21
  `;
17
22
 
18
- export const FormWrapper = styled.div`
23
+ const FormWrapper = styled.div`
19
24
  height: calc(100% - ${(p) => p.theme.spacing.s} - 73px);
20
25
  overflow: auto;
21
26
  margin: -${(p) => p.theme.spacing.m};
22
27
  padding: ${(p) => p.theme.spacing.m};
23
28
  `;
29
+
30
+ export { Wrapper, Footer, FormWrapper }
@@ -59,7 +59,7 @@ const PublicPreview = () => {
59
59
  footer={state && state.footerContent}
60
60
  languageID={state && state.language}
61
61
  pageLanguages={state && state.pageLanguages}
62
- renderer="editor"
62
+ renderer="preview"
63
63
  />
64
64
  </S.Wrapper>
65
65
  );
@@ -60,37 +60,39 @@ const RedirectPanel = (props: IProps): JSX.Element => {
60
60
  isOpenedSecond={isOpenedSecond}
61
61
  handlePanel={toggleSecondaryPanel}
62
62
  >
63
- <FieldsBehavior
64
- title="Old URL"
65
- name="oldUrl"
66
- fieldType="TextField"
67
- value={formValues.from}
68
- onChange={handleOldUrl}
69
- autoComplete="redirect-old"
70
- helptext="Type the complete old page url you want to redirect."
71
- />
72
- <FieldsBehavior
73
- title="New URL"
74
- name="newUrl"
75
- fieldType="UrlField"
76
- value={formValues.to}
77
- onChange={handleNewUrl}
78
- handlePanel={toggleSecondaryPanel}
79
- inFloatingPanel={true}
80
- autoComplete="redirect-new"
81
- helptext="Select an internal page or paste an external url."
82
- />
83
- <S.Footer>
84
- {redirect ? (
85
- <Button className="button" type="button" onClick={editButton.action} disabled={editButton.disabled}>
86
- {editButton.label}
87
- </Button>
88
- ) : (
89
- <Button className="button" type="button" onClick={addButton.action} disabled={addButton.disabled}>
90
- {addButton.label}
91
- </Button>
92
- )}
93
- </S.Footer>
63
+ <S.Wrapper>
64
+ <FieldsBehavior
65
+ title="Old URL"
66
+ name="oldUrl"
67
+ fieldType="TextField"
68
+ value={formValues.from}
69
+ onChange={handleOldUrl}
70
+ autoComplete="redirect-old"
71
+ helptext="Type the complete old page url you want to redirect."
72
+ />
73
+ <FieldsBehavior
74
+ title="New URL"
75
+ name="newUrl"
76
+ fieldType="UrlField"
77
+ value={formValues.to}
78
+ onChange={handleNewUrl}
79
+ handlePanel={toggleSecondaryPanel}
80
+ inFloatingPanel={true}
81
+ autoComplete="redirect-new"
82
+ helptext="Select an internal page or paste an external url."
83
+ />
84
+ <S.Footer>
85
+ {redirect ? (
86
+ <Button className="button" type="button" onClick={editButton.action} disabled={editButton.disabled}>
87
+ {editButton.label}
88
+ </Button>
89
+ ) : (
90
+ <Button className="button" type="button" onClick={addButton.action} disabled={addButton.disabled}>
91
+ {addButton.label}
92
+ </Button>
93
+ )}
94
+ </S.Footer>
95
+ </S.Wrapper>
94
96
  </FloatingPanel>
95
97
  );
96
98
  };
@@ -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};
@@ -10,4 +15,4 @@ const ModalContent = styled.div`
10
15
  padding: ${(p) => p.theme.spacing.m};
11
16
  `;
12
17
 
13
- export { Footer, ModalContent };
18
+ export { Wrapper, Footer, ModalContent };
@@ -257,7 +257,6 @@ const Redirects = (props: IProps): JSX.Element => {
257
257
  const secondaryImportModalAction = { title: "Cancel", onClick: toggleCheckImportModal };
258
258
 
259
259
  const searchFilters = [
260
- { value: "filterby", label: "Filter by" },
261
260
  { value: "from", label: "Old URL" },
262
261
  { value: "to", label: "New URL" },
263
262
  ];
@@ -54,75 +54,77 @@ function VariablePanel(props: IProps): JSX.Element {
54
54
  return (
55
55
  <FloatingPanel title={title} toggleModal={toggleModal} isOpen={isOpen}>
56
56
  <S.Wrapper>
57
- <S.NoteWrapper>
58
- <NoteField value={{ title: "", text: "Make sure you include the variable key in the code." }} />
59
- </S.NoteWrapper>
60
- <FieldsBehavior
61
- title="Is this variable language-dependent?"
62
- name="isMultilanguage"
63
- fieldType="RadioGroup"
64
- value={!!state.multilanguage?.length}
65
- options={variableOptions}
66
- onChange={handleIsMultilanguage}
67
- />
68
- <FieldsBehavior
69
- title="Variable Name"
70
- name="variableName"
71
- fieldType="TextField"
72
- placeholder="Type a variable name"
73
- mandatory
74
- value={state.variableName}
75
- onChange={handleNameChange}
76
- />
77
- <FieldsBehavior
78
- title="Variable Key"
79
- name="variableKey"
80
- fieldType="TextField"
81
- placeholder="Type a variable {key}"
82
- mandatory
83
- value={state.variableKey}
84
- onChange={handleKeyChange}
85
- helptext="Define a Key to this variable"
86
- />
87
- {!state.multilanguage?.length && (
57
+ <S.ContentWrapper>
58
+ <S.NoteWrapper>
59
+ <NoteField value={{ title: "", text: "Make sure you include the variable key in the code." }} />
60
+ </S.NoteWrapper>
88
61
  <FieldsBehavior
89
- title="Default Value"
90
- name="defaulValue"
91
- fieldType="TextArea"
92
- placeholder="Type a default value"
93
- value={state.defaultValue}
94
- onChange={handleValueChange}
95
- helptext="You can define a default value to this variable"
62
+ title="Is this variable language-dependent?"
63
+ name="isMultilanguage"
64
+ fieldType="RadioGroup"
65
+ value={!!state.multilanguage?.length}
66
+ options={variableOptions}
67
+ onChange={handleIsMultilanguage}
96
68
  />
97
- )}
98
- {state.multilanguage?.map((field: IVariableLang, index: number) => {
99
- const language = langs.find((lang: ILanguage) => lang.id === field.languageId);
100
-
101
- const handleLangChange = (value: string) => {
102
- const langs = state.multilanguage ? [...state.multilanguage] : [];
103
- langs[index].value = value;
104
- setState({ ...state, multilanguage: langs });
105
- };
106
-
107
- return (
69
+ <FieldsBehavior
70
+ title="Variable Name"
71
+ name="variableName"
72
+ fieldType="TextField"
73
+ placeholder="Type a variable name"
74
+ mandatory
75
+ value={state.variableName}
76
+ onChange={handleNameChange}
77
+ />
78
+ <FieldsBehavior
79
+ title="Variable Key"
80
+ name="variableKey"
81
+ fieldType="TextField"
82
+ placeholder="Type a variable {key}"
83
+ mandatory
84
+ value={state.variableKey}
85
+ onChange={handleKeyChange}
86
+ helptext="Define a Key to this variable"
87
+ />
88
+ {!state.multilanguage?.length && (
108
89
  <FieldsBehavior
109
- title={`Default ${language?.language} Value`}
90
+ title="Default Value"
110
91
  name="defaulValue"
111
92
  fieldType="TextArea"
112
93
  placeholder="Type a default value"
113
- value={field.value}
114
- onChange={handleLangChange}
115
- helptext={`You can define a ${language?.language} default value to this variable`}
116
- key={field.languageId}
94
+ value={state.defaultValue}
95
+ onChange={handleValueChange}
96
+ helptext="You can define a default value to this variable"
117
97
  />
118
- );
119
- })}
98
+ )}
99
+ {state.multilanguage?.map((field: IVariableLang, index: number) => {
100
+ const language = langs.find((lang: ILanguage) => lang.id === field.languageId);
101
+
102
+ const handleLangChange = (value: string) => {
103
+ const langs = state.multilanguage ? [...state.multilanguage] : [];
104
+ langs[index].value = value;
105
+ setState({ ...state, multilanguage: langs });
106
+ };
107
+
108
+ return (
109
+ <FieldsBehavior
110
+ title={`Default ${language?.language} Value`}
111
+ name="defaulValue"
112
+ fieldType="TextArea"
113
+ placeholder="Type a default value"
114
+ value={field.value}
115
+ onChange={handleLangChange}
116
+ helptext={`You can define a ${language?.language} default value to this variable`}
117
+ key={field.languageId}
118
+ />
119
+ );
120
+ })}
121
+ </S.ContentWrapper>
122
+ <S.ActionWrapper>
123
+ <Button type="button" onClick={handleButtonClick}>
124
+ {title}
125
+ </Button>
126
+ </S.ActionWrapper>
120
127
  </S.Wrapper>
121
- <S.ActionWrapper>
122
- <Button type="button" onClick={handleButtonClick}>
123
- {title}
124
- </Button>
125
- </S.ActionWrapper>
126
128
  </FloatingPanel>
127
129
  );
128
130
  }
@@ -1,6 +1,11 @@
1
1
  import styled from "styled-components";
2
2
 
3
3
  const Wrapper = styled.div`
4
+ padding: ${(p) => p.theme.spacing.m};
5
+ height: 100%;
6
+ `;
7
+
8
+ const ContentWrapper = styled.div`
4
9
  overflow-y: scroll;
5
10
  border-bottom: 1px solid ${(p) => p.theme.color.uiLine};
6
11
  position: absolute;
@@ -25,4 +30,4 @@ const NoteWrapper = styled.div`
25
30
  margin-bottom: ${(p) => p.theme.spacing.m};
26
31
  `;
27
32
 
28
- export { Wrapper, ActionWrapper, NoteWrapper };
33
+ export { Wrapper, ContentWrapper, ActionWrapper, NoteWrapper };
@@ -270,9 +270,11 @@ const IntegrationForm = (props: IProps) => {
270
270
  </S.SettingContent>
271
271
  </S.SettingsWrapper>
272
272
  <FloatingPanel title="Select pages" toggleModal={toggleModal} isOpen={isOpen}>
273
- {isOpen && (
274
- <PageFinder onClick={handleSetPage} isOpen={isOpen} multiple={true} hideSites={true} pages={pageIDs} />
275
- )}
273
+ <S.ContentWrapper>
274
+ {isOpen && (
275
+ <PageFinder onClick={handleSetPage} isOpen={isOpen} multiple={true} hideSites={true} pages={pageIDs} />
276
+ )}
277
+ </S.ContentWrapper>
276
278
  </FloatingPanel>
277
279
  {isVariableOpen && (
278
280
  <VariablePanel
@@ -63,6 +63,11 @@ const PageElement = styled.div`
63
63
  white-space: nowrap;
64
64
  `;
65
65
 
66
+ const ContentWrapper = styled.div`
67
+ padding: ${(p) => p.theme.spacing.m};
68
+ height: 100%;
69
+ `;
70
+
66
71
  export {
67
72
  Wrapper,
68
73
  Heading,
@@ -74,4 +79,5 @@ export {
74
79
  PagesWrapper,
75
80
  ButtonWrapper,
76
81
  PageElement,
82
+ ContentWrapper,
77
83
  };
@@ -42,18 +42,20 @@ const LanguagePanel = (props: IProps): JSX.Element => {
42
42
 
43
43
  return (
44
44
  <FloatingPanel title={title} toggleModal={toggleModal} isOpen={isOpen}>
45
- <Form item={item} />
46
- <S.Footer>
47
- {item ? (
48
- <Button className="button" type="button" onClick={editButton.action} disabled={editButton.disabled}>
49
- {editButton.label}
50
- </Button>
51
- ) : (
52
- <Button className="button" type="button" onClick={addButton.action} disabled={addButton.disabled}>
53
- {addButton.label}
54
- </Button>
55
- )}
56
- </S.Footer>
45
+ <S.Wrapper>
46
+ <Form item={item} />
47
+ <S.Footer>
48
+ {item ? (
49
+ <Button className="button" type="button" onClick={editButton.action} disabled={editButton.disabled}>
50
+ {editButton.label}
51
+ </Button>
52
+ ) : (
53
+ <Button className="button" type="button" onClick={addButton.action} disabled={addButton.disabled}>
54
+ {addButton.label}
55
+ </Button>
56
+ )}
57
+ </S.Footer>
58
+ </S.Wrapper>
57
59
  </FloatingPanel>
58
60
  );
59
61
  };
@@ -1,7 +1,14 @@
1
1
  import styled from "styled-components";
2
2
 
3
- export const Footer = styled.div`
3
+ const Wrapper = styled.div`
4
+ padding: ${(p) => p.theme.spacing.m};
5
+ height: 100%;
6
+ `;
7
+
8
+ const Footer = styled.div`
4
9
  position: absolute;
5
10
  bottom: ${(p) => p.theme.spacing.m};
6
11
  right: ${(p) => p.theme.spacing.m};
7
12
  `;
13
+
14
+ export { Wrapper, Footer };
@@ -331,7 +331,7 @@ export interface IGetGlobalPagesParams {
331
331
  }
332
332
 
333
333
  export interface IGetStructuredDataParams {
334
- dataID: string | null;
334
+ dataID?: string | null;
335
335
  page: number;
336
336
  itemsPerPage: number;
337
337
  pagination: boolean;