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

Show banner indicating draft mode when viewing own draft presentation #30

Open
alkrauss48 opened this issue Sep 1, 2024 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest-recommended

Comments

@alkrauss48
Copy link
Owner

alkrauss48 commented Sep 1, 2024

Something like this, but probably with bigger more legible text. Make sure it's responsive!

Screenshot 2024-10-11 at 10 56 46 AM

Tips:

  • Create a new Vue component called something like DraftBanner in /resources/js/Components. It shouldn't need any props. You could use the ProgressBar component as an example, and this one would be even simpler. You'll probably want the component to be display: fixed; so it doesn't interfere with how the slide rendering works.
  • Edit the PresentationController#show action to add in a new property that gets sent via Inertia, called isPublished. Use the presentation's is_published value to set that property
  • Edit the resources/js/Pages/Slides.vue file to accept the new prop, and then render the DraftBanner component right before the SlideView component only if the presentation is not published
  • Lastly, add some tests! I can think of 2 front-end tests to add, and 2 back-end tests to add, and if you think of more, add them:

Front-End Tests to Add

See resources/js/test/components and create a new file for SlidePage.test.ts

  • Test that the DraftBanner component is there if the isPublished prop is set to true
  • Test that the DraftBanner component is not there if the isPublished prop is set to false

Back-End Tests

Augment the existing test/Feature/PresentationControllerTest.php file

  • Test the the inertia response includes isPublished = true for a published presentation. See the test titled show screen returns the right view and data for how to assert Inertia responses.
  • Test the the inertia response includes isPublished = false for a non-published presentation. See the test titled show screen returns the right view and data for how to assert Inertia responses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest-recommended
Projects
None yet
Development

No branches or pull requests

2 participants