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

changed alert message on wiki creation #8452

Merged
merged 3 commits into from
May 4, 2021

Conversation

Hassanelashram
Copy link
Member

Fixes #4504

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@gitpod-io
Copy link

gitpod-io bot commented Oct 3, 2020

@Hassanelashram
Copy link
Member Author

@gauravano Could you please review ?

@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

❗ No coverage uploaded for pull request base (main@39b51e8). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 465b351 differs from pull request most recent head 1f5a9e6. Consider uploading reports for the commit 1f5a9e6 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8452   +/-   ##
=======================================
  Coverage        ?   79.67%           
=======================================
  Files           ?       98           
  Lines           ?     5947           
  Branches        ?        0           
=======================================
  Hits            ?     4738           
  Misses          ?     1209           
  Partials        ?        0           

@grvsachdeva
Copy link
Member

Hi @Hassanelashram, thank you for opening the PR. The current solution requires improvement. A new user can post to publiclab.org only if they have one approved node (question/research note).

Now, there can be 2 cases:

  1. User has not created any note till now
  2. User has created note(s) but it's still in review

Currently, we don't differentiate between the above 2 cases and show this message - Please post a question or other content before editing the wiki. Click here to learn why.

Now, either we can start differentiating with an extra condition to check if there is any post in review for the current user which will make one more DB query or we can just append in the current message to say that Please post a question or other content before editing the wiki. Click here to learn why. If you have already posted a note then you would be able to edit the wiki as soon as your post get approved by moderators -- something like this :)

@jywarren @cesswairimu what do you think would be better?

@cesswairimu
Copy link
Collaborator

cesswairimu commented Oct 4, 2020

I think differentiating the two and giving different flash messages would be ideal

@cesswairimu cesswairimu closed this Oct 6, 2020
@cesswairimu cesswairimu reopened this Oct 6, 2020
@gitpod-io
Copy link

gitpod-io bot commented Oct 6, 2020

@jywarren
Copy link
Member

jywarren commented Oct 7, 2020

Sorry, just trying to retrigger the tests now that we've resolved an unrelated issue!

@jywarren jywarren closed this Oct 7, 2020
@jywarren jywarren reopened this Oct 7, 2020
@gitpod-io
Copy link

gitpod-io bot commented Oct 7, 2020

@cesswairimu cesswairimu reopened this Oct 29, 2020
@gitpod-io
Copy link

gitpod-io bot commented Oct 29, 2020

@cesswairimu cesswairimu reopened this Dec 31, 2020
@gitpod-io
Copy link

gitpod-io bot commented Dec 31, 2020

@cesswairimu
Copy link
Collaborator

I think this might need a rebase Travis still shows up after reopening

@jywarren jywarren force-pushed the change-alert-wiki-creation branch from c2be97d to 792ba22 Compare May 4, 2021 21:59
@gitpod-io
Copy link

gitpod-io bot commented May 4, 2021

@jywarren
Copy link
Member

jywarren commented May 4, 2021

Rebased!

@@ -193,7 +193,7 @@ def teardown
id: 'chicago'
}

assert_equal flash[:notice], "Please post a question or other content before editing the wiki. Click <a href='https://publiclab.org/notes/tester/04-23-2016/new-moderation-system-for-first-time-posters'>here</a> to learn why."
assert_equal flash[:notice], "You can create the wiki once your research note/question is approved by moderators. Click <a href='https://publiclab.org/notes/tester/04-23-2016/new-moderation-system-for-first-time-posters'>here</a> to learn why."
Copy link
Member

Choose a reason for hiding this comment

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

So strange that this failed!? I don't understand -- we changed the test here too!

Progress: |=== FAIL WikiControllerTest#test_disallow_viewing_edit_wiki_page_for_first-timers (38.87s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -"Please post a question or other content before editing the wiki. Click <a href='https://publiclab.org/notes/tester/04-23-2016/new-moderation-system-for-first-time-posters'>here</a> to learn why."
        +"You can create the wiki once your research note/question is approved by moderators. Click <a href='https://publiclab.org/notes/tester/04-23-2016/new-moderation-system-for-first-time-posters'>here</a> to learn why."
        test/functional/wiki_controller_test.rb:196:in `block in <class:WikiControllerTest>'

Copy link
Member

Choose a reason for hiding this comment

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

Aha! Ok, we actually have to make the change twice in the controller. I'll make a suggestion!!!

@jywarren
Copy link
Member

jywarren commented May 4, 2021

OK, my apologies, there were a couple extra places to make the same change! I was able to add the extra changes and with luck this will now pass. Thank you for your patience!!

@codeclimate
Copy link

codeclimate bot commented May 4, 2021

Code Climate has analyzed commit 1f5a9e6 and detected 0 issues on this pull request.

View more on Code Climate.

@jywarren jywarren merged commit cbf677c into publiclab:main May 4, 2021
@jywarren
Copy link
Member

jywarren commented May 4, 2021

Excellent, thank you so much!!!

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* changed alert message on wiki creation

* Update wiki_controller.rb

* Update _like.html.erb

Co-authored-by: Jeffrey Warren <[email protected]>
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* changed alert message on wiki creation

* Update wiki_controller.rb

* Update _like.html.erb

Co-authored-by: Jeffrey Warren <[email protected]>
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.

Show different alert at wiki creation if work is in moderation
4 participants