WikiEducationFoundation / WikiEduDashboard

Wiki Education Foundation's Wikipedia course dashboard system
https://dashboard.wikiedu.org
MIT License
387 stars 617 forks source link

Fixed bug in Article Viewer #5773

Closed omChauhanDev closed 5 months ago

omChauhanDev commented 5 months ago

What this PR does

Fixes #5769 This pr fixes bugs in Article Viewer.

Video

After : For issue 1

After1.webm

For issue 2

After2.webm

omChauhanDev commented 5 months ago

@ragesoss Sir, in which example you saw that : This new 'Show last revision' feature incorrectly shows a highlighted colour instead of the 'no attributed content' message if we load authorship data for that earlier revision and then switch back to the current revision with no remaining student work.

ragesoss commented 5 months ago

@om-chauhan1 it was happening in the example I linked in the issue.

omChauhanDev commented 5 months ago

@ragesoss Sir kindly see are these status correct, then i will proceed accordingly :

Status diagram of Article Viewer

ragesoss commented 5 months ago

@ragesoss Sir kindly see are these status correct, then i will proceed accordingly :

Status diagram of Article Viewer

I'm not 100% sure — I don't understand the prevHtml === nextHtml part — but it looks like you have the right idea.

One of the important bits is the handling of editors who don't have IDs that show up in the parsed authorship highlighting data... sometimes this is because of a problem with the data, even though that user actually has contributions to the current version, and sometimes it is because all their contributions were removed. You may want to explore the PR that implemented the handling of that: https://github.com/WikiEducationFoundation/WikiEduDashboard/pull/5470

Note that 'editorsID' is an unhelpful variable name and should probably be changed, as it does not clearly communicate that these are IDs of editors who do not have highlighted content.

omChauhanDev commented 5 months ago

@ragesoss Kindly have a look : Cases :

  1. When data is fetched successfully but the user has no contributions in the shown version of the Article :

https://github.com/WikiEducationFoundation/WikiEduDashboard/assets/119471995/a939c0c2-c3c5-4568-a3a7-c5d88d7ea061

  1. When user contributions exist but remain unhighlighted because of certain factors (mentioned in the message below):

Demo 2.webm

  1. When no unhighlighted users exist :

Demo 3.webm