Merge lp:~jamesh/unity-scopes-api/rating-input-doc-fix into lp:unity-scopes-api

Proposed by James Henstridge
Status: Superseded
Proposed branch: lp:~jamesh/unity-scopes-api/rating-input-doc-fix
Merge into: lp:unity-scopes-api
Diff against target: 18 lines (+8/-1)
1 file modified
src/scopes/PreviewWidget.cpp (+8/-1)
To merge this branch: bzr merge lp:~jamesh/unity-scopes-api/rating-input-doc-fix
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Michi Henning (community) Approve
Review via email: mp+250714@code.launchpad.net

This proposal has been superseded by a proposal from 2015-03-04.

Commit message

Update docs to explain how the rating and review of a rating-input widget are delivered to the scope.

Description of the change

The documentation for the rating-input preview widget explains that a preview action is fired when the user submits a rating, but it doesn't explain how the rating and review are passed to the scope. This branch addresses that.

To post a comment you must log in.
Revision history for this message
Michi Henning (michihenning) wrote :

Thanks for that!

The "review" entry is obviously a string, but it's not clear what type and values to expect for "rating". Do we need to say what kind of variant to expect and what the possible values are?

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
322. By James Henstridge

Document the types in the scope data.

Revision history for this message
James Henstridge (jamesh) wrote :

Good point. I've included the types now.

Revision history for this message
Michi Henning (michihenning) wrote :

I don't mean to be recalcitrant here. I'm asking because I've never used the rating widget... :-)

So the rating is a double. Is it 0.0 to 5.0? 1.0 to 5.0? Something else?

323. By James Henstridge

Indicate what each value in the VariantMap holds.

Revision history for this message
James Henstridge (jamesh) wrote :

I believe it is 1.0 to 5.0 at integer intervals (there is a comment in the click scope complaining about the fact that it isn't an integer).

Branch updated again to make it more explicit and change the formatting a bit so it'll be easier to add extra keys should the widget type ever get them.

Revision history for this message
Michi Henning (michihenning) wrote :

Awesome, thank you!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

Thank you Mr Jenkins! James edited a comment, and our build failed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Could you please target it at devel?

review: Needs Fixing

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/PreviewWidget.cpp'
2--- src/scopes/PreviewWidget.cpp 2015-01-07 23:03:50 +0000
3+++ src/scopes/PreviewWidget.cpp 2015-02-24 10:45:50 +0000
4@@ -288,7 +288,14 @@
5 a star-based rating and an input field for the user to enter his/her review.
6 It is possible to hide each widget as well as to require them to be filled in.
7
8-When a user presses the "Send" button, the scope receives a preview action activation with the id \c "rated".
9+When a user presses the "Send" button, the scope receives a preview
10+action activation with the id \c "rated". The actual rating and/or
11+review can be accessed via unity::scopes::ActionMetadata::scope_data.
12+The scope data will be a VariantMap with the following keys:
13+
14+ - \c "rating" - a double holding the number of stars the user
15+ selected (1 to 5)
16+ - \c "review" - a string holding the free text review
17
18 List of attributes:
19

Subscribers

People subscribed via source and target branches

to all changes: