Skip to content

Commit

Permalink
Merge pull request #7004 from deutschebank/db-contrib/waltz-6908-add-…
Browse files Browse the repository at this point in the history
…assessments-to-inv-kinds

Db contrib/waltz 6908 add assessments to inv kinds
  • Loading branch information
davidwatkins73 authored Feb 23, 2024
2 parents f5560f9 + 43e74f5 commit 7945a1e
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,27 @@ private static Map<EntityKind, Tuple3<Table, Field<Long>, Field<String>>> mkName
mappings.put(EntityKind.APPLICATION, tuple(APPLICATION, APPLICATION.ID, APPLICATION.NAME));
mappings.put(EntityKind.APP_GROUP, tuple(APPLICATION_GROUP, APPLICATION_GROUP.ID, APPLICATION_GROUP.NAME));
mappings.put(EntityKind.CHANGE_INITIATIVE, tuple(CHANGE_INITIATIVE, CHANGE_INITIATIVE.ID, CHANGE_INITIATIVE.NAME));
mappings.put(EntityKind.CHANGE_SET, tuple(CHANGE_SET, CHANGE_SET.ID, CHANGE_SET.NAME));
mappings.put(EntityKind.DATA_TYPE, tuple(DATA_TYPE, DATA_TYPE.ID, DATA_TYPE.NAME));
mappings.put(EntityKind.FLOW_DIAGRAM, tuple(FLOW_DIAGRAM, FLOW_DIAGRAM.ID, FLOW_DIAGRAM.NAME));
mappings.put(EntityKind.END_USER_APPLICATION, tuple(END_USER_APPLICATION, END_USER_APPLICATION.ID, END_USER_APPLICATION.NAME));
mappings.put(EntityKind.ENTITY_RELATIONSHIP, tuple(ENTITY_RELATIONSHIP, ENTITY_RELATIONSHIP.ID, DSL.val("Entity Relationship")));
mappings.put(EntityKind.ENTITY_STATISTIC, tuple(ENTITY_STATISTIC_DEFINITION, ENTITY_STATISTIC_DEFINITION.ID, ENTITY_STATISTIC_DEFINITION.NAME));
mappings.put(EntityKind.FLOW_CLASSIFICATION_RULE, tuple(FLOW_CLASSIFICATION_RULE, FLOW_CLASSIFICATION_RULE.ID, DSL.val("Flow Classification Rule")));
mappings.put(EntityKind.FLOW_DIAGRAM, tuple(FLOW_DIAGRAM, FLOW_DIAGRAM.ID, FLOW_DIAGRAM.NAME));
mappings.put(EntityKind.INVOLVEMENT_KIND, tuple(INVOLVEMENT_KIND, INVOLVEMENT_KIND.ID, INVOLVEMENT_KIND.NAME));
mappings.put(EntityKind.LEGAL_ENTITY, tuple(LEGAL_ENTITY, LEGAL_ENTITY.ID, LEGAL_ENTITY.NAME));
mappings.put(EntityKind.LEGAL_ENTITY_RELATIONSHIP, tuple(LEGAL_ENTITY_RELATIONSHIP, LEGAL_ENTITY_RELATIONSHIP.ID, DSL.val("Legal Entity Relationship")));
mappings.put(EntityKind.LICENCE, tuple(LICENCE, LICENCE.ID, LICENCE.NAME));
mappings.put(EntityKind.LOGICAL_DATA_FLOW, tuple(LOGICAL_FLOW, LOGICAL_FLOW.ID, DSL.val("Logical Flow")));
mappings.put(EntityKind.MEASURABLE, tuple(MEASURABLE, MEASURABLE.ID, MEASURABLE.NAME));
mappings.put(EntityKind.MEASURABLE_RATING, tuple(MEASURABLE_RATING, MEASURABLE_RATING.ID, DSL.val("Measurable Rating")));
mappings.put(EntityKind.MEASURABLE_CATEGORY, tuple(MEASURABLE_CATEGORY, MEASURABLE_CATEGORY.ID, MEASURABLE_CATEGORY.NAME));
mappings.put(EntityKind.ORG_UNIT, tuple(ORGANISATIONAL_UNIT, ORGANISATIONAL_UNIT.ID, ORGANISATIONAL_UNIT.NAME));
mappings.put(EntityKind.PERSON, tuple(PERSON, PERSON.ID, PERSON.DISPLAY_NAME));
mappings.put(EntityKind.PHYSICAL_FLOW, tuple(PHYSICAL_FLOW, PHYSICAL_FLOW.ID, DSL.val("Physical Flow")));
mappings.put(EntityKind.PHYSICAL_SPECIFICATION, tuple(PHYSICAL_SPECIFICATION, PHYSICAL_SPECIFICATION.ID, PHYSICAL_SPECIFICATION.NAME));
mappings.put(EntityKind.SERVER, tuple(SERVER_INFORMATION, SERVER_INFORMATION.ID, SERVER_INFORMATION.HOSTNAME));
mappings.put(EntityKind.LICENCE, tuple(LICENCE, LICENCE.ID, LICENCE.NAME));
mappings.put(EntityKind.SOFTWARE, tuple(SOFTWARE_PACKAGE, SOFTWARE_PACKAGE.ID, SOFTWARE_PACKAGE.NAME));
return mappings;
}

Expand All @@ -142,15 +149,18 @@ private static Map<EntityKind,Tuple3<Table,Field<Long>,Field<String>>> mkExterna
mappings.put(EntityKind.ACTOR, tuple(ACTOR, ACTOR.ID, ACTOR.EXTERNAL_ID));
mappings.put(EntityKind.APPLICATION, tuple(APPLICATION, APPLICATION.ID, APPLICATION.ASSET_CODE));
mappings.put(EntityKind.CHANGE_INITIATIVE, tuple(CHANGE_INITIATIVE, CHANGE_INITIATIVE.ID, CHANGE_INITIATIVE.EXTERNAL_ID));
mappings.put(EntityKind.CHANGE_SET, tuple(CHANGE_SET, CHANGE_SET.ID, CHANGE_SET.EXTERNAL_ID));
mappings.put(EntityKind.DATA_TYPE, tuple(DATA_TYPE, DATA_TYPE.ID, DATA_TYPE.CODE));
mappings.put(EntityKind.END_USER_APPLICATION, tuple(END_USER_APPLICATION, END_USER_APPLICATION.ID, END_USER_APPLICATION.EXTERNAL_ID));
mappings.put(EntityKind.LOGICAL_DATA_FLOW, tuple(LOGICAL_FLOW, LOGICAL_FLOW.ID, LOGICAL_FLOW.EXTERNAL_ID));
mappings.put(EntityKind.LEGAL_ENTITY, tuple(LEGAL_ENTITY, LEGAL_ENTITY.ID, LEGAL_ENTITY.EXTERNAL_ID));
mappings.put(EntityKind.MEASURABLE, tuple(MEASURABLE, MEASURABLE.ID, MEASURABLE.EXTERNAL_ID));
mappings.put(EntityKind.MEASURABLE_CATEGORY, tuple(MEASURABLE_CATEGORY, MEASURABLE_CATEGORY.ID, MEASURABLE_CATEGORY.EXTERNAL_ID));
mappings.put(EntityKind.PERSON, tuple(PERSON, PERSON.ID, PERSON.EMPLOYEE_ID));
mappings.put(EntityKind.PHYSICAL_FLOW, tuple(PHYSICAL_FLOW, PHYSICAL_FLOW.ID, PHYSICAL_FLOW.EXTERNAL_ID));
mappings.put(EntityKind.PHYSICAL_SPECIFICATION, tuple(PHYSICAL_SPECIFICATION, PHYSICAL_SPECIFICATION.ID, PHYSICAL_SPECIFICATION.EXTERNAL_ID));
mappings.put(EntityKind.SERVER, tuple(SERVER_INFORMATION, SERVER_INFORMATION.ID, SERVER_INFORMATION.EXTERNAL_ID));
mappings.put(EntityKind.SOFTWARE, tuple(SOFTWARE_PACKAGE, SOFTWARE_PACKAGE.ID, SOFTWARE_PACKAGE.EXTERNAL_ID));
return mappings;
}

Expand Down
21 changes: 21 additions & 0 deletions waltz-ng/client/dynamic-section/dynamic-section-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*
*/
import BookmarkPanel from "../bookmarks/svelte/BookmarkPanel.svelte";
import InvolvementsSection from "../involvement-kind/components/svelte/InvolvementsSection.svelte";


const appsSection = {
Expand Down Expand Up @@ -462,6 +463,15 @@ const dataTypeDecoratorSection = {
id: 10040,
};

const involvementsSection = {
svelteComponent: InvolvementsSection,
componentId: "involvements-section",
name: "Involvements",
icon: "users",
description: "Involvements for this involvement kind",
id: 10050,
};


export const dynamicSections = {
appCostsSection,
Expand Down Expand Up @@ -490,6 +500,7 @@ export const dynamicSections = {
entityStatisticSummarySection,
flowSpecDefinitionSection,
involvedPeopleSection,
involvementsSection,
legalEntitySection,
legalEntityRelationshipKindSection,
licenceSection,
Expand Down Expand Up @@ -753,6 +764,15 @@ const flowDiagramSections = [
changeLogSection
];


const involvementKindSections = [
assessmentRatingSection,
bookmarksSection,
entityNamedNotesSection,
involvementsSection,
changeLogSection
];

const processDiagramSections = [
pack(appsSection,
[
Expand Down Expand Up @@ -898,6 +918,7 @@ export const dynamicSectionsByKind = {
"main.entity-relationship.view": entityRelationshipSections,
"main.flow-classification-rule.view": flowClassificationRuleSections,
"main.flow-diagram.view": flowDiagramSections,
"main.involvement-kind.view": involvementKindSections,
"main.legal-entity.view": legalEntitySections,
"main.legal-entity-relationship.view": legalEntityRelationshipSections,
"main.legal-entity-relationship-kind.view": legalEntityRelationshipKindSections,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,24 @@
import {involvementKindStore} from "../../../svelte-stores/involvement-kind-store";
import ViewLink from "../../../common/svelte/ViewLink.svelte";
import PageHeader from "../../../common/svelte/PageHeader.svelte";
import InvolvementListPanel from "./InvolvementListPanel.svelte";
import InvolvementKindOverview from "./InvolvementKindOverview.svelte";
import BulkInvolvementLoader from "./BulkInvolvementLoader.svelte";
import AssessmentFavouritesList
from "../../../assessments/components/favourites-list/AssessmentFavouritesList.svelte";
import {activeSections} from "../../../dynamic-section/section-store";
import {dynamicSections} from "../../../dynamic-section/dynamic-section-definitions";
import SubSection from "../../../common/svelte/SubSection.svelte";
export let parentEntityRef;
const Modes = {
VIEW: "VIEW",
BULK_UPLOAD: "BULK_UPLOAD"
}
let activeMode = Modes.VIEW;
let involvementKindCall;
$: involvementKindCall = involvementKindStore.getById(parentEntityRef.id);
$: involvementKind = $involvementKindCall?.data;
function reload(id) {
involvementKindCall = involvementKindStore.getById(id, true);
}
function bulkUpdate() {
activeMode = Modes.VIEW;
return reload(parentEntityRef.id)
}
</script>
<PageHeader icon="id-badge"
Expand All @@ -54,47 +46,28 @@
<div class="waltz-page-summary waltz-page-summary-attach">
<div class="waltz-display-section">
<InvolvementKindOverview {involvementKind} {reload}/>
</div>
</div>
<br>
<div class="waltz-section">
<div class="waltz-section-header">
<div class="waltz-section-header-title">
Involvements
</div>
</div>
<div class="container-fluid waltz-section-body">
<div class="waltz-section-actions">
{#if activeMode === Modes.VIEW}
<button class="btn btn-xs btn-default"
on:click={() => activeMode = Modes.BULK_UPLOAD}>
Bulk Insert
</button>
{:else}
<button class="btn btn-xs btn-default"
on:click={() => activeMode = Modes.VIEW}>
Cancel
</button>
{/if}
</div>
<div class="row">
<div class="col-sm-12">
{#if activeMode === Modes.VIEW}
<InvolvementListPanel {involvementKind}/>
{:else if activeMode === Modes.BULK_UPLOAD}
<BulkInvolvementLoader {involvementKind}
onSave={bulkUpdate}/>
{/if}
<div class="col-md-6">
<InvolvementKindOverview {involvementKind} {reload}/>
</div>
<div class="col-md-6">
<SubSection>
<div slot="header">
Assessments
</div>
<div slot="content">
<AssessmentFavouritesList/>
</div>
<div slot="controls">
<div style="float: right; padding-top: 1px">
<button class="btn-link"
on:click={() => activeSections.add(dynamicSections.assessmentRatingSection)}>
More
</button>
</div>
</div>
</SubSection>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script>
import InvolvementListPanel from "./InvolvementListPanel.svelte";
import BulkInvolvementLoader from "./BulkInvolvementLoader.svelte";
import {involvementKindStore} from "../../../svelte-stores/involvement-kind-store";
export let primaryEntityRef;
let involvementKind;
let involvementKindCall;
const Modes = {
VIEW: "VIEW",
BULK_UPLOAD: "BULK_UPLOAD"
}
let activeMode = Modes.VIEW;
function bulkUpdate() {
activeMode = Modes.VIEW;
return reload(primaryEntityRef.id)
}
function reload(id) {
involvementKindCall = involvementKindStore.getById(id, true);
}
$: involvementKindCall = involvementKindStore.getById(primaryEntityRef.id);
$: involvementKind = $involvementKindCall?.data;
</script>
<div class="waltz-section-actions">
{#if activeMode === Modes.VIEW}
<button class="btn btn-xs btn-default"
on:click={() => activeMode = Modes.BULK_UPLOAD}>
Bulk Insert
</button>
{:else}
<button class="btn btn-xs btn-default"
on:click={() => activeMode = Modes.VIEW}>
Cancel
</button>
{/if}
</div>
<div class="row">
<div class="col-sm-12">
{#if activeMode === Modes.VIEW}
<InvolvementListPanel {involvementKind}/>
{:else if activeMode === Modes.BULK_UPLOAD}
<BulkInvolvementLoader {involvementKind}
onSave={bulkUpdate}/>
{/if}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
<waltz-svelte-component component="$ctrl.InvolvementKindPanel"
parent-entity-ref="$ctrl.primaryEntityRef">
</waltz-svelte-component>

<br>

<waltz-dynamic-sections-view parent-entity-ref="$ctrl.primaryEntityRef">
</waltz-dynamic-sections-view>
</div>
Loading

0 comments on commit 7945a1e

Please sign in to comment.