@griddo/ax 11.14.2 → 11.14.3-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/config/jest/setup.js +13 -7
- package/package.json +2 -2
- package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.test.tsx +4 -3
- package/src/components/CategoryCell/index.tsx +3 -1
- package/src/components/ElementsTooltip/index.tsx +8 -4
- package/src/components/ErrorPage/index.tsx +3 -1
- package/src/components/FilterTagsBar/index.tsx +3 -3
- package/src/components/HeadingsPreviewModal/utils.tsx +2 -1
- package/src/components/KeywordsPreviewModal/atoms.tsx +2 -2
- package/src/components/KeywordsPreviewModal/index.tsx +6 -6
- package/src/components/KeywordsPreviewModal/utils.tsx +5 -3
- package/src/components/Modal/style.tsx +5 -5
- package/src/components/TableFilters/CheckGroupFilter/index.tsx +3 -2
- package/src/components/TableFilters/LiveFilter/index.tsx +4 -4
- package/src/components/TableFilters/SiteFilter/index.tsx +11 -12
- package/src/components/TableFilters/TranslationsFilter/index.tsx +2 -2
- package/src/components/TableFilters/TranslationsFilter/style.tsx +2 -2
- package/src/components/Tag/index.tsx +15 -7
- package/src/components/TruncatedTooltip/index.tsx +48 -0
- package/src/components/index.tsx +2 -0
- package/src/constants/index.ts +3 -0
- package/src/helpers/categoryColumns.tsx +55 -0
- package/src/helpers/images.tsx +3 -1
- package/src/helpers/index.tsx +2 -0
- package/src/modules/ActivityLog/ItemLog/EventItem/index.tsx +17 -10
- package/src/modules/ActivityLog/ItemLog/EventItem/style.tsx +18 -1
- package/src/modules/ActivityLog/ItemLogUser/UserItem/EventItem/index.tsx +10 -7
- package/src/modules/ActivityLog/ItemLogUser/UserItem/index.tsx +9 -3
- package/src/modules/ActivityLog/ItemLogUser/UserItem/style.tsx +17 -1
- package/src/modules/App/Routing/NavMenu/NavItem/style.tsx +1 -0
- package/src/modules/App/Routing/index.tsx +2 -2
- package/src/modules/App/Routing/style.tsx +8 -1
- package/src/modules/Categories/CategoriesList/BulkHeader/TableHeader/style.tsx +1 -0
- package/src/modules/Categories/CategoriesList/CategoryItem/index.tsx +7 -3
- package/src/modules/Categories/CategoriesList/CategoryItem/style.tsx +38 -5
- package/src/modules/Content/BulkHeader/TableHeader/style.tsx +1 -1
- package/src/modules/Content/PageItem/index.tsx +80 -204
- package/src/modules/Content/PageItem/style.tsx +18 -10
- package/src/modules/Content/atoms.tsx +147 -18
- package/src/modules/Content/index.tsx +2 -9
- package/src/modules/Forms/FormCategoriesList/CategoryItem/index.tsx +7 -3
- package/src/modules/Forms/FormCategoriesList/CategoryItem/style.tsx +34 -0
- package/src/modules/Forms/FormEditor/index.tsx +28 -50
- package/src/modules/Forms/FormList/FormItem/index.tsx +91 -120
- package/src/modules/Forms/FormList/FormItem/style.tsx +19 -0
- package/src/modules/Forms/FormList/index.tsx +27 -48
- package/src/modules/Forms/atoms.tsx +44 -32
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/index.tsx +8 -8
- package/src/modules/StructuredData/StructuredDataList/BulkHeader/TableHeader/style.tsx +2 -2
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +83 -101
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/style.tsx +11 -5
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +31 -54
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/style.tsx +13 -7
- package/src/modules/Users/Roles/BulkHeader/TableHeader/style.tsx +6 -6
- package/src/modules/Users/Roles/RoleItem/index.tsx +3 -4
- package/src/modules/Users/Roles/RoleItem/style.tsx +12 -15
- package/src/modules/Users/Roles/index.tsx +1 -2
- package/src/modules/Users/UserCreate/SiteItem/index.tsx +10 -4
- package/src/modules/Users/UserCreate/SiteItem/style.tsx +33 -1
- package/src/modules/Users/UserForm/index.tsx +6 -4
- package/src/modules/Users/UserList/BulkHeader/TableHeader/index.tsx +2 -4
- package/src/modules/Users/UserList/BulkHeader/TableHeader/style.tsx +1 -1
- package/src/modules/Users/UserList/UserItem/index.tsx +18 -10
- package/src/modules/Users/UserList/UserItem/style.tsx +60 -4
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from "react";
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
CategoryCell,
|
|
6
|
-
CheckField,
|
|
7
|
-
ErrorToast,
|
|
8
|
-
FieldsBehavior,
|
|
9
|
-
Flag,
|
|
10
|
-
FloatingMenu,
|
|
11
|
-
Icon,
|
|
12
|
-
LanguageMenu,
|
|
13
|
-
Modal,
|
|
14
|
-
Tag,
|
|
15
|
-
Tooltip,
|
|
16
|
-
} from "@ax/components";
|
|
4
|
+
import { CheckField, Flag, FloatingMenu, Icon, LanguageMenu, Tag, Tooltip, TruncatedTooltip } from "@ax/components";
|
|
17
5
|
import { appActions } from "@ax/containers/App";
|
|
18
6
|
import { pageEditorActions } from "@ax/containers/PageEditor";
|
|
19
7
|
import { type ISetCurrentPageIDAction, pageStatus } from "@ax/containers/PageEditor/interfaces";
|
|
20
|
-
import {
|
|
21
|
-
|
|
8
|
+
import {
|
|
9
|
+
buildCategoryColumns,
|
|
10
|
+
getHumanLastModifiedDate,
|
|
11
|
+
getScheduleFormatDate,
|
|
12
|
+
getTemplateDisplayName,
|
|
13
|
+
slugify,
|
|
14
|
+
} from "@ax/helpers";
|
|
15
|
+
import { useModals, usePermissions } from "@ax/hooks";
|
|
22
16
|
import type {
|
|
23
17
|
ICheck,
|
|
24
18
|
IColumn,
|
|
@@ -33,9 +27,8 @@ import type {
|
|
|
33
27
|
} from "@ax/types";
|
|
34
28
|
|
|
35
29
|
import { config } from "components";
|
|
36
|
-
import { useTheme } from "styled-components";
|
|
37
30
|
|
|
38
|
-
import { CopyModal, DeleteModal } from "../atoms";
|
|
31
|
+
import { CopyModal, DeleteModal, DuplicatePageModal, RemovePageModal, UnpublishPageModal } from "../atoms";
|
|
39
32
|
|
|
40
33
|
import * as S from "./style";
|
|
41
34
|
|
|
@@ -91,6 +84,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
91
84
|
liveStatus,
|
|
92
85
|
publicationScheduled,
|
|
93
86
|
haveDraftPage,
|
|
87
|
+
title,
|
|
94
88
|
} = page;
|
|
95
89
|
|
|
96
90
|
const displayName = getTemplateDisplayName(templateId);
|
|
@@ -99,25 +93,17 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
99
93
|
const [site, setSite] = useState(null);
|
|
100
94
|
const [modalState, setModalState] = useState(initValue);
|
|
101
95
|
const [deleteAllVersions, setDeleteAllVersions] = useState(false);
|
|
102
|
-
const {
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const isAllowedToDuplicatePages = usePermission("content.duplicatePages");
|
|
115
|
-
const isAllowedToPublishPages = usePermission("content.publishUnpublishPages");
|
|
116
|
-
const isAllowedToCreatePages = usePermission("content.createPages");
|
|
117
|
-
const isAllowedToCopyPage = usePermission("content.copyPageInOtherSite");
|
|
118
|
-
const isAllowedToDeletePage = usePermission("content.deletePages");
|
|
119
|
-
const isAllowedToDeletePublishedPage = usePermission("content.deletePublishedPages");
|
|
120
|
-
const isAllowedToEditContentPage = usePermission("content.editContentPages");
|
|
96
|
+
const { toggleModal, isOpen } = useModals(["duplicate", "remove", "unpublish", "delete", "copy"]);
|
|
97
|
+
|
|
98
|
+
const isAllowedTo = usePermissions({
|
|
99
|
+
duplicatePages: "content.duplicatePages",
|
|
100
|
+
publishUnpublishPages: "content.publishUnpublishPages",
|
|
101
|
+
createPages: "content.createPages",
|
|
102
|
+
copyPageInOtherSite: "content.copyPageInOtherSite",
|
|
103
|
+
deletePages: "content.deletePages",
|
|
104
|
+
deletePublishedPages: "content.deletePublishedPages",
|
|
105
|
+
editContentPages: "content.editContentPages",
|
|
106
|
+
});
|
|
121
107
|
|
|
122
108
|
const currentTemplateDataPacks = schemas.templates[templateId].dataPacks;
|
|
123
109
|
|
|
@@ -127,7 +113,8 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
127
113
|
const activeColumns = columns.filter((col) => col.show).map((col) => col.id);
|
|
128
114
|
const API_URL = process.env.GRIDDO_API_URL || process.env.REACT_APP_API_ENDPOINT;
|
|
129
115
|
const isPublished = liveStatus?.status === pageStatus.PUBLISHED || liveStatus?.status === pageStatus.UPLOAD_PENDING;
|
|
130
|
-
const isAllowedToDelete =
|
|
116
|
+
const isAllowedToDelete =
|
|
117
|
+
(isPublished && isAllowedTo.deletePublishedPages) || (!isPublished && isAllowedTo.deletePages);
|
|
131
118
|
const isScheduledPub = !!publicationScheduled && (liveStatus?.status === pageStatus.SCHEDULED || haveDraftPage);
|
|
132
119
|
|
|
133
120
|
const publishedTooltip: Record<string, string> = {
|
|
@@ -214,7 +201,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
214
201
|
const handleDeleteItem = async () => {
|
|
215
202
|
const allPageVersions = pageLanguages.map((lang: IPageLanguage) => lang.pageId);
|
|
216
203
|
deleteAllVersions ? deleteBulk(allPageVersions) : deletePage();
|
|
217
|
-
|
|
204
|
+
toggleModal("delete");
|
|
218
205
|
};
|
|
219
206
|
|
|
220
207
|
const handleRemoveItemFromSite = async () => {
|
|
@@ -223,7 +210,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
223
210
|
setRemovedPage(page.originalGlobalPage);
|
|
224
211
|
toggleToast();
|
|
225
212
|
}
|
|
226
|
-
|
|
213
|
+
toggleModal("remove");
|
|
227
214
|
});
|
|
228
215
|
};
|
|
229
216
|
|
|
@@ -282,36 +269,28 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
282
269
|
if (isDuplicable) {
|
|
283
270
|
const isDuplicated = await duplicatePage(page.id, modalState);
|
|
284
271
|
if (isDuplicated) {
|
|
285
|
-
toggleModal();
|
|
272
|
+
toggleModal("duplicate");
|
|
286
273
|
setRoute("pages/editor");
|
|
287
274
|
}
|
|
288
275
|
} else {
|
|
289
|
-
toggleModal();
|
|
276
|
+
toggleModal("duplicate");
|
|
290
277
|
setModalState({ title: "", slug: "" });
|
|
291
278
|
setTemplateInstanceError({ error: true, templateName: displayName });
|
|
292
279
|
}
|
|
293
280
|
};
|
|
294
281
|
|
|
295
282
|
const handleCloseDuplicate = () => {
|
|
296
|
-
toggleModal();
|
|
283
|
+
toggleModal("duplicate");
|
|
297
284
|
setModalState({ title: "", slug: "" });
|
|
298
285
|
};
|
|
299
286
|
|
|
300
|
-
const mainModalAction = {
|
|
301
|
-
title: "Duplicate",
|
|
302
|
-
onClick: handleDuplicatePage,
|
|
303
|
-
disabled: !modalState.title.trim() || !modalState.slug.trim() || isSaving,
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
const secondaryModalAction = { title: "Cancel", onClick: handleCloseDuplicate };
|
|
307
|
-
|
|
308
287
|
const currentLanguages = getCurrentPageLanguages();
|
|
309
288
|
|
|
310
289
|
const isTemplateActivated = activatedTemplates.some((temp: any) => temp.id === templateId);
|
|
311
290
|
|
|
312
291
|
let availableLanguages = siteLanguages;
|
|
313
292
|
|
|
314
|
-
if (!isTemplateActivated || isGlobal || !
|
|
293
|
+
if (!isTemplateActivated || isGlobal || !isAllowedTo.createPages) {
|
|
315
294
|
const pageLanguagesIDs = pageLanguages.map((language: IPageLanguage) => language.languageId);
|
|
316
295
|
availableLanguages = siteLanguages?.filter((language) => pageLanguagesIDs.includes(language.id));
|
|
317
296
|
}
|
|
@@ -356,25 +335,25 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
356
335
|
menuOptions.push({
|
|
357
336
|
label: isGlobal ? "Remove" : "delete",
|
|
358
337
|
icon: "delete",
|
|
359
|
-
action: isGlobal ?
|
|
338
|
+
action: () => toggleModal(isGlobal ? "remove" : "delete"),
|
|
360
339
|
disabled: deleteDisabled,
|
|
361
340
|
helpText: deleteHelpText,
|
|
362
341
|
});
|
|
363
342
|
}
|
|
364
343
|
|
|
365
|
-
if (isCopyable &&
|
|
344
|
+
if (isCopyable && isAllowedTo.copyPageInOtherSite) {
|
|
366
345
|
menuOptions.unshift({
|
|
367
346
|
label: "Copy page in another site",
|
|
368
347
|
icon: "copy",
|
|
369
|
-
action:
|
|
348
|
+
action: () => toggleModal("copy"),
|
|
370
349
|
});
|
|
371
350
|
}
|
|
372
351
|
|
|
373
|
-
if (!isGlobal &&
|
|
352
|
+
if (!isGlobal && isAllowedTo.duplicatePages) {
|
|
374
353
|
menuOptions.unshift({
|
|
375
354
|
label: "duplicate",
|
|
376
355
|
icon: "duplicate",
|
|
377
|
-
action: toggleModal,
|
|
356
|
+
action: () => toggleModal("duplicate"),
|
|
378
357
|
});
|
|
379
358
|
}
|
|
380
359
|
|
|
@@ -395,7 +374,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
395
374
|
return {
|
|
396
375
|
label: "unpublish",
|
|
397
376
|
icon: "offline",
|
|
398
|
-
action: page.haveDraftPage ?
|
|
377
|
+
action: page.haveDraftPage ? () => toggleModal("unpublish") : unpublishPage,
|
|
399
378
|
disabled,
|
|
400
379
|
helpText,
|
|
401
380
|
};
|
|
@@ -403,7 +382,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
403
382
|
return {
|
|
404
383
|
label: "unpublish",
|
|
405
384
|
icon: "offline",
|
|
406
|
-
action: page.haveDraftPage ?
|
|
385
|
+
action: page.haveDraftPage ? () => toggleModal("unpublish") : cancelPublishPage,
|
|
407
386
|
disabled,
|
|
408
387
|
helpText,
|
|
409
388
|
};
|
|
@@ -422,7 +401,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
422
401
|
|
|
423
402
|
const publishAction = getPublishItem(page.liveStatus?.status, canBeUnpublished);
|
|
424
403
|
|
|
425
|
-
menuOptions = publishAction &&
|
|
404
|
+
menuOptions = publishAction && isAllowedTo.publishUnpublishPages ? [publishAction, ...menuOptions] : menuOptions;
|
|
426
405
|
|
|
427
406
|
const editOptions = [
|
|
428
407
|
{
|
|
@@ -433,7 +412,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
433
412
|
},
|
|
434
413
|
];
|
|
435
414
|
|
|
436
|
-
if (
|
|
415
|
+
if (isAllowedTo.editContentPages) {
|
|
437
416
|
editOptions.unshift({
|
|
438
417
|
label: "Edit draft",
|
|
439
418
|
icon: "modified",
|
|
@@ -452,13 +431,6 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
452
431
|
</Tooltip>
|
|
453
432
|
);
|
|
454
433
|
|
|
455
|
-
const mainRemoveModalAction = {
|
|
456
|
-
title: "Remove",
|
|
457
|
-
onClick: handleRemoveItemFromSite,
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
const secondaryRemoveModalAction = { title: "Cancel", onClick: toggleRemoveModal };
|
|
461
|
-
|
|
462
434
|
const copyToOtherSite = () => {
|
|
463
435
|
if (site) {
|
|
464
436
|
const siteID = parseInt(site);
|
|
@@ -467,59 +439,21 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
467
439
|
if (successEvent === true) {
|
|
468
440
|
toggleCopiedToast();
|
|
469
441
|
}
|
|
470
|
-
|
|
442
|
+
toggleModal("copy");
|
|
471
443
|
});
|
|
472
444
|
}
|
|
473
445
|
};
|
|
474
446
|
|
|
475
|
-
const secondaryCopyModalAction = {
|
|
476
|
-
title: "Cancel",
|
|
477
|
-
onClick: toggleCopyModal,
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
const mainCopyModalAction = { title: "Copy page", onClick: copyToOtherSite, disabled: !site };
|
|
481
|
-
|
|
482
447
|
const getLiveStatus = () => (isScheduledPub ? "scheduled" : haveDraftPage ? "modified" : liveStatus?.status);
|
|
483
448
|
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
const CategoryColumns = categoryColumns.map((col) => {
|
|
494
|
-
if (!activeColumns.includes(col.key)) {
|
|
495
|
-
return <React.Fragment key={col.key} />;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
const type: any = structuredDataContent?.[col.key];
|
|
499
|
-
|
|
500
|
-
if (typeof type !== "object") {
|
|
501
|
-
return (
|
|
502
|
-
<S.ColumnCell key={col.key} onClick={goToPage}>
|
|
503
|
-
{type}
|
|
504
|
-
</S.ColumnCell>
|
|
505
|
-
);
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
const categories: string[] = !type
|
|
509
|
-
? []
|
|
510
|
-
: Array.isArray(type)
|
|
511
|
-
? type.map((cat: any) => cat.label || cat.title)
|
|
512
|
-
: [type.label || type.title];
|
|
513
|
-
|
|
514
|
-
return (
|
|
515
|
-
<CategoryCell
|
|
516
|
-
key={col.key}
|
|
517
|
-
categories={categories}
|
|
518
|
-
categoryColors={categoryColors}
|
|
519
|
-
addCategoryColors={addCategoryColors}
|
|
520
|
-
/>
|
|
521
|
-
);
|
|
522
|
-
});
|
|
449
|
+
const CategoryColumns = buildCategoryColumns(
|
|
450
|
+
categoryColumns,
|
|
451
|
+
activeColumns,
|
|
452
|
+
structuredDataContent,
|
|
453
|
+
categoryColors,
|
|
454
|
+
addCategoryColors,
|
|
455
|
+
goToPage,
|
|
456
|
+
);
|
|
523
457
|
|
|
524
458
|
return (
|
|
525
459
|
<>
|
|
@@ -527,30 +461,22 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
527
461
|
<S.CheckCell role="cell">
|
|
528
462
|
<CheckField name="check" value={page.id} checked={isSelected || hoverCheck} onChange={handleOnChange} />
|
|
529
463
|
</S.CheckCell>
|
|
530
|
-
<S.NameCell role="cell" onClick={goToPage}
|
|
464
|
+
<S.NameCell role="cell" onClick={goToPage}>
|
|
531
465
|
{isHome && (
|
|
532
466
|
<S.Home>
|
|
533
467
|
<Icon name="home" />
|
|
534
468
|
Home
|
|
535
469
|
</S.Home>
|
|
536
470
|
)}
|
|
537
|
-
<
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
</
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
left={0}
|
|
546
|
-
top={1}
|
|
547
|
-
expanded
|
|
548
|
-
>
|
|
549
|
-
<S.Title width={title.width}>{title.text}</S.Title>
|
|
550
|
-
{!isHome && <S.Slug width={path.width}>{path.text}</S.Slug>}
|
|
551
|
-
</Tooltip>
|
|
471
|
+
<TruncatedTooltip content={title} expanded top={-5}>
|
|
472
|
+
<S.Title>{title}</S.Title>
|
|
473
|
+
</TruncatedTooltip>
|
|
474
|
+
{!isHome && (
|
|
475
|
+
<TruncatedTooltip content={fullPath.page} expanded top={5}>
|
|
476
|
+
<S.Slug>{fullPath.page}</S.Slug>
|
|
477
|
+
</TruncatedTooltip>
|
|
478
|
+
)}
|
|
552
479
|
</S.NameCell>
|
|
553
|
-
|
|
554
480
|
{activeColumns.includes("type") && (
|
|
555
481
|
<S.TypeCell role="cell" onClick={goToPage}>
|
|
556
482
|
{displayName}
|
|
@@ -588,86 +514,36 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
588
514
|
</S.ActionsCell>
|
|
589
515
|
</S.PageRow>
|
|
590
516
|
<CopyModal
|
|
591
|
-
isOpen={
|
|
517
|
+
isOpen={isOpen("copy")}
|
|
592
518
|
toggleModal={() => {
|
|
593
519
|
setSite(null);
|
|
594
|
-
|
|
520
|
+
toggleModal("copy");
|
|
595
521
|
}}
|
|
596
|
-
|
|
597
|
-
secondaryModalAction={secondaryCopyModalAction}
|
|
522
|
+
onCopy={copyToOtherSite}
|
|
598
523
|
sites={sites}
|
|
599
524
|
site={site}
|
|
600
525
|
setSite={setSite}
|
|
601
526
|
/>
|
|
602
|
-
<
|
|
603
|
-
isOpen={isOpen}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
value={modalState.title}
|
|
619
|
-
onChange={handleNameChange}
|
|
620
|
-
/>
|
|
621
|
-
<FieldsBehavior
|
|
622
|
-
fieldType="TextField"
|
|
623
|
-
name="slug"
|
|
624
|
-
title="Slug"
|
|
625
|
-
mandatory={true}
|
|
626
|
-
value={modalState.slug}
|
|
627
|
-
onChange={handleSlugChange}
|
|
628
|
-
/>
|
|
629
|
-
</S.ModalContent>
|
|
630
|
-
) : null}
|
|
631
|
-
</Modal>
|
|
632
|
-
<Modal
|
|
633
|
-
isOpen={isRemoveOpen}
|
|
634
|
-
hide={toggleRemoveModal}
|
|
635
|
-
title="Remove page from this site?"
|
|
636
|
-
secondaryAction={secondaryRemoveModalAction}
|
|
637
|
-
mainAction={mainRemoveModalAction}
|
|
638
|
-
size="S"
|
|
639
|
-
>
|
|
640
|
-
{isRemoveOpen ? (
|
|
641
|
-
<S.ModalContent>
|
|
642
|
-
<p>
|
|
643
|
-
Are you sure you want to remove <strong>‘{page.title}’</strong> from this site?
|
|
644
|
-
<br />
|
|
645
|
-
This action <strong>cannot be undone</strong>.
|
|
646
|
-
</p>
|
|
647
|
-
</S.ModalContent>
|
|
648
|
-
) : null}
|
|
649
|
-
</Modal>
|
|
650
|
-
<Modal
|
|
651
|
-
isOpen={isUnpublishOpen}
|
|
652
|
-
hide={toggleUnpublishModal}
|
|
653
|
-
size="S"
|
|
654
|
-
title="Unpublish Modified Page"
|
|
655
|
-
mainAction={mainUnpublishAction}
|
|
656
|
-
>
|
|
657
|
-
{isUnpublishOpen && (
|
|
658
|
-
<S.ModalContent>
|
|
659
|
-
<p>
|
|
660
|
-
There are some saved changes that are not published on this page. To Unpublish this page,{" "}
|
|
661
|
-
<strong>you must publish these changes or discard them.</strong>
|
|
662
|
-
</p>
|
|
663
|
-
</S.ModalContent>
|
|
664
|
-
)}
|
|
665
|
-
</Modal>
|
|
527
|
+
<DuplicatePageModal
|
|
528
|
+
isOpen={isOpen("duplicate")}
|
|
529
|
+
toggleModal={handleCloseDuplicate}
|
|
530
|
+
modalState={modalState}
|
|
531
|
+
onNameChange={handleNameChange}
|
|
532
|
+
onSlugChange={handleSlugChange}
|
|
533
|
+
onDuplicate={handleDuplicatePage}
|
|
534
|
+
isSaving={isSaving}
|
|
535
|
+
/>
|
|
536
|
+
<RemovePageModal
|
|
537
|
+
isOpen={isOpen("remove")}
|
|
538
|
+
toggleModal={() => toggleModal("remove")}
|
|
539
|
+
pageTitle={page.title}
|
|
540
|
+
onRemove={handleRemoveItemFromSite}
|
|
541
|
+
/>
|
|
542
|
+
<UnpublishPageModal isOpen={isOpen("unpublish")} toggleModal={() => toggleModal("unpublish")} />
|
|
666
543
|
<DeleteModal
|
|
667
|
-
isOpen={
|
|
668
|
-
toggleModal={
|
|
669
|
-
|
|
670
|
-
secondaryModalAction={secondaryDeleteModalAction}
|
|
544
|
+
isOpen={isOpen("delete")}
|
|
545
|
+
toggleModal={() => toggleModal("delete")}
|
|
546
|
+
onDelete={handleDeleteItem}
|
|
671
547
|
{...{ isTranslated, deleteAllVersions, setDeleteAllVersions, title: page.title }}
|
|
672
548
|
/>
|
|
673
549
|
</>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
|
-
import { Cell, Row } from "@ax/components/TableList/TableItem/style";
|
|
4
1
|
import { ActionMenu } from "@ax/components";
|
|
2
|
+
import { Cell, Row } from "@ax/components/TableList/TableItem/style";
|
|
3
|
+
|
|
4
|
+
import styled from "styled-components";
|
|
5
5
|
|
|
6
6
|
const CheckCell = styled(Cell)`
|
|
7
7
|
padding-right: 0;
|
|
@@ -16,6 +16,12 @@ const CheckCell = styled(Cell)`
|
|
|
16
16
|
|
|
17
17
|
const NameCell = styled(Cell)`
|
|
18
18
|
flex-grow: 1;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
position: relative;
|
|
21
|
+
flex-flow: column;
|
|
22
|
+
> * {
|
|
23
|
+
min-width: 0;
|
|
24
|
+
}
|
|
19
25
|
svg {
|
|
20
26
|
height: ${(p) => p.theme.spacing.s};
|
|
21
27
|
path {
|
|
@@ -24,20 +30,20 @@ const NameCell = styled(Cell)`
|
|
|
24
30
|
}
|
|
25
31
|
`;
|
|
26
32
|
|
|
27
|
-
const Title = styled.div
|
|
33
|
+
const Title = styled.div`
|
|
34
|
+
width: 100%;
|
|
28
35
|
${(p) => p.theme.textStyle.uiL};
|
|
29
36
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
30
37
|
overflow: hidden;
|
|
31
|
-
white-space: nowrap;
|
|
32
38
|
text-overflow: ellipsis;
|
|
33
|
-
|
|
39
|
+
white-space: nowrap;
|
|
34
40
|
`;
|
|
35
41
|
|
|
36
|
-
const Slug = styled.div
|
|
42
|
+
const Slug = styled.div`
|
|
43
|
+
width: 100%;
|
|
37
44
|
overflow: hidden;
|
|
38
|
-
white-space: nowrap;
|
|
39
45
|
text-overflow: ellipsis;
|
|
40
|
-
|
|
46
|
+
white-space: nowrap;
|
|
41
47
|
`;
|
|
42
48
|
|
|
43
49
|
const TypeCell = styled(Cell)`
|
|
@@ -124,6 +130,8 @@ const StyledActionMenu = styled(ActionMenu)`
|
|
|
124
130
|
|
|
125
131
|
const PageRow = styled(Row)<{ global?: boolean }>`
|
|
126
132
|
position: relative;
|
|
133
|
+
width: 100%;
|
|
134
|
+
box-sizing: border-box;
|
|
127
135
|
&:hover {
|
|
128
136
|
${TypeCell}, ${SeoCell} {
|
|
129
137
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
@@ -195,7 +203,7 @@ const ModalContent = styled.div`
|
|
|
195
203
|
`;
|
|
196
204
|
|
|
197
205
|
const ColumnCell = styled(Cell)`
|
|
198
|
-
flex: 0 0
|
|
206
|
+
flex: 0 0 215px;
|
|
199
207
|
position: relative;
|
|
200
208
|
align-items: center;
|
|
201
209
|
`;
|