From c4a7b4a6b2b3cd814c8ff910386e17ca2dfddd69 Mon Sep 17 00:00:00 2001 From: "david.watkins@db.com" Date: Wed, 10 Apr 2024 13:31:54 +0100 Subject: [PATCH 1/6] Allowing EUDA's to be seen in flow views and tables - Added to lots of selector factories - FlowDao includes End User Apps in name field #CTCTOWALTZ-3136 #7047 --- .../change_unit/ChangeUnitIdSelectorFactory.java | 3 ++- .../waltz/data/logical_flow/LogicalFlowDao.java | 8 ++++---- .../LogicalFlowIdSelectorFactory.java | 16 ++++++++++------ .../PhysicalFlowIdSelectorFactory.java | 1 + .../PhysicalSpecificationIdSelectorFactory.java | 5 +++-- waltz-ng/client/common/selector-utils.js | 1 + .../data_type/DataTypeDecoratorService.java | 4 ++-- .../FlowClassificationRuleService.java | 1 + 8 files changed, 24 insertions(+), 15 deletions(-) diff --git a/waltz-data/src/main/java/org/finos/waltz/data/change_unit/ChangeUnitIdSelectorFactory.java b/waltz-data/src/main/java/org/finos/waltz/data/change_unit/ChangeUnitIdSelectorFactory.java index 72104987f5..49ef005b89 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/change_unit/ChangeUnitIdSelectorFactory.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/change_unit/ChangeUnitIdSelectorFactory.java @@ -46,7 +46,8 @@ public Select> apply(IdSelectionOptions options) { switch(options.entityReference().kind()) { case ACTOR: case APPLICATION: - // all physical flows where the app is a source or target + case END_USER_APPLICATION: + // all physical flows where the node is a source or target return mkForFlowEndpoint(options); case ALL: case APP_GROUP: diff --git a/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowDao.java b/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowDao.java index d43a03d6e1..062f4854ef 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowDao.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowDao.java @@ -85,23 +85,23 @@ public class LogicalFlowDao { private static final Field SOURCE_NAME_FIELD = InlineSelectFieldFactory.mkNameField( LOGICAL_FLOW.SOURCE_ENTITY_ID, LOGICAL_FLOW.SOURCE_ENTITY_KIND, - newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR)); + newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR, EntityKind.END_USER_APPLICATION)); private static final Field TARGET_NAME_FIELD = InlineSelectFieldFactory.mkNameField( LOGICAL_FLOW.TARGET_ENTITY_ID, LOGICAL_FLOW.TARGET_ENTITY_KIND, - newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR)); + newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR, EntityKind.END_USER_APPLICATION)); private static final Field SOURCE_EXTERNAL_ID_FIELD = InlineSelectFieldFactory.mkExternalIdField( LOGICAL_FLOW.SOURCE_ENTITY_ID, LOGICAL_FLOW.SOURCE_ENTITY_KIND, - newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR)); + newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR, EntityKind.END_USER_APPLICATION)); private static final Field TARGET_EXTERNAL_ID_FIELD = InlineSelectFieldFactory.mkExternalIdField( LOGICAL_FLOW.TARGET_ENTITY_ID, LOGICAL_FLOW.TARGET_ENTITY_KIND, - newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR)); + newArrayList(EntityKind.APPLICATION, EntityKind.ACTOR, EntityKind.END_USER_APPLICATION)); public static final RecordMapper TO_DOMAIN_MAPPER = r -> { diff --git a/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowIdSelectorFactory.java b/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowIdSelectorFactory.java index 2a127f1196..1d798eb351 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowIdSelectorFactory.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowIdSelectorFactory.java @@ -18,6 +18,7 @@ package org.finos.waltz.data.logical_flow; +import org.finos.waltz.model.EntityReference; import org.finos.waltz.schema.tables.Application; import org.finos.waltz.data.IdSelectorFactory; import org.finos.waltz.data.SelectorUtilities; @@ -62,7 +63,8 @@ public Select> apply(IdSelectionOptions options) { checkNotNull(options, "options cannot be null"); switch (options.entityReference().kind()) { case ACTOR: - return mkForActor(options); + case END_USER_APPLICATION: + return mkForSpecificNode(options); case ALL: case APPLICATION: case APP_GROUP: @@ -93,14 +95,16 @@ public Select> apply(IdSelectionOptions options) { } } - private Select> mkForActor(IdSelectionOptions options) { + + private Select> mkForSpecificNode(IdSelectionOptions options) { SelectorUtilities.ensureScopeIsExact(options); + EntityReference ref = options.entityReference(); - Condition sourceCondition = LOGICAL_FLOW.SOURCE_ENTITY_ID.eq(options.entityReference().id()) - .and(LOGICAL_FLOW.SOURCE_ENTITY_KIND.eq(EntityKind.ACTOR.name())); + Condition sourceCondition = LOGICAL_FLOW.SOURCE_ENTITY_ID.eq(ref.id()) + .and(LOGICAL_FLOW.SOURCE_ENTITY_KIND.eq(ref.kind().name())); - Condition targetCondition = LOGICAL_FLOW.TARGET_ENTITY_ID.eq(options.entityReference().id()) - .and(LOGICAL_FLOW.TARGET_ENTITY_KIND.eq(EntityKind.ACTOR.name())); + Condition targetCondition = LOGICAL_FLOW.TARGET_ENTITY_ID.eq(ref.id()) + .and(LOGICAL_FLOW.TARGET_ENTITY_KIND.eq(ref.kind().name())); return DSL .select(LOGICAL_FLOW.ID) diff --git a/waltz-data/src/main/java/org/finos/waltz/data/physical_flow/PhysicalFlowIdSelectorFactory.java b/waltz-data/src/main/java/org/finos/waltz/data/physical_flow/PhysicalFlowIdSelectorFactory.java index 5ff9ab86ce..427b9de915 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/physical_flow/PhysicalFlowIdSelectorFactory.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/physical_flow/PhysicalFlowIdSelectorFactory.java @@ -63,6 +63,7 @@ public Select> apply(IdSelectionOptions options) { case APPLICATION: case ACTOR: case APP_GROUP: + case END_USER_APPLICATION: case CHANGE_INITIATIVE: case MEASURABLE: case ORG_UNIT: diff --git a/waltz-data/src/main/java/org/finos/waltz/data/physical_specification/PhysicalSpecificationIdSelectorFactory.java b/waltz-data/src/main/java/org/finos/waltz/data/physical_specification/PhysicalSpecificationIdSelectorFactory.java index d490fb6e67..ce33e7d16d 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/physical_specification/PhysicalSpecificationIdSelectorFactory.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/physical_specification/PhysicalSpecificationIdSelectorFactory.java @@ -51,7 +51,8 @@ public Select> apply(IdSelectionOptions options) { switch(options.entityReference().kind()) { case ACTOR: case APPLICATION: - return mkForApplicationOrActor(options); + case END_USER_APPLICATION: + return mkForSpecificNode(options); case PHYSICAL_FLOW: return mkForPhysicalFlow(options); case LOGICAL_DATA_ELEMENT: @@ -72,7 +73,7 @@ public Select> apply(IdSelectionOptions options) { } - private Select> mkForApplicationOrActor(IdSelectionOptions options) { + private Select> mkForSpecificNode(IdSelectionOptions options) { SelectorUtilities.ensureScopeIsExact(options); Condition lifecycleCondition = options.entityLifecycleStatuses().contains(EntityLifecycleStatus.REMOVED) diff --git a/waltz-ng/client/common/selector-utils.js b/waltz-ng/client/common/selector-utils.js index a9fb67fefe..0a7adda7f1 100644 --- a/waltz-ng/client/common/selector-utils.js +++ b/waltz-ng/client/common/selector-utils.js @@ -44,6 +44,7 @@ export function determineDownwardsScopeForKind(kind) { case "APPLICATION": case "APP_GROUP": case "CHANGE_INITIATIVE": + case "END_USER_APPLICATION": case "FLOW_DIAGRAM": case "LICENCE": case "LEGAL_ENTITY": diff --git a/waltz-service/src/main/java/org/finos/waltz/service/data_type/DataTypeDecoratorService.java b/waltz-service/src/main/java/org/finos/waltz/service/data_type/DataTypeDecoratorService.java index 1a571ff9b0..8d33c6fdd3 100644 --- a/waltz-service/src/main/java/org/finos/waltz/service/data_type/DataTypeDecoratorService.java +++ b/waltz-service/src/main/java/org/finos/waltz/service/data_type/DataTypeDecoratorService.java @@ -75,7 +75,6 @@ import static org.finos.waltz.common.ListUtilities.newArrayList; import static org.finos.waltz.common.SetUtilities.filter; import static org.finos.waltz.common.SetUtilities.map; -import static org.finos.waltz.model.EntityKind.ACTOR; import static org.finos.waltz.model.EntityKind.APPLICATION; import static org.finos.waltz.model.EntityKind.DATA_TYPE; import static org.finos.waltz.model.EntityKind.LOGICAL_DATA_FLOW; @@ -294,9 +293,10 @@ private Collection getSelectorForLogicalFlow(DataTypeDecorato return dao.findByAppIdSelector( genericSelectorFactory.applyForKind(APPLICATION, options).selector()); case ACTOR: + case END_USER_APPLICATION: return dao.findByEntityIdSelector( DSL.select(DSL.val(options.entityReference().id())), - Optional.of(ACTOR)); + Optional.of(options.entityReference().kind())); case DATA_TYPE: return dao.findByDataTypeIdSelector( genericSelectorFactory.applyForKind(DATA_TYPE, options).selector()); diff --git a/waltz-service/src/main/java/org/finos/waltz/service/flow_classification_rule/FlowClassificationRuleService.java b/waltz-service/src/main/java/org/finos/waltz/service/flow_classification_rule/FlowClassificationRuleService.java index 4d345b5e8f..80a9e91df1 100644 --- a/waltz-service/src/main/java/org/finos/waltz/service/flow_classification_rule/FlowClassificationRuleService.java +++ b/waltz-service/src/main/java/org/finos/waltz/service/flow_classification_rule/FlowClassificationRuleService.java @@ -446,6 +446,7 @@ public Set findClassificationRules(IdSelectionOptions op break; case APPLICATION: case ACTOR: + case END_USER_APPLICATION: customSelectionCriteria = Tables.FLOW_CLASSIFICATION_RULE.SUBJECT_ENTITY_KIND.eq(options.entityReference().kind().name()) .and(Tables.FLOW_CLASSIFICATION_RULE.SUBJECT_ENTITY_ID.eq(options.entityReference().id())) .and(FlowClassificationRuleDao.SUPPLIER_APP.KIND.notIn(options.filters().omitApplicationKinds())); From 2cce3eb74117f387b2e9f87186f396028a01c932 Mon Sep 17 00:00:00 2001 From: "david.watkins@db.com" Date: Thu, 11 Apr 2024 12:57:56 +0100 Subject: [PATCH 2/6] Allowing EUDA's to be seen in flow views and tables - Fixed up the slopey graph - Added EUDA support to the new(ish) flow viz - Updated the context panels - Back end view service now includes EUDAs #CTCTOWALTZ-3136 #7047 --- .../logical_flow/LogicalFlowStatsDao.java | 16 +++++++++++++--- waltz-ng/client/common/entity-utils.js | 17 +++++++++++++++++ waltz-ng/client/common/svelte/ViewLink.svelte | 4 ++++ .../svelte/info-panels/EntityInfoPanel.svelte | 3 +++ .../svelte/FlowDecoratorExplorerPanel.svelte | 19 +++++++++++-------- .../components/svelte/flow-decorator-utils.js | 4 ++++ .../data_type/DataTypeDecoratorService.java | 7 +++++-- 7 files changed, 57 insertions(+), 13 deletions(-) diff --git a/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowStatsDao.java b/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowStatsDao.java index 6ab5f98024..73a44836f7 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowStatsDao.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowStatsDao.java @@ -76,6 +76,7 @@ public class LogicalFlowStatsDao { private static final org.finos.waltz.schema.tables.LogicalFlowDecorator lfd = LogicalFlowDecorator.LOGICAL_FLOW_DECORATOR.as("lfd"); private static final Application counterpart_app = APPLICATION.as("counterpart_app"); private static final Actor counterpart_actor = ACTOR.as("counterpart_actor"); + private static final EndUserApplication counterpart_euc = END_USER_APPLICATION.as("counterpart_euc"); private static final DataType rollup_dt = Tables.DATA_TYPE.as("rollup_dt"); private static final DataType actual_dt = Tables.DATA_TYPE.as("actual_dt"); @@ -256,8 +257,10 @@ public Map> getFlowInfoByDirection(EntityReference Condition sourceAppCondition = lf.SOURCE_ENTITY_ID.eq(counterpart_app.ID).and(lf.SOURCE_ENTITY_KIND.eq(EntityKind.APPLICATION.name())); Condition sourceActorCondition = lf.SOURCE_ENTITY_ID.eq(counterpart_actor.ID).and(lf.SOURCE_ENTITY_KIND.eq(EntityKind.ACTOR.name())); + Condition sourceEucCondition = lf.SOURCE_ENTITY_ID.eq(counterpart_euc.ID).and(lf.SOURCE_ENTITY_KIND.eq(EntityKind.END_USER_APPLICATION.name())); Condition targetAppCondition = lf.TARGET_ENTITY_ID.eq(counterpart_app.ID).and(lf.TARGET_ENTITY_KIND.eq(EntityKind.APPLICATION.name())); Condition targetActorCondition = lf.TARGET_ENTITY_ID.eq(counterpart_actor.ID).and(lf.TARGET_ENTITY_KIND.eq(EntityKind.ACTOR.name())); + Condition targetEucCondition = lf.TARGET_ENTITY_ID.eq(counterpart_euc.ID).and(lf.TARGET_ENTITY_KIND.eq(EntityKind.END_USER_APPLICATION.name())); Condition dataTypeCondition = datatypeId == null ? rollup_dt.PARENT_ID.isNull() : rollup_dt.PARENT_ID.eq(datatypeId); @@ -267,6 +270,7 @@ public Map> getFlowInfoByDirection(EntityReference SelectConditionStep> sourceQry = mkDirectionalQuery( sourceAppCondition, sourceActorCondition, + sourceEucCondition, dataTypeCondition, isDownstream, INBOUND); @@ -274,6 +278,7 @@ public Map> getFlowInfoByDirection(EntityReference SelectConditionStep> targetQry = mkDirectionalQuery( targetAppCondition, targetActorCondition, + targetEucCondition, dataTypeCondition, isUpstream, OUTBOUND); @@ -315,6 +320,7 @@ record -> { private SelectConditionStep> mkDirectionalQuery(Condition appDirectionCondition, Condition actorDirectionCondition, + Condition eucDirectionCondition, Condition dataTypeCondition, Condition parentDirection, FlowDirection direction) { @@ -326,10 +332,13 @@ private SelectConditionStep `flow-diagram/${ctx.id}`, title: "Flow Diagram View" }, + "main.end-user-application.view": { + path: ctx => `end-user-application/id/${ctx.id}`, + title: "End User Application View" + }, "main.flow-classification-rule.view": { path: ctx => `flow-classification-rule/${ctx.id}`, title: "Flow Classification Rule View" diff --git a/waltz-ng/client/common/svelte/info-panels/EntityInfoPanel.svelte b/waltz-ng/client/common/svelte/info-panels/EntityInfoPanel.svelte index d540049fed..5ae60cd5d9 100644 --- a/waltz-ng/client/common/svelte/info-panels/EntityInfoPanel.svelte +++ b/waltz-ng/client/common/svelte/info-panels/EntityInfoPanel.svelte @@ -8,6 +8,7 @@ import LogicalDataFlowPanel from "./LogicalDataFlowInfoPanel.svelte" import SurveyInstanceInfoPanel from "./SurveyInstanceInfoPanel.svelte"; import PersonInfoPanel from "./PersonInfoPanel.svelte"; + import EndUserApplicationInfoPanel from "./EndUserApplicationInfoPanel.svelte"; export let primaryEntityRef; @@ -21,6 +22,8 @@ return ChangeInitiativeInfoPanel; case "DATA_TYPE": return DataTypeInfoPanel; + case "END_USER_APPLICATION": + return EndUserApplicationInfoPanel; case "LOGICAL_DATA_FLOW": return LogicalDataFlowPanel; case "MEASURABLE": diff --git a/waltz-ng/client/data-flow/components/svelte/FlowDecoratorExplorerPanel.svelte b/waltz-ng/client/data-flow/components/svelte/FlowDecoratorExplorerPanel.svelte index 7307eb7602..b0fc98f862 100644 --- a/waltz-ng/client/data-flow/components/svelte/FlowDecoratorExplorerPanel.svelte +++ b/waltz-ng/client/data-flow/components/svelte/FlowDecoratorExplorerPanel.svelte @@ -38,16 +38,18 @@ import Icon from "../../../common/svelte/Icon.svelte"; import NoData from "../../../common/svelte/NoData.svelte"; import {flowClassificationStore} from "../../../svelte-stores/flow-classification-store"; - import {sameRef} from "../../../common/entity-utils"; + import {loadSvelteEntity, sameRef} from "../../../common/entity-utils"; export let primaryEntityRef; let flowGraphSummaryCall = logicalFlowStore.getFlowGraphSummary(primaryEntityRef, null); let flowClassificationCall = flowClassificationStore.findAll() let physicalFlowCall = physicalFlowStore.findBySelector(mkSelectionOptions(primaryEntityRef, "EXACT")); - let entityCall = primaryEntityRef.kind === 'APPLICATION' - ? applicationStore.getById(primaryEntityRef.id) - : actorStore.getById(primaryEntityRef.id); + // let entityCall = primaryEntityRef.kind === 'APPLICATION' + // ? applicationStore.getById(primaryEntityRef.id) + // : actorStore.getById(primaryEntityRef.id); + let entityCall = loadSvelteEntity(primaryEntityRef); + let breadcrumbs = []; let additionalBreadcrumbs = []; @@ -75,8 +77,8 @@ $: baseBreadcrumb = { id: -1, name: $flowDirection === flowDirections.INBOUND - ? `${$focusClient?.name || entity.name} Inbound flows` - : `${$focusClient?.name || entity.name} Outbound flows`, + ? `${$focusClient?.name || entity?.name} Inbound flows` + : `${$focusClient?.name || entity?.name} Outbound flows`, classes: "breadcrumb-root", onClick: () => { const parent = $focusClient || entity @@ -87,7 +89,7 @@ $: homeBreadcrumb = { id: -2, - name: `Home (${entity.name})`, + name: `Home (${entity?.name})`, classes: "breadcrumb-home", onClick: () => { $focusClient = null; @@ -197,7 +199,7 @@ } - +{#if entity}
+{/if}