Skip to content

Commit

Permalink
Merge pull request finos#6804 from deutschebank/db-contrib/waltz-6800…
Browse files Browse the repository at this point in the history
…-actor-assessments

actor assessments
  • Loading branch information
davidwatkins73 authored Oct 12, 2023
2 parents 5206eda + 5ddf9bd commit 9f14174
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 41 deletions.
78 changes: 43 additions & 35 deletions waltz-ng/client/actor/components/actor-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,64 @@
~
-->

<div>
<div class="row">
<div class="col-sm-2">
<label>
Name
</label>
</div>
<div class="col-sm-6">
<div class="row">
<div class="col-md-7">
<div class="row">
<div class="col-sm-2">
<label>
Name
</label>
</div>
<div class="col-sm-6">
<span ng-bind="$ctrl.actor.name">
</span>
</div>
</div>
</div>

<div class="row">
<div class="col-sm-2">
<label>
Description
</label>
</div>
<div class="col-sm-10">
<waltz-svelte-component component="$ctrl.Markdown"
text="$ctrl.actor.description">
</waltz-svelte-component>
<div class="row">
<div class="col-sm-2">
<label>
Description
</label>
</div>
<div class="col-sm-10">
<waltz-svelte-component component="$ctrl.Markdown"
text="$ctrl.actor.description">
</waltz-svelte-component>
</div>
</div>
</div>

<div class="row">
<div class="col-sm-2">
<label>
External Id
</label>
</div>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-2">
<label>
External Id
</label>
</div>
<div class="col-sm-10">
<span style="font-family: monospace"
ng-bind="$ctrl.actor.externalId || '-'">
</span>
</div>
</div>
</div>


<div class="row">
<div class="col-sm-2">
<label>
Provenance
</label>
</div>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-2">
<label>
Provenance
</label>
</div>
<div class="col-sm-10">
<span ng-bind="$ctrl.actor.provenance">
</span>
</div>
</div>
</div>

<div class="col-md-5">
<!-- Assessment Ratings -->
<waltz-assessment-rating-sub-section parent-entity-ref="$ctrl.parentEntityRef">
</waltz-assessment-rating-sub-section>
</div>

</div>
2 changes: 1 addition & 1 deletion waltz-ng/client/actor/components/actor-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function controller() {

vm.$onChanges = (changes) => {
if (vm.actor) {
vm.entityRef = {
vm.parentEntityRef = {
kind: "ACTOR",
id: vm.actor.id
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {resolveResponses} from "../../../common/promise-utils";


const bindings = {
parentEntityRef: "<"
parentEntityRef: "<?"
};

const initialState = {
Expand Down Expand Up @@ -72,9 +72,11 @@ function controller($q, serviceBroker) {
};


vm.$onInit = () => {
loadAll();
vm.useExternalEditorPage = _.includes(["CHANGE_UNIT"], vm.parentEntityRef.kind);
vm.$onChanges = () => {
if (vm.parentEntityRef) {
loadAll();
vm.useExternalEditorPage = _.includes(["CHANGE_UNIT"], vm.parentEntityRef.kind);
}
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<div class="col-md-12">
<waltz-section-actions>
<button waltz-has-role="{{ctrl.definition.permittedRole}}"
ng-if="ctrl.allowBulkEditing"
class="btn btn-xs btn-primary"
ui-sref="main.assessment-definition.edit ({id: ctrl.definition.id})">
Bulk Edit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const ratingCellTemplate = `


const initialState = {
allowBulkEditing: false,
columnDefs: [
mkEntityLinkGridCell("Entity", "entityRef", "none", "right"),
{
Expand All @@ -49,6 +50,7 @@ const initialState = {
]
};

const bulkEditableKinds = ["APPLICATION"];

function controller($q,
$stateParams,
Expand All @@ -65,7 +67,10 @@ function controller($q,
const loadAll = () => {
serviceBroker
.loadViewData(CORE_API.AssessmentDefinitionStore.getById, [definitionId])
.then(r => vm.definition = r.data);
.then(r => {
vm.definition = r.data;
vm.allowBulkEditing = _.includes(bulkEditableKinds, vm.definition.entityKind);
});

const ratingSchemePromise = serviceBroker
.loadViewData(CORE_API.RatingSchemeStore.findRatingsSchemeItems, [definitionId])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ const appSections = [

const actorSections = [
appsSection,
assessmentRatingSection,
bookmarksSection,
changeInitiativeSection,
dataFlowSection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function getRequiredFields(d) {
}

export const possibleAssessmentKinds = [
{value: "ACTOR", name: "Actor", qualifierKind: null},
{value: "APPLICATION", name: "Application", qualifierKind: null},
{value: "CHANGE_INITIATIVE", name: "Change Initiative", qualifierKind: null},
{value: "CHANGE_SET", name: "Change Set", qualifierKind: null},
Expand Down

0 comments on commit 9f14174

Please sign in to comment.