Skip to content

Commit

Permalink
Merge 6ea2297 into 9cdd3e1
Browse files Browse the repository at this point in the history
  • Loading branch information
eputtone committed Nov 16, 2018
2 parents 9cdd3e1 + 6ea2297 commit 91bb307
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 36 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

**Highlight**
- Add `stopped` field to executor data. In database, REST API and nFlow Explorer. Requires database migration.
- Support Azure AD authentication in Explorer (see `nflow-explorer/src/config.js` for configuration options)

**Details**
- Travis CI no longer runs tests with Oracle JDK 10. Only oraclejdk8 and openjdk11 are currently running Travis CI tests.
Expand Down
4 changes: 3 additions & 1 deletion nflow-explorer/src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
var m = angular.module('nflowExplorer', [
'nflowExplorer.about',
'nflowExplorer.config',
'nflowExplorer.config.adal',
'nflowExplorer.components',
'nflowExplorer.frontPage',
'nflowExplorer.layout',
Expand All @@ -20,7 +21,8 @@
'ngSanitize',
'ngTouch',
'ui.bootstrap',
'chart.js'
'chart.js',
'AdalAngular'
]);

m.run(function (EndpointService, ExecutorService) {
Expand Down
9 changes: 9 additions & 0 deletions nflow-explorer/src/app/config/adal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(function () {
'use strict';
var m = angular.module('nflowExplorer.config.adal', ['nflowExplorer.config', 'AdalAngular']);
m.config(function(config, $httpProvider, adalAuthenticationServiceProvider) {
if (config.adal && config.adal.requireADLogin) {
adalAuthenticationServiceProvider.init(config.adal, $httpProvider);
}
});
})();
10 changes: 10 additions & 0 deletions nflow-explorer/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ var Config = function() {
},
];

// see: https://github.com/AzureAD/azure-activedirectory-library-for-js/wiki/Config-authentication-context#configurable-options
this.adal = {
// undocumented adal-option that controls authentication on globally
requireADLogin: false,
instance: 'https://login.microsoftonline.com/',
tenant: 'Enter_your_tenant_name_here_e.g._contoso.onmicrosoft.com',
clientId: 'Enter_your_client_ID_here_e.g._e9a5a8b6-8af7-4719-9821-0deef255f68e',
popUp: false
};

this.radiator = {
// poll period in seconds
pollPeriod: 15,
Expand Down
3 changes: 3 additions & 0 deletions nflow-explorer/src/external/adal-angular/adal-1.0.17.min.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions nflow-explorer/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
<!-- endbower -->
<!-- endbuild -->

<!--
Adal-angular is not managed using Bower purely because JS uglification fails because the
library declares strict mode but is not compliant with it, which makes the build to fail.
https://github.com/AzureAD/azure-activedirectory-library-for-js/pull/820/files
-->
<script src="external/adal-angular/adal-1.0.17.min.js"></script>
<script src="external/adal-angular/adal-angular-1.0.17.min.js"></script>
<script src="external/angular-ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.min.js"></script>

<script src="config.js"></script>
Expand All @@ -75,6 +82,7 @@
<script src="app/config/index.js"></script>
<script src="app/config/console.js"></script>
<script src="app/config/routes.js"></script>
<script src="app/config/adal.js"></script>

<script src="app/components/index.js"></script>
<script src="app/components/constants.js"></script>
Expand Down
5 changes: 3 additions & 2 deletions nflow-explorer/test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ module.exports = function(config) {
'bower_components/momentjs/moment.js',
'bower_components/lodash/lodash.js',
'bower_components/bootstrap-sass/assets/javascripts/bootstrap.js',
'bower_components/d3/d3.js',

'src/external/dagre-d3/js/dagre-d3.min.js',
'src/external/adal-angular/adal-1.0.17.min.js',
'src/external/adal-angular/adal-angular-1.0.17.min.js',
'src/external/angular-ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.min.js',
'bower_components/d3/d3.js',
'src/config.js',
'src/app/**/*.js',
'test/mock/**/*.js',
Expand Down
32 changes: 0 additions & 32 deletions nflow-explorer/test/spec/workflow-definition/statisticsTestUtil.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,37 @@ describe('Controller: WorkflowStatisticsTable', function () {
});
});

function stubStatePoller(WorkflowStatsPoller, stats) {
sinon.stub(WorkflowStatsPoller, 'getLatest').callsFake(function() {
return {
stateStatistics: stats
};
});
sinon.stub(WorkflowStatsPoller, 'start').callsFake(function() {});
}

function createStatsForState(cai, cqi, ipai, ipqi, eai, mai, fai) {
return {
created: {
allInstances: cai,
queuedInstances: cqi
},
inProgress: {
allInstances: ipai,
queuedInstances: ipqi
},
executing: {
allInstances: eai
},
manual: {
allInstances: mai
},
finished: {
allInstances: fai
}
};
}

function getCtrl(WorkflowStatsPoller, $scope) {
return $controller('WorkflowStatisticsTable', {
$scope: $scope,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

describe('Controller: WorkflowDefinitionTabsCtrl', function () {
var $controller, $scope, $rootScope, WorkflowStatsPoller, definitionStateStats;
var $controller, $scope, $rootScope, WorkflowStatsPoller;

beforeEach(module('nflowExplorer.workflowDefinition.tabs'));
beforeEach(module('nflowExplorer.services.WorkflowStatsPoller'));
Expand Down Expand Up @@ -57,6 +57,37 @@ describe('Controller: WorkflowDefinitionTabsCtrl', function () {
});
});

function stubStatePoller(WorkflowStatsPoller, stats) {
sinon.stub(WorkflowStatsPoller, 'getLatest').callsFake(function() {
return {
stateStatistics: stats
};
});
sinon.stub(WorkflowStatsPoller, 'start').callsFake(function() {});
}

function createStatsForState(cai, cqi, ipai, ipqi, eai, mai, fai) {
return {
created: {
allInstances: cai,
queuedInstances: cqi
},
inProgress: {
allInstances: ipai,
queuedInstances: ipqi
},
executing: {
allInstances: eai
},
manual: {
allInstances: mai
},
finished: {
allInstances: fai
}
};
}

function getCtrl(WorkflowStatsPoller, $scope) {
return $controller('WorkflowDefinitionTabsCtrl', {
$scope: $scope,
Expand Down

0 comments on commit 91bb307

Please sign in to comment.