]> git.localhorst.tv Git - alttp.git/commitdiff
allow editing of synced episodes
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 12 Jan 2026 10:08:53 +0000 (11:08 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 12 Jan 2026 10:08:53 +0000 (11:08 +0100)
resources/js/components/episodes/Form/index.jsx
resources/js/helpers/permissions.js
resources/js/i18n/de.js
resources/js/i18n/en.js

index 9db2c2d046e04a18fa2d314c539f5658bd22bfdb..9da9464aea6c0062057374573722a0cc4a5b192a 100644 (file)
@@ -1,7 +1,7 @@
 import { withFormik } from 'formik';
 import PropTypes from 'prop-types';
 import React from 'react';
-import { Button, Col, Form, Modal, Row } from 'react-bootstrap';
+import { Alert, Button, Col, Form, Modal, Row } from 'react-bootstrap';
 import { useTranslation } from 'react-i18next';
 
 import EpisodePart from './EpisodePart';
@@ -18,6 +18,7 @@ const arrayWithout = (arr, index) => {
 };
 
 const EpisodeForm = ({
+       episode,
        errors,
        handleBlur,
        handleChange,
@@ -49,6 +50,11 @@ const EpisodeForm = ({
                <Row>
                        <Col className="border-end" xl={6}>
                                <Modal.Body>
+                                       {episode?.ext_id ?
+                                               <Alert variant="warning">
+                                                       {t('episodes.extSyncWarning')}
+                                               </Alert>
+                                       : null}
                                        <EpisodePart
                                                errors={errors}
                                                handleBlur={handleBlur}
@@ -93,6 +99,9 @@ const EpisodeForm = ({
 };
 
 EpisodeForm.propTypes = {
+       episode: PropTypes.shape({
+               ext_id: PropTypes.string,
+       }),
        errors: PropTypes.shape({
                comment: PropTypes.string,
                confirmed: PropTypes.string,
index 10af0b0894d1761cec0d42b6f63c5a10d6eb2f57..17201d00103c0aad165053054a8dc20d5cde5c83 100644 (file)
@@ -57,7 +57,7 @@ export const episodeHasChannel = (episode, channel) =>
        episode && channel && episode.channels && episode.channels.find(c => c.id === channel.id);
 
 export const mayEditEpisode = (user, episode) =>
-       user && episode && !episode.ext_id && user.event_crews &&
+       user && episode && user.event_crews &&
                user.event_crews.find(c => c.role === 'admin' && c.event_id === episode.event_id);
 
 export const mayRestreamEpisodes = user => isAnyChannelAdmin(user);
index ba00b051a43f2ca69ccd57dad00c42b28455a128..88aaac4be0782e88d13e84f61aaf7f024b9cfc6f 100644 (file)
@@ -245,6 +245,7 @@ export default {
                        estimate: 'Geschätzte Laufzeit',
                        estimatePreview: '{{ estimate }} Std.',
                        estimatePreviewWithEnd: '{{ estimate }} Std. (endet {{ end, LL LT }} Uhr)',
+                       extSyncWarning: 'Achtung: Diese Episopde wird mit einer externen Datenquelle synchronisiert und Änderungen können überschrieben werden!',
                        missingStreams: 'Fehlende Runner-Streams',
                        players: {
                                name_override: 'Abweichender Name',
index 5adc10209cc84424a23b2f5290a85adc4332a8eb..f5b18dec78924df3d2db0e5e34a123ddeaaccecc 100644 (file)
@@ -245,6 +245,7 @@ export default {
                        estimate: 'Estimated runtime',
                        estimatePreview: '{{ estimate }}h',
                        estimatePreviewWithEnd: '{{ estimate }}h (ends {{ end, LL LT }})',
+                       extSyncWarning: 'Warning: This episode is synchronized to an external data source. Changes may be overwritten!',
                        missingStreams: 'Missing runner streams',
                        players: {
                                name_override: 'Name override',