diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index accb088a3..63b6e890c 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -76,7 +76,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 an adminstrator for further help." }, "discard": { diff --git a/src/main/Save.tsx b/src/main/Save.tsx index 75ecc09e9..102da0edb 100644 --- a/src/main/Save.tsx +++ b/src/main/Save.tsx @@ -14,6 +14,8 @@ import { selectSegments, selectTracks, setHasChanges as videoSetHasChanges, + selectValidSegments, + validateSegments, } from "../redux/videoSlice"; import { postVideoInformation, selectStatus, selectError } from "../redux/workflowPostSlice"; @@ -50,6 +52,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({ display: "flex", flexDirection: "column", @@ -74,11 +80,11 @@ const Save: React.FC = () => { return ( <> - {t("save.info-text")} + {validSegments ? t("save.info-text") : t("save.invalid-text")}