From ffe83e98f910be6101a44e62dde0c0f418c0199d Mon Sep 17 00:00:00 2001 From: Esa Puttonen Date: Fri, 5 Feb 2021 15:41:47 +0200 Subject: [PATCH 1/8] Update year in Explorer footer --- nflow-explorer/src/app/layout/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nflow-explorer/src/app/layout/footer.html b/nflow-explorer/src/app/layout/footer.html index 9ee76bae9..81e922519 100644 --- a/nflow-explorer/src/app/layout/footer.html +++ b/nflow-explorer/src/app/layout/footer.html @@ -2,7 +2,7 @@
From 79cb7a0987485f1992cf5800f0dd4c449a0395b2 Mon Sep 17 00:00:00 2001 From: Esa Puttonen Date: Fri, 5 Feb 2021 15:59:39 +0200 Subject: [PATCH 2/8] Add hideFooter-property to config.js --- nflow-explorer/src/app/layout/layout.js | 9 ++++++--- nflow-explorer/src/config.js | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nflow-explorer/src/app/layout/layout.js b/nflow-explorer/src/app/layout/layout.js index 886b3b459..17ff4a78e 100644 --- a/nflow-explorer/src/app/layout/layout.js +++ b/nflow-explorer/src/app/layout/layout.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - var m = angular.module('nflowExplorer.layout', []); + var m = angular.module('nflowExplorer.layout', ['nflowExplorer.config']); m.directive('layout', function() { return { @@ -20,13 +20,16 @@ }; }); - m.directive('pageFooter', function() { + m.directive('pageFooter', function(config) { + if (config.hideFooter) { + return {}; + } return { restrict: 'E', replace: 'true', templateUrl: 'app/layout/footer.html' }; - }); +}); m.controller('PageHeaderCtrl', function($location, $state, $window) { var self = this; diff --git a/nflow-explorer/src/config.js b/nflow-explorer/src/config.js index 9a70a1029..f2465c927 100644 --- a/nflow-explorer/src/config.js +++ b/nflow-explorer/src/config.js @@ -71,4 +71,5 @@ var Config = function() { return null; }; + this.hideFooter = false; }; From 0821a51c2c8c46e2ad39c367d20ccfce504698bb Mon Sep 17 00:00:00 2001 From: Esa Puttonen Date: Fri, 5 Feb 2021 16:23:55 +0200 Subject: [PATCH 3/8] Add htmlTitle-property to config.js --- nflow-explorer/src/app/app.js | 5 ++++- nflow-explorer/src/config.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nflow-explorer/src/app/app.js b/nflow-explorer/src/app/app.js index 3ec0929a9..dc21bca8e 100644 --- a/nflow-explorer/src/app/app.js +++ b/nflow-explorer/src/app/app.js @@ -26,7 +26,10 @@ 'toastr' ]); - m.run(function (EndpointService, ExecutorService) { + m.run(function (EndpointService, ExecutorService, $window, config) { + if (config.htmlTitle) { + $window.document.title = config.htmlTitle + }; EndpointService.init(); ExecutorService.start(); }); diff --git a/nflow-explorer/src/config.js b/nflow-explorer/src/config.js index f2465c927..2504b4207 100644 --- a/nflow-explorer/src/config.js +++ b/nflow-explorer/src/config.js @@ -71,5 +71,6 @@ var Config = function() { return null; }; + this.htmlTitle = undefined; this.hideFooter = false; }; From 1af37fb83d7b9420dd9833f17ca6d2b32479b033 Mon Sep 17 00:00:00 2001 From: Esa Puttonen Date: Fri, 5 Feb 2021 16:36:10 +0200 Subject: [PATCH 4/8] Add nflowLogoFile-property to config.js --- nflow-explorer/src/app/layout/header.html | 2 +- nflow-explorer/src/app/layout/layout.js | 3 ++- nflow-explorer/src/config.js | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nflow-explorer/src/app/layout/header.html b/nflow-explorer/src/app/layout/header.html index 43ee06b1b..1132e2437 100644 --- a/nflow-explorer/src/app/layout/header.html +++ b/nflow-explorer/src/app/layout/header.html @@ -7,7 +7,7 @@
- nFlow + nFlow
diff --git a/nflow-explorer/src/app/layout/layout.js b/nflow-explorer/src/app/layout/layout.js index 17ff4a78e..4d28a7198 100644 --- a/nflow-explorer/src/app/layout/layout.js +++ b/nflow-explorer/src/app/layout/layout.js @@ -31,7 +31,7 @@ }; }); - m.controller('PageHeaderCtrl', function($location, $state, $window) { + m.controller('PageHeaderCtrl', function($location, $state, $window, config) { var self = this; // nope, $stateParams.radiator wont work here self.radiator = !!$location.search().radiator; @@ -41,6 +41,7 @@ self.isAboutTabActive = function() { return $state.includes('aboutTab'); }; self.returnUrl = getServerParamFromUrl('returnUrl', $window); self.returnUrlLabel = getServerParamFromUrl('returnUrlLabel', $window) || 'Back'; + self.nflowLogoFile = config.nflowLogoFile || 'images/nflow_logo.svg'; function getServerParamFromUrl(paramName, $window) { var searchStr = $window.location.search.substring(1); diff --git a/nflow-explorer/src/config.js b/nflow-explorer/src/config.js index 2504b4207..3da97d022 100644 --- a/nflow-explorer/src/config.js +++ b/nflow-explorer/src/config.js @@ -71,6 +71,12 @@ var Config = function() { return null; }; + // Replaces HTML page title by given string this.htmlTitle = undefined; + + // Replaces nFlow logo in header by image in given location + this.nflowLogoFile = undefined; + + // When true, hides the sticky footer with copyright this.hideFooter = false; }; From c6a713bc67a2f98d94b3991b101199c2eb027426 Mon Sep 17 00:00:00 2001 From: Esa Puttonen Date: Fri, 5 Feb 2021 17:55:37 +0200 Subject: [PATCH 5/8] Put workflow instance properties in a table (behind config.js workflowInfoTable-property) --- nflow-explorer/src/app/workflow/workflow.html | 11 ++- .../src/app/workflow/workflowInfo.html | 95 +++++++++++++++---- .../src/app/workflow/workflowInfo.js | 3 +- nflow-explorer/src/config.js | 4 + nflow-explorer/src/styles/main.scss | 21 ++++ 5 files changed, 109 insertions(+), 25 deletions(-) diff --git a/nflow-explorer/src/app/workflow/workflow.html b/nflow-explorer/src/app/workflow/workflow.html index ae3bcb133..29e6fb9c7 100644 --- a/nflow-explorer/src/app/workflow/workflow.html +++ b/nflow-explorer/src/app/workflow/workflow.html @@ -1,12 +1,13 @@
-

{{ctrl.definition.type}} ({{ctrl.workflow.id}})

+

+ + {{ctrl.definition.type}} + + ({{ctrl.workflow.id}}) +

{{ctrl.definition.description}}
- - -
Parent workflow: - {{ctrl.parentWorkflow.type}} ({{ctrl.parentWorkflow.id}}) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parent workflow{{ctrl.parentWorkflow.type}} ({{ctrl.parentWorkflow.id}})
Child workflows{{ctrl.childWorkflows.length}}
Current state + {{ctrl.workflow.state}} +
Current status{{ctrl.workflow.status}}
+
Next activation{{ctrl.workflow.nextActivation | fromNowOrNever}}
Business key{{ctrl.workflow.businessKey}}
External id{{ctrl.workflow.externalId}}
Current signal{{ctrl.workflow.signal}}
Priority{{ctrl.workflow.priority}}
Created{{ctrl.workflow.created | date:'yyyy-MM-dd HH:mm:ss'}}
Started{{ctrl.workflow.started | date:'yyyy-MM-dd HH:mm:ss'}}
Modified{{ctrl.workflow.modified | date:'yyyy-MM-dd HH:mm:ss'}}
-
Child workflows: - {{ctrl.childWorkflows.length}} +
+ +
Child workflows: + {{ctrl.childWorkflows.length}} +
+ Created: {{ctrl.workflow.created | date:'yyyy-MM-dd HH:mm:ss' }}
+ Started: {{ctrl.workflow.started | date:'yyyy-MM-dd HH:mm:ss' }}
+ Modified: {{ctrl.workflow.modified | date:'yyyy-MM-dd HH:mm:ss' }}
+ Current state: {{ctrl.workflow.state}} + ({{ctrl.workflow.stateText}})
+ Current status: {{ctrl.workflow.status}}
+
+ Current signal: {{ctrl.workflow.signal}}
+
+ Next activation: {{ctrl.workflow.nextActivation | fromNowOrNever}} +
Workflow id: {{ctrl.workflow.id}}
+
Priority: {{ctrl.workflow.priority}}
+
Business key: {{ctrl.workflow.businessKey}}
+
External id: {{ctrl.workflow.externalId}}
+
- Created: {{ctrl.workflow.created | date:'yyyy-MM-dd HH:mm:ss' }}
- Started: {{ctrl.workflow.started | date:'yyyy-MM-dd HH:mm:ss' }}
- Modified: {{ctrl.workflow.modified | date:'yyyy-MM-dd HH:mm:ss' }}
- Current state: {{ctrl.workflow.state}} - ({{ctrl.workflow.stateText}})
- Current status: {{ctrl.workflow.status}}
-
- Current signal: {{ctrl.workflow.signal}}
-
- Next activation: {{ctrl.workflow.nextActivation | fromNowOrNever}} -
Workflow id: {{ctrl.workflow.id}}
-
Priority: {{ctrl.workflow.priority}}
-
Business key: {{ctrl.workflow.businessKey}}
-
External id: {{ctrl.workflow.externalId}}
-
diff --git a/nflow-explorer/src/app/workflow/workflowInfo.js b/nflow-explorer/src/app/workflow/workflowInfo.js index b0199fb53..c87e1bbc2 100644 --- a/nflow-explorer/src/app/workflow/workflowInfo.js +++ b/nflow-explorer/src/app/workflow/workflowInfo.js @@ -6,7 +6,7 @@ 'nflowExplorer.workflow.graph', ]); - m.directive('workflowInfo', function() { + m.directive('workflowInfo', function(config) { return { restrict: 'E', replace: true, @@ -27,6 +27,7 @@ var self = this; self.currentStateTime = currentStateTime; self.selectAction = WorkflowGraphApi.onSelectNode; + self.workflowInfoTable = config.workflowInfoTable; self.contentGenerator = config.customInstanceContent; function currentStateTime() { diff --git a/nflow-explorer/src/config.js b/nflow-explorer/src/config.js index 3da97d022..6907cac04 100644 --- a/nflow-explorer/src/config.js +++ b/nflow-explorer/src/config.js @@ -79,4 +79,8 @@ var Config = function() { // When true, hides the sticky footer with copyright this.hideFooter = false; + + // When true, workflow instance properties shown in a table + // (if needed, update your customInstanceContent to generate table rows) + this.workflowInfoTable = false; }; diff --git a/nflow-explorer/src/styles/main.scss b/nflow-explorer/src/styles/main.scss index 22b54e627..86f2c2540 100644 --- a/nflow-explorer/src/styles/main.scss +++ b/nflow-explorer/src/styles/main.scss @@ -276,3 +276,24 @@ ul.listing { width: 100%; } +#workflow-properties tr:nth-child(even) { + background-color: #f2f2f2; +} + +#workflow-properties tr:hover { + background-color: #ddd; +} + +#workflow-properties td:first-child { + font-weight: bold; +} + +#workflow-properties td { + border: 1px solid #ddd; + padding: 8px; +} + +#workflow-properties code { + color: black; + background-color: transparent; +} From 39e56151943af99215bfb911fa879cafc96a07da Mon Sep 17 00:00:00 2001 From: Esa Puttonen Date: Fri, 5 Feb 2021 21:10:25 +0200 Subject: [PATCH 6/8] Change layout for workflow instance properties and graph, and fix Grunt warnings --- nflow-explorer/src/app/app.js | 4 +-- nflow-explorer/src/app/workflow/workflow.html | 23 +++++++++++++---- .../src/app/workflow/workflowInfo.js | 2 +- nflow-explorer/src/styles/main.scss | 25 +++---------------- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/nflow-explorer/src/app/app.js b/nflow-explorer/src/app/app.js index dc21bca8e..a325db5d9 100644 --- a/nflow-explorer/src/app/app.js +++ b/nflow-explorer/src/app/app.js @@ -28,8 +28,8 @@ m.run(function (EndpointService, ExecutorService, $window, config) { if (config.htmlTitle) { - $window.document.title = config.htmlTitle - }; + $window.document.title = config.htmlTitle; + } EndpointService.init(); ExecutorService.start(); }); diff --git a/nflow-explorer/src/app/workflow/workflow.html b/nflow-explorer/src/app/workflow/workflow.html index 29e6fb9c7..36878908c 100644 --- a/nflow-explorer/src/app/workflow/workflow.html +++ b/nflow-explorer/src/app/workflow/workflow.html @@ -8,11 +8,24 @@

({{ctrl.workflow.id}})

{{ctrl.definition.description}}
- - +
+ + +
+
+
+ +
+
+ +
+
Date: Sat, 6 Feb 2021 11:11:05 +0200 Subject: [PATCH 7/8] Fix review findings --- .../src/app/workflow/workflowInfo.html | 131 +++++++----------- .../src/app/workflow/workflowInfo.js | 1 - nflow-explorer/src/config.js | 4 - nflow-explorer/src/styles/main.scss | 14 +- 4 files changed, 62 insertions(+), 88 deletions(-) diff --git a/nflow-explorer/src/app/workflow/workflowInfo.html b/nflow-explorer/src/app/workflow/workflowInfo.html index 74643a043..46a25174e 100644 --- a/nflow-explorer/src/app/workflow/workflowInfo.html +++ b/nflow-explorer/src/app/workflow/workflowInfo.html @@ -1,80 +1,55 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parent workflow{{ctrl.parentWorkflow.type}} ({{ctrl.parentWorkflow.id}})
Child workflows{{ctrl.childWorkflows.length}}
Current state - {{ctrl.workflow.state}} -
Current status{{ctrl.workflow.status}}
-
Next activation{{ctrl.workflow.nextActivation | fromNowOrNever}}
Business key{{ctrl.workflow.businessKey}}
External id{{ctrl.workflow.externalId}}
Current signal{{ctrl.workflow.signal}}
Priority{{ctrl.workflow.priority}}
Created{{ctrl.workflow.created | date:'yyyy-MM-dd HH:mm:ss'}}
Started{{ctrl.workflow.started | date:'yyyy-MM-dd HH:mm:ss'}}
Modified{{ctrl.workflow.modified | date:'yyyy-MM-dd HH:mm:ss'}}
-
-
- -
Child workflows: - {{ctrl.childWorkflows.length}} -
- Created: {{ctrl.workflow.created | date:'yyyy-MM-dd HH:mm:ss' }}
- Started: {{ctrl.workflow.started | date:'yyyy-MM-dd HH:mm:ss' }}
- Modified: {{ctrl.workflow.modified | date:'yyyy-MM-dd HH:mm:ss' }}
- Current state: {{ctrl.workflow.state}} - ({{ctrl.workflow.stateText}})
- Current status: {{ctrl.workflow.status}}
-
- Current signal: {{ctrl.workflow.signal}}
-
- Next activation: {{ctrl.workflow.nextActivation | fromNowOrNever}} -
Workflow id: {{ctrl.workflow.id}}
-
Priority: {{ctrl.workflow.priority}}
-
Business key: {{ctrl.workflow.businessKey}}
-
External id: {{ctrl.workflow.externalId}}
- -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parent workflow{{ctrl.parentWorkflow.type}} ({{ctrl.parentWorkflow.id}})
Child workflows{{ctrl.childWorkflows.length}}
Current state + {{ctrl.workflow.state}} +
Current status{{ctrl.workflow.status}}
+
Next activation{{ctrl.workflow.nextActivation | fromNowOrNever}}
Business key{{ctrl.workflow.businessKey}}
External id{{ctrl.workflow.externalId}}
Current signal{{ctrl.workflow.signal}}
Priority{{ctrl.workflow.priority}}
Created{{ctrl.workflow.created | date:'yyyy-MM-dd HH:mm:ss'}}
Started{{ctrl.workflow.started | date:'yyyy-MM-dd HH:mm:ss'}}
Modified{{ctrl.workflow.modified | date:'yyyy-MM-dd HH:mm:ss'}}
+
diff --git a/nflow-explorer/src/app/workflow/workflowInfo.js b/nflow-explorer/src/app/workflow/workflowInfo.js index a47d1011a..b0199fb53 100644 --- a/nflow-explorer/src/app/workflow/workflowInfo.js +++ b/nflow-explorer/src/app/workflow/workflowInfo.js @@ -27,7 +27,6 @@ var self = this; self.currentStateTime = currentStateTime; self.selectAction = WorkflowGraphApi.onSelectNode; - self.workflowInfoTable = config.workflowInfoTable; self.contentGenerator = config.customInstanceContent; function currentStateTime() { diff --git a/nflow-explorer/src/config.js b/nflow-explorer/src/config.js index 6907cac04..3da97d022 100644 --- a/nflow-explorer/src/config.js +++ b/nflow-explorer/src/config.js @@ -79,8 +79,4 @@ var Config = function() { // When true, hides the sticky footer with copyright this.hideFooter = false; - - // When true, workflow instance properties shown in a table - // (if needed, update your customInstanceContent to generate table rows) - this.workflowInfoTable = false; }; diff --git a/nflow-explorer/src/styles/main.scss b/nflow-explorer/src/styles/main.scss index 1edf72066..7bbf5d592 100644 --- a/nflow-explorer/src/styles/main.scss +++ b/nflow-explorer/src/styles/main.scss @@ -259,24 +259,28 @@ ul.listing { cursor: pointer; } -#workflow-properties tr:nth-child(even) { +.workflow-properties tr:nth-child(even) { background-color: #f2f2f2; } -#workflow-properties tr:hover { +.workflow-properties tr:hover { background-color: #ddd; } -#workflow-properties td:first-child { +.workflow-properties td:first-child { font-weight: bold; } -#workflow-properties td { +.workflow-properties th { + background-color: #d9d9d9; +} + +.workflow-properties td, .workflow-properties th { border: 1px solid #ddd; padding: 8px; } -#workflow-properties code { +.workflow-properties code { color: black; background-color: transparent; } From 55dd7437af4493333d8aa23cf979304fb16bb0d5 Mon Sep 17 00:00:00 2001 From: Esa Puttonen Date: Mon, 8 Feb 2021 09:58:18 +0200 Subject: [PATCH 8/8] Replace nflow_logo.svg reference (now inside layout.js) to cache-busted (created by filerev) version --- nflow-explorer/Gruntfile.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nflow-explorer/Gruntfile.js b/nflow-explorer/Gruntfile.js index 2662cc860..bf515bcf9 100644 --- a/nflow-explorer/Gruntfile.js +++ b/nflow-explorer/Gruntfile.js @@ -236,8 +236,14 @@ module.exports = function (grunt) { usemin: { html: ['<%= yeoman.dist %>/**/*.html'], css: ['<%= yeoman.dist %>/styles/{,*/}*.css'], + js: ['<%= yeoman.dist %>/**/*.js'], options: { - assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images'] + assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images'], + patterns: { + js: [ + [/(nflow_logo\.svg)/, 'Replacing reference to nflow_logo.svg'] + ] + } } },