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

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

Merged
merged 10 commits into from
Mar 8, 2024

Conversation

R-Tomas-Gonzalez
Copy link
Contributor

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

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

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

@R-Tomas-Gonzalez
Copy link
Contributor Author

R-Tomas-Gonzalez commented Mar 6, 2024

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

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

I've broken the PR task discussion into pieces, and requested two new items.

@wesleyboar wesleyboar self-requested a review March 8, 2024 17:13
@wesleyboar wesleyboar merged commit c0f9db2 into main Mar 8, 2024
1 check passed
@wesleyboar wesleyboar deleted the sub-task/tup-697-create-full-user-news-plugin branch March 8, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants