← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/ubuntu-weather-app/fix-1505848-add-owm-key into lp:ubuntu-weather-app/reboot

 

Andrew Hayzen has proposed merging lp:~ahayzen/ubuntu-weather-app/fix-1505848-add-owm-key into lp:ubuntu-weather-app/reboot.

Commit message:
* Add support for OWM API keys

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)
Related bugs:
  Bug #1505848 in Ubuntu Weather App: "OWM now requires an API key"
  https://bugs.launchpad.net/ubuntu-weather-app/+bug/1505848

For more details, see:
https://code.launchpad.net/~ahayzen/ubuntu-weather-app/fix-1505848-add-owm-key/+merge/274423

* Add support for OWM API keys

Not sure what we should do with the settings page when you have no keys at all (note we currently hide TWC), and not sure what should happen when you load the app with no keys.
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~ahayzen/ubuntu-weather-app/fix-1505848-add-owm-key into lp:ubuntu-weather-app/reboot.
=== modified file 'app/data/WeatherApi.js'
--- app/data/WeatherApi.js	2015-08-22 23:17:02 +0000
+++ app/data/WeatherApi.js	2015-10-14 15:40:00 +0000
@@ -333,6 +333,10 @@
             urls.daily = _baseUrl+"forecast/daily?cnt=10&units="+params.units+latLongParams+"&lang="+Qt.locale().name.split("_")[0];
             urls.forecast = _baseUrl+"forecast?units="+params.units+latLongParams+"&lang="+Qt.locale().name.split("_")[0];
         }
+        urls.current += "&APPID="+params.owm_api_key;
+        urls.daily += "&APPID="+params.owm_api_key;
+        urls.forecast += "&APPID="+params.owm_api_key;
+
         return urls;
     }
     //
@@ -572,7 +576,7 @@
     function _getUrl(params) {
         var url, serviceId,
             baseParams = {
-                key: params.api_key,
+                key: params.twc_api_key,
                 units: (params.units === "metric") ? "m" : "e",
                 locale: Qt.locale().name,
                 hours: "48",
@@ -741,7 +745,8 @@
                         db: loc.db,
                         units: 'metric',
                         service: message.params.service,
-                        api_key: message.params.api_key,
+                        twc_api_key: message.params.twc_api_key,
+                        owm_api_key: message.params.owm_api_key,
                         interval: message.params.interval
                     },
                     secsFromLastFetch = (now-loc.updated)/1000;

=== modified file 'app/data/key.js'
--- app/data/key.js	2015-06-11 00:22:03 +0000
+++ app/data/key.js	2015-10-14 15:40:00 +0000
@@ -1,1 +1,2 @@
 var twcKey = "";
+var owmKey = "";  // goto http://openweathermap.org/faq#error401 to get a personal API key

=== modified file 'app/ubuntu-weather-app.qml'
--- app/ubuntu-weather-app.qml	2015-09-03 22:55:17 +0000
+++ app/ubuntu-weather-app.qml	2015-10-14 15:40:00 +0000
@@ -118,7 +118,8 @@
                         locations: locations,
                         force: force_refresh,
                         service: settings.service,
-                        api_key: Key.twcKey,
+                        twc_api_key: Key.twcKey,
+                        owm_api_key: Key.owmKey,
                         interval: settings.refreshInterval
                     }
                 }, responseDataHandler)

=== modified file 'debian/changelog'
--- debian/changelog	2015-10-07 18:56:07 +0000
+++ debian/changelog	2015-10-14 15:40:00 +0000
@@ -49,6 +49,7 @@
   * Various tidy ups to improve readability and code commentary of autopilot code
   * ListItem transparent and PageWithBottomEdge colour correct so that they don't appear white on the LocationsPage
   * When expanding day delegates ensure that extra info is visible by animating it into view (LP: #1496425)
+  * Add support for OWM API keys (LP: #1505848)
 
   [ Carla Sella ]
   * Create autopilot test which shows the day delegate (LP: #1452491)

=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot	2015-10-07 18:56:07 +0000
+++ po/com.ubuntu.weather.pot	2015-10-14 15:40:00 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: ubuntu-weather-app\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-10-07 19:53+0100\n"
+"POT-Creation-Date: 2015-10-14 16:30+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"


Follow ups