Skip to content

Commit f22cdba

Browse files
Merge pull request #6877 from davidwatkins73/waltz-6895-flow-details-enhance
flow details enhance
2 parents 209e6b0 + c9307d7 commit f22cdba

30 files changed

Lines changed: 1105 additions & 779 deletions

File tree

waltz-data/src/main/java/org/finos/waltz/data/GenericSelectorFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.finos.waltz.data.logical_flow.LogicalFlowIdSelectorFactory;
3030
import org.finos.waltz.data.measurable.MeasurableIdSelectorFactory;
3131
import org.finos.waltz.data.orgunit.OrganisationalUnitIdSelectorFactory;
32+
import org.finos.waltz.data.physical_flow.PhysicalFlowIdSelectorFactory;
3233
import org.finos.waltz.data.physical_specification.PhysicalSpecificationIdSelectorFactory;
3334
import org.finos.waltz.model.EntityKind;
3435
import org.finos.waltz.model.HierarchyQueryScope;
@@ -53,6 +54,7 @@ public class GenericSelectorFactory {
5354
private final OrganisationalUnitIdSelectorFactory organisationalUnitIdSelectorFactory = new OrganisationalUnitIdSelectorFactory();
5455
private final AttestationIdSelectorFactory attestationIdSelectorFactory = new AttestationIdSelectorFactory();
5556
private final PhysicalSpecificationIdSelectorFactory specificationIdSelectorFactory = new PhysicalSpecificationIdSelectorFactory();
57+
private final PhysicalFlowIdSelectorFactory physicalFlowIdSelectorFactory = new PhysicalFlowIdSelectorFactory();
5658

5759

5860
public GenericSelector apply(IdSelectionOptions selectionOptions) {
@@ -125,6 +127,8 @@ private Select<Record1<Long>> applySelectorForKind(EntityKind kind, IdSelectionO
125127
return organisationalUnitIdSelectorFactory.apply(selectionOptions);
126128
case ATTESTATION:
127129
return attestationIdSelectorFactory.apply(selectionOptions);
130+
case PHYSICAL_FLOW:
131+
return physicalFlowIdSelectorFactory.apply(selectionOptions);
128132
case PHYSICAL_SPECIFICATION:
129133
return specificationIdSelectorFactory.apply(selectionOptions);
130134
//todo: (KS) Add support for Person

waltz-data/src/main/java/org/finos/waltz/data/datatype_decorator/PhysicalSpecDecoratorDao.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@
5252
import static org.finos.waltz.common.Checks.checkNotNull;
5353
import static org.finos.waltz.common.DateTimeUtilities.nowUtc;
5454
import static org.finos.waltz.common.DateTimeUtilities.toLocalDateTime;
55-
import static org.finos.waltz.model.EntityKind.DATA_TYPE;
56-
import static org.finos.waltz.model.EntityKind.PHYSICAL_SPECIFICATION;
5755
import static org.finos.waltz.model.EntityReference.mkRef;
56+
import static org.finos.waltz.schema.Tables.DATA_TYPE;
5857
import static org.finos.waltz.schema.tables.LogicalFlowDecorator.LOGICAL_FLOW_DECORATOR;
5958
import static org.finos.waltz.schema.tables.PhysicalFlow.PHYSICAL_FLOW;
6059
import static org.finos.waltz.schema.tables.PhysicalSpecDataType.PHYSICAL_SPEC_DATA_TYPE;
@@ -65,8 +64,8 @@ public class PhysicalSpecDecoratorDao extends DataTypeDecoratorDao {
6564
public static final RecordMapper<? super Record, DataTypeDecorator> TO_DOMAIN_MAPPER = r -> {
6665
PhysicalSpecDataTypeRecord record = r.into(PHYSICAL_SPEC_DATA_TYPE);
6766
return ImmutableDataTypeDecorator.builder()
68-
.decoratorEntity(mkRef(DATA_TYPE, record.getDataTypeId()))
69-
.entityReference(mkRef(PHYSICAL_SPECIFICATION,record.getSpecificationId()))
67+
.decoratorEntity(mkRef(EntityKind.DATA_TYPE, record.getDataTypeId(), r.get(DATA_TYPE.NAME)))
68+
.entityReference(mkRef(EntityKind.PHYSICAL_SPECIFICATION,record.getSpecificationId()))
7069
.provenance(record.getProvenance())
7170
.lastUpdatedAt(toLocalDateTime(record.getLastUpdatedAt()))
7271
.lastUpdatedBy(record.getLastUpdatedBy())
@@ -102,7 +101,9 @@ public PhysicalSpecDecoratorDao(DSLContext dsl) {
102101
public DataTypeDecorator getByEntityIdAndDataTypeId(long specId, long dataTypeId) {
103102
return dsl
104103
.select(PHYSICAL_SPEC_DATA_TYPE.fields())
104+
.select(DATA_TYPE.NAME)
105105
.from(PHYSICAL_SPEC_DATA_TYPE)
106+
.innerJoin(DATA_TYPE).on(PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID.eq(DATA_TYPE.ID))
106107
.where(PHYSICAL_SPEC_DATA_TYPE.SPECIFICATION_ID.eq(specId))
107108
.and(PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID.eq(dataTypeId))
108109
.fetchOne(TO_DOMAIN_MAPPER);
@@ -113,7 +114,9 @@ public DataTypeDecorator getByEntityIdAndDataTypeId(long specId, long dataTypeId
113114
public List<DataTypeDecorator> findByEntityId(long specId) {
114115
return dsl
115116
.select(PHYSICAL_SPEC_DATA_TYPE.fields())
117+
.select(DATA_TYPE.NAME)
116118
.from(PHYSICAL_SPEC_DATA_TYPE)
119+
.innerJoin(DATA_TYPE).on(PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID.eq(DATA_TYPE.ID))
117120
.where(PHYSICAL_SPEC_DATA_TYPE.SPECIFICATION_ID.eq(specId))
118121
.fetch(TO_DOMAIN_MAPPER);
119122
}
@@ -124,32 +127,33 @@ public List<DataTypeDecorator> findByEntityIdSelector(Select<Record1<Long>> spec
124127
Optional<EntityKind> entityKind) {
125128
return dsl
126129
.select(PHYSICAL_SPEC_DATA_TYPE.fields())
130+
.select(DATA_TYPE.NAME)
127131
.from(PHYSICAL_SPEC_DATA_TYPE)
132+
.innerJoin(DATA_TYPE).on(PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID.eq(DATA_TYPE.ID))
128133
.where(PHYSICAL_SPEC_DATA_TYPE.SPECIFICATION_ID.in(specIdSelector))
129134
.fetch(TO_DOMAIN_MAPPER);
130135
}
131136

132137

133138
@Override
134139
public List<DataTypeDecorator> findByAppIdSelector(Select<Record1<Long>> appIdSelector) {
135-
throw new UnsupportedOperationException("method not supported for " + PHYSICAL_SPECIFICATION.prettyName());
140+
throw new UnsupportedOperationException("method not supported for " + EntityKind.PHYSICAL_SPECIFICATION.prettyName());
136141
}
137142

138143
@Override
139144
public Set<DataTypeDecorator> findByFlowIdSelector(Select<Record1<Long>> flowIdSelector) {
140-
throw new UnsupportedOperationException("method not supported for " + PHYSICAL_SPECIFICATION.prettyName());
145+
throw new UnsupportedOperationException("method not supported for " + EntityKind.PHYSICAL_SPECIFICATION.prettyName());
141146
}
142147

143-
144148
@Override
145149
public List<DataTypeDecorator> findByDataTypeIdSelector(Select<Record1<Long>> dataTypeIdSelector) {
146-
throw new UnsupportedOperationException("method not supported for " + PHYSICAL_SPECIFICATION.prettyName());
150+
throw new UnsupportedOperationException("method not supported for " + EntityKind.PHYSICAL_SPECIFICATION.prettyName());
147151
}
148152

149153

150154
@Override
151155
public Set<DataTypeDecorator> findByFlowIds(Collection<Long> flowIds) {
152-
throw new UnsupportedOperationException("method not supported for " + PHYSICAL_SPECIFICATION.prettyName());
156+
throw new UnsupportedOperationException("method not supported for " + EntityKind.PHYSICAL_SPECIFICATION.prettyName());
153157
}
154158

155159

@@ -204,7 +208,7 @@ public List<DataTypeUsageCharacteristics> findDatatypeUsageCharacteristics(Entit
204208

205209
@Override
206210
public Set<DataTypeDecorator> findByLogicalFlowIdSelector(Select<Record1<Long>> flowIdSelector) {
207-
throw new UnsupportedOperationException("method not supported for " + PHYSICAL_SPECIFICATION.prettyName());
211+
throw new UnsupportedOperationException("method not supported for " + EntityKind.PHYSICAL_SPECIFICATION.prettyName());
208212
}
209213

210214

@@ -234,17 +238,17 @@ public int rippleDataTypesToLogicalFlows() {
234238
SelectConditionStep<Record7<Long, String, Long, String, String, Timestamp, String>> qry = DSL
235239
.selectDistinct(
236240
PHYSICAL_FLOW.LOGICAL_FLOW_ID,
237-
DSL.val(DATA_TYPE.name()),
241+
DSL.val(EntityKind.DATA_TYPE.name()),
238242
PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID,
239243
DSL.val(AuthoritativenessRatingValue.NO_OPINION.value()),
240244
DSL.val("waltz"),
241245
DSL.val(Timestamp.valueOf(nowUtc())),
242246
DSL.val("admin"))
243247
.from(PHYSICAL_SPEC_DATA_TYPE)
244-
.innerJoin(Tables.DATA_TYPE)
245-
.on(PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID.eq(Tables.DATA_TYPE.ID)
246-
.and(Tables.DATA_TYPE.UNKNOWN.isFalse()
247-
.and(Tables.DATA_TYPE.DEPRECATED.isFalse())))
248+
.innerJoin(DATA_TYPE)
249+
.on(PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID.eq(DATA_TYPE.ID)
250+
.and(DATA_TYPE.UNKNOWN.isFalse()
251+
.and(DATA_TYPE.DEPRECATED.isFalse())))
248252
.innerJoin(Tables.PHYSICAL_SPECIFICATION)
249253
.on(PHYSICAL_SPEC_DATA_TYPE.SPECIFICATION_ID.eq(Tables.PHYSICAL_SPECIFICATION.ID)
250254
.and(Tables.PHYSICAL_SPECIFICATION.IS_REMOVED.isFalse()))
@@ -259,7 +263,7 @@ public int rippleDataTypesToLogicalFlows() {
259263
.leftJoin(LOGICAL_FLOW_DECORATOR)
260264
.on(LOGICAL_FLOW_DECORATOR.LOGICAL_FLOW_ID.eq(Tables.LOGICAL_FLOW.ID)
261265
.and(LOGICAL_FLOW_DECORATOR.DECORATOR_ENTITY_ID.eq(PHYSICAL_SPEC_DATA_TYPE.DATA_TYPE_ID))
262-
.and(LOGICAL_FLOW_DECORATOR.DECORATOR_ENTITY_KIND.eq(DATA_TYPE.name())))
266+
.and(LOGICAL_FLOW_DECORATOR.DECORATOR_ENTITY_KIND.eq(EntityKind.DATA_TYPE.name())))
263267
.where(LOGICAL_FLOW_DECORATOR.LOGICAL_FLOW_ID.isNull());
264268

265269
return dsl

waltz-model/src/main/java/org/finos/waltz/model/logical_flow/LogicalFlowView.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,28 @@
3636
@JsonDeserialize(as = ImmutableLogicalFlowView.class)
3737
public abstract class LogicalFlowView {
3838

39-
public abstract Set<LogicalFlow> flows();
39+
public abstract Set<LogicalFlow> logicalFlows();
4040

41-
public abstract Set<AssessmentRating> flowRatings();
41+
public abstract Set<PhysicalFlow> physicalFlows();
4242

43-
public abstract Set<AssessmentDefinition> primaryAssessmentDefinitions();
43+
public abstract Set<PhysicalSpecification> physicalSpecifications();
4444

4545
public abstract Set<RatingSchemeItem> ratingSchemeItems();
4646

47-
public abstract Set<DataTypeDecorator> dataTypeDecorators();
47+
public abstract Set<DataTypeDecorator> logicalFlowDataTypeDecorators();
4848

49-
public abstract Set<PhysicalFlow> physicalFlows();
49+
public abstract Set<DataTypeDecorator> physicalSpecificationDataTypeDecorators();
5050

51-
public abstract Set<PhysicalSpecification> physicalSpecifications();
51+
public abstract Set<AssessmentDefinition> logicalFlowAssessmentDefinitions();
52+
53+
public abstract Set<AssessmentDefinition> physicalFlowAssessmentDefinitions();
54+
55+
public abstract Set<AssessmentDefinition> physicalSpecificationAssessmentDefinitions();
56+
57+
public abstract Set<AssessmentRating> logicalFlowRatings();
58+
59+
public abstract Set<AssessmentRating> physicalFlowRatings();
60+
61+
public abstract Set<AssessmentRating> physicalSpecificationRatings();
5262

5363
}

waltz-ng/client/assessments/components/rating-editor/RatingListView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
2929
$: canAdd = hasAddPermission && (singleValueCanAdd || multiValueCanAdd);
3030
31-
$: sortedRatingList =_.sortBy($selectedAssessment?.ratings, d => _.toLower(d.ratingItem.ratingGroup + d.ratingItem.name));
31+
$: sortedRatingList =_.sortBy($selectedAssessment?.ratings, d => _.toLower(d.ratingItem?.ratingGroup + d.ratingItem?.name));
3232
3333
</script>
3434

waltz-ng/client/common/svelte/DescriptionFade.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
export let text = "";
77
export let context = {};
8+
export let expanderAlignment = "center"; // left | center (default) | right
89
910
let expanded = false;
1011
@@ -17,7 +18,7 @@
1718
<Markdown {text} {context}/>
1819
</div>
1920
{#if hasLongDescription}
20-
<div class="expander">
21+
<div class="expander" style:text-align={expanderAlignment}>
2122
<button class="btn btn-skinny small"
2223
on:click={() => expanded = !expanded}>
2324
{expanded ? "Show less" : "Show more"}

waltz-ng/client/common/svelte/Toggle.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@
4141
</span>
4242
{/if}
4343
{/if}
44+
45+
<style>
46+
button {
47+
font-size: inherit;
48+
}
49+
</style>

waltz-ng/client/common/svelte/Tooltip.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
export let content;
1212
export let props;
13+
export let trigger = "mouseenter click";
1314
export let placement = "top";
1415
export let delay = [300, 100];
1516
@@ -21,7 +22,8 @@
2122
content: "loading",
2223
arrow: true,
2324
interactive: true,
24-
trigger: 'mouseenter click',
25+
appendTo: document.body,
26+
trigger,
2527
theme: "light-border",
2628
placement,
2729
delay,
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<script context="module">
2+
import {writable} from "svelte/store";
3+
let hideRatings = writable(true);
4+
</script>
5+
6+
<script>
7+
import _ from "lodash";
8+
import EntityLabel from "../../../../common/svelte/EntityLabel.svelte";
9+
import Toggle from "../../../../common/svelte/Toggle.svelte";
10+
11+
export let decorators = [];
12+
export let flowClassifications = []
13+
14+
15+
$: flowClassificationsByCode = _.keyBy(flowClassifications, d => d.code);
16+
17+
$: hasRatings = !_.isEmpty(flowClassifications)
18+
$: showRatings = !$hideRatings && hasRatings;
19+
20+
</script>
21+
22+
<table class="">
23+
<tbody class="small">
24+
{#each _.orderBy(decorators, d => d.decoratorEntity.name) as type}
25+
<tr>
26+
<td>
27+
<div class="rating-icon"
28+
style={`background-color: ${flowClassificationsByCode[type.rating]?.color}`}>
29+
</div>
30+
<EntityLabel ref={type.decoratorEntity}
31+
showIcon={false}>
32+
</EntityLabel>
33+
</td>
34+
{#if showRatings}
35+
<td>
36+
{_.get(flowClassificationsByCode, [type.rating, "name"], "-")}
37+
</td>
38+
{/if}
39+
</tr>
40+
{/each}
41+
</tbody>
42+
</table>
43+
44+
{#if hasRatings}
45+
<div class="smaller">
46+
<Toggle state={showRatings}
47+
labelOn="Hide Ratings"
48+
onToggle={() => $hideRatings = !$hideRatings}
49+
labelOff="Show Ratings"/>
50+
</div>
51+
{/if}
52+
53+
54+
55+
<style>
56+
57+
.rating-icon {
58+
display: inline-block;
59+
height: 1em;
60+
width: 1em;
61+
border:1px solid #ccc;
62+
border-radius: 2px;
63+
}
64+
65+
table {
66+
width: 100%;
67+
}
68+
69+
table td {
70+
padding-bottom: 0.2em;
71+
padding-right: 0.6em;
72+
border-bottom: 1px solid #eee;
73+
vertical-align: top;
74+
}
75+
</style>

waltz-ng/client/data-flow/components/svelte/flow-detail-tab/DataTypeTooltipContent.svelte

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)