Skip to content

Commit 934cc9f

Browse files
ferishiliArnei
authored andcommitted
make sure the overwriting events perms is offered by the configs with optional modal button
1 parent f35cc2d commit 934cc9f

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

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

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

1316
/**
1417
* This component manages the access policy tab of the series details modal
@@ -29,6 +32,10 @@ const SeriesDetailsAccessTab = ({
2932

3033
const policies = useAppSelector(state => getSeriesDetailsAcl(state));
3134

35+
const orgProperties = useAppSelector(state => getOrgProperties(state));
36+
37+
const overrideEnabled = (orgProperties['admin.series.acl.event.update.mode'] || 'optional').toLowerCase() === 'optional';
38+
3239
useEffect(() => {
3340
dispatch(removeNotificationWizardForm());
3441
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -46,7 +53,7 @@ const SeriesDetailsAccessTab = ({
4653
editAccessRole={"ROLE_UI_SERIES_DETAILS_ACL_EDIT"}
4754
policyChanged={policyChanged}
4855
setPolicyChanged={setPolicyChanged}
49-
withOverrideButton={true}
56+
withOverrideButton={overrideEnabled}
5057
/>
5158
);
5259
};

src/components/shared/SaveEditFooter.tsx

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

29+
const saveButtonText = customSaveButtonText || "SAVE";
30+
2731
return <footer style={{ padding: "0 15px" }}>
2832
{active && isValid && (
2933
<div className="pull-left">
@@ -56,7 +60,7 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
5660
className={`save green ${
5761
!isValid || !active ? "disabled" : ""
5862
}`}
59-
>{t("SAVE")}</BaseButton>
63+
>{t(saveButtonText)}</BaseButton>
6064
</div>
6165
</footer>;
6266
}

src/components/shared/modals/ResourceDetailsAccessPolicyTab.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ const ResourceDetailsAccessPolicyTab = ({
658658
hint: "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.REPLACE_EVENT_ACLS_HINT",
659659
onClick: () => saveAccess(formik.values, true)
660660
} : undefined}
661+
customSaveButtonText={withOverrideButton ? "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.SAVE_SERIES_ACL_ONLY" : undefined}
661662
/>}
662663
</div>
663664
)}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,9 @@
12121212
"ACTION": "Actions",
12131213
"NEW": "New policy",
12141214
"DETAILS": "Details",
1215-
"REPLACE_EVENT_ACLS": "Update series permissions",
1216-
"REPLACE_EVENT_ACLS_HINT": "Ensure all events of this series have these permissions in effect",
1215+
"REPLACE_EVENT_ACLS": "Save series and overwrite event permissions",
1216+
"REPLACE_EVENT_ACLS_HINT": "Save the series permissions and overwrite the permissions for all events in this series.",
1217+
"SAVE_SERIES_ACL_ONLY": "Save series permission",
12171218
"LOAD_MORE_LIMIT": "policies shown.",
12181219
"LOAD_MORE_LINK": "Load more"
12191220
},

0 commit comments

Comments
 (0)