Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit 09936d6

Browse files
committed
Changes for the selected tab when opening the product
1 parent fd2d0d4 commit 09936d6

5 files changed

Lines changed: 44 additions & 23 deletions

File tree

digexp-dashboard/js/app.js

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,42 @@
1010
// Main application with dependencies
1111
var dashboardApp = angular.module('dashboardApp',
1212
['ngRoute', 'dashboardApp.navBar','dashboardControllers', 'ngAnimate']);
13-
14-
var digExperienceDashboard = 'Digital Experience Dashboard';
15-
13+
var firstRoute = true;
1614
// Configure routes for the different views
1715
dashboardApp.config(['$routeProvider', function($routeProvider) {
16+
var redirect = '/listApps';
17+
if(firstRoute == true){
18+
firstRoute = false;
19+
var digExperienceDashboard = 'Digital Experience Dashboard';
20+
var configInfo = dashConfig.getConfigInfo();
21+
var haveServers = configInfo.servers[0].host.length!= 0;
22+
// first start up and no routes go to settings
23+
if(haveServers == false){
24+
redirect = '/settings';
25+
}
26+
else{
27+
redirect = configInfo.lastOpened;
28+
if(!redirect)
29+
redirect = '/listApps';
30+
}
31+
32+
}
1833
$routeProvider.when('/listApps', {
19-
templateUrl: 'partials/listAppsView.html'
20-
,controller: 'AppsListController'
21-
}).when('/appDetails/:id', {
22-
templateUrl: 'partials/appDetailsView.html'
23-
// , controller : 'AppDetailsController'
24-
}).when('/settings', {
25-
templateUrl: 'partials/settingsView.html'
26-
,controller: 'SettingsController'
27-
}).when('/listThemes', {
28-
templateUrl: 'partials/listThemesView.html'
29-
,controller: 'ThemeListController'
30-
}).when('/listWcmDesigns', {
31-
templateUrl: 'partials/listWcmDesignsView.html'
32-
,controller: 'WcmDesignListController'
33-
}).otherwise({
34-
redirectTo: '/listApps'
35-
});
34+
templateUrl: 'partials/listAppsView.html'
35+
,controller: 'AppsListController'
36+
}).when('/appDetails/:id', {
37+
templateUrl: 'partials/appDetailsView.html'
38+
// , controller : 'AppDetailsController'
39+
}).when('/settings', {
40+
templateUrl: 'partials/settingsView.html'
41+
,controller: 'SettingsController'
42+
}).when('/listThemes', {
43+
templateUrl: 'partials/listThemesView.html'
44+
,controller: 'ThemeListController'
45+
}).when('/listWcmDesigns', {
46+
templateUrl: 'partials/listWcmDesignsView.html'
47+
,controller: 'WcmDesignListController'
48+
}).otherwise({
49+
redirectTo: redirect
50+
});
3651
}]);

digexp-dashboard/js/controllers/appListController.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ dashboardControllers.controller('AppsListController', ['$scope', '$route', '$loc
4343
};
4444

4545
$scope.configInfo = dashConfig.getConfigInfo();
46-
$scope.apps = spApp.apps;
46+
$scope.configInfo.lastOpened = '/listApps';
47+
dashConfig.setConfigInfo($scope.configInfo);
48+
$scope.apps = spApp.apps;;
4749
$scope.spCmdlnLog = "";
4850
$scope.server = dashConfig.getServerForTool(dashConfig.tools.spApp);
4951

digexp-dashboard/js/controllers/listWcmDesignsController.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ function($scope) {
109109
$parent.$parent.loadingNewLibraries--;
110110
fs.writeFileSync($scope.configInfo.wcmDesignsPath + '/' + library.title + '.json', JSON.stringify(library, null, ' '));
111111
if($parent.$parent.loadingNewLibraries == 0){
112-
$parent.$parent.wcmDesigns = wcmDesign.getWcmDesigns();
113-
$parent.$apply();
112+
$parent.$apply($parent.reload());
114113
$parent.$parent.$apply(function(){$scope.status = 'Pulling Library ' + library.title + ' complete';});
115114
}
116115
debugLogger.log("Success adding " + library.title);

digexp-dashboard/js/controllers/themesController.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ dashboardControllers.controller('ThemeListController', ['$scope', '$route', '$lo
1414
var logger = null;
1515

1616
$scope.configInfo = dashConfig.getConfigInfo();
17+
$scope.configInfo.lastOpened = '/listThemes';
18+
dashConfig.setConfigInfo($scope.configInfo);
1719
$scope.getThemeList = function() {
1820
return Object.keys($scope.themes).map(function(key) {
1921
return $scope.themes[key];

digexp-dashboard/js/controllers/wcmDesignsController.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ var __oldWcmDesignsPath = "";
1515
dashboardControllers.controller('WcmDesignListController', ['$scope', '$route', '$location',
1616
function($scope, $route) {
1717
$scope.configInfo = dashConfig.getConfigInfo();
18+
$scope.configInfo.lastOpened = '/listWcmDesigns';
19+
dashConfig.setConfigInfo($scope.configInfo);
20+
1821
$scope.server = dashConfig.getServerForTool(dashConfig.tools.wcmDesigns);
1922
if ($scope.server != oldServer){
2023
wcmDesign.init($scope.server.host, $scope.server.port, $scope.server.contenthandlerPath, $scope.server.userName, $scope.server.password, $scope.server.secure, $scope.configInfo.wcmDesignsPath);

0 commit comments

Comments
 (0)