-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request #291: Show changes to taxonomies on the list page
Merge in WALTZ/waltz from WALTZ/waltz-dw:CTCTOWALTZ-2778-taxonomy-changes-6675 to db-feature/waltz-6675-taxonomy-changes * commit 'e81b235eec55c69c3abd97abe9c1aa7e7fc849e7': Show changes to taxonomies on the list page
- Loading branch information
Showing
16 changed files
with
460 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
waltz-ng/client/common/services/enums/taxonomy-change-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
export const taxonomyChangeType = { | ||
ADD_PEER: { | ||
key: "ADD_PEER", | ||
name: "Add Peer", | ||
icon: null, | ||
description: null, | ||
position: 10 | ||
}, | ||
ADD_CHILD: { | ||
key: "ADD_CHILD", | ||
name: "Add Child", | ||
icon: null, | ||
description: null, | ||
position: 10 | ||
}, | ||
DEPRECATE: { | ||
key: "DEPRECATE", | ||
name: "Deprecate", | ||
icon: null, | ||
description: null, | ||
position: 10 | ||
}, | ||
MOVE: { | ||
key: "MOVE", | ||
name: "Move", | ||
icon: null, | ||
description: null, | ||
position: 20 | ||
}, | ||
MERGE: { | ||
key: "MERGE", | ||
name: "Merge", | ||
icon: null, | ||
description: null, | ||
position: 20 | ||
}, | ||
REMOVE: { | ||
key: "REMOVE", | ||
name: "Remove", | ||
icon: null, | ||
description: null, | ||
position: 30 | ||
}, | ||
REORDER_SIBLINGS: { | ||
key: "REORDER_SIBLINGS", | ||
name: "Reorder Siblings", | ||
icon: null, | ||
description: null, | ||
position: 30 | ||
}, | ||
UPDATE_NAME: { | ||
key: "UPDATE_NAME", | ||
name: "Update Name", | ||
icon: null, | ||
description: null, | ||
position: 30 | ||
}, | ||
UPDATE_DESCRIPTION: { | ||
key: "UPDATE_DESCRIPTION", | ||
name: "Update Description", | ||
icon: null, | ||
description: null, | ||
position: 30 | ||
}, | ||
UPDATE_CONCRETENESS: { | ||
key: "UPDATE_CONCRETENESS", | ||
name: "Update Concreteness", | ||
icon: null, | ||
description: null, | ||
position: 30 | ||
}, | ||
UPDATE_EXTERNAL_ID: { | ||
key: "UPDATE_EXTERNAL_ID", | ||
name: "Update External ID", | ||
icon: null, | ||
description: null, | ||
position: 30 | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...urable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="ui-grid-cell-contents" | ||
ng-switch="$ctrl.change.changeType"> | ||
<span ng-switch-when="ADD_CHILD" | ||
ng-bind="$ctrl.change.params.name"> | ||
</span> | ||
<span ng-switch-when="UPDATE_DESCRIPTION" | ||
ng-bind="$ctrl.change.params.description"> | ||
</span> | ||
<span ng-switch-when="MOVE"> | ||
To: <span ng-bind="$ctrl.change.params.destinationName"></span> | ||
</span> | ||
<span ng-switch-when="MERGE"> | ||
Into: <span ng-bind="$ctrl.change.params.targetName"></span> | ||
</span> | ||
<span ng-switch-default> | ||
- | ||
</span> | ||
</div> |
31 changes: 31 additions & 0 deletions
31
...asurable-category/components/taxonomy-change-summary-cell/taxonomy-change-summary-cell.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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 | ||
}; |
29 changes: 29 additions & 0 deletions
29
...z-ng/client/measurable-category/components/taxonomy-changes/taxonomy-changes-section.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<waltz-no-data ng-if="$ctrl.items.length === 0"> | ||
<message> | ||
There are no logged changes | ||
</message> | ||
</waltz-no-data> | ||
|
||
|
||
<div class="help-block"> | ||
This section lists any formal changes against this taxonomy. | ||
These changes are ones that have been defined and applied directly in Waltz. | ||
</div> | ||
|
||
|
||
<div ng-if="$ctrl.items.length > 0"> | ||
<waltz-grid-with-search column-defs="$ctrl.columnDefs" | ||
style="min-height: 1600px" | ||
entries="$ctrl.items"> | ||
</waltz-grid-with-search> | ||
</div> | ||
|
||
|
||
<div class="pull-right"> | ||
<waltz-data-extract-link name="Export" | ||
styling="link" | ||
extract="taxonomy-changes/all-applied/{{$ctrl.parentEntityRef.kind}}/{{$ctrl.parentEntityRef.id}}" | ||
method="GET" | ||
ng-if="$ctrl.items.length > 0"> | ||
</waltz-data-extract-link> | ||
</div> |
82 changes: 82 additions & 0 deletions
82
waltz-ng/client/measurable-category/components/taxonomy-changes/taxonomy-changes-section.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import template from "./taxonomy-changes-section.html"; | ||
import {initialiseData} from "../../../common"; | ||
import {CORE_API} from "../../../common/services/core-api-utils"; | ||
import _ from "lodash"; | ||
import {mkEntityLinkGridCell} from "../../../common/grid-utils"; | ||
|
||
|
||
const initialState = { | ||
items: [], | ||
columnDefs: [ | ||
{ | ||
field: "changeType", | ||
cellFilter: "toDisplayName:'taxonomyChangeType'", | ||
width: "10%" | ||
}, | ||
mkEntityLinkGridCell("Entity", "primaryReference", "none", "right"), | ||
{ | ||
field: "params", | ||
displayName: "Parameters", | ||
cellTemplate: ` | ||
<div class="ui-grid-cell-contents"> | ||
<waltz-taxonomy-change-summary-cell change="row.entity"> | ||
</waltz-taxonomy-change-summary-cell> | ||
</div>` | ||
}, { | ||
field: "lastUpdatedBy", | ||
displayName: "Updated By", | ||
width: "10%", | ||
}, { | ||
field: "lastUpdatedAt", | ||
displayName: "Updated At", | ||
cellTemplate: "<div class=\"ui-grid-cell-contents\"><waltz-from-now timestamp=\"COL_FIELD\"></waltz-from-now></div>" | ||
} | ||
] | ||
}; | ||
|
||
|
||
const bindings = { | ||
parentEntityRef: "<" | ||
}; | ||
|
||
|
||
function controller(serviceBroker) { | ||
const vm = initialiseData(this, initialState); | ||
|
||
vm.$onInit = (c) => { | ||
if (vm.parentEntityRef) { | ||
serviceBroker | ||
.execute( | ||
CORE_API.TaxonomyManagementStore.findAllChangesByDomain, | ||
[vm.parentEntityRef]) | ||
.then(r => { | ||
vm.items = _ | ||
.chain(r.data) | ||
.filter(d => d.status === "EXECUTED") | ||
.orderBy( | ||
[d => d.lastUpdatedAt, d => d.createdAt], | ||
["desc", "desc"]) | ||
.value(); | ||
console.log(vm.items) | ||
}); | ||
|
||
} | ||
}; | ||
} | ||
|
||
|
||
controller.$inject = [ | ||
"ServiceBroker" | ||
]; | ||
|
||
|
||
const component = { | ||
bindings, | ||
controller, | ||
template | ||
}; | ||
|
||
export default { | ||
id: "waltzTaxonomyChangesSection", | ||
component | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.