Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classification #3

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"angular-gridster": "~0.9.11",
"jquery-ui": "~1.11.0",
"console-polyfill": "latest",
"ozp-iwc": "ozone-development/ozp-iwc",
"ozp-classification": "ozone-development/ozp-classification",
"bootstrap": "https://github.com/ozone-development/ozp-bootstrap-sass.git#master",
"ozp-iwc": "ozoneplatform/ozp-iwc",
"ozp-classification": "https://github.com/ozoneplatform/ozp-classification.git",
"bootstrap": "https://github.com/ozoneplatform/ozp-bootstrap-sass.git#master",
"ubuntu-fontface": "~0.1.3",
"icons": "ozone-development/ozp-icons#master",
"icons": "ozoneplatform/ozp-icons",
"angular-spinner": "0.6.1",
"angular-aria": "~1.4.1",
"humps": "~1.0.0"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"author": "OZONE",
"name": "ozpwebtop",
"version": "1.1.6",
"homepage": "https://github.com/ozone-development/ozp-webtop",
"homepage": "https://github.com/ozoneplatform/ozp-webtop",
"licenses": {
"type": "Apache-2.0",
"url": "https://spdx.org/licenses/Apache-2.0"
},
"bugs": "https://github.com/ozone-development/ozp-webtop/issues",
"bugs": "https://github.com/ozoneplatform/ozp-webtop/issues",
"repository": {
"type": "git",
"url": "git@github.com:ozone-development/ozp-webtop.git"
"url": "git@github.com:ozoneplatform/ozp-webtop.git"
},
"dependencies": {
"es6-promise": "~1.0.0"
Expand Down
9 changes: 5 additions & 4 deletions src/OzoneConfig.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
window.OzoneConfig = {
'API_URL': 'https://localhost:4440',
'API_URL': 'http://localhost:4440',
'APPLICATION_NAME': 'AppsMall Webtop',
'HELP_URL': 'http://localhost:8888/#/',
'CENTER_URL': 'https://ozone-development.github.io/ozp-center',
'CENTER_URL': 'http://localhost:8000/',
'DEVELOPER_RESOURCES_URL': '#',
'FEEDBACK_ADDRESS': 'mailto:person@address.com',
'HELPDESK_ADDRESS': 'mailto:helpdesk@address.com',
Expand All @@ -11,11 +11,12 @@ window.OzoneConfig = {
'SOCIAL_PIN_ADDRESS': '#',
'SOCIAL_CHAT_ADDRESS': '#',
'SOCIAL_BLOG_ADDRESS': '#',
'HUD_URL': 'https://ozone-development.github.io/ozp-hud',
'HUD_URL': 'http://localhost:8088/',
'IWC_URL': 'https://ozone-development.github.io/iwc',
'METRICS_URL': '/path/to/metrics',
'METRICS_WEBTOP_SITE_ID': 3,
'WEBTOP_URL': 'https://localhost:4440/webtop',
'WEBTOP_URL': 'http://localhost:9000',
'SYSTEM_HIGH_CLASSIFICATION': 'U',
'HELP_DOCS': {
'Help doc 1': '/path/to/document',
'Help doc 2': '/path/to/document',
Expand Down
11 changes: 10 additions & 1 deletion src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ angular.module( 'ozpWebtop', [
'ozpWebtop.constants',
'ozpWebtop.services.ozpInterface',
'ozpWebtop.models',
'ozpWebtop.services.responseObserver',
'ozpWebtop.services.widgets',
'ozpWebtop.appToolbar',
'ozpWebtop.ozpToolbar',
Expand Down Expand Up @@ -82,10 +83,16 @@ angular.module( 'ozpWebtop', [
])

.config(function($stateProvider, $urlRouterProvider,
$logProvider, maxStickyBoards) {
$logProvider, maxStickyBoards, $httpProvider) {

$logProvider.debugEnabled(true);

$httpProvider.interceptors.push('responseObserver');
$httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

$httpProvider.defaults.xsrfCookieName = 'csrftoken';
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';

/*
To avoid losing the internal state of widgets as users switch between
dashboards, we leverage the 'sticky state' capabilities of ui-router-extras
Expand Down Expand Up @@ -152,6 +159,8 @@ angular.module( 'ozpWebtop', [

$rootScope.$state = $state;

$rootScope.systemHighClassification = $window.OzoneConfig.SYSTEM_HIGH_CLASSIFICATION;

// TODO: flag to optionally use IWC

/*
Expand Down
2 changes: 1 addition & 1 deletion src/app/constants.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ describe('constants', function () {
it('should define highlightFrameOnGridLayoutEvent', function() {
expect(highlightFrameOnGridLayoutEvent).toBe('highlightFrameOnGridLayout');
});
});
});
14 changes: 14 additions & 0 deletions src/app/services/responseObserver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

angular.module('ozpWebtop.services.responseObserver', [])
.factory('responseObserver', function($q, $window) {
return {
'responseError': function(error) {
if (error.status === 403 && error.config.url.indexOf('/api/') >= 0) {
$window.location = $window.OzoneConfig.API_URL + '/accounts/login/';
} else {
return $q.reject(error);
}
}
};
});
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script type="text/javascript" src="<%= file %>"></script><% }); %>

</head>
<body ng-app="ozpWebtop" ozp-classification="U">
<body ng-app="ozpWebtop" ozp-classification="{{systemHighClassification}}" ozp-color-banners="true">

<!-- dashboard panel -->
<div ng-controller="OzpToolbarCtrl">
Expand Down