[WIP] Implement comment posting (and reenable voting)
Needs ReviewPublic

Authored by leinir on Jan 20 2020, 2:37 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is a work in progress for adding support for posting comments
to the KNewStuffCore framework, and cleaning up voting a touch. It
further adds UI for creating said comments to KNSQuick.

  • Add signals to fake a virtual function for posting a comment
  • Implement comment posting (and userCanVote check)
  • Add invokable functions for creating comments (and reviews)
  • Add voting function to the quickitemsmodel (and userCanVote role)
  • Entry details checks for voting ability
  • Don't allow voting from the list view (in the old dialog)
  • Allow clearing the Rating control when it's editable
  • Add vote requesting feature to the Rating control (separate from editable), to allow the user to vote without changing the existing value (which should be updated elsewhere)
  • "New Comment" component created to allow making new comments, replies to comments, and reviews
  • Added New Comment to the entry comments page, and replying to the comment delegates
  • Added New Comment to the entry details page, which can be activated when an entry has no comments already
  • Add reply request functionality to the comment delegate
  • Add calls through to Attica for requesting editing of user credentials (which uses the code in D25961, which launches the kaccounts kcm to allow the user to log in to their opendesktop.org account)
  • If the user is marked as not allowed to vote, attempting to comment or vote will request the credentials editor

This does not strictly require D25961, but without it this will simply not allow voting and commenting with the attica backend

The entry details page if there are no comments:

The new comment sheet without having picked a star rating:

The comments page (note the reply and new comment actions):

The new comment sheet with a star rating picked (and fields filled out):

The new comment sheet when creating a reply (also showing what happens if the sheet is hidden and shown again without submission - contents are retained, reducing potential for data loss):

BUG:418995

Diff Detail

Repository
R304 KNewStuff
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21571
Build 21589: arc lint + arc unit
leinir created this revision.Jan 20 2020, 2:37 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 20 2020, 2:37 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
leinir requested review of this revision.Jan 20 2020, 2:37 PM
leinir updated this revision to Diff 74016.Jan 21 2020, 1:51 PM
  • Allow clearing the Rating control when editable
  • Initial new-comment sheet (needs some layout work)
leinir edited the summary of this revision. (Show Details)Jan 21 2020, 1:52 PM
leinir updated this revision to Diff 74113.Jan 22 2020, 1:30 PM
leinir added a subscriber: mart.

Progressing steadily, with some layout fixing assistance from Marco.
Also, ensure you're using kirigami master for the best experience ;)

  • Forward the userCanComment information from the items model
  • Clean up the layouting of the comments sheet (thanks for the help, @mart!)
  • Add reply request functionality to the comment delegate
leinir edited the summary of this revision. (Show Details)Jan 22 2020, 1:31 PM
leinir updated this revision to Diff 74119.Jan 22 2020, 2:12 PM
  • Add a voting method to the Ratings component (separate to editable)
  • Use the votable prop to add voting UI to entry details
  • Hook up to the functions which do the actual vote/comment work
leinir edited the summary of this revision. (Show Details)Jan 22 2020, 2:13 PM
leinir updated this revision to Diff 74210.Jan 23 2020, 11:01 AM
  • Add editCredentials to the knscore provider interface
  • Implement edit credentials in the Attica provider
  • Add functionality to request a credentials editor from KNSCore::Engine
  • Add an invokable to the KNSQuick Engine for editing credentials
  • Call in and request the credentials editor if none exist
leinir edited the summary of this revision. (Show Details)Jan 23 2020, 12:42 PM
leinir updated this revision to Diff 74225.Jan 23 2020, 1:05 PM
  • Pull out the new comments sheet into a component
  • Use NewCommentSheet to let users create comments on entries without
leinir edited the summary of this revision. (Show Details)Jan 23 2020, 1:07 PM
leinir updated this revision to Diff 74227.Jan 23 2020, 1:12 PM
  • Don't suggest making reviews if you're writing a reply comment
  • Don't pull up a comments model until we actually need it
leinir edited the summary of this revision. (Show Details)Jan 23 2020, 1:17 PM
leinir edited the summary of this revision. (Show Details)
leinir updated this revision to Diff 74229.Jan 23 2020, 1:26 PM
leinir edited the summary of this revision. (Show Details)
  • Clarify the "be the first" text a touch...
leinir updated this revision to Diff 74230.Jan 23 2020, 1:28 PM
  • A better text for the "be the first" link (i'll try not dither too much)

Right, so because it is being brought up by people, i thought i should perhaps just do a touch of an explanation for the thought process that made me arrive at the current design for the NewCommentSheet component and its ability to chose whether or not you are writing a comment or a review. The options that i found can be enumerated as follows:

*) This one (that is, one action shows a dialogue which lets the user switch between a comment being a review or just a comment by either setting a rating or not)
a) A check box to explicitly indicate that you want to create a review, which then enables/disables the ratings stars (so much clunkiness)
x) As above, but it hides/shows the ratings stars instead of enable/disable (ew, stuff moving under my cursor)
n) Two separate actions, one for creating a review, and one for creating a comment, and they then show a sheet which can only do one or the other (really just adding this in for completion, because wow, just no - also incidentally not a straightforward thing to do, as there's only the one main action on a kirigami page, though that's an overcomeable technical limitation rather than a workflow dictated one)

leinir edited the summary of this revision. (Show Details)Mar 19 2020, 1:33 PM