Skip to content

Commit 3d84d27

Browse files
Pull request #653: Integration/maker checker workflow
Merge in WALTZ/waltz from integration/maker-checker-workflow to db-feature/waltz-7440-propose-flow-enhancements-and-bug-fixes * commit '597ed657338774e637c365850af5a4610b0a9b9e': minor refactor for code readability removed lock from initiateAction and added reset store for propose delete incorporated review comments minor refactor modification of code readability small refactor small refactor added negative integration test case small refactor added positive integration test case for propose flow actions fixed disable button for existing flow in create,edit and delete propose flow minor style change to fix the column header while scrolling minor refactor revert previous change minor refactor for changing header of help panel on create propose flow screen sort data based on last updated for historical tab modified basis offset format on approve/reject screen removed restore button on logical flow screen when maker checker enabled
2 parents 9a96607 + 597ed65 commit 3d84d27

11 files changed

Lines changed: 383 additions & 106 deletions

File tree

waltz-integration-test/src/test/java/org/finos/waltz/integration_test/inmem/service/ProposedFlowWorkflowServiceTest.java

Lines changed: 266 additions & 92 deletions
Large diffs are not rendered by default.

waltz-ng/client/common/svelte/GridWithCellRenderer.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
<div class="row">
6767
<div class="col-sm-12">
68-
<div class={_.size(rowData) > 6 ? "waltz-scroll-region-300" : ""}>
68+
<div class={_.size(rowData) > 6 ? "waltz-scroll-region-300" : ""} style="padding: 0">
6969
<table class="table table-condensed table-hover small fixed-table">
7070
<colgroup>
7171
{#each columnDefs as col}
@@ -119,4 +119,11 @@
119119
.searching {
120120
color: deepskyblue;
121121
}
122+
123+
thead th {
124+
position: sticky;
125+
top: 0;
126+
background-color: white;
127+
z-index: 1;
128+
}
122129
</style>

waltz-ng/client/data-flow/components/svelte/propose-data-flow/ProposeDataFlowView.svelte

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
$: logicalFlowCall = targetLogicalFlowId ? logicalFlowStore.getById(targetLogicalFlowId) : null;
5353
$: $logicalFlow = logicalFlowCall ? $logicalFlowCall.data : null;
5454
55+
$: $logicalFlow || $physicalFlow || $physicalSpecification ||$dataTypes, resetDuplicateState();
56+
57+
function resetDuplicateState() {
58+
if ($duplicateProposeFlowMessage) {
59+
$duplicateProposeFlowMessage = null;
60+
$existingProposeFlowId = null;
61+
}
62+
}
63+
64+
5565
function goToWorkflow(proposedFlowId) {
5666
$pageInfo = {
5767
state: "main.proposed-flow.view",
@@ -138,7 +148,7 @@
138148

139149
<span>
140150
<button class="btn btn-success"
141-
disabled={incompleteRecord || commandLaunched}
151+
disabled={incompleteRecord || commandLaunched || $duplicateProposeFlowMessage}
142152
on:click={() => launchCommand()}>
143153
Propose
144154
</button>

waltz-ng/client/data-flow/components/svelte/user-dashboard/ProposedFlowSection.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ $: filteredGridData = gridData
145145
.filter(d => ($filters.state.length === 0) || $filters.state.includes(d.workflowState.state))
146146
.filter(d => ($filters.change.length === 0) || $filters.change.includes(d.flowDef.proposalType))
147147
.filter(d => ($filters.proposer.length === 0) || $filters.proposer.includes(d.createdBy === userName ? "USER" : "OTHERS"))
148+
.sort((a, b) => new Date(b.workflowState.lastUpdatedAt) - new Date(a.workflowState.lastUpdatedAt))
148149
.sort((a, b) => $filters.state.indexOf(a.workflowState.state) - $filters.state.indexOf(b.workflowState.state))
149150
.sort((a, b) => $filters.change.indexOf(a.flowDef.proposalType) - $filters.change.indexOf(b.flowDef.proposalType))
150151
.sort((a, b) => $filters.proposer.indexOf(a.createdBy === userName ? "USER" : "OTHERS")

waltz-ng/client/data-types/components/usage-panel/ReasonSelection.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
5555
function cancel() {
5656
cancelProposeDeleteFlow(false);
57+
$deleteFlowReason = null;
58+
$duplicateProposeFlowMessage = null;
59+
$existingProposeFlowId = null;
5760
}
5861
5962
$: ratingSchemeCall = ratingSchemeStore.loadAll();
@@ -124,7 +127,7 @@
124127
{/if}
125128
<div style="display: flex; justify-content: flex-end;margin: 0;gap: 0.5rem">
126129
<button class="btn btn-sm btn-primary"
127-
disabled={!workingCopy?.rating?.length}>
130+
disabled={!workingCopy?.rating?.length || $existingProposeFlowId}>
128131
Submit
129132
</button>
130133
<button type="button" class="btn btn-sm" on:click={cancel}>

waltz-ng/client/data-types/components/usage-panel/data-type-usage-panel-propose-flow.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@
8484
Save
8585
</a>
8686
<a ng-if="$ctrl.dataFlowProposalsEnabled"
87-
ng-click="$ctrl.onSavePropose()"
88-
class="clickable"
89-
ng-disabled="!($ctrl.isDirty && $ctrl.isReasonSelected)">
87+
ng-click="!$ctrl.isProposeDisabled && $ctrl.isDirty && $ctrl.isReasonSelected && $ctrl.onSavePropose()" class="clickable"
88+
ng-disabled="$ctrl.isProposeDisabled || !($ctrl.isDirty && $ctrl.isReasonSelected)">
9089
Propose Edit
9190
</a>
9291
|

waltz-ng/client/data-types/components/usage-panel/data-type-usage-panel-propose-flow.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ const initialState = {
5454
isReasonSelected:false,
5555
proposalType:PROPOSAL_TYPES.EDIT,
5656
duplicateProposeFlowMessage,
57-
existingProposeFlowId
57+
existingProposeFlowId,
58+
isProposeDisabled:false
5859
};
5960

6061

@@ -79,6 +80,10 @@ function controller(serviceBroker, userService, $q) {
7980

8081
});
8182

83+
existingProposeFlowId.subscribe((value)=>{
84+
vm.isProposeDisabled = !_.isNil(value);
85+
})
86+
8287

8388
const decoratedRef = vm.parentEntityRef
8489
? vm.parentEntityRef
@@ -104,6 +109,9 @@ function controller(serviceBroker, userService, $q) {
104109

105110
vm.onHideEdit = () => {
106111
vm.visibility.editor = false;
112+
editDataTypeReason.set(null);
113+
duplicateProposeFlowMessage.set(null);
114+
existingProposeFlowId.set(null);
107115
};
108116

109117
editDataTypeReason.subscribe(value => {

waltz-ng/client/logical-flow/pages/view/logical-flow-view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
<div class="waltz-page-summary waltz-page-summary-attach">
5454
<waltz-section-actions>
55-
<button ng-if="ctrl.canRestore"
55+
<button ng-if="!ctrl.dataFlowProposalsEnabled && ctrl.canRestore"
5656
class="btn btn-xs btn-primary"
5757
uib-popover="Restore this flow, any physical flows that were active when this logical flow was removed will also be restored"
5858
popover-append-to-body="true"

waltz-ng/client/logical-flow/pages/view/logical-flow-view.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import _ from "lodash";
2626
import {displayError} from "../../../common/error-utils";
2727
import AlignedDataTypesList from "../../components/aligned-data-types-list/AlignedDataTypesList.svelte";
2828
import {copyTextToClipboard} from "../../../common/browser-utils";
29+
import {isDataFlowProposalsEnabled} from "../../../common/utils/settings-util";
2930

3031

3132
const initialState = {
@@ -38,8 +39,7 @@ const initialState = {
3839
updateCommand: {
3940
readOnly: false,
4041
},
41-
AlignedDataTypesList,
42-
dataFlowProposalsRatingSchemeSetting:null
42+
AlignedDataTypesList
4343
};
4444

4545
function controller($q,
@@ -53,7 +53,6 @@ function controller($q,
5353

5454
vm.$onInit = () => {
5555
const flowId = $stateParams.id;
56-
const DATAFLOW_PROPOSAL_SETTING_NAME="feature.data-flow-proposals.enabled";
5756

5857
vm.entityReference = {
5958
id: flowId,
@@ -98,8 +97,7 @@ function controller($q,
9897
.loadViewData(CORE_API.SettingsStore.findAll, [])
9998
.then(r => {
10099
let settings = r.data;
101-
vm.dataFlowProposalsEnabled= settings
102-
.filter(t => t.name === DATAFLOW_PROPOSAL_SETTING_NAME)[0].value === "true";
100+
vm.dataFlowProposalsEnabled = isDataFlowProposalsEnabled(settings)
103101
});
104102

105103
};

waltz-ng/client/proposed-flow/components/ProposedFlowDetails.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
import EntityLink from "../../common/svelte/EntityLink.svelte";
33
import Icon from "../../common/svelte/Icon.svelte";
44
import { safe,STATES } from "../utils";
5+
import toBasisOffsetFilter from "../../common/filters/to-basis-offset-filter";
56
67
export let proposedFlow = {};
8+
const toBasisOffsetFilterFn = toBasisOffsetFilter();
79
810
$: flowDef = proposedFlow?.flowDef || {};
911
@@ -29,7 +31,7 @@
2931
}:null,
3032
value: safe(flowDef?.flowAttributes?.name) || safe(flowDef?.specification?.name)
3133
},
32-
{ key: "Basis Offset", value: safe(flowDef?.flowAttributes?.basisOffset) },
34+
{ key: "Basis Offset", value: toBasisOffsetFilterFn(safe(flowDef?.flowAttributes?.basisOffset)) },
3335
{ key: "Criticality", value: safe(flowDef?.flowAttributes?.criticality) },
3436
{ key: "Transport", value: safe(flowDef?.flowAttributes?.transport) },
3537
{ key: "Frequency", value: safe(flowDef?.flowAttributes?.frequency) },

0 commit comments

Comments
 (0)