Merge lp:~abreu-alexandre/unity-js-scopes/search-reply-activation-response into lp:unity-js-scopes

Proposed by Alexandre Abreu
Status: Merged
Approved by: Alexandre Abreu
Approved revision: 134
Merged at revision: 134
Proposed branch: lp:~abreu-alexandre/unity-js-scopes/search-reply-activation-response
Merge into: lp:unity-js-scopes
Diff against target: 97 lines (+31/-14)
4 files modified
examples/soundcloud/soundcloud.js (+5/-5)
src/bindings/index.js (+3/-1)
src/bindings/src/activation-response.cc (+18/-7)
src/bindings/src/activation-response.h (+5/-1)
To merge this branch: bzr merge lp:~abreu-alexandre/unity-js-scopes/search-reply-activation-response
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alberto Mardegan (community) Approve
Review via email: mp+286334@code.launchpad.net

Commit message

Handle SearchReply as an activation response creation parameter

Description of the change

Handle SearchReply as an activation response creation parameter

To post a comment you must log in.
Revision history for this message
Alberto Mardegan (mardy) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/soundcloud/soundcloud.js'
--- examples/soundcloud/soundcloud.js 2016-02-15 20:34:33 +0000
+++ examples/soundcloud/soundcloud.js 2016-02-17 14:43:26 +0000
@@ -268,20 +268,20 @@
268 action_id,268 action_id,
269 // activate269 // activate
270 function() {270 function() {
271 console.log('activate called');271 console.log('Activate called');
272272
273 var result;273 var activation_response;
274 switch (action_id) {274 switch (action_id) {
275 case 'updateId':275 case 'updateId':
276 result = activateUpdatePreview();276 activation_response = activateUpdatePreview();
277 break;277 break;
278 default:278 default:
279 result = new scopes.lib.ActivationResponse(279 activation_response = new scopes.lib.ActivationResponse(
280 scopes.defs.ActivationResponseStatus.NotHandled);280 scopes.defs.ActivationResponseStatus.NotHandled);
281 break;281 break;
282 }282 }
283283
284 return result;284 return activation_response;
285 },285 },
286 // cancelled286 // cancelled
287 function() {287 function() {
288288
=== modified file 'src/bindings/index.js'
--- src/bindings/index.js 2016-02-13 16:01:06 +0000
+++ src/bindings/index.js 2016-02-17 14:43:26 +0000
@@ -221,7 +221,9 @@
221 ShowDash: 1,221 ShowDash: 1,
222 HideDash: 2,222 HideDash: 2,
223 ShowPreview: 3,223 ShowPreview: 3,
224 PerformQuery: 4224 PerformQuery: 4,
225 UpdateResult: 5,
226 UpdatePreview: 6
225};227};
226228
227module.exports = {229module.exports = {
228230
=== modified file 'src/bindings/src/activation-response.cc'
--- src/bindings/src/activation-response.cc 2016-02-15 20:34:33 +0000
+++ src/bindings/src/activation-response.cc 2016-02-17 14:43:26 +0000
@@ -51,13 +51,24 @@
51 activation_response_.reset(51 activation_response_.reset(
52 new unity::scopes::ActivationResponse(widgets_list));52 new unity::scopes::ActivationResponse(widgets_list));
53 } else {53 } else {
54 auto query =54 // TODO fix at the v8cpp level
55 v8cpp::from_v8<std::shared_ptr<CannedQuery>>(55 try {
56 v8::Isolate::GetCurrent(),56 auto query =
57 arg);57 v8cpp::from_v8<std::shared_ptr<CannedQuery>>(
58 activation_response_.reset(58 v8::Isolate::GetCurrent(),
59 new unity::scopes::ActivationResponse(59 arg);
60 query->canned_query()));60 activation_response_.reset(
61 new unity::scopes::ActivationResponse(
62 query->canned_query()));
63 } catch (std::invalid_argument& e) {
64 auto result =
65 v8cpp::from_v8<std::shared_ptr<Result>>(
66 v8::Isolate::GetCurrent(),
67 arg);
68 activation_response_.reset(
69 new unity::scopes::ActivationResponse(
70 *result));
71 }
61 }72 }
62}73}
6374
6475
=== modified file 'src/bindings/src/activation-response.h'
--- src/bindings/src/activation-response.h 2016-02-15 20:34:33 +0000
+++ src/bindings/src/activation-response.h 2016-02-17 14:43:26 +0000
@@ -41,7 +41,11 @@
41--doc:constructor41--doc:constructor
42 *42 *
43 * @constructor43 * @constructor
44 * @param status|query|{Array of PreviewWidget} ActivationResponseStatus to create a response with given status OR CannedQuery to create an ActivationResponse with status defs.ActivationResponseStatus.PerformQuery and a search query to be executed OR an array of PreviewWidgets to create an ActivationResponse with status defs.ActivationResponseStatus.UpdatePreview to update the given widgets44 * @param status|query|result|{Array of PreviewWidget} The parameter can be of different types depending on the intended ActivationResponse:
45 - ActivationResponseStatus to create a response with given status
46 - CannedQuery to create an ActivationResponse with status defs.ActivationResponseStatus.PerformQuery and a search query to be executed
47 - SearchResult to create an ActivationResponse with status defs.ActivationResponseStatus.UpdateResult
48 - an array of PreviewWidgets to create an ActivationResponse with status defs.ActivationResponseStatus.UpdatePreview to update the given widgets
45--/doc:constructor49--/doc:constructor
4650
47--doc:prototype ActivationResponse51--doc:prototype ActivationResponse

Subscribers

People subscribed via source and target branches

to all changes: