← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19214: Adjust menu ui to use adjusted settings api

 

------------------------------------------------------------
revno: 19214
committer: Mark Polak <markpo@xxxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-05-31 13:14:36 +0200
message:
  Adjust menu ui to use adjusted settings api
  
  With the settings api now returning 404 instead of 200 on settings
  that are not found, when requesting the currentStyle for
  the user the request will now fail. This would be correct
  however if the user does not have a default style. We therefore
  have to set the default style on the 404 for the usersettings.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js	2015-04-09 11:50:27 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js	2015-05-31 11:14:36 +0000
@@ -1107,7 +1107,12 @@
                                         setHeaderLink(systemSettings.startModule);
                                     })
                                     .error(function (e) {
-                                        console && console.log(e);
+                                        console && console.info && console.info('Unable to load usersettings, falling back to default');
+
+                                        addUserStyleStylesheet(getStylesheetUrl());
+                                        setHeaderLogo(undefined, systemSettings.keyCustomTopMenuLogo);
+                                        setHeaderTitle(systemSettings.applicationTitle);
+                                        setHeaderLink(systemSettings.startModule);
                                     });
                             })
                             .error(function() {
@@ -1210,4 +1215,4 @@
         //If there is no angular we just run our normal init function to find tags ourselves
         dhis2.menu.ui.initMenu();
     }
-})();
\ No newline at end of file
+})();