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

Implement Slide Delimiter field #40

Open
alkrauss48 opened this issue Oct 11, 2024 · 0 comments
Open

Implement Slide Delimiter field #40

alkrauss48 opened this issue Oct 11, 2024 · 0 comments
Assignees

Comments

@alkrauss48
Copy link
Owner

Currently, each slide breaks on a double newline (either \n\n or \r\n - as seen in resources/js/store/dataStore.tsL17-18)

I'd like to add a field in Filament when creating a presentation called Slide Delimiter, which is a dropdown with 2 options:

  • Double New Line (default)
  • 3 Dashes (---)

This involves:

  • Creating a migration for slide_delimiter on the presentations as a non-nullable string, with a default value of \n\n
  • Creating an enum for the possible values (listed above)
  • Casting the enum to the slide_delimiter property on the Presentation model
  • Updating the PresentationFactory with the new field w/ default value
  • Adding a Select field on the sidebar of the PresentationResource in Filament, using that enum for the options
  • Sending the value of that property on the PresentationController#show action, via a slideDelimiter Inertia property
  • Accepting that property on resources/js/Pages/Slide.ts, and setting that on the dataStore as a new property
    • Set a default value of the prop to \n\n
  • Using that new field in the dataStore processData function, when splitting the content into slides.

Optional - Add Tests

This task is a bit challenging as it is, so tests can be added later for this. But if you would like to add tests, then consider adding:

  • Back-end tests for the PresentationResourceTest, when creating a presentation
  • Back-end tests in PresentationControllerTest using assertInertia of the properties
  • Front-end tests for the slide page and/or dataStore

I'd put the new field between the Description and Thumbnail fields:

Screenshot 2024-10-11 at 1 12 43 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant