WikiEduDashboard icon indicating copy to clipboard operation
WikiEduDashboard copied to clipboard

Dashboard should not post more than one 'welcome' message to use talk page

Open ragesoss opened this issue 7 years ago • 13 comments

Basically, before making the talk page welcome post, it should check to see whether that template is already present, and skip it if it is.

ragesoss avatar Aug 25 '17 18:08 ragesoss

Hi, first time contributer here! I would like to help out with this issue if no one else is working on it already.

lpassamano avatar Sep 11 '17 20:09 lpassamano

@lpassamano great! This message gets posted from the WikiCourseEdits#enroll_in_course method. It currently doesn't fetch the content of the page before posting, but there are other similar routines that do, including WikiAssignmentOutput.

You may want to start a new class like WikiWelcomeOutput and call it from WikiCourseEdits to isolate this new behavior, instead of just expanding WikiCourseEdits.

ragesoss avatar Sep 11 '17 20:09 ragesoss

Hey, I am an outreachy applicant, can I take this up?

sresthas avatar Mar 04 '19 16:03 sresthas

@twisted-sres Please feel free to take this up as I review the other PR!

bwreid avatar Mar 04 '19 17:03 bwreid

Hey, how do I reproduce this?

sresthas avatar Mar 04 '19 18:03 sresthas

@twisted-sres I believe some of this you can attempt just from the console itself. For example, running the enroll_in_course function from WikiCourseEdits. @ragesoss, Can you add what the best way to mock out/make a request to the API would be?

bwreid avatar Mar 04 '19 18:03 bwreid

The general strategy I would recommend here:

  • Find a user who is a student in a dashboard.wikiedu.org course, and verify that they have the welcome message on their user talk page
  • Add a test case to the #enroll_in_course section of wiki_course_edits_spec.rb that uses that student as the enrolling user, with an expectation that the welcome message is not posted. This should be failing initially.
  • Update WikiCourseEdits to make it pass.
  • Move that WikiCourseEdits code to a new class and move the corresponding tests to a new file.

ragesoss avatar Mar 04 '19 18:03 ragesoss

Could you please assign me this task?

HARSHITHASALADI1 avatar Dec 12 '23 13:12 HARSHITHASALADI1

@ragesoss can u explain the issue, I am not able to understand what is meant by user talk page and reproduce the issue.

fillingtothemomo avatar Jan 01 '24 19:01 fillingtothemomo

@fillingtothemomo Here's an example of a user talk page (which has had the welcome message posted, by 'User:Brianda (Wiki Ed)' ): https://en.wikipedia.org/wiki/User_talk:Fedfed2

The welcome template gets substituted, so rather than the actual template, what ends up saved on the page is the content of that template. But an HTML comment in the source text remains to indicate that it came from the template, and that can be used to test whether a given page already had a welcome message posted: <!-- Template:Dashboard.wikiedu.org welcome -->

ragesoss avatar Jan 02 '24 18:01 ragesoss