@griddo/ax 10.6.0 → 10.6.2

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 (53) hide show
  1. package/package.json +2 -2
  2. package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/MixableComponentArray.test.tsx +3 -3
  3. package/src/components/Button/style.tsx +1 -1
  4. package/src/components/ConfigPanel/Form/ConnectedField/NavConnectedField/index.tsx +2 -2
  5. package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/TemplateManager/index.tsx +2 -2
  6. package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/index.tsx +3 -3
  7. package/src/components/Fields/ComponentArray/MixableComponentArray/index.tsx +4 -3
  8. package/src/components/Fields/ImageField/index.tsx +19 -2
  9. package/src/components/Gallery/GalleryPanel/DetailPanel/index.tsx +8 -5
  10. package/src/components/Gallery/GalleryPanel/GalleryDragAndDrop/index.tsx +15 -5
  11. package/src/components/Gallery/GalleryPanel/GalleryDragAndDrop/style.tsx +1 -0
  12. package/src/components/Gallery/GalleryPanel/index.tsx +2 -11
  13. package/src/components/MenuGroup/index.tsx +81 -0
  14. package/src/components/MenuGroup/style.tsx +46 -0
  15. package/src/components/MenuItem/index.tsx +14 -7
  16. package/src/components/MenuItem/style.tsx +48 -26
  17. package/src/components/Nav/index.tsx +2 -2
  18. package/src/components/SideModal/SideModalOption/index.tsx +1 -1
  19. package/src/components/SideModal/index.tsx +3 -2
  20. package/src/components/Tooltip/index.tsx +1 -1
  21. package/src/components/index.tsx +2 -0
  22. package/src/containers/Gallery/actions.tsx +10 -2
  23. package/src/containers/Sites/actions.tsx +27 -0
  24. package/src/containers/Sites/constants.tsx +1 -0
  25. package/src/containers/Sites/interfaces.tsx +6 -0
  26. package/src/containers/Sites/reducer.tsx +4 -0
  27. package/src/helpers/index.tsx +2 -2
  28. package/src/helpers/themes.tsx +18 -13
  29. package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/index.tsx +2 -2
  30. package/src/modules/Content/BulkHeader/TableHeader/index.tsx +1 -5
  31. package/src/modules/Content/BulkHeader/TableHeader/style.tsx +6 -0
  32. package/src/modules/Content/ContentFilters/index.tsx +66 -41
  33. package/src/modules/Content/ContentFilters/style.tsx +4 -38
  34. package/src/modules/Content/ContentFilters/utils.tsx +47 -10
  35. package/src/modules/Content/OptionTable/index.tsx +24 -14
  36. package/src/modules/Content/index.tsx +26 -7
  37. package/src/modules/Content/utils.tsx +32 -31
  38. package/src/modules/Navigation/Defaults/Nav/index.tsx +4 -6
  39. package/src/modules/Navigation/Menus/List/Nav/index.tsx +2 -2
  40. package/src/modules/Settings/ContentTypes/DataPacks/Nav/index.tsx +6 -10
  41. package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/index.tsx +1 -6
  42. package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/style.tsx +6 -0
  43. package/src/modules/StructuredData/StructuredDataList/ContentFilters/index.tsx +33 -41
  44. package/src/modules/StructuredData/StructuredDataList/ContentFilters/style.tsx +4 -38
  45. package/src/modules/StructuredData/StructuredDataList/ContentFilters/utils.tsx +44 -11
  46. package/src/modules/StructuredData/StructuredDataList/OptionTable/index.tsx +5 -5
  47. package/src/modules/StructuredData/StructuredDataList/index.tsx +1 -2
  48. package/src/modules/Users/UserForm/index.tsx +13 -27
  49. package/src/routes/multisite.tsx +1 -1
  50. package/src/routes/site.tsx +1 -1
  51. package/src/types/index.tsx +15 -0
  52. package/src/modules/Content/ContentFilters/constants.tsx +0 -15
  53. package/src/modules/StructuredData/StructuredDataList/ContentFilters/constants.tsx +0 -21
@@ -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, Tooltip } from "@ax/components";
5
+ import { Button, ErrorToast, FieldsBehavior, SearchField } from "@ax/components";
6
6
  import { IImage, IRootState, IUser, ISite, IRole, ISiteRoles } from "@ax/types";
7
- import { useModal, usePermission } from "@ax/hooks";
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
- {isAvatarDisabled ? (
213
- <Tooltip content="You don't have the permissions to access the images gallery." top={10}>
214
- <AvatarField />
215
- </Tooltip>
216
- ) : (
217
- <AvatarField />
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"
@@ -24,7 +24,7 @@ export default [
24
24
  {
25
25
  path: "/data",
26
26
  component: StructuredDataList,
27
- name: "Global Data",
27
+ name: "Global Content",
28
28
  showInNav: true,
29
29
  icon: "Data",
30
30
  permission: "global.globalData.accessToGlobalData",
@@ -23,7 +23,7 @@ export default [
23
23
  {
24
24
  path: `${BASE_PATH}/pages`,
25
25
  component: Content,
26
- name: "Content",
26
+ name: "Site Content",
27
27
  showInNav: true,
28
28
  icon: "page",
29
29
  permission: "content.accessToPages",
@@ -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;
@@ -1,15 +0,0 @@
1
- export const filterStructure = [
2
- {
3
- title: "Unique pages",
4
- filters: [
5
- {
6
- name: "All",
7
- value: "unique-pages"
8
- }
9
- ]
10
- },
11
- {
12
- title: "Content Types",
13
- filters: []
14
- }
15
- ];
@@ -1,21 +0,0 @@
1
- export const filterStructure = [
2
- {
3
- fromPage: true,
4
- filters: [
5
- {
6
- name: "All Pages",
7
- value: "all-pages",
8
- },
9
- ],
10
- },
11
- {
12
- title: "Pages",
13
- fromPage: true,
14
- filters: [],
15
- },
16
- {
17
- title: "Simple Content",
18
- fromPage: false,
19
- filters: [],
20
- },
21
- ];