diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index a26b7d4fa..feb60d116 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -72,7 +72,9 @@ "success-tooltip-aria": "Saved successfully", "saveArea-tooltip": "Save Area", "confirm-success": "Okay", - "cancel-save": "Don't save" + "cancel-save": "Don't save", + "invalid-headline-text": "Invalid Edits", + "invalid-text": "The segments do not create a valid video. Either change or discard your edits if you wish to proceed. If you wanted to delete this video use the Opencast Admin UI. Contact {{ contact }} for further help." }, "discard": { diff --git a/src/main/Save.tsx b/src/main/Save.tsx index d65ad2a33..4351b14f6 100644 --- a/src/main/Save.tsx +++ b/src/main/Save.tsx @@ -15,6 +15,8 @@ import { selectSegments, selectTracks, setHasChanges as videoSetHasChanges, + selectValidSegments, + validateSegments, } from "../redux/videoSlice"; import { postVideoInformation, selectStatus, selectError } from "../redux/workflowPostSlice"; @@ -53,6 +55,10 @@ const Save: React.FC = () => { const hasChanges = useAppSelector(selectHasChanges); const subtitleHasChanges = useAppSelector(selectSubtitleHasChanges); + const dispatch = useAppDispatch(); + dispatch(validateSegments()); + const validSegments = useAppSelector(selectValidSegments); + const saveStyle = css({ height: "100%", display: finishState !== "Save changes" ? "none" : "flex", @@ -77,11 +83,11 @@ const Save: React.FC = () => { return ( <> - {t("save.info-text")} + {validSegments ? t("save.info-text") : t("save.invalid-text", { contact: settings.help.contact })}