Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OV-349: Add warning modal when the scenes exceed the scripts #380

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

stefano-lacorazza
Copy link
Collaborator

Added a check in the submit function to compare the total duration of the scenes with the duration of the scripts.
If the scenes duration exceeds the scripts duration, the modal is opened.
Otherwise, the submission proceeds as usual.

OutreachVids.-.Google.Chrome.2024-09-20.17-05-55.mp4
OutreachVids.-.Google.Chrome.2024-09-20.17-06-36.mp4

@stefano-lacorazza stefano-lacorazza added the FE Fronted feature label Sep 20, 2024
@stefano-lacorazza stefano-lacorazza added this to the Final DEMO milestone Sep 20, 2024
@stefano-lacorazza stefano-lacorazza self-assigned this Sep 20, 2024
@stefano-lacorazza stefano-lacorazza linked an issue Sep 20, 2024 that may be closed by this pull request
6 tasks
const scenesExceedScripts = (scenes: Scene[], scripts: Script[]): boolean => {
const totalScenesDuration = scenes.reduce(
(accumulator, scene) => accumulator + scene.duration,
0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets prevent magic values

);
const totalScriptsDuration = scripts.reduce(
(accumulator, script) => accumulator + script.duration,
0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@nikita-remeslov nikita-remeslov merged commit 3cc7242 into next Sep 24, 2024
2 checks passed
@nikita-remeslov nikita-remeslov deleted the task/OV-349-add-logic-to-modal-warning branch September 24, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FE Fronted feature
Projects
Status: To Be Tested
Development

Successfully merging this pull request may close these issues.

FEAT: Add logic to modal warning
3 participants