Page MenuHomePhabricator

Add a flag button
Closed, ResolvedPublic5 Estimated Story Points

Description

When viewing a collection that I do not own whilst logged in or not logged in I see a flag button.
Clicking the flag should event log the following

  • user id of the person flagging (0 or null for anonymous)
  • edit count of user
  • groups that the user belongs to e.g. autoconfirmed, admin etc..
  • collection id

When a user clicks the flag button they see a confirmation message saying "Are you sure you want to flag this collection for review?"
A user who flags a collection sees a toast so that they know their action was recorded. The toast appears for 2 seconds max and says "This collection has been flagged for review".

Flag button gets disabled after it has been flagged for review.
We will manually go through these and work out correct heuristics for flagging.

Event Timeline

Jdlrobson assigned this task to MSyed.
Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Gather.
Jdlrobson moved this task to Bug backlog on the Gather board.
Jdlrobson subscribed.
Jdlrobson edited a custom field.
Jdlrobson renamed this task from Data to fuel heuristics for flagging to Add a flag button.Apr 10 2015, 10:41 PM

@Jdlrobson. @MSyed has added mock, here: https://phabricator.wikimedia.org/T94228#1202075, but I think it has some issues. Waiting to hear back from moiz...

Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)

@Jdlrobson @JKatzWMF Since we dont have Follow and Share functionality built, just the flag icon in the corner is fine.

Also, I'm putting a hide icon in the corner too for admins.

CollectionsFlagging2.png (1×1 px, 305 KB)

rmoen added a subscriber: MSyed.

Thanks @MSyed. Stealing this from you now. Go back to vacationing ;)

@JKatzWMF @Jdlrobson: For schema, value for "groups that the user belongs to" is a comma separated list?
eg: "autoconfirmed, admin"

Should this be in its own schema (GatherFlags) ? Or add a flag option to GatherClicks?

@rmoen. Good questions. Groups that a user belongs to is comma
separated. I like having them in the same schema, but for scalability,
let's put it in its own schema for now.

@JKatzWMF comma separated may be a bad idea... how do you plan to use this information? If comma separated you cannot easily do queries such as "what % of users who reported were admins?"

you'll have to do LIKE statements which may be slower.

That said, user groups should also be possible to obtain by joining with the user groups table...

I think it is much faster to search this table with like than doing a join
against user table. Anytime I have had to join against user table it takes

30 minutes.

Depends on the table size but okay! :)

Patch here: https://gerrit.wikimedia.org/r/#/c/204201/
The schema registration was a bit confusing. I think I got it all rigged up but needs tested.
All that's left is schema testing and any rigging, and adding in userGroups (it is an empty string now)

@Jdlrobson, would appreciate your thoughts about the ConfirmationOverlay. It simplified the CollectionDeleteOverlay quite a bit and I think it will be useful for further down the road.

@Jhernandez, feel free to grab this in the morning if you want to poke with the schema, otherwise I will finish when I wake up.

Change 204611 had a related patch set uploaded (by Jdlrobson):
Add flag collection button and confirm overlay

https://gerrit.wikimedia.org/r/204611

@JKatzWMF we haven't been clear on the disabled behaviour. Can you create a separate card about this - what does a disabled flag look like? Does the flag stay disabled if I refresh the page/go to another device (remember we show this to anons too)?

@Jdlrobson the flag should never be shown in a disable state. If you're an
anon, then you shouldnt seen any flag icon.

@JKatzWMF @MSyed the task asked to show this to anons. When beta labs is back up and running can you review and create a follow up sub task before signing off if you are unhappy with it.

Change 204611 merged by jenkins-bot:
Add flag collection button and confirm overlay

https://gerrit.wikimedia.org/r/204611