Merge lp:~mardy/unity-webapps-qml/app-access into lp:unity-webapps-qml
- app-access
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | David Barth | ||||
Approved revision: | 108 | ||||
Merged at revision: | 145 | ||||
Proposed branch: | lp:~mardy/unity-webapps-qml/app-access | ||||
Merge into: | lp:unity-webapps-qml | ||||
Prerequisite: | lp:~abreu-alexandre/unity-webapps-qml/fix-1288801 | ||||
Diff against target: |
237 lines (+152/-4) 7 files modified
debian/control (+2/-1) examples/api-bindings/online-accounts/www/js/app.js (+11/-1) src/Ubuntu/UnityWebApps/UnityWebApps.pro (+3/-1) src/Ubuntu/UnityWebApps/UnityWebApps.qml (+1/-0) src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts-client.js (+87/-0) src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts.js (+2/-0) src/Ubuntu/UnityWebApps/bindings/online-accounts/client/online-accounts.js (+46/-1) |
||||
To merge this branch: | bzr merge lp:~mardy/unity-webapps-qml/app-access | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Alexandre Abreu (community) | Needs Fixing | ||
Justin McPherson | Approve | ||
Review via email: mp+219321@code.launchpad.net |
This proposal supersedes a proposal from 2014-05-13.
Commit message
Bindings for the OnlineAccounts.
Description of the change
Bindings for the OnlineAccounts.
PS Jenkins bot (ps-jenkins) wrote : | # |
Alexandre Abreu (abreu-alexandre) wrote : | # |
- You should at least add a Suggests w/ qtdeclarative5-
I have an error when trying to instanciate the Setup object:
Cannot assign to non-existent property \"applicationId\"
I am pretty sure I already saw that ...
Justin McPherson (justinmcp) : | # |
- 105. By Alberto Mardegan
-
Add Suggests for qtdeclarative5-
online- accounts- client0. 1
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:105
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Alexandre Abreu (abreu-alexandre) : | # |
- 106. By Alberto Mardegan
-
Merge trunk
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* Bindings for the download manager (LP: #1295842)
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* Cleanup the structure of the QML bindings to make it clearer. No
Changes in functionality all features are still working & same, This
is an updated version of: https://code.launchpad .net/~abreu-
alexandre/unity-webapps- qml/restructure -cleanup- bindings- qml-
structure/+merge/ 208148 with the latest changes that got in in
between (LP: #1288801)
* Simplifies the manifest.json handling in some instances. More
precisely when one is using a custom model search path for the
webapp lookup, some restrictions are being put on what is expected
to be found in the folder among which: a common/ subfolder (even if
the webapp doesnt require one),. one or more unity-webapps-* folders
with manifest.json & *.user.js files in it,. More over the manifest
files do require user scripts to be defined. This imposes a set of
constraints over a given webapp that simply wants to use the
container (w/o js injection). This simplifies it an allows one to
define a manifest.json file (still with some required elements, but
a smaller set), directly in the model search path. E.g. something
like: { "name": "MyWebApp", "homepage":
"http://www.bbc. co.uk/news/", "domain": "bbc.co.uk",
"includes": [] } will do, or to avoid any confusion w/ the click
manifest.json file, one also searches for a webapp-properties. json
w/ the same content as above.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:106
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandre Abreu (abreu-alexandre) wrote : | # |
You need to update the install files ...
- 107. By Alberto Mardegan
-
Install missing file
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:107
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandre Abreu (abreu-alexandre) wrote : | # |
I am all +1 for this, but this doesnt solve the bug linked at all, it adds an API; could you please remove the attached bug #
- 108. By Alberto Mardegan
-
From trunk
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* When using a webapp-properties file for an unamed webapp the user
script does not get injected. (LP: #1409051)
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* Make sure that the content hub bindings are fail safe since the
content hub package is a suggests (which is fine since it is not
there by default on desktop). (LP: #1395524)
* The content hub has been updated with some changes that caused the
getPeers() fonction to break on the HTML5 API side.
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* Improve testability for the desktop webapp search path
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* Port qml bindings to oxide (LP: #1374100)
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* Add small guard before url navigation (LP: #1378437)
* debian/control:
- update libqt5webkit5-qmlwebkitplugin -> qml-module-qtwebkit
(fixes a multiarch install failure)
[ Ken VanDine ]
* handle qtdeclarative5-ubuntu- content1 package rename
[ Ubuntu daily release ]
* New rebuild forced
[ Alexandre Abreu ]
* Simplify the click webapp definition for things like overrides etc.
[ Alexandre Abreu ]
* Add bidirectional callback support between js <-> qml,
[ Alexandre Abreu ]
* Fix issue with qmlplugindump using 100% cpu Fix and expanded AP
tests to properly test the installed webapps case (LP: #1300957)
[ Ken VanDine ]
* add content share
[ Alexandre Abreu ]
* add content share
[ Ubuntu daily release ]
* New rebuild forced
[ Olivier Tilloy ]
* Do not override existing message handlers. Oxide has this nice
feature that it automatically attaches the instantiated message
handler to the webview anyway, so this line was useless. (LP:
#1323735)
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2015-01-08 19:36:38 +0000 | |||
3 | +++ debian/control 2015-03-04 17:01:07 +0000 | |||
4 | @@ -35,7 +35,8 @@ | |||
5 | 35 | qtdeclarative5-accounts-plugin, | 35 | qtdeclarative5-accounts-plugin, |
6 | 36 | ${misc:Depends}, | 36 | ${misc:Depends}, |
7 | 37 | ${shlibs:Depends}, | 37 | ${shlibs:Depends}, |
9 | 38 | Suggests: qtdeclarative5-ubuntu-content1, | 38 | Suggests: qtdeclarative5-online-accounts-client0.1 (>= 0.3+14.10.20140530), |
10 | 39 | qtdeclarative5-ubuntu-content1, | ||
11 | 39 | qtdeclarative5-ubuntu-download-manager0.1 | 40 | qtdeclarative5-ubuntu-download-manager0.1 |
12 | 40 | Description: Unity Webapps QML component | 41 | Description: Unity Webapps QML component |
13 | 41 | Unity Webapps QML is a QML component that binds to a QML WebView and allows | 42 | Unity Webapps QML is a QML component that binds to a QML WebView and allows |
14 | 42 | 43 | ||
15 | === modified file 'examples/api-bindings/online-accounts/www/js/app.js' | |||
16 | --- examples/api-bindings/online-accounts/www/js/app.js 2014-05-09 13:17:09 +0000 | |||
17 | +++ examples/api-bindings/online-accounts/www/js/app.js 2015-03-04 17:01:07 +0000 | |||
18 | @@ -4,13 +4,23 @@ | |||
19 | 4 | var api = external.getUnityObject('1.0'); | 4 | var api = external.getUnityObject('1.0'); |
20 | 5 | var oa = api.OnlineAccounts; | 5 | var oa = api.OnlineAccounts; |
21 | 6 | 6 | ||
23 | 7 | oa.api.getProviders({"applicationId": "webbrowser-app"}, function(providers) { | 7 | var appId = "shotwell"; |
24 | 8 | |||
25 | 9 | oa.api.getProviders({"applicationId": appId}, function(providers) { | ||
26 | 8 | var ul = document.querySelector('#providers ul'); | 10 | var ul = document.querySelector('#providers ul'); |
27 | 9 | 11 | ||
28 | 10 | for (var i = 0; i < providers.length; ++i) { | 12 | for (var i = 0; i < providers.length; ++i) { |
29 | 11 | var li = document.createElement('li'); | 13 | var li = document.createElement('li'); |
30 | 14 | var button = document.createElement('input'); | ||
31 | 15 | button.type = 'button'; | ||
32 | 16 | button.providerId = providers[i].providerId; | ||
33 | 17 | button.value = 'Request account'; | ||
34 | 18 | button.addEventListener('click', function() { | ||
35 | 19 | oa.api.requestAccount(appId, this.providerId, function() {}); | ||
36 | 20 | }); | ||
37 | 12 | li.innerHTML = 'displayName: ' + providers[i].displayName | 21 | li.innerHTML = 'displayName: ' + providers[i].displayName |
38 | 13 | + ', providerId: ' + providers[i].providerId; | 22 | + ', providerId: ' + providers[i].providerId; |
39 | 23 | li.appendChild(button); | ||
40 | 14 | ul.appendChild(li); | 24 | ul.appendChild(li); |
41 | 15 | } | 25 | } |
42 | 16 | }); | 26 | }); |
43 | 17 | 27 | ||
44 | === modified file 'src/Ubuntu/UnityWebApps/UnityWebApps.pro' | |||
45 | --- src/Ubuntu/UnityWebApps/UnityWebApps.pro 2014-07-11 17:13:18 +0000 | |||
46 | +++ src/Ubuntu/UnityWebApps/UnityWebApps.pro 2015-03-04 17:01:07 +0000 | |||
47 | @@ -60,7 +60,9 @@ | |||
48 | 60 | alarm_binding_backend_js_files.files = ./bindings/alarm-api/backend/alarm-api.js | 60 | alarm_binding_backend_js_files.files = ./bindings/alarm-api/backend/alarm-api.js |
49 | 61 | 61 | ||
50 | 62 | online_accounts_binding_backend_js_files.path = $$installPath/bindings/online-accounts/backend/ | 62 | online_accounts_binding_backend_js_files.path = $$installPath/bindings/online-accounts/backend/ |
52 | 63 | online_accounts_binding_backend_js_files.files = ./bindings/online-accounts/backend/online-accounts.js | 63 | online_accounts_binding_backend_js_files.files = \ |
53 | 64 | ./bindings/online-accounts/backend/online-accounts.js \ | ||
54 | 65 | ./bindings/online-accounts/backend/online-accounts-client.js | ||
55 | 64 | 66 | ||
56 | 65 | runtime_api_binding_backend_js_files.path = $$installPath/bindings/runtime-api/backend/ | 67 | runtime_api_binding_backend_js_files.path = $$installPath/bindings/runtime-api/backend/ |
57 | 66 | runtime_api_binding_backend_js_files.files = ./bindings/runtime-api/backend/runtime-api.js | 68 | runtime_api_binding_backend_js_files.files = ./bindings/runtime-api/backend/runtime-api.js |
58 | 67 | 69 | ||
59 | === modified file 'src/Ubuntu/UnityWebApps/UnityWebApps.qml' | |||
60 | --- src/Ubuntu/UnityWebApps/UnityWebApps.qml 2015-01-08 19:36:38 +0000 | |||
61 | +++ src/Ubuntu/UnityWebApps/UnityWebApps.qml 2015-03-04 17:01:07 +0000 | |||
62 | @@ -26,6 +26,7 @@ | |||
63 | 26 | import "./bindings/alarm-api/backend/alarm-api.js" as AlarmApiBackend | 26 | import "./bindings/alarm-api/backend/alarm-api.js" as AlarmApiBackend |
64 | 27 | import "./bindings/content-hub/backend/content-hub.js" as ContentHubApiBackend | 27 | import "./bindings/content-hub/backend/content-hub.js" as ContentHubApiBackend |
65 | 28 | import "./bindings/online-accounts/backend/online-accounts.js" as OnlineAccountsApiBackend | 28 | import "./bindings/online-accounts/backend/online-accounts.js" as OnlineAccountsApiBackend |
66 | 29 | import "./bindings/online-accounts/backend/online-accounts-client.js" as OnlineAccountsClientApiBackend | ||
67 | 29 | import "./bindings/download-manager/backend/download-api.js" as DownloadApiBackend | 30 | import "./bindings/download-manager/backend/download-api.js" as DownloadApiBackend |
68 | 30 | 31 | ||
69 | 31 | /*! | 32 | /*! |
70 | 32 | 33 | ||
71 | === added file 'src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts-client.js' | |||
72 | --- src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts-client.js 1970-01-01 00:00:00 +0000 | |||
73 | +++ src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts-client.js 2015-03-04 17:01:07 +0000 | |||
74 | @@ -0,0 +1,87 @@ | |||
75 | 1 | /* | ||
76 | 2 | * Copyright 2014 Canonical Ltd. | ||
77 | 3 | * | ||
78 | 4 | * This file is part of unity-webapps-qml. | ||
79 | 5 | * | ||
80 | 6 | * unity-webapps-qml is free software; you can redistribute it and/or modify | ||
81 | 7 | * it under the terms of the GNU General Public License as published by | ||
82 | 8 | * the Free Software Foundation; version 3. | ||
83 | 9 | * | ||
84 | 10 | * unity-webapps-qml is distributed in the hope that it will be useful, | ||
85 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
86 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
87 | 13 | * GNU General Public License for more details. | ||
88 | 14 | * | ||
89 | 15 | * You should have received a copy of the GNU General Public License | ||
90 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
91 | 17 | */ | ||
92 | 18 | |||
93 | 19 | /** | ||
94 | 20 | * | ||
95 | 21 | * Online Accounts client API backend binding | ||
96 | 22 | * | ||
97 | 23 | */ | ||
98 | 24 | function createOnlineAccountsClientApi(backendDelegate) { | ||
99 | 25 | var PLUGIN_URI = 'Ubuntu.OnlineAccounts.Client'; | ||
100 | 26 | var VERSION = 0.1; | ||
101 | 27 | |||
102 | 28 | function Setup(params) { | ||
103 | 29 | var result = backendDelegate.createQmlObject( | ||
104 | 30 | PLUGIN_URI, VERSION, 'Setup', params); | ||
105 | 31 | this._id = result.id; | ||
106 | 32 | this._object = result.object; | ||
107 | 33 | }; | ||
108 | 34 | Setup.prototype = { | ||
109 | 35 | _validate: function() { | ||
110 | 36 | if (! this._object) | ||
111 | 37 | throw new TypeError("Invalid object null"); | ||
112 | 38 | }, | ||
113 | 39 | |||
114 | 40 | destroy: function() { | ||
115 | 41 | if (! this._object) | ||
116 | 42 | return; | ||
117 | 43 | this._object.destroy(); | ||
118 | 44 | backendDelegate.deleteId(this._id); | ||
119 | 45 | }, | ||
120 | 46 | |||
121 | 47 | // object methods | ||
122 | 48 | serialize: function() { | ||
123 | 49 | this._validate(); | ||
124 | 50 | return { | ||
125 | 51 | type: 'object-proxy', | ||
126 | 52 | apiid: 'OnlineAccounts.Client', | ||
127 | 53 | objecttype: 'Setup', | ||
128 | 54 | objectid: this._id, | ||
129 | 55 | } | ||
130 | 56 | }, | ||
131 | 57 | |||
132 | 58 | // methods | ||
133 | 59 | exec: function(callback) { | ||
134 | 60 | this._validate(); | ||
135 | 61 | |||
136 | 62 | var self = this; | ||
137 | 63 | |||
138 | 64 | var onFinished = function() { | ||
139 | 65 | self._object.onFinished.disconnect(onFinished); | ||
140 | 66 | callback(); | ||
141 | 67 | } | ||
142 | 68 | |||
143 | 69 | this._object.onFinished.connect(onFinished); | ||
144 | 70 | this._object.exec(); | ||
145 | 71 | } | ||
146 | 72 | }; | ||
147 | 73 | |||
148 | 74 | return { | ||
149 | 75 | requestAccount: function(applicationId, providerId, callback) { | ||
150 | 76 | var setup = new Setup({ | ||
151 | 77 | 'applicationId': applicationId, | ||
152 | 78 | 'providerId': providerId, | ||
153 | 79 | }); | ||
154 | 80 | var onFinished = function() { | ||
155 | 81 | setup.destroy(); | ||
156 | 82 | callback(); | ||
157 | 83 | }; | ||
158 | 84 | setup.exec(onFinished); | ||
159 | 85 | }, | ||
160 | 86 | }; | ||
161 | 87 | } | ||
162 | 0 | 88 | ||
163 | === modified file 'src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts.js' | |||
164 | --- src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts.js 2014-05-22 08:54:56 +0000 | |||
165 | +++ src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts.js 2015-03-04 17:01:07 +0000 | |||
166 | @@ -673,6 +673,8 @@ | |||
167 | 673 | } | 673 | } |
168 | 674 | }, | 674 | }, |
169 | 675 | 675 | ||
170 | 676 | Client: OnlineAccountsClientApiBackend.createOnlineAccountsClientApi(backendDelegate), | ||
171 | 677 | |||
172 | 676 | // Internal | 678 | // Internal |
173 | 677 | 679 | ||
174 | 678 | dispatchToObject: function(infos) { | 680 | dispatchToObject: function(infos) { |
175 | 679 | 681 | ||
176 | === modified file 'src/Ubuntu/UnityWebApps/bindings/online-accounts/client/online-accounts.js' | |||
177 | --- src/Ubuntu/UnityWebApps/bindings/online-accounts/client/online-accounts.js 2014-05-09 13:17:09 +0000 | |||
178 | +++ src/Ubuntu/UnityWebApps/bindings/online-accounts/client/online-accounts.js 2015-03-04 17:01:07 +0000 | |||
179 | @@ -161,7 +161,7 @@ | |||
180 | 161 | * | 161 | * |
181 | 162 | * @method api.getAccounts | 162 | * @method api.getAccounts |
182 | 163 | * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are: | 163 | * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are: |
184 | 164 | * - application: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications) | 164 | * - applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications) |
185 | 165 | * - provider: the ID of a provider (see /usr/share/accounts/providers/ or ~/.local/share/accounts/providers/ for a list of the available providers) | 165 | * - provider: the ID of a provider (see /usr/share/accounts/providers/ or ~/.local/share/accounts/providers/ for a list of the available providers) |
186 | 166 | * - service: the ID of a service (see /usr/share/accounts/services/ or ~/.local/share/accounts/services/ for a list of the available services) | 166 | * - service: the ID of a service (see /usr/share/accounts/services/ or ~/.local/share/accounts/services/ for a list of the available services) |
187 | 167 | * | 167 | * |
188 | @@ -215,6 +215,51 @@ | |||
189 | 215 | , [filters] | 215 | , [filters] |
190 | 216 | , callback); | 216 | , callback); |
191 | 217 | }, | 217 | }, |
192 | 218 | /** | ||
193 | 219 | * Requests access to an account. | ||
194 | 220 | * | ||
195 | 221 | * Applications must invoke this method in order to obtain access | ||
196 | 222 | * to an account. The user will be prompted to grant access to | ||
197 | 223 | * either an existing account, to create a new one or to decline | ||
198 | 224 | * the request. | ||
199 | 225 | * | ||
200 | 226 | * @method api.requestAccount | ||
201 | 227 | * @param applicationId {String} The ID of the application | ||
202 | 228 | * requesting the account (see /usr/share/accounts/applications/ or | ||
203 | 229 | * ~/.local/share/accounts/applications/ for a list of the | ||
204 | 230 | * available applications) | ||
205 | 231 | * @param providerId {String} The ID of the provider of the desired | ||
206 | 232 | * account (see /usr/share/accounts/providers/ or | ||
207 | 233 | * ~/.local/share/accounts/providers/ for a list of the available | ||
208 | 234 | * providers) | ||
209 | 235 | * @param callback {Function()} Callback which will be invoked | ||
210 | 236 | * after the access request has been decided (either with the | ||
211 | 237 | * access to an account being granted, or with a refusal). | ||
212 | 238 | * | ||
213 | 239 | * @example | ||
214 | 240 | var api = external.getUnityObject(1.0); | ||
215 | 241 | var oa = api.OnlineAccounts; | ||
216 | 242 | |||
217 | 243 | var appId = 'com.ubuntu.developer.me.MyPackage_MyApp'; | ||
218 | 244 | oa.api.requestAccount(appId, | ||
219 | 245 | 'facebook', | ||
220 | 246 | function() { | ||
221 | 247 | oa.api.getAccounts({ 'application': appId }, function(result) { | ||
222 | 248 | for (var i = 0; i < result.length; ++i) { | ||
223 | 249 | console.log("name: " + result[i].displayName() | ||
224 | 250 | + ', id: ' + result[i].accountId() | ||
225 | 251 | + ', providerName: ' + result[i].provider().displayName | ||
226 | 252 | + ', enabled: ' + (result[i].enabled() ? "true" : "false") | ||
227 | 253 | ); | ||
228 | 254 | } | ||
229 | 255 | }); | ||
230 | 256 | }); | ||
231 | 257 | */ | ||
232 | 258 | requestAccount: function(applicationId, providerId, callback) { | ||
233 | 259 | backendBridge.call('OnlineAccounts.Client.requestAccount', | ||
234 | 260 | [ applicationId, providerId], | ||
235 | 261 | callback); | ||
236 | 262 | }, | ||
237 | 218 | }, | 263 | }, |
238 | 219 | 264 | ||
239 | 220 | 265 |
PASSED: Continuous integration, rev:104 jenkins. qa.ubuntu. com/job/ unity-webapps- qml-ci/ 123/ jenkins. qa.ubuntu. com/job/ unity-webapps- qml-utopic- amd64-ci/ 9 jenkins. qa.ubuntu. com/job/ unity-webapps- qml-utopic- armhf-ci/ 9
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- webapps- qml-ci/ 123/rebuild
http://