@griddo/ax 11.15.9 → 11.16.0-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/package.json +2 -2
- package/src/__tests__/components/RestrictionsModal/CurrentAccessList/CurrentAccessList.test.tsx +173 -0
- package/src/__tests__/components/RestrictionsModal/OptionsStep/OptionsStep.test.tsx +160 -0
- package/src/__tests__/components/RestrictionsModal/RestrictionsModal.test.tsx +134 -0
- package/src/__tests__/components/RestrictionsModal/RolesList/RolesList.test.tsx +234 -0
- package/src/__tests__/components/RestrictionsModal/UsersList/UsersList.test.tsx +288 -0
- package/src/__tests__/hooks/users.test.tsx +382 -0
- package/src/api/pages.tsx +24 -1
- package/src/api/sites.tsx +14 -14
- package/src/api/structuredData.tsx +17 -7
- package/src/components/Browser/index.tsx +12 -0
- package/src/components/Browser/style.tsx +5 -1
- package/src/components/ConfigPanel/Form/index.tsx +11 -10
- package/src/components/ContentItem/index.tsx +31 -0
- package/src/components/ContentItem/style.tsx +43 -0
- package/src/components/Fields/ImageField/index.tsx +2 -1
- package/src/components/Fields/RadioField/index.tsx +3 -3
- package/src/components/Fields/RadioField/style.tsx +1 -1
- package/src/components/FloatingNote/index.tsx +12 -1
- package/src/components/FloatingNote/style.tsx +2 -1
- package/src/components/Modal/style.tsx +11 -0
- package/src/components/PageFinder/SelectionListItem/index.tsx +27 -17
- package/src/components/PageFinder/index.tsx +65 -28
- package/src/components/PageFinder/style.tsx +0 -1
- package/src/components/RestrictionsModal/CurrentAccessList/index.tsx +74 -0
- package/src/components/RestrictionsModal/CurrentAccessList/style.tsx +155 -0
- package/src/components/RestrictionsModal/OptionsStep/index.tsx +55 -0
- package/src/components/RestrictionsModal/OptionsStep/style.tsx +29 -0
- package/src/components/RestrictionsModal/RolesList/RoleItem/index.tsx +54 -0
- package/src/components/RestrictionsModal/RolesList/RoleItem/style.tsx +34 -0
- package/src/components/RestrictionsModal/RolesList/index.tsx +107 -0
- package/src/components/RestrictionsModal/RolesList/style.tsx +76 -0
- package/src/components/RestrictionsModal/UsersList/UserItem/index.tsx +78 -0
- package/src/components/RestrictionsModal/UsersList/UserItem/style.tsx +73 -0
- package/src/components/RestrictionsModal/UsersList/index.tsx +151 -0
- package/src/components/RestrictionsModal/UsersList/style.tsx +55 -0
- package/src/components/RestrictionsModal/index.tsx +181 -0
- package/src/components/RestrictionsModal/style.tsx +31 -0
- package/src/components/RestrictionsModal/utils.tsx +24 -0
- package/src/components/ScheduleModal/index.tsx +32 -8
- package/src/components/SelectionComponent/index.tsx +65 -0
- package/src/components/SelectionComponent/style.tsx +69 -0
- package/src/components/TableFilters/RoleFilter/index.tsx +3 -3
- package/src/components/TableList/TableItem/style.tsx +7 -13
- package/src/components/Tabs/index.tsx +2 -1
- package/src/components/UserRolesAndSites/index.tsx +2 -2
- package/src/components/index.tsx +6 -0
- package/src/containers/PageEditor/actions.tsx +43 -0
- package/src/containers/PageEditor/constants.tsx +1 -0
- package/src/containers/PageEditor/interfaces.tsx +26 -19
- package/src/containers/PageEditor/reducer.tsx +32 -19
- package/src/containers/Users/reducer.tsx +1 -0
- package/src/helpers/forms.tsx +3 -1
- package/src/hooks/index.tsx +2 -1
- package/src/hooks/users.tsx +154 -14
- package/src/modules/ActivityLog/LogFilters/UserFilter/index.tsx +11 -12
- package/src/modules/Content/PageItem/index.tsx +17 -10
- package/src/modules/Content/index.tsx +1 -3
- package/src/modules/GlobalEditor/Editor/index.tsx +6 -0
- package/src/modules/GlobalEditor/PageBrowser/index.tsx +6 -0
- package/src/modules/GlobalEditor/Preview/index.tsx +4 -2
- package/src/modules/GlobalEditor/index.tsx +72 -45
- package/src/modules/Navigation/Menus/List/Table/ConfigPanel/Form/index.tsx +3 -5
- package/src/modules/Navigation/Menus/List/Table/ConfigPanel/index.tsx +4 -4
- package/src/modules/Navigation/Menus/List/Table/SidePanel/Form/ConnectedField/index.tsx +2 -3
- package/src/modules/Navigation/Menus/List/Table/SidePanel/Form/index.tsx +3 -4
- package/src/modules/Navigation/Menus/List/Table/SidePanel/index.tsx +5 -6
- package/src/modules/PageEditor/Editor/index.tsx +6 -0
- package/src/modules/PageEditor/PageBrowser/index.tsx +6 -0
- package/src/modules/PageEditor/Preview/index.tsx +9 -2
- package/src/modules/PageEditor/atoms.tsx +110 -3
- package/src/modules/PageEditor/index.tsx +76 -95
- package/src/modules/Settings/Integrations/IntegrationForm/index.tsx +1 -3
- package/src/modules/Sites/SitesList/GridView/GridSiteItem/style.tsx +19 -2
- package/src/modules/Sites/SitesList/WelcomeModal/FinalStep/index.tsx +2 -2
- package/src/modules/Sites/SitesList/WelcomeModal/utils.ts +2 -2
- package/src/modules/StructuredData/Form/ConnectedField/index.tsx +2 -2
- package/src/modules/StructuredData/Form/index.tsx +120 -75
- package/src/modules/StructuredData/Form/style.tsx +7 -1
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +15 -8
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +15 -9
- package/src/modules/StructuredData/{StructuredDataList/StructuredDataItem/utils.tsx → utils.tsx} +16 -2
- package/src/modules/Users/Profile/atoms.tsx +62 -4
- package/src/modules/Users/Profile/index.tsx +83 -4
- package/src/modules/Users/Profile/style.tsx +60 -0
- package/src/modules/Users/UserCreate/SiteItem/RolesModal/RoleItem/index.tsx +3 -5
- package/src/modules/Users/UserCreate/SiteItem/index.tsx +2 -2
- package/src/modules/Users/UserCreate/atoms.tsx +69 -0
- package/src/modules/Users/UserCreate/index.tsx +149 -70
- package/src/modules/Users/UserCreate/style.tsx +24 -1
- package/src/modules/Users/UserForm/index.tsx +260 -146
- package/src/modules/Users/UserForm/style.tsx +13 -1
- package/src/modules/Users/UserList/UserItem/index.tsx +3 -3
- package/src/types/index.tsx +19 -6
- package/src/types/logs.tsx +1 -1
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
KeywordsPreviewModal,
|
|
12
12
|
Loading,
|
|
13
13
|
MainWrapper,
|
|
14
|
-
Modal,
|
|
15
14
|
Notification,
|
|
16
15
|
OcassionalToast,
|
|
17
16
|
RestoreModal,
|
|
17
|
+
RestrictionsModal,
|
|
18
18
|
ScheduleModal,
|
|
19
19
|
} from "@ax/components";
|
|
20
20
|
import { appActions } from "@ax/containers/App";
|
|
@@ -24,7 +24,7 @@ import { pageStatus } from "@ax/containers/PageEditor/interfaces";
|
|
|
24
24
|
import { dataPacksActions } from "@ax/containers/Settings/DataPacks";
|
|
25
25
|
import { RouteLeavingGuard } from "@ax/guards";
|
|
26
26
|
import { dateToString, getDeactivatedModules, isModuleDisabled } from "@ax/helpers";
|
|
27
|
-
import { useIsDirty, useModals,
|
|
27
|
+
import { useIsDirty, useModals, usePermissionsForPage } from "@ax/hooks";
|
|
28
28
|
import type {
|
|
29
29
|
HeadingFilter,
|
|
30
30
|
IErrorItem,
|
|
@@ -33,10 +33,12 @@ import type {
|
|
|
33
33
|
IPageLanguage,
|
|
34
34
|
IRootState,
|
|
35
35
|
ISavePageParams,
|
|
36
|
+
ISite,
|
|
36
37
|
IUserEditing,
|
|
38
|
+
PageAccessGrantsSummary,
|
|
37
39
|
} from "@ax/types";
|
|
38
40
|
|
|
39
|
-
import { DeleteModal } from "./atoms";
|
|
41
|
+
import { DeleteModal, DirtyNavigateModal, UnpublishModal, UserEditingModal } from "./atoms";
|
|
40
42
|
import Editor from "./Editor";
|
|
41
43
|
import Preview from "./Preview";
|
|
42
44
|
|
|
@@ -75,15 +77,25 @@ const PageEditor = (props: IProps) => {
|
|
|
75
77
|
schemaVersion,
|
|
76
78
|
setIsLoading,
|
|
77
79
|
updateEditorContent,
|
|
80
|
+
currentSiteInfo,
|
|
81
|
+
updatePageAccessGrants,
|
|
82
|
+
accessGrants,
|
|
78
83
|
} = props;
|
|
79
84
|
|
|
80
|
-
const isAllowedTo =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const isAllowedTo = usePermissionsForPage(
|
|
86
|
+
currentSiteInfo.id,
|
|
87
|
+
pageID,
|
|
88
|
+
{
|
|
89
|
+
publishPages: "content.publishUnpublishPages",
|
|
90
|
+
createPages: "content.createPages",
|
|
91
|
+
deletePages: "content.deletePages",
|
|
92
|
+
deletePublishedPages: "content.deletePublishedPages",
|
|
93
|
+
editContentPages: "content.editContentPages",
|
|
94
|
+
setPagePermissions: "general.setPermissionPerPage",
|
|
95
|
+
},
|
|
96
|
+
accessGrants,
|
|
97
|
+
pageLanguages,
|
|
98
|
+
);
|
|
87
99
|
|
|
88
100
|
const defaultTab = isAllowedTo.editContentPages ? "edit" : "view";
|
|
89
101
|
|
|
@@ -109,6 +121,7 @@ const PageEditor = (props: IProps) => {
|
|
|
109
121
|
"headingsPreview",
|
|
110
122
|
"keywordsPreview",
|
|
111
123
|
"dirtyNavigate",
|
|
124
|
+
"userAccess",
|
|
112
125
|
]);
|
|
113
126
|
|
|
114
127
|
const { isDirty, setIsDirty, resetDirty } = useIsDirty(editorContent, isNewTranslation);
|
|
@@ -128,6 +141,7 @@ const PageEditor = (props: IProps) => {
|
|
|
128
141
|
const deleteHelpText = !canBeUnpublished ? "This is the canonical site of the page. You cannot unpublish it." : null;
|
|
129
142
|
const isScheduled = !!editorContent && !!editorContent.publicationScheduled;
|
|
130
143
|
const isDeleted = editorContent.deleted;
|
|
144
|
+
const isRestricted = !!(accessGrants.users.length || accessGrants.roles.length);
|
|
131
145
|
const defaultContentTab = "content";
|
|
132
146
|
|
|
133
147
|
const errorNotificationText =
|
|
@@ -167,6 +181,10 @@ const PageEditor = (props: IProps) => {
|
|
|
167
181
|
return () => clearInterval(interval);
|
|
168
182
|
}, []);
|
|
169
183
|
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
setSelectedTab(defaultTab);
|
|
186
|
+
}, [defaultTab]);
|
|
187
|
+
|
|
170
188
|
// biome-ignore lint/correctness/useExhaustiveDependencies: TODO: fix this
|
|
171
189
|
useEffect(() => {
|
|
172
190
|
const { pageID, sendPagePing, currentUserID } = props;
|
|
@@ -354,6 +372,14 @@ const PageEditor = (props: IProps) => {
|
|
|
354
372
|
|
|
355
373
|
const menuOptions = [];
|
|
356
374
|
|
|
375
|
+
if (isAllowedTo.setPagePermissions) {
|
|
376
|
+
menuOptions.push({
|
|
377
|
+
label: "Page user access",
|
|
378
|
+
icon: "users",
|
|
379
|
+
action: () => toggleModal("userAccess"),
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
357
383
|
if (isAllowedTo.publishPages && !isScheduled && !isPublished && props.pageStatus !== pageStatus.OFFLINE_PENDING) {
|
|
358
384
|
menuOptions.push({
|
|
359
385
|
label: "Schedule",
|
|
@@ -561,25 +587,6 @@ const PageEditor = (props: IProps) => {
|
|
|
561
587
|
props.setHistoryPush(backLinkRoute, false);
|
|
562
588
|
};
|
|
563
589
|
|
|
564
|
-
const mainAction = { title: "Preview Page", onClick: () => toggleModal("userEditing") };
|
|
565
|
-
const secondaryAction = { title: "Ok, go back", onClick: handleGoBack };
|
|
566
|
-
|
|
567
|
-
const mainUnpublishAction = { title: "Ok", onClick: () => toggleModal("unpublish") };
|
|
568
|
-
|
|
569
|
-
const mainScheduleModalAction = {
|
|
570
|
-
title: "Schedule",
|
|
571
|
-
onClick: handleSchedulePublication,
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
const secondaryScheduleModalAction = { title: "Cancel", onClick: () => toggleModal("schedule") };
|
|
575
|
-
|
|
576
|
-
const mainCancelScheduleModalAction = {
|
|
577
|
-
title: "Cancel Schedule",
|
|
578
|
-
onClick: handleCancelSchedulePublication,
|
|
579
|
-
};
|
|
580
|
-
|
|
581
|
-
const secondaryCancelScheduleModalAction = { title: "Back", onClick: () => toggleModal("cancelSchedule") };
|
|
582
|
-
|
|
583
590
|
const tabIcons = isAllowedTo.editContentPages
|
|
584
591
|
? [
|
|
585
592
|
{ name: "edit", text: "Edit mode" },
|
|
@@ -664,17 +671,24 @@ const PageEditor = (props: IProps) => {
|
|
|
664
671
|
setTab(defaultContentTab);
|
|
665
672
|
};
|
|
666
673
|
|
|
674
|
+
const handleUpdateAccessGrants = async (accessGrants: PageAccessGrantsSummary) => {
|
|
675
|
+
const isUpdated = await updatePageAccessGrants({ siteID: currentSiteInfo.id, pageID, accessGrants });
|
|
676
|
+
if (isUpdated) {
|
|
677
|
+
toggleModal("userAccess");
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
|
|
667
681
|
const onNavigateWithDirty = (navigateCallback: () => void) => {
|
|
668
682
|
setPendingNavigateCallback(() => navigateCallback);
|
|
669
683
|
toggleModal("dirtyNavigate");
|
|
670
684
|
};
|
|
671
685
|
|
|
672
686
|
const handleConfirmDirtyNavigation = () => {
|
|
673
|
-
toggleModal("dirtyNavigate");
|
|
674
687
|
if (pendingNavigateCallback) {
|
|
675
688
|
pendingNavigateCallback();
|
|
676
689
|
setPendingNavigateCallback(null);
|
|
677
690
|
}
|
|
691
|
+
toggleModal("dirtyNavigate");
|
|
678
692
|
};
|
|
679
693
|
|
|
680
694
|
const handleCancelDirtyNavigation = () => {
|
|
@@ -682,22 +696,6 @@ const PageEditor = (props: IProps) => {
|
|
|
682
696
|
setPendingNavigateCallback(null);
|
|
683
697
|
};
|
|
684
698
|
|
|
685
|
-
const dirtyNavigateModalText = (
|
|
686
|
-
<>
|
|
687
|
-
Some content <strong>is not saved</strong> on this page.
|
|
688
|
-
</>
|
|
689
|
-
);
|
|
690
|
-
|
|
691
|
-
const mainDirtyNavigateAction = {
|
|
692
|
-
title: "Yes, discard changes",
|
|
693
|
-
onClick: handleConfirmDirtyNavigation,
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
const secondaryDirtyNavigateAction = {
|
|
697
|
-
title: "Cancel",
|
|
698
|
-
onClick: handleCancelDirtyNavigation,
|
|
699
|
-
};
|
|
700
|
-
|
|
701
699
|
return isLoading ? (
|
|
702
700
|
<Loading />
|
|
703
701
|
) : (
|
|
@@ -784,49 +782,25 @@ const PageEditor = (props: IProps) => {
|
|
|
784
782
|
keywordsFilter={keywordsFilter}
|
|
785
783
|
isDirty={isDirty}
|
|
786
784
|
onNavigateWithDirty={onNavigateWithDirty}
|
|
785
|
+
isRestrictedPage={isRestricted}
|
|
786
|
+
onRestrictionsClick={isAllowedTo.setPagePermissions ? () => toggleModal("userAccess") : undefined}
|
|
787
787
|
/>
|
|
788
788
|
</S.Content>
|
|
789
789
|
</>
|
|
790
790
|
) : (
|
|
791
791
|
<>
|
|
792
|
-
<Preview />
|
|
792
|
+
<Preview isRestrictedPage={isRestricted} />
|
|
793
793
|
{toastMsg?.length && <OcassionalToast icon="warning" message={toastMsg} />}
|
|
794
794
|
</>
|
|
795
795
|
)}
|
|
796
796
|
|
|
797
|
-
<
|
|
797
|
+
<UserEditingModal
|
|
798
798
|
isOpen={isOpen("userEditing")}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
>
|
|
805
|
-
{isOpen("userEditing") && (
|
|
806
|
-
<S.ModalContent>
|
|
807
|
-
<p>
|
|
808
|
-
<strong>{userEditing?.name}</strong> is currently working on this page. You can preview the page but{" "}
|
|
809
|
-
<strong>you cannot make changes to it</strong> until {userEditing?.name} leaves the page.
|
|
810
|
-
</p>
|
|
811
|
-
</S.ModalContent>
|
|
812
|
-
)}
|
|
813
|
-
</Modal>
|
|
814
|
-
<Modal
|
|
815
|
-
isOpen={isOpen("unpublish")}
|
|
816
|
-
hide={() => toggleModal("unpublish")}
|
|
817
|
-
size="S"
|
|
818
|
-
title="Unpublish Modified Page"
|
|
819
|
-
mainAction={mainUnpublishAction}
|
|
820
|
-
>
|
|
821
|
-
{isOpen("unpublish") && (
|
|
822
|
-
<S.ModalContent>
|
|
823
|
-
<p>
|
|
824
|
-
There are some saved changes that are not published on this page. To Unpublish this page,{" "}
|
|
825
|
-
<strong>you must publish these changes or discard them.</strong>
|
|
826
|
-
</p>
|
|
827
|
-
</S.ModalContent>
|
|
828
|
-
)}
|
|
829
|
-
</Modal>
|
|
799
|
+
toggleModal={() => toggleModal("userEditing")}
|
|
800
|
+
userEditing={userEditing}
|
|
801
|
+
onBack={handleGoBack}
|
|
802
|
+
/>
|
|
803
|
+
<UnpublishModal isOpen={isOpen("unpublish")} toggleModal={() => toggleModal("unpublish")} />
|
|
830
804
|
<DeleteModal
|
|
831
805
|
isOpen={isOpen("delete")}
|
|
832
806
|
toggleModal={() => toggleModal("delete")}
|
|
@@ -837,16 +811,14 @@ const PageEditor = (props: IProps) => {
|
|
|
837
811
|
<ScheduleModal
|
|
838
812
|
isOpen={isOpen("schedule")}
|
|
839
813
|
toggleModal={() => toggleModal("schedule")}
|
|
840
|
-
|
|
841
|
-
secondaryModalAction={secondaryScheduleModalAction}
|
|
814
|
+
onSchedule={handleSchedulePublication}
|
|
842
815
|
scheduleDate={scheduleDate}
|
|
843
816
|
setScheduleDate={setScheduleDate}
|
|
844
817
|
/>
|
|
845
818
|
<CancelScheduleModal
|
|
846
819
|
isOpen={isOpen("cancelSchedule")}
|
|
847
820
|
toggleModal={() => toggleModal("cancelSchedule")}
|
|
848
|
-
|
|
849
|
-
secondaryModalAction={secondaryCancelScheduleModalAction}
|
|
821
|
+
onCancelSchedule={handleCancelSchedulePublication}
|
|
850
822
|
/>
|
|
851
823
|
<RestoreModal
|
|
852
824
|
isOpen={isOpen("restore")}
|
|
@@ -874,19 +846,18 @@ const PageEditor = (props: IProps) => {
|
|
|
874
846
|
addKeywords={handleAddKeywords}
|
|
875
847
|
deleteKeyword={handledeleteKeyword}
|
|
876
848
|
/>
|
|
877
|
-
<
|
|
849
|
+
<DirtyNavigateModal
|
|
878
850
|
isOpen={isOpen("dirtyNavigate")}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
</Modal>
|
|
851
|
+
onConfirm={handleConfirmDirtyNavigation}
|
|
852
|
+
onCancel={handleCancelDirtyNavigation}
|
|
853
|
+
/>
|
|
854
|
+
<RestrictionsModal
|
|
855
|
+
isOpen={isOpen("userAccess")}
|
|
856
|
+
toggleModal={() => toggleModal("userAccess")}
|
|
857
|
+
currentAccessGrants={accessGrants}
|
|
858
|
+
onUpdateAccessGrants={handleUpdateAccessGrants}
|
|
859
|
+
isSaving={isSaving}
|
|
860
|
+
/>
|
|
890
861
|
</MainWrapper>
|
|
891
862
|
</>
|
|
892
863
|
);
|
|
@@ -913,6 +884,8 @@ const mapStateToProps = (state: IRootState): IPageEditorStateProps => ({
|
|
|
913
884
|
currentSiteErrorPages: state.sites.currentSiteErrorPages,
|
|
914
885
|
skipReviewOnPublish: state.app.globalSettings.skipReviewOnPublish,
|
|
915
886
|
schemaVersion: state.structuredData.schemaVersion,
|
|
887
|
+
currentSiteInfo: state.sites.currentSiteInfo!,
|
|
888
|
+
accessGrants: state.pageEditor.accessGrants,
|
|
916
889
|
});
|
|
917
890
|
|
|
918
891
|
interface IPageEditorStateProps {
|
|
@@ -936,6 +909,8 @@ interface IPageEditorStateProps {
|
|
|
936
909
|
skipReviewOnPublish?: boolean;
|
|
937
910
|
schema: any;
|
|
938
911
|
schemaVersion: string;
|
|
912
|
+
currentSiteInfo: ISite;
|
|
913
|
+
accessGrants: PageAccessGrantsSummary;
|
|
939
914
|
}
|
|
940
915
|
|
|
941
916
|
const mapDispatchToProps = {
|
|
@@ -960,6 +935,7 @@ const mapDispatchToProps = {
|
|
|
960
935
|
setCurrentPageID: pageEditorActions.setCurrentPageID,
|
|
961
936
|
restorePage: pageEditorActions.restorePage,
|
|
962
937
|
updateEditorContent: pageEditorActions.updateEditorContent,
|
|
938
|
+
updatePageAccessGrants: pageEditorActions.updatePageAccessGrants,
|
|
963
939
|
};
|
|
964
940
|
|
|
965
941
|
interface IPageEditorDispatchProps {
|
|
@@ -989,6 +965,11 @@ interface IPageEditorDispatchProps {
|
|
|
989
965
|
restorePage(id: number | number[]): Promise<boolean>;
|
|
990
966
|
setIsLoading(loading: boolean): void;
|
|
991
967
|
updateEditorContent(selectedEditorID: number, key: string, value: any): void;
|
|
968
|
+
updatePageAccessGrants(data: {
|
|
969
|
+
siteID: number | "global";
|
|
970
|
+
pageID: number | null;
|
|
971
|
+
accessGrants: PageAccessGrantsSummary;
|
|
972
|
+
}): Promise<boolean>;
|
|
992
973
|
}
|
|
993
974
|
|
|
994
975
|
type IProps = IPageEditorStateProps & IPageEditorDispatchProps & RouteComponentProps;
|
|
@@ -273,9 +273,7 @@ const IntegrationForm = (props: IProps) => {
|
|
|
273
273
|
</S.SettingsWrapper>
|
|
274
274
|
<FloatingPanel title="Select pages" toggleModal={toggleModal} isOpen={isOpen}>
|
|
275
275
|
<S.ContentWrapper>
|
|
276
|
-
{isOpen &&
|
|
277
|
-
<PageFinder onClick={handleSetPage} isOpen={isOpen} multiple={true} hideSites={true} pages={pageIDs} />
|
|
278
|
-
)}
|
|
276
|
+
{isOpen && <PageFinder onClick={handleSetPage} isOpen={isOpen} pages={pageIDs} multiple hideSites />}
|
|
279
277
|
</S.ContentWrapper>
|
|
280
278
|
</FloatingPanel>
|
|
281
279
|
{isVariableOpen && (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
1
|
import { ActionMenu } from "@ax/components";
|
|
3
2
|
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
4
5
|
const SiteWrapper = styled.div`
|
|
5
6
|
position: relative;
|
|
6
7
|
background: ${(p) => p.theme.color.uiBackground02};
|
|
7
|
-
border-radius:
|
|
8
|
+
border-radius: ${(p) => p.theme.radii.s};
|
|
8
9
|
display: flex;
|
|
9
10
|
flex-direction: column;
|
|
10
11
|
align-items: flex-start;
|
|
@@ -13,6 +14,22 @@ const SiteWrapper = styled.div`
|
|
|
13
14
|
div {
|
|
14
15
|
max-width: 100%;
|
|
15
16
|
}
|
|
17
|
+
|
|
18
|
+
:before {
|
|
19
|
+
content: "";
|
|
20
|
+
border-radius: ${(p) => p.theme.radii.s};
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
opacity: 0;
|
|
27
|
+
transition: opacity 0.1s;
|
|
28
|
+
}
|
|
29
|
+
:hover:before {
|
|
30
|
+
background-color: ${(p) => p.theme.color.overlayHoverPrimary};
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
16
33
|
`;
|
|
17
34
|
|
|
18
35
|
const ImageContainer = styled.div`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button, Icon, UserRolesAndSites } from "@ax/components";
|
|
2
|
-
import type { IRole, ISite,
|
|
2
|
+
import type { IRole, ISite, UserRoleAssignment } from "@ax/types";
|
|
3
3
|
|
|
4
4
|
import { getMostFrequentRole } from "../utils";
|
|
5
5
|
import { LEARN_ITEMS } from "./constants";
|
|
@@ -68,7 +68,7 @@ const FinalStep = (props: IFinalStepProps) => {
|
|
|
68
68
|
|
|
69
69
|
interface IFinalStepProps {
|
|
70
70
|
isSuperAdmin: boolean;
|
|
71
|
-
userRoles:
|
|
71
|
+
userRoles: UserRoleAssignment[];
|
|
72
72
|
roles: IRole[];
|
|
73
73
|
sites: ISite[];
|
|
74
74
|
onClose: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserRoleAssignment } from "@ax/types";
|
|
2
2
|
|
|
3
3
|
const GENERIC_DOMAINS = new Set(["gmail", "hotmail", "outlook", "yahoo", "icloud", "live", "msn", "aol"]);
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ const getCompanyFromEmail = (email: string): string => {
|
|
|
9
9
|
return company.charAt(0).toUpperCase() + company.slice(1);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const getMostFrequentRole = (userRoles:
|
|
12
|
+
const getMostFrequentRole = (userRoles: UserRoleAssignment[]): number | null => {
|
|
13
13
|
const roleCounts: Record<number, number> = {};
|
|
14
14
|
|
|
15
15
|
userRoles.forEach(({ roles }) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
|
|
4
|
-
import type { IErrorItem, ILanguage, IRootState, ISite } from "@ax/types";
|
|
5
|
-
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
6
4
|
import { FieldsBehavior } from "@ax/components";
|
|
5
|
+
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
7
6
|
import { getStructuredDataInnerFields } from "@ax/forms";
|
|
7
|
+
import type { IErrorItem, ILanguage, IRootState, ISite } from "@ax/types";
|
|
8
8
|
|
|
9
9
|
import * as S from "./style";
|
|
10
10
|
|