@griddo/ax 11.10.16 → 11.10.17-rc.0
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/README.md +1 -0
- package/config/griddo-config/index.js +1 -0
- package/package.json +2 -2
- package/src/__tests__/components/BulkSelectionOptions/BulkSelectionOptions.test.tsx +10 -24
- package/src/components/BulkSelectionOptions/index.tsx +9 -11
- package/src/components/BulkSelectionOptions/style.tsx +12 -5
- package/src/components/Fields/CheckField/index.tsx +4 -5
- package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +17 -17
- package/src/components/Fields/UniqueCheck/index.tsx +21 -16
- package/src/components/Fields/UniqueCheck/style.tsx +17 -0
- package/src/components/FileGallery/GalleryPanel/DetailPanel/index.tsx +2 -1
- package/src/components/FilterTagsBar/style.tsx +2 -0
- package/src/components/Gallery/GalleryPanel/DetailPanel/index.tsx +2 -1
- package/src/components/Gallery/index.tsx +25 -26
- package/src/components/TableList/TableItem/style.tsx +4 -1
- package/src/components/TableList/index.tsx +3 -3
- package/src/components/TableList/style.tsx +11 -1
- package/src/hooks/bulk.tsx +17 -8
- package/src/hooks/index.tsx +8 -7
- package/src/locales/en-US.ts +47 -0
- package/src/locales/es-ES.ts +47 -0
- package/src/locales/index.ts +11 -0
- package/src/modules/Categories/CategoriesList/BulkHeader/TableHeader/index.tsx +1 -3
- package/src/modules/Categories/CategoriesList/BulkHeader/TableHeader/style.tsx +4 -2
- package/src/modules/Categories/CategoriesList/BulkHeader/index.tsx +6 -2
- package/src/modules/Categories/CategoriesList/index.tsx +29 -28
- package/src/modules/Categories/CategoriesList/utils.tsx +3 -2
- package/src/modules/Content/BulkHeader/TableHeader/style.tsx +4 -3
- package/src/modules/Content/BulkHeader/index.tsx +6 -2
- package/src/modules/Content/index.tsx +51 -51
- package/src/modules/FileDrive/BulkGridHeader/GridHeader/style.tsx +2 -0
- package/src/modules/FileDrive/BulkGridHeader/index.tsx +5 -3
- package/src/modules/FileDrive/BulkGridHeader/style.tsx +6 -4
- package/src/modules/FileDrive/BulkListHeader/TableHeader/style.tsx +5 -3
- package/src/modules/FileDrive/BulkListHeader/index.tsx +15 -4
- package/src/modules/FileDrive/BulkListHeader/style.tsx +5 -4
- package/src/modules/FileDrive/FileModal/DetailPanel/index.tsx +9 -7
- package/src/modules/FileDrive/index.tsx +25 -23
- package/src/modules/Forms/FormCategoriesList/BulkHeader/TableHeader/style.tsx +4 -2
- package/src/modules/Forms/FormCategoriesList/BulkHeader/index.tsx +6 -2
- package/src/modules/Forms/FormCategoriesList/BulkHeader/style.tsx +3 -3
- package/src/modules/Forms/FormCategoriesList/index.tsx +13 -12
- package/src/modules/Forms/FormList/BulkHeader/TableHeader/style.tsx +5 -2
- package/src/modules/Forms/FormList/BulkHeader/index.tsx +6 -2
- package/src/modules/Forms/FormList/index.tsx +20 -19
- package/src/modules/MediaGallery/BulkGridHeader/GridHeader/style.tsx +2 -0
- package/src/modules/MediaGallery/BulkGridHeader/index.tsx +5 -3
- package/src/modules/MediaGallery/BulkGridHeader/style.tsx +6 -4
- package/src/modules/MediaGallery/BulkListHeader/TableHeader/style.tsx +4 -3
- package/src/modules/MediaGallery/BulkListHeader/index.tsx +6 -3
- package/src/modules/MediaGallery/BulkListHeader/style.tsx +3 -4
- package/src/modules/MediaGallery/ImageModal/DetailPanel/index.tsx +7 -6
- package/src/modules/MediaGallery/index.tsx +27 -25
- package/src/modules/Navigation/Defaults/BulkHeader/TableHeader/style.tsx +6 -4
- package/src/modules/Navigation/Defaults/BulkHeader/index.tsx +15 -3
- package/src/modules/Navigation/Defaults/index.tsx +8 -9
- package/src/modules/Redirects/BulkHeader/TableHeader/style.tsx +4 -2
- package/src/modules/Redirects/BulkHeader/index.tsx +7 -2
- package/src/modules/Redirects/index.tsx +12 -12
- package/src/modules/Settings/Integrations/BulkHeader/TableHeader/style.tsx +4 -2
- package/src/modules/Settings/Integrations/BulkHeader/index.tsx +5 -2
- package/src/modules/Settings/Integrations/index.tsx +16 -16
- package/src/modules/Sites/SitesList/ListView/BulkHeader/TableHeader/style.tsx +4 -3
- package/src/modules/Sites/SitesList/ListView/BulkHeader/index.tsx +5 -3
- package/src/modules/Sites/SitesList/ListView/BulkHeader/style.tsx +4 -2
- package/src/modules/Sites/SitesList/index.tsx +25 -18
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/style.tsx +4 -2
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/index.tsx +6 -2
- package/src/modules/StructuredData/StructuredDataList/index.tsx +46 -45
- package/src/modules/StructuredData/StructuredDataList/utils.tsx +7 -5
- package/src/modules/Users/Roles/BulkHeader/TableHeader/style.tsx +4 -2
- package/src/modules/Users/Roles/BulkHeader/index.tsx +6 -2
- package/src/modules/Users/Roles/index.tsx +7 -7
- package/src/modules/Users/UserList/BulkHeader/TableHeader/style.tsx +4 -2
- package/src/modules/Users/UserList/BulkHeader/index.tsx +6 -2
- package/src/modules/Users/UserList/index.tsx +14 -15
- package/src/schemas/pages/GlobalPage.tsx +17 -0
- package/src/schemas/pages/Page.tsx +17 -0
- package/tsconfig.paths.json +1 -0
package/src/hooks/bulk.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
2
|
|
|
3
3
|
import { areEquals } from "@ax/helpers";
|
|
4
|
-
import { ICheck } from "@ax/types";
|
|
4
|
+
import type { ICheck } from "@ax/types";
|
|
5
5
|
|
|
6
6
|
const useBulkSelection = (itemIDs: any[]) => {
|
|
7
|
-
const selectedItemsInitialState:
|
|
7
|
+
const selectedItemsInitialState: IBulkSelectedItems = {
|
|
8
8
|
all: [],
|
|
9
9
|
notPublished: [],
|
|
10
10
|
published: [],
|
|
@@ -97,11 +97,13 @@ const useBulkSelection = (itemIDs: any[]) => {
|
|
|
97
97
|
|
|
98
98
|
let bulkSelection: any = [...selectedItems.all];
|
|
99
99
|
|
|
100
|
-
isChecked && isMultiCheck
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
if (isChecked && isMultiCheck) {
|
|
101
|
+
bulkSelection = multiSelectTo(value);
|
|
102
|
+
} else if (isChecked) {
|
|
103
|
+
bulkSelection.push(value);
|
|
104
|
+
} else {
|
|
105
|
+
bulkSelection = bulkSelection.filter((id: any) => id !== value);
|
|
106
|
+
}
|
|
105
107
|
|
|
106
108
|
if (callback) {
|
|
107
109
|
const filteredItems = callback(bulkSelection);
|
|
@@ -139,4 +141,11 @@ const useBulkSelection = (itemIDs: any[]) => {
|
|
|
139
141
|
};
|
|
140
142
|
};
|
|
141
143
|
|
|
144
|
+
export interface IBulkSelectedItems {
|
|
145
|
+
all: any[];
|
|
146
|
+
notPublished: any[];
|
|
147
|
+
published: any[];
|
|
148
|
+
drafts: any[];
|
|
149
|
+
}
|
|
150
|
+
|
|
142
151
|
export { useBulkSelection };
|
package/src/hooks/index.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useBulkSelection } from "./bulk";
|
|
1
|
+
import { type IBulkSelectedItems, useBulkSelection } from "./bulk";
|
|
2
|
+
import { useAdaptiveText, useCategoryColors, useEmptyState } from "./content";
|
|
2
3
|
import { useDebounce, useEqualStructured, useIsDirty, usePrevious, useShouldBeSaved } from "./forms";
|
|
3
|
-
import { useHandleClickOutside, useModal, useToast } from "./modals";
|
|
4
|
-
import { useURLSearchParam } from "./location";
|
|
5
|
-
import { useCategoryColors, useEmptyState, useAdaptiveText } from "./content";
|
|
6
|
-
import { useWindowSize } from "./window";
|
|
7
4
|
import { useOnMessageReceivedFromIframe, useOnMessageReceivedFromOutside } from "./iframe";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { useURLSearchParam } from "./location";
|
|
6
|
+
import { useHandleClickOutside, useModal, useToast } from "./modals";
|
|
10
7
|
import { useNetworkStatus } from "./network";
|
|
8
|
+
import { useResizable } from "./resize";
|
|
9
|
+
import { useGlobalPermission, usePermission } from "./users";
|
|
10
|
+
import { useWindowSize } from "./window";
|
|
11
11
|
|
|
12
12
|
export {
|
|
13
13
|
useModal,
|
|
@@ -30,4 +30,5 @@ export {
|
|
|
30
30
|
useOnMessageReceivedFromIframe,
|
|
31
31
|
useOnMessageReceivedFromOutside,
|
|
32
32
|
useNetworkStatus,
|
|
33
|
+
type IBulkSelectedItems,
|
|
33
34
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English translations organized by domain/feature
|
|
3
|
+
*/
|
|
4
|
+
export const enUS = {
|
|
5
|
+
common: {
|
|
6
|
+
save: "Save",
|
|
7
|
+
cancel: "Cancel",
|
|
8
|
+
delete: "Delete",
|
|
9
|
+
edit: "Edit",
|
|
10
|
+
add: "Add",
|
|
11
|
+
close: "Close",
|
|
12
|
+
confirm: "Confirm",
|
|
13
|
+
loading: "Loading...",
|
|
14
|
+
saving: "Saving",
|
|
15
|
+
search: "Search",
|
|
16
|
+
noResults: "No results found",
|
|
17
|
+
copyUrl: "Copy URL",
|
|
18
|
+
},
|
|
19
|
+
fields: {
|
|
20
|
+
tags: {
|
|
21
|
+
helptext: "Type a tag and press enter to create it",
|
|
22
|
+
},
|
|
23
|
+
image: {
|
|
24
|
+
title: "Title",
|
|
25
|
+
alt: "Alternative text",
|
|
26
|
+
addImage: "Add image",
|
|
27
|
+
saveAndAdd: "Save & Add",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
gallery: {
|
|
31
|
+
uploaded: "Uploaded",
|
|
32
|
+
type: "Type",
|
|
33
|
+
size: "Size",
|
|
34
|
+
resolution: "Resolution",
|
|
35
|
+
},
|
|
36
|
+
validation: {
|
|
37
|
+
required: "This field is required",
|
|
38
|
+
invalidEmail: "Please enter a valid email",
|
|
39
|
+
minLength: "Minimum {min} characters required",
|
|
40
|
+
maxLength: "Maximum {max} characters allowed",
|
|
41
|
+
},
|
|
42
|
+
errors: {
|
|
43
|
+
generic: "Something went wrong. Please try again.",
|
|
44
|
+
network: "Network error. Please check your connection.",
|
|
45
|
+
unauthorized: "You are not authorized to perform this action.",
|
|
46
|
+
},
|
|
47
|
+
} as const;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spanish translations organized by domain/feature
|
|
3
|
+
*/
|
|
4
|
+
export const esES = {
|
|
5
|
+
common: {
|
|
6
|
+
save: "Guardar",
|
|
7
|
+
cancel: "Cancelar",
|
|
8
|
+
delete: "Eliminar",
|
|
9
|
+
edit: "Editar",
|
|
10
|
+
add: "Añadir",
|
|
11
|
+
close: "Cerrar",
|
|
12
|
+
confirm: "Confirmar",
|
|
13
|
+
loading: "Cargando...",
|
|
14
|
+
saving: "Guardando",
|
|
15
|
+
search: "Buscar",
|
|
16
|
+
noResults: "No se encontraron resultados",
|
|
17
|
+
copyUrl: "Copiar URL",
|
|
18
|
+
},
|
|
19
|
+
fields: {
|
|
20
|
+
tags: {
|
|
21
|
+
helptext: "Escribe una etiqueta y pulsa enter para crearla",
|
|
22
|
+
},
|
|
23
|
+
image: {
|
|
24
|
+
title: "Título",
|
|
25
|
+
alt: "Texto alternativo",
|
|
26
|
+
addImage: "Añadir imagen",
|
|
27
|
+
saveAndAdd: "Guardar & Añadir",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
gallery: {
|
|
31
|
+
uploaded: "Cargado",
|
|
32
|
+
type: "Tipo",
|
|
33
|
+
size: "Tamaño",
|
|
34
|
+
resolution: "Resolución",
|
|
35
|
+
},
|
|
36
|
+
validation: {
|
|
37
|
+
required: "Este campo es requerido",
|
|
38
|
+
invalidEmail: "Por favor, escriba un email válido",
|
|
39
|
+
minLength: "Mínimo {min} caracteres requeridos",
|
|
40
|
+
maxLength: "Máximo {max} caracteres permitidos",
|
|
41
|
+
},
|
|
42
|
+
errors: {
|
|
43
|
+
generic: "Algo salió mal. Por favor, intente nuevamente.",
|
|
44
|
+
network: "Error de red. Por favor, verifique su conexión.",
|
|
45
|
+
unauthorized: "No está autorizado para realizar esta acción.",
|
|
46
|
+
},
|
|
47
|
+
} as const;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { enUS } from "./en-US";
|
|
2
|
+
import { esES } from "./es-ES";
|
|
3
|
+
|
|
4
|
+
const currentLocale = localStorage.getItem("locale") || "en-US";
|
|
5
|
+
|
|
6
|
+
const allLocales = {
|
|
7
|
+
"en-US": enUS,
|
|
8
|
+
"es-ES": esES,
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export const LOCALE = allLocales[currentLocale as keyof typeof allLocales];
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
1
|
import { Header } from "@ax/components/TableList/style";
|
|
3
2
|
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
4
5
|
const TableHeader = styled.div<{ isScrolling?: boolean }>`
|
|
5
6
|
width: 100%;
|
|
6
7
|
display: flex;
|
|
7
8
|
flex-direction: row;
|
|
8
|
-
padding: ${(p) => `${p.theme.spacing.s} ${p.theme.spacing.m} ${p.theme.spacing.xs} ${p.theme.spacing.m}`};
|
|
9
9
|
border-bottom: ${(p) => (p.isScrolling ? `1px solid ${p.theme.color.uiLine};` : "")};
|
|
10
|
+
align-items: center;
|
|
11
|
+
min-height: 40px;
|
|
10
12
|
`;
|
|
11
13
|
|
|
12
14
|
const CheckHeader = styled(Header)`
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { BulkSelectionOptions } from "@ax/components";
|
|
3
|
-
import {
|
|
2
|
+
import type { IBulkSelectedItems } from "@ax/hooks";
|
|
3
|
+
import type { IQueryValue } from "@ax/types";
|
|
4
|
+
|
|
4
5
|
import TableHeader from "./TableHeader";
|
|
5
6
|
|
|
6
7
|
const BulkHeader = (props: IProps): JSX.Element => {
|
|
@@ -15,6 +16,7 @@ const BulkHeader = (props: IProps): JSX.Element => {
|
|
|
15
16
|
filterItems,
|
|
16
17
|
filterValues,
|
|
17
18
|
setHoverCheck,
|
|
19
|
+
selectedItems,
|
|
18
20
|
} = props;
|
|
19
21
|
|
|
20
22
|
return showBulk ? (
|
|
@@ -23,6 +25,7 @@ const BulkHeader = (props: IProps): JSX.Element => {
|
|
|
23
25
|
actions={bulkActions}
|
|
24
26
|
selectItems={selectItems}
|
|
25
27
|
totalItems={totalItems}
|
|
28
|
+
selectedItems={selectedItems}
|
|
26
29
|
/>
|
|
27
30
|
) : (
|
|
28
31
|
<TableHeader
|
|
@@ -48,6 +51,7 @@ interface IProps {
|
|
|
48
51
|
filterValues: Record<string, IQueryValue[]>;
|
|
49
52
|
filterItems: (filterPointer: string, filtersSelected: IQueryValue[]) => void;
|
|
50
53
|
setHoverCheck: (state: boolean) => void;
|
|
54
|
+
selectedItems: IBulkSelectedItems;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
export default BulkHeader;
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
|
+
|
|
4
|
+
import { EmptyState, ErrorToast, FilterTagsBar, MainWrapper, SearchTagsBar, TableList, Toast } from "@ax/components";
|
|
5
|
+
import { appActions } from "@ax/containers/App";
|
|
6
|
+
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
7
|
+
import { sortBy } from "@ax/helpers";
|
|
8
|
+
import { useBulkSelection, useModal, usePermission, useToast } from "@ax/hooks";
|
|
9
|
+
import type {
|
|
10
|
+
ICategoryGroup,
|
|
11
|
+
IDataPack,
|
|
12
|
+
IGetStructuredDataParams,
|
|
13
|
+
ILanguage,
|
|
14
|
+
IOrderCategoryParams,
|
|
15
|
+
IQueryValue,
|
|
16
|
+
IRootState,
|
|
17
|
+
IStructuredData,
|
|
18
|
+
IStructuredDataCategory,
|
|
19
|
+
} from "@ax/types";
|
|
20
|
+
|
|
3
21
|
import {
|
|
4
22
|
closestCenter,
|
|
5
23
|
DndContext,
|
|
6
|
-
DragEndEvent,
|
|
7
|
-
DragMoveEvent,
|
|
8
|
-
DragOverEvent,
|
|
9
|
-
DragStartEvent,
|
|
24
|
+
type DragEndEvent,
|
|
25
|
+
type DragMoveEvent,
|
|
26
|
+
type DragOverEvent,
|
|
27
|
+
type DragStartEvent,
|
|
10
28
|
KeyboardSensor,
|
|
11
29
|
MeasuringStrategy,
|
|
12
30
|
PointerSensor,
|
|
13
|
-
UniqueIdentifier,
|
|
31
|
+
type UniqueIdentifier,
|
|
14
32
|
useSensor,
|
|
15
33
|
useSensors,
|
|
16
34
|
} from "@dnd-kit/core";
|
|
@@ -21,33 +39,15 @@ import {
|
|
|
21
39
|
verticalListSortingStrategy,
|
|
22
40
|
} from "@dnd-kit/sortable";
|
|
23
41
|
|
|
24
|
-
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
25
|
-
import { appActions } from "@ax/containers/App";
|
|
26
|
-
import {
|
|
27
|
-
IRootState,
|
|
28
|
-
IStructuredData,
|
|
29
|
-
IGetStructuredDataParams,
|
|
30
|
-
IDataPack,
|
|
31
|
-
IStructuredDataCategory,
|
|
32
|
-
ICategoryGroup,
|
|
33
|
-
IOrderCategoryParams,
|
|
34
|
-
IQueryValue,
|
|
35
|
-
ILanguage,
|
|
36
|
-
} from "@ax/types";
|
|
37
|
-
import { useBulkSelection, useModal, usePermission, useToast } from "@ax/hooks";
|
|
38
|
-
import { MainWrapper, TableList, ErrorToast, Toast, EmptyState, SearchTagsBar, FilterTagsBar } from "@ax/components";
|
|
39
|
-
import { sortBy } from "@ax/helpers";
|
|
40
|
-
|
|
41
42
|
import { DeleteGroupModal, DeleteModal } from "./atoms";
|
|
42
|
-
import
|
|
43
|
+
import BulkHeader from "./BulkHeader";
|
|
43
44
|
import CategoryItem from "./CategoryItem";
|
|
44
|
-
import CategoryPanel from "./CategoryPanel";
|
|
45
45
|
import CategoryNav from "./CategoryNav";
|
|
46
|
-
import
|
|
46
|
+
import CategoryPanel from "./CategoryPanel";
|
|
47
|
+
import { buildTree, type FlattenedItem, flattenTree, getProjection, removeChildrenOf, setProperty } from "./helpers";
|
|
47
48
|
import { useFilterQuery } from "./hooks";
|
|
48
|
-
import { buildTree, FlattenedItem, flattenTree, getProjection, removeChildrenOf, setProperty } from "./helpers";
|
|
49
|
-
|
|
50
49
|
import * as S from "./style";
|
|
50
|
+
import { filterCategoriesAndGroups, getAllLangCategoriesIds } from "./utils";
|
|
51
51
|
|
|
52
52
|
const CategoriesList = (props: IProps): JSX.Element => {
|
|
53
53
|
const {
|
|
@@ -256,6 +256,7 @@ const CategoriesList = (props: IProps): JSX.Element => {
|
|
|
256
256
|
filterValues={filterValues}
|
|
257
257
|
filterItems={filterItems}
|
|
258
258
|
setHoverCheck={setHoverCheck}
|
|
259
|
+
selectedItems={selectedItems}
|
|
259
260
|
/>
|
|
260
261
|
);
|
|
261
262
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IBulkSelectedItems } from "@ax/hooks";
|
|
2
|
+
import type { ICategoryGroup, IDataLanguage, IStructuredDataCategory } from "@ax/types";
|
|
2
3
|
|
|
3
4
|
const getAllLangCategoriesIds = (
|
|
4
5
|
currentCategories: (IStructuredDataCategory | ICategoryGroup)[],
|
|
5
|
-
selectedItems:
|
|
6
|
+
selectedItems: IBulkSelectedItems,
|
|
6
7
|
): number[] => {
|
|
7
8
|
let langsCategoryIds: number[] = [];
|
|
8
9
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
1
|
import { Header } from "@ax/components/TableList/style";
|
|
4
2
|
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
5
5
|
const TableHeader = styled.div<{ isScrolling?: boolean }>`
|
|
6
6
|
width: 100%;
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: row;
|
|
9
|
-
|
|
9
|
+
align-items: center;
|
|
10
10
|
border-bottom: ${(p) => (p.isScrolling ? `1px solid ${p.theme.color.uiLine};` : "")};
|
|
11
|
+
min-height: 40px;
|
|
11
12
|
`;
|
|
12
13
|
|
|
13
14
|
const CheckHeader = styled(Header)`
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { BulkSelectionOptions } from "@ax/components";
|
|
3
|
-
import {
|
|
2
|
+
import type { IBulkSelectedItems } from "@ax/hooks";
|
|
4
3
|
import { usePermission } from "@ax/hooks";
|
|
4
|
+
import type { IColumn, IQueryValue } from "@ax/types";
|
|
5
|
+
|
|
5
6
|
import TableHeader from "./TableHeader";
|
|
6
7
|
|
|
7
8
|
const BulkHeader = (props: IProps): JSX.Element => {
|
|
@@ -29,6 +30,7 @@ const BulkHeader = (props: IProps): JSX.Element => {
|
|
|
29
30
|
maxColumns,
|
|
30
31
|
exportAction,
|
|
31
32
|
setHoverCheck,
|
|
33
|
+
selectedItems,
|
|
32
34
|
} = props;
|
|
33
35
|
|
|
34
36
|
const isAllowedToDeletePage = usePermission("content.deletePages");
|
|
@@ -65,6 +67,7 @@ const BulkHeader = (props: IProps): JSX.Element => {
|
|
|
65
67
|
selectItems={selectItems}
|
|
66
68
|
totalItems={totalItems}
|
|
67
69
|
exportAction={exportAction}
|
|
70
|
+
selectedItems={selectedItems}
|
|
68
71
|
/>
|
|
69
72
|
) : (
|
|
70
73
|
<TableHeader
|
|
@@ -112,6 +115,7 @@ interface IProps {
|
|
|
112
115
|
siteID: number;
|
|
113
116
|
exportAction?(formats: (number | string)[]): void;
|
|
114
117
|
setHoverCheck: (state: boolean) => void;
|
|
118
|
+
selectedItems: IBulkSelectedItems;
|
|
115
119
|
}
|
|
116
120
|
|
|
117
121
|
export default BulkHeader;
|
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
import { useHistory, useLocation } from "react-router-dom";
|
|
4
|
+
|
|
4
5
|
import { config } from "components";
|
|
5
6
|
|
|
6
7
|
const schemas = config.schemas.ui;
|
|
7
8
|
|
|
8
|
-
import { useModal, useBulkSelection, useToast, useCategoryColors, usePermission, useWindowSize } from "@ax/hooks";
|
|
9
|
-
import {
|
|
10
|
-
IRootState,
|
|
11
|
-
IPage,
|
|
12
|
-
ISavePageParams,
|
|
13
|
-
IStructuredDataContent,
|
|
14
|
-
IDataPack,
|
|
15
|
-
IEmptyStateProps,
|
|
16
|
-
ICheck,
|
|
17
|
-
IGetSitePagesParams,
|
|
18
|
-
ISite,
|
|
19
|
-
IUser,
|
|
20
|
-
IErrorItem,
|
|
21
|
-
IGetSitesParams,
|
|
22
|
-
ISiteRoles,
|
|
23
|
-
IPageLanguage,
|
|
24
|
-
IQueryValue,
|
|
25
|
-
IStructuredData,
|
|
26
|
-
ISchemaField,
|
|
27
|
-
IExportDataParams,
|
|
28
|
-
ILanguage,
|
|
29
|
-
} from "@ax/types";
|
|
30
9
|
import {
|
|
10
|
+
EmptyState,
|
|
11
|
+
ErrorToast,
|
|
12
|
+
FilterTagsBar,
|
|
31
13
|
MainWrapper,
|
|
32
14
|
Modal,
|
|
33
|
-
TableList,
|
|
34
|
-
ErrorToast,
|
|
35
|
-
Toast,
|
|
36
|
-
EmptyState,
|
|
37
15
|
Notification,
|
|
38
16
|
SearchTagsBar,
|
|
39
|
-
|
|
17
|
+
TableList,
|
|
18
|
+
Toast,
|
|
40
19
|
} from "@ax/components";
|
|
41
|
-
import { getMaxColumns, isGlobalStructuredData, isStructuredDataFromPage, updateColumns } from "@ax/helpers";
|
|
42
|
-
|
|
43
20
|
import { appActions } from "@ax/containers/App";
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
21
|
+
import { IError } from "@ax/containers/App/reducer";
|
|
22
|
+
import { integrationsActions } from "@ax/containers/Integrations";
|
|
47
23
|
import { navigationActions } from "@ax/containers/Navigation/Defaults";
|
|
24
|
+
import { pageEditorActions } from "@ax/containers/PageEditor";
|
|
48
25
|
import { INITIAL_TEMPLATE } from "@ax/containers/PageEditor/constants";
|
|
49
|
-
import { dataPacksActions } from "@ax/containers/Settings";
|
|
50
26
|
import {
|
|
51
27
|
ISetCurrentPageIDAction,
|
|
52
|
-
ISetCurrentPageStatusAction,
|
|
53
28
|
ISetCurrentPageNameAction,
|
|
29
|
+
ISetCurrentPageStatusAction,
|
|
54
30
|
pageStatus,
|
|
55
31
|
} from "@ax/containers/PageEditor/interfaces";
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
|
|
32
|
+
import { dataPacksActions } from "@ax/containers/Settings";
|
|
33
|
+
import { sitesActions } from "@ax/containers/Sites";
|
|
34
|
+
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
35
|
+
import { getMaxColumns, isGlobalStructuredData, isStructuredDataFromPage, updateColumns } from "@ax/helpers";
|
|
36
|
+
import { useBulkSelection, useCategoryColors, useModal, usePermission, useToast, useWindowSize } from "@ax/hooks";
|
|
59
37
|
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
38
|
+
ICheck,
|
|
39
|
+
IDataPack,
|
|
40
|
+
IEmptyStateProps,
|
|
41
|
+
IErrorItem,
|
|
42
|
+
IExportDataParams,
|
|
43
|
+
IGetSitePagesParams,
|
|
44
|
+
IGetSitesParams,
|
|
45
|
+
ILanguage,
|
|
46
|
+
IPage,
|
|
47
|
+
IPageLanguage,
|
|
48
|
+
IQueryValue,
|
|
49
|
+
IRootState,
|
|
50
|
+
ISavePageParams,
|
|
51
|
+
ISchemaField,
|
|
52
|
+
ISite,
|
|
53
|
+
ISiteRoles,
|
|
54
|
+
IStructuredData,
|
|
55
|
+
IStructuredDataContent,
|
|
56
|
+
IUser,
|
|
57
|
+
} from "@ax/types";
|
|
58
|
+
|
|
71
59
|
import StructuredDataItem from "./../StructuredData/StructuredDataList/StructuredDataItem";
|
|
60
|
+
import { DeleteModal } from "./atoms";
|
|
72
61
|
import BulkHeader from "./BulkHeader";
|
|
62
|
+
import ContentFilters from "./ContentFilters";
|
|
63
|
+
import { useFilterQuery, useSortedListStatus } from "./hooks";
|
|
64
|
+
import OptionTable from "./OptionTable";
|
|
73
65
|
import PageImporter from "./PageImporter";
|
|
74
|
-
import
|
|
75
|
-
|
|
66
|
+
import PageItem from "./PageItem";
|
|
76
67
|
import * as S from "./style";
|
|
68
|
+
import {
|
|
69
|
+
filterByStatus,
|
|
70
|
+
getColumns,
|
|
71
|
+
getCurrentFilter,
|
|
72
|
+
getOptionFilters,
|
|
73
|
+
getOptionValues,
|
|
74
|
+
getSortedListStatus,
|
|
75
|
+
} from "./utils";
|
|
77
76
|
|
|
78
77
|
// TODO: Make this monster manageable
|
|
79
78
|
const Content = (props: IProps): JSX.Element => {
|
|
@@ -594,6 +593,7 @@ const Content = (props: IProps): JSX.Element => {
|
|
|
594
593
|
maxColumns={maxColumns}
|
|
595
594
|
exportAction={exportContent}
|
|
596
595
|
setHoverCheck={setHoverCheck}
|
|
596
|
+
selectedItems={selectedItems}
|
|
597
597
|
/>
|
|
598
598
|
);
|
|
599
599
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IBulkAction } from "@ax/types";
|
|
1
|
+
import type { IBulkSelectedItems } from "@ax/hooks";
|
|
2
|
+
import type { IBulkAction } from "@ax/types";
|
|
3
3
|
|
|
4
4
|
import GridHeader from "./GridHeader";
|
|
5
5
|
|
|
6
6
|
import * as S from "./style";
|
|
7
7
|
|
|
8
8
|
const BulkGridHeader = (props: IBulkHeaderProps): JSX.Element => {
|
|
9
|
-
const { showBulk, checkState, selectItems, selectAllItems, totalItems, bulkActions } = props;
|
|
9
|
+
const { showBulk, checkState, selectItems, selectAllItems, totalItems, bulkActions, selectedItems } = props;
|
|
10
10
|
|
|
11
11
|
return showBulk ? (
|
|
12
12
|
<S.BulkWrapper>
|
|
@@ -16,6 +16,7 @@ const BulkGridHeader = (props: IBulkHeaderProps): JSX.Element => {
|
|
|
16
16
|
actions={bulkActions}
|
|
17
17
|
selectItems={selectItems}
|
|
18
18
|
totalItems={totalItems}
|
|
19
|
+
selectedItems={selectedItems}
|
|
19
20
|
/>
|
|
20
21
|
</S.BulkWrapper>
|
|
21
22
|
) : (
|
|
@@ -30,6 +31,7 @@ export interface IBulkHeaderProps {
|
|
|
30
31
|
selectAllItems: () => void;
|
|
31
32
|
totalItems: number;
|
|
32
33
|
bulkActions: IBulkAction[];
|
|
34
|
+
selectedItems: IBulkSelectedItems;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export default BulkGridHeader;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
1
|
import { BulkSelectionOptions } from "@ax/components";
|
|
4
2
|
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
5
5
|
const BulkWrapper = styled.div`
|
|
6
6
|
width: 100%;
|
|
7
7
|
span {
|
|
@@ -10,8 +10,10 @@ const BulkWrapper = styled.div`
|
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
12
|
const StyledBulkSelectionOptions = styled(BulkSelectionOptions)`
|
|
13
|
-
padding:
|
|
14
|
-
|
|
13
|
+
padding:0;
|
|
14
|
+
margin-left: 16px;
|
|
15
|
+
padding-right: 24px;
|
|
16
|
+
min-height: 40px;
|
|
15
17
|
`;
|
|
16
18
|
|
|
17
19
|
export { BulkWrapper, StyledBulkSelectionOptions };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
1
|
import { Header } from "@ax/components/TableList/style";
|
|
4
2
|
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
5
5
|
const TableHeader = styled.div<{ isScrolling?: boolean }>`
|
|
6
6
|
width: 100%;
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: row;
|
|
9
|
-
|
|
9
|
+
align-items: center;
|
|
10
10
|
border-bottom: ${(p) => (p.isScrolling ? `1px solid ${p.theme.color.uiLine};` : "")};
|
|
11
|
+
min-height: 40px;
|
|
12
|
+
padding-right: ${(p) => p.theme.spacing.s};
|
|
11
13
|
`;
|
|
12
14
|
|
|
13
15
|
const CheckHeader = styled(Header)`
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IBulkAction } from "@ax/types";
|
|
1
|
+
import type { IBulkSelectedItems } from "@ax/hooks";
|
|
2
|
+
import type { IBulkAction } from "@ax/types";
|
|
3
3
|
|
|
4
4
|
import TableHeader from "./TableHeader";
|
|
5
5
|
|
|
6
6
|
import * as S from "./style";
|
|
7
7
|
|
|
8
8
|
const BulkListHeader = (props: IBulkHeaderProps): JSX.Element => {
|
|
9
|
-
const {
|
|
10
|
-
|
|
9
|
+
const {
|
|
10
|
+
showBulk,
|
|
11
|
+
checkState,
|
|
12
|
+
selectItems,
|
|
13
|
+
selectAllItems,
|
|
14
|
+
totalItems,
|
|
15
|
+
bulkActions,
|
|
16
|
+
isSearching,
|
|
17
|
+
setHoverCheck,
|
|
18
|
+
selectedItems,
|
|
19
|
+
} = props;
|
|
11
20
|
|
|
12
21
|
return showBulk ? (
|
|
13
22
|
<S.BulkWrapper>
|
|
@@ -17,6 +26,7 @@ const BulkListHeader = (props: IBulkHeaderProps): JSX.Element => {
|
|
|
17
26
|
actions={bulkActions}
|
|
18
27
|
selectItems={selectItems}
|
|
19
28
|
totalItems={totalItems}
|
|
29
|
+
selectedItems={selectedItems}
|
|
20
30
|
/>
|
|
21
31
|
</S.BulkWrapper>
|
|
22
32
|
) : (
|
|
@@ -40,6 +50,7 @@ export interface IBulkHeaderProps {
|
|
|
40
50
|
bulkActions: IBulkAction[];
|
|
41
51
|
isSearching: boolean;
|
|
42
52
|
setHoverCheck: (state: boolean) => void;
|
|
53
|
+
selectedItems: IBulkSelectedItems;
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
export default BulkListHeader;
|