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

updated petition snippets to be ordered newest to oldest #7955

Merged
merged 9 commits into from
Dec 2, 2021

Conversation

danielfmiranda
Copy link
Collaborator

@danielfmiranda danielfmiranda commented Nov 29, 2021

Closes #7615

Link to sample test page: https://foundation-s-7615-petit-w9nftu.herokuapp.com/cms/snippets/wagtailpages/petition/?locale=en

Steps to test:

  1. Please visit the testing link above, and log in to the CMS.
  2. Create a new snippet with whatever name you like
  3. Once saved, the new snippet should now appear at the top of the page vs at the end of the list.
  4. If everything is working as expected, testing is complete!

Checklist

Changes in Models:

@mofodevops mofodevops temporarily deployed to foundation-s-7615-petit-w9nftu November 29, 2021 19:43 Inactive
@danielfmiranda danielfmiranda temporarily deployed to foundation-s-7615-petit-w9nftu November 29, 2021 19:46 Inactive
Daniel Miranda added 2 commits November 29, 2021 11:58
…dation.mozilla.org into 7615-petition-snippet-order
@danielfmiranda danielfmiranda temporarily deployed to foundation-s-7615-petit-w9nftu November 29, 2021 19:59 Inactive
@danielfmiranda danielfmiranda temporarily deployed to foundation-s-7615-petit-w9nftu November 29, 2021 21:15 Inactive
@danielfmiranda danielfmiranda temporarily deployed to foundation-s-7615-petit-w9nftu November 29, 2021 21:20 Inactive
@@ -271,6 +271,7 @@ class Petition(TranslatableMixin, CTA):
]

class Meta(TranslatableMixin.Meta):
ordering = ['-id']
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since snippets do not seem to have a "created" or "created_date" column, I am ordering them by their unique ID's which are assigned upon creation. That way we can order them by newest to oldest

Copy link
Contributor

@Pomax Pomax Nov 29, 2021

Choose a reason for hiding this comment

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

that's basically the only option for snippets, so: approved =P

@kristinashu
Copy link

So I see how the newest snippets appear at the top of the snippet creation list. This is great and super helpful.

To be honest tho, the intention of this ticket was to make it appear at the top of the CTA picker.

For example:

  • Go to create a new campaign page
  • Click to "Choose CTA"

image

  • Then a list is shown
  • Currently it shows oldest to newest but it would be better if it were newest to oldest.

Screen cap of current picker within a page to show that the newer snippets appear last:

Screen Shot 2021-11-29 at 4 10 07 PM

I'll approve this PR since it is still a nice improvement but perhaps we should open a follow up ticket for the in page picker?

@danielfmiranda danielfmiranda temporarily deployed to foundation-s-7615-petit-w9nftu December 1, 2021 23:27 Inactive
@danielfmiranda
Copy link
Collaborator Author

Hi @kristinashu! wanted to give you a heads up that I updated this PR to now order the snippets under the campaign chooser panel as requested. Below is a screenshot of what appears now, thanks!

image

Copy link

@kristinashu kristinashu left a comment

Choose a reason for hiding this comment

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

Perfect, thank you!

@danielfmiranda danielfmiranda merged commit b931491 into main Dec 2, 2021
@danielfmiranda danielfmiranda deleted the 7615-petition-snippet-order branch December 2, 2021 19:08
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.

Improve petition snippet order
4 participants