Skip to content

Commit

Permalink
Merge pull request finos#6799 from davidwatkins73/waltz-6798-lfd-asse…
Browse files Browse the repository at this point in the history
…ssments

Adding logical flow decorator support to assessments
  • Loading branch information
kamransaleem authored Oct 10, 2023
2 parents 9a966f0 + 8711723 commit 5206eda
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public enum EntityKind {
LEGAL_ENTITY("Legal Entity"),
LEGAL_ENTITY_RELATIONSHIP("Legal Entity Relationship"),
LEGAL_ENTITY_RELATIONSHIP_KIND("Legal Entity Relationship Kind"),
LOGICAL_DATA_ELEMENT("Logical data element"),
LOGICAL_DATA_FLOW("Logical flow"),
LOGICAL_DATA_ELEMENT("Logical Data Element"),
LOGICAL_DATA_FLOW("Logical Flow"),
LOGICAL_DATA_FLOW_DATA_TYPE_DECORATOR("Logical Flow Datatype Decorator"),
MEASURABLE("Measurable"),
MEASURABLE_CATEGORY("Measurable category"),
MEASURABLE_RATING("Measurable rating"),
Expand All @@ -76,6 +77,7 @@ public enum EntityKind {
PERFORMANCE_METRIC_PACK("Performance metric pack"),
PERSON("Person"),
PHYSICAL_SPECIFICATION("Physical specification"),
PHYSICAL_SPEC_DATA_TYPE_DECORATOR("Physical specification data type decorator"),
PHYSICAL_SPEC_DEFN("Physical spec definition"),
PHYSICAL_SPEC_DEFN_FIELD("Physical spec definition field"),
PHYSICAL_FLOW("Physical flow"),
Expand Down
14 changes: 14 additions & 0 deletions waltz-ng/client/common/services/enums/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ export const entity = {
description: null,
position: 1600
},
LOGICAL_DATA_FLOW_DATA_TYPE_DECORATOR: {
key: "LOGICAL_DATA_FLOW_DATA_TYPE_DECORATOR",
name: "Logical Flow Data Type",
icon: "barcode",
description: null,
position: 1650
},
ORG_UNIT: {
key: "ORG_UNIT",
name: "Org Unit",
Expand Down Expand Up @@ -325,6 +332,13 @@ export const entity = {
description: null,
position: 2100
},
PHYSICAL_SPEC_DATA_TYPE_DECORATOR: {
key: "PHYSICAL_SPEC_DATA_TYPE_DECORATOR",
name: "Physical Specification Data Type",
icon: "barcode",
description: null,
position: 2150
},
PHYSICAL_FLOW: {
key: "PHYSICAL_FLOW",
name: "Physical Flow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,22 @@
import {
getRequiredFields,
possibleVisibility,
possibleEntityKinds,
possibleAssessmentKinds,
selectedDefinition
} from "./assessment-definition-utils";
import {measurableCategoryStore} from "../../../svelte-stores/measurable-category-store";
import {legalEntityRelationshipKindStore} from "../../../svelte-stores/legal-entity-relationship-kind-store";
import {toEntityRef} from "../../../common/entity-utils";
export let doCancel;
export let doSave;
const qualifiableKinds = _
.chain(possibleEntityKinds)
.chain(possibleAssessmentKinds)
.reject(d => _.isNil(d.qualifierKind))
.map(d => d.value)
.value();
function toRef(d) {
return {
id: d.id,
name: d.name,
kind: d.kind
};
}
function save() {
const def = Object.assign({}, $selectedDefinition);
if (! _.includes(qualifiableKinds, $selectedDefinition.entityKind)) {
Expand Down Expand Up @@ -62,12 +55,12 @@
$: canEditCardinality = !$selectedDefinition.id || !$hasMultiValuesAssessmentsCall?.data; // allow edit for new categories without check
$: ratings = $ratingCall?.data || [];
$: possibleRatingSchemes = _.sortBy($ratingSchemesCall.data, d => d.name);
$: measurableCategories = _.map($measurableCategoryCall?.data || [], toRef);
$: legalEntityRelationshipKinds = _.map($legalEntityRelationshipKindCall?.data || [], toRef);
$: measurableCategories = _.map($measurableCategoryCall?.data || [], toEntityRef);
$: legalEntityRelationshipKinds = _.map($legalEntityRelationshipKindCall?.data || [], toEntityRef);
$: hasRatings = ratings.length > 0;
$: invalid = _.some(getRequiredFields($selectedDefinition), v => _.isNil(v));
$: qualifierKind = _.find(possibleEntityKinds, d => d.value === $selectedDefinition.entityKind)?.qualifierKind;
$: qualifierKind = _.find(possibleAssessmentKinds, d => d.value === $selectedDefinition.entityKind)?.qualifierKind;
</script>
Expand Down Expand Up @@ -129,7 +122,7 @@
disabled={hasRatings}
bind:value={$selectedDefinition.entityKind}>
{#each possibleEntityKinds as k}
{#each possibleAssessmentKinds as k}
<option value={k.value}>
{k.name}
</option>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
import _ from "lodash";
import PageHeader from "../../../common/svelte/PageHeader.svelte";
import ViewLink from "../../../common/svelte/ViewLink.svelte";
import EntityIcon from "../../../common/svelte/EntityIcon.svelte";
Expand All @@ -14,6 +15,7 @@
import RatingSchemePreviewBar from "../ratings-schemes/ItemPreviewBar.svelte";
import {selectedDefinition} from "./assessment-definition-utils";
import {onMount} from "svelte";
import {entity} from "../../../common/services/enums/entity";
const definitionsCall = assessmentDefinitionStore.loadAll();
Expand Down Expand Up @@ -174,7 +176,7 @@
</td>
<td>
<EntityIcon kind={def.entityKind}/>
{def.entityKind}
{_.get(entity, [def.entityKind, "name"], def.entityKind)}
</td>
<td>
<button class="btn-link"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ export function getRequiredFields(d) {
return [d.name, d.entityKind, d.description];
}

export const possibleEntityKinds = [
export const possibleAssessmentKinds = [
{value: "APPLICATION", name: "Application", qualifierKind: null},
{value: "CHANGE_INITIATIVE", name: "Change Initiative", qualifierKind: null},
{value: "CHANGE_SET", name: "Change Set", qualifierKind: null},
{value: "LOGICAL_DATA_FLOW_DATA_TYPE_DECORATOR", name: "Logical Flow Data Type Decorator", qualifierKind: null},
{value: "PHYSICAL_SPEC_DATA_TYPE_DECORATOR", name: "Physical Spec Data Type Decorator", qualifierKind: null},
{value: "ENTITY_RELATIONSHIP", name: "Entity Relationship", qualifierKind: null},
{value: "LEGAL_ENTITY", name: "Legal Entity", qualifierKind: null},
{value: "LEGAL_ENTITY_RELATIONSHIP", name: "Legal Entity Relationship", qualifierKind: "LEGAL_ENTITY_RELATIONSHIP_KIND"},
Expand Down

0 comments on commit 5206eda

Please sign in to comment.