diff --git a/waltz-ng/client/involvement/components/involved-people-section.js b/waltz-ng/client/involvement/components/involved-people-section.js index 06202765ce..7394e713e5 100644 --- a/waltz-ng/client/involvement/components/involved-people-section.js +++ b/waltz-ng/client/involvement/components/involved-people-section.js @@ -184,7 +184,6 @@ function controller($q, displayNameService, descriptionService, serviceBroker, i .filter(d => d.direction === "EXACT") .value(); applyFilters(); - console.log({raw: vm.rawGridData, curr: vm.currentInvolvements}) }); }; diff --git a/waltz-ng/client/measurable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.html b/waltz-ng/client/measurable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.html deleted file mode 100644 index 6b7611f146..0000000000 --- a/waltz-ng/client/measurable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.html +++ /dev/null @@ -1,18 +0,0 @@ -
- - - - - - To: - - - Into: - - - - - -
\ No newline at end of file diff --git a/waltz-ng/client/measurable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.js b/waltz-ng/client/measurable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.js deleted file mode 100644 index 4b0a2a53fb..0000000000 --- a/waltz-ng/client/measurable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.js +++ /dev/null @@ -1,31 +0,0 @@ -import template from "./taxonomy-change-summary-cell.html"; -import {initialiseData} from "../../../common"; - - -const initialState = {}; - -const bindings = { - change: "<" -}; - - -function controller(serviceBroker) { - const vm = initialiseData(this, initialState); -} - - -controller.$inject = [ - "ServiceBroker" -]; - - -const component = { - bindings, - controller, - template -}; - -export default { - id: "waltzTaxonomyChangeSummaryCell", - component -}; diff --git a/waltz-ng/client/measurable-category/components/taxonomy-changes/taxonomy-changes-section.js b/waltz-ng/client/measurable-category/components/taxonomy-changes/taxonomy-changes-section.js index eaf44cecbb..d794cdfda1 100644 --- a/waltz-ng/client/measurable-category/components/taxonomy-changes/taxonomy-changes-section.js +++ b/waltz-ng/client/measurable-category/components/taxonomy-changes/taxonomy-changes-section.js @@ -15,13 +15,11 @@ const initialState = { }, mkEntityLinkGridCell("Entity", "primaryReference", "none", "right"), { - field: "params", - displayName: "Parameters", - cellTemplate: ` -
- - -
` + field: "value", + displayName: "Value" + }, { + field: "originalValue", + displayName: "Original Value" }, { field: "lastUpdatedBy", displayName: "Updated By", @@ -29,7 +27,11 @@ const initialState = { }, { field: "lastUpdatedAt", displayName: "Updated At", - cellTemplate: "
" + cellTemplate: ` +
+ + +
` } ] }; @@ -40,6 +42,52 @@ const bindings = { }; +function determineValue(change) { + const params = change.params; + switch (change.changeType) { + case "ADD_CHILD": + return params.name; + case "UPDATE_NAME": + return params.name; + case "UPDATE_DESCRIPTION": + return params.description; + case "UPDATE_CONCRETENESS": + return params.concrete; + case "UPDATE_EXTERNAL_ID": + return params.externalId; + case "MOVE": + return `To: ${params.destinationName}`; + case "MERGE": + return `Into: ${params.targetName}`; + case "REORDER_SIBLINGS": + return params.listAsNames; + default: + return "-"; + } +} + + +function determineOriginalValue(change) { + const params = change.params; + const orig = params.originalValue || "-"; + switch (change.changeType) { + case "MOVE": + return `From: ${orig}`; + default: + return orig; + } +} + + +function mkValueAndOriginalValueProps(change) { + + return { + value: determineValue(change), + originalValue: determineOriginalValue(change) + }; +} + + function controller(serviceBroker) { const vm = initialiseData(this, initialState); @@ -52,11 +100,21 @@ function controller(serviceBroker) { .then(r => vm.items = _ .chain(r.data) .filter(d => d.status === "EXECUTED") + .map(d => { + return Object.assign( + { + changeType: d.changeType, + primaryReference: d.primaryReference, + lastUpdatedBy: d.lastUpdatedBy, + lastUpdatedAt: d.lastUpdatedAt, + params: d.params + }, + mkValueAndOriginalValueProps(d)); + }) .orderBy( [d => d.lastUpdatedAt, d => d.createdAt], ["desc", "desc"]) .value()); - } }; } diff --git a/waltz-ng/client/measurable-category/index.js b/waltz-ng/client/measurable-category/index.js index 461fd8273a..4b10e4c106 100644 --- a/waltz-ng/client/measurable-category/index.js +++ b/waltz-ng/client/measurable-category/index.js @@ -20,7 +20,6 @@ import angular from "angular"; import CategoryStore from "./services/measurable-category-store"; import TaxonomyChangesSection from "./components/taxonomy-changes/taxonomy-changes-section" -import TaxonomyChangeSummaryCell from "./components/taxonomy-change-summary-cell/taxonomy-change-summary-cell" import Routes from "./routes"; import {registerComponents, registerStores} from "../common/module-utils"; @@ -32,8 +31,7 @@ export default () => { registerComponents( module, [ - TaxonomyChangesSection, - TaxonomyChangeSummaryCell + TaxonomyChangesSection ]); module.config(Routes); diff --git a/waltz-ng/client/measurable/components/change-control/measurable-change-control.js b/waltz-ng/client/measurable/components/change-control/measurable-change-control.js index f70e914f2b..36a3fbf5ad 100644 --- a/waltz-ng/client/measurable/components/change-control/measurable-change-control.js +++ b/waltz-ng/client/measurable/components/change-control/measurable-change-control.js @@ -130,7 +130,8 @@ function controller($scope, }, onChange: () => { vm.submitDisabled = vm.commandParams.name === vm.measurable.name; - } + }, + paramProcessor: (d) => Object.assign(d, {originalValue: vm.measurable.name}) }, { name: "Description", code: "UPDATE_DESCRIPTION", @@ -143,7 +144,8 @@ function controller($scope, }, onChange: () => { vm.submitDisabled = vm.commandParams.description === vm.measurable.description; - } + }, + paramProcessor: (d) => Object.assign(d, {originalValue: vm.measurable.description}) }, { name: "Concrete", code: "UPDATE_CONCRETENESS", @@ -157,7 +159,8 @@ function controller($scope, resetForm({ concrete: !vm.measurable.concrete }); vm.submitDisabled = false; calcPreview(); - } + }, + paramProcessor: (d) => Object.assign(d, {originalValue: vm.measurable.concrete}) }, { name: "External Id", code: "UPDATE_EXTERNAL_ID", @@ -171,7 +174,8 @@ function controller($scope, }, onChange: () => { vm.submitDisabled = vm.commandParams.externalId === vm.measurable.externalId; - } + }, + paramProcessor: (d) => Object.assign(d, {originalValue: vm.measurable.externalId}) }, { name: "Move", code: "MOVE", @@ -197,6 +201,7 @@ function controller($scope, resetForm(); }, paramProcessor: (d) => ({ + originalValue: vm.parent.name, destinationId: d.destination.id, destinationName: d.destination.name }) @@ -221,7 +226,9 @@ function controller($scope, }, paramProcessor: (commandParams) => { return { - list: JSON.stringify(_.map(commandParams.list, d => d.id)) + originalValue: JSON.stringify(_.map(vm.siblings, d => d.name)), + list: JSON.stringify(_.map(commandParams.list, d => d.id)), + listAsNames: JSON.stringify(_.map(commandParams.list, d => d.name)) } } }