mai-youth / website-fe

Main website for MAI Youth.
MIT License
0 stars 1 forks source link

Save articles as draft without publishing them #50

Closed salahusama closed 4 years ago

salahusama commented 5 years ago

This will be useful to save articles still in progress without having them on the main articles page publicly.

A Boolean value of published on each article is a good solution. We can just show the published articles on the main page.

mahmoudal99 commented 5 years ago

Screenshot_1

mahmoudal99 commented 5 years ago

Logic for saving as draft let me know what you would change anything

mahmoudal99 commented 5 years ago

I tried to think of how gmail does it if you try exit an email without pressing send it will ask you if you want to save it as a draft

salahusama commented 5 years ago

Good work. I think it might be better to simplify this a bit though. Keep in mind you have to update the BE to support this as well.

For example, something like this might be a good idea...

To publish an article:

  1. Article editor open
  2. Details entered
  3. Save and Publish clicked

To save an article as draft:

  1. Article editor open
  2. Details entered
  3. Save clicked

You'll also need to see (and toggle) whether the article is published or not. So we should be able to publish an article saved as draft and un-publish an article. A toggle in the admin table maybe?

mahmoudal99 commented 5 years ago

Ive added a save button then i created a function which checks if the save button was clicked or the publish button then i added a save function in the article for modal. I still need to add a function which saves the draft in the database