Skip to content

Commit 461767b

Browse files
committed
make sure the overwriting events perms is offered by the configs with optional modal button
1 parent 31088ac commit 461767b

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/components/events/partials/ModalTabsAndPages/SeriesDetailsAccessTab.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import {
88
import { removeNotificationWizardForm } from "../../../../slices/notificationSlice";
99
import { useAppDispatch, useAppSelector } from "../../../../store";
1010
import { ParseKeys } from "i18next";
11+
import {
12+
getOrgProperties,
13+
} from "../../../../selectors/userInfoSelectors";
1114

1215
/**
1316
* This component manages the access policy tab of the series details modal
@@ -28,6 +31,10 @@ const SeriesDetailsAccessTab = ({
2831
const policies = useAppSelector(state => getSeriesDetailsAcl(state));
2932
const policyTemplateId = useAppSelector(state => getPolicyTemplateId(state));
3033

34+
const orgProperties = useAppSelector(state => getOrgProperties(state));
35+
36+
const overrideEnabled = (orgProperties['admin.series.acl.event.update.mode'] || 'optional').toLowerCase() === 'optional';
37+
3138
useEffect(() => {
3239
dispatch(removeNotificationWizardForm());
3340
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -54,7 +61,7 @@ const SeriesDetailsAccessTab = ({
5461
viewNonUsersAccessRole={"ROLE_UI_SERIES_DETAILS_ACL_NONUSER_ROLES_VIEW"}
5562
policyChanged={policyChanged}
5663
setPolicyChanged={setPolicyChanged}
57-
withOverrideButton={true}
64+
withOverrideButton={overrideEnabled}
5865
/>
5966
);
6067
};

src/components/shared/SaveEditFooter.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type SaveEditFooterProps = {
77
reset: () => void;
88
submit: () => void;
99
isValid?: boolean;
10+
customSaveButtonText?: ParseKeys;
1011
additionalButton?: {
1112
label: ParseKeys,
1213
hint: ParseKeys,
@@ -19,10 +20,13 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
1920
reset,
2021
submit,
2122
isValid,
22-
additionalButton
23+
customSaveButtonText,
24+
additionalButton,
2325
}) => {
2426
const { t } = useTranslation();
2527

28+
const saveButtonText = customSaveButtonText || "SAVE";
29+
2630
return <footer style={{ padding: "0 15px" }}>
2731
{active && isValid && (
2832
<div className="pull-left">
@@ -53,7 +57,7 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
5357
className={`save green ${
5458
!isValid || !active ? "disabled" : ""
5559
}`}
56-
>{t("SAVE")}</button>
60+
>{t(saveButtonText)}</button>
5761
</div>
5862
</footer>;
5963
}

src/components/shared/modals/ResourceDetailsAccessPolicyTab.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ const ResourceDetailsAccessPolicyTab = ({
378378
hint: "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.REPLACE_EVENT_ACLS_HINT",
379379
onClick: () => saveAccess(formik.values, true)
380380
} : undefined}
381+
customSaveButtonText={withOverrideButton ? "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.SAVE_SERIES_ACL_ONLY" : undefined}
381382
/>}
382383
</div>
383384
)}

src/i18n/org/opencastproject/adminui/languages/lang-en_US.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,8 +1215,9 @@
12151215
"USER": "User",
12161216
"USERS": "Users who are authorized for the series",
12171217
"NEW_USER": "New user",
1218-
"REPLACE_EVENT_ACLS": "Update series permissions",
1219-
"REPLACE_EVENT_ACLS_HINT": "Ensure all events of this series have these permissions in effect",
1218+
"REPLACE_EVENT_ACLS": "Save series and overwrite event permissions",
1219+
"REPLACE_EVENT_ACLS_HINT": "Save the series permissions and overwrite the permissions for all events in this series.",
1220+
"SAVE_SERIES_ACL_ONLY": "Save series permission",
12201221
"LOAD_MORE_LIMIT": "policies shown.",
12211222
"LOAD_MORE_LINK": "Load more"
12221223
},

0 commit comments

Comments
 (0)