TACC / tup-ui

React client for TACC User Portal
2 stars 0 forks source link

TUP-697: User Updates, Change Page Listing to Use a Plugin #438

Closed R-Tomas-Gonzalez closed 4 months ago

R-Tomas-Gonzalez commented 4 months ago

Overview

Designers would like to edit the User Updates page. Created a plugin that adds in all of the user updates, and then adjusted the page.

Related

Changes

  1. Makes the default base news/latest-news
  2. Adds in full list of User Updates
  3. Adds in the template

Testing

  1. Head over to http://localhost:8000/news/user-updates/
  2. Remove text plugin
  3. Add in the Full User News List plugin
  4. Determine that the page is editable, and you're able to view the articles.

UI

Before After
Screenshot 2024-03-05 at 11 24 40 PM Screenshot 2024-03-05 at 11 24 53 PM

Notes

R-Tomas-Gonzalez commented 4 months ago

It works! With some issues.

  1. Remove "User Updates" from output. So CMS admin can add/remove/change heading without developers.1
  2. Fix URL for User Update pages. Example: Click the name of a User Update, you get http://localhost:8000/news/latest-news107514/.
  3. Retire the "User Updates" view. E.g. remove UserNewsListView; have user_news/list.html or user_news/full_list.html, not both; rename user_news/list_for_plugin.html (cuz now all the plugin content is via plugins).
  4. Rename plugins. I'm thinking:

    • "User News List" → "Latest User Updates"2
    • "Full User News List" → "User Updates"2

If I've neglected or misunderstood anything, please correct me.

Footnotes

  1. Consider how we can safely give admins more power. It gives us less work and gets them results faster (cuz to change this text we must change code, test, PR, review, deploy).
  2. No "List" because they are both a list (and Blog plugin only uses "List" to distinguish) and I don't think there will be other "User Updates" plugins. If there are, then we can append "List". ↩2

@wesleyboar 1 and 2 have been addressed by: 6ef537e

For 3. I have removed UserNewsListView. For the rest of this comment, I am confused as to how to only use one of the files... I guess I'm unsure because I don't know how to use the list.html for what we need. The full_list.html file shows ALL user updates, and omits the header. The list.html has the header included... Is there a way to create an if statement to know what plugin is using the file? Therefore allowing me to only use what is needed from the file that has more?

For 4.a. After testing, this would be a breaking change (User News List" → "Latest User Updates.) Here's why: The plugin is already being used with it's name and therefore the template is looking for this plugin name. If we remove the plugin, we must delete first before deploying this change.

For 4.b. We can make this change (Full User News List" → "User Updates) because it has not been used in prod yet. Done here: e4ced86