-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request #351: CTCTOWALTZ-3048 data type section improvements 6986
Merge in WALTZ/waltz from WALTZ/waltz-jws:CTCTOWALTZ-3048-data-type-section-improvements-6986 to db-feature/waltz-6986-data-type-decorator-section-rework * commit '441f56a6dc72b91947ae62ae7b21f5a9017fafb2': Prevent flow classification rules showing where rating for flow is 'DISCOURAGED' Add provenance and additional information to the data type section on logical flows Add provenance and additional information to the data type section on logical flows Add provenance and additional information to the data type section on logical flows Add provenance and additional information to the data type section on logical flows
- Loading branch information
Showing
31 changed files
with
1,398 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...z-model/src/main/java/org/finos/waltz/model/logical_flow/FlowClassificationRulesView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Waltz - Enterprise Architecture | ||
* Copyright (C) 2016, 2017, 2018, 2019 Waltz open source project | ||
* See README.md for more information | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific | ||
* | ||
*/ | ||
|
||
package org.finos.waltz.model.logical_flow; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import org.finos.waltz.model.datatype.DataType; | ||
import org.finos.waltz.model.flow_classification.FlowClassification; | ||
import org.finos.waltz.model.flow_classification_rule.FlowClassificationRule; | ||
import org.immutables.value.Value; | ||
|
||
import java.util.Set; | ||
|
||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableFlowClassificationRulesView.class) | ||
@JsonDeserialize(as = ImmutableFlowClassificationRulesView.class) | ||
public interface FlowClassificationRulesView { | ||
|
||
Set<FlowClassificationRule> flowClassificationRules(); | ||
Set<FlowClassification> flowClassifications(); | ||
Set<DataType> dataTypes(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
waltz-ng/client/common/svelte/DataTypeDecoratorNodeContent.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<script> | ||
import RatingIndicatorCell from "../../ratings/components/rating-indicator-cell/RatingIndicatorCell.svelte"; | ||
import Icon from "./Icon.svelte"; | ||
import Tooltip from "./Tooltip.svelte"; | ||
import DataTypeDecoratorTreeTooltip from "./DataTypeDecoratorTreeTooltip.svelte"; | ||
export let node; | ||
export let multiSelect; | ||
export let selectNode = (d) => console.log(d); | ||
export let isDisabled = false; | ||
export let isChecked = false; | ||
function mkTooltipProps(node) { | ||
return { | ||
dataType: node, | ||
decorator: node.decorator | ||
} | ||
} | ||
</script> | ||
|
||
<Tooltip content={DataTypeDecoratorTreeTooltip} | ||
placement="left-start" | ||
props={mkTooltipProps(node)}> | ||
<svelte:fragment slot="target"> | ||
<button class="btn btn-plain" | ||
class:concrete={node.concrete} | ||
class:abstract={!node.concrete} | ||
class:unknown={node.unknown} | ||
class:deprecated={node.deprecated} | ||
disabled={isDisabled} | ||
on:click={() => selectNode(node)}> | ||
{#if multiSelect} | ||
<Icon name={isChecked ? "square-o" : "checked-square-o}"}/> | ||
{/if} | ||
{node.name} | ||
</button> | ||
{#if node.deprecated} | ||
<span class="label label-danger"> | ||
Deprecated | ||
</span> | ||
{/if} | ||
<span class="small"> | ||
{#if node.decorator?.flowClassification} | ||
<RatingIndicatorCell showName={false} {...node.decorator?.flowClassification}/> | ||
{/if} | ||
{#if node.decorator?.isReadonly} | ||
<Icon name="lock"/> | ||
{/if} | ||
</span> | ||
</svelte:fragment> | ||
</Tooltip> | ||
|
||
|
||
|
||
<style> | ||
.concrete { | ||
} | ||
.abstract { | ||
font-style: italic; | ||
} | ||
.deprecated { | ||
color: darkred; | ||
} | ||
.unknown { | ||
color: gray; | ||
} | ||
</style> |
91 changes: 91 additions & 0 deletions
91
waltz-ng/client/common/svelte/DataTypeDecoratorTreeNode.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<script> | ||
import _ from "lodash"; | ||
import Icon from "./Icon.svelte"; | ||
import {createEventDispatcher} from "svelte"; | ||
import RatingIndicatorCell from "../../ratings/components/rating-indicator-cell/RatingIndicatorCell.svelte"; | ||
import DataTypeDecoratorNodeContent from "./DataTypeDecoratorNodeContent.svelte"; | ||
export let selectionFilter = () => true; | ||
export let multiSelect = false; | ||
export let nonConcreteSelectable = true; | ||
export let childNodes = []; | ||
export let node; | ||
export let expanded = false; | ||
export let isRoot = false; | ||
$: sortedNodes = _.orderBy(childNodes, [d => d.deprecated, d => d.name]); | ||
const dispatcher = createEventDispatcher(); | ||
function toggleExpanded() { | ||
expanded = !expanded; | ||
} | ||
function selectNode(selectedNode) { | ||
dispatcher("select", selectedNode); | ||
} | ||
function calcChecked(filterFn, n) { | ||
const isUnchecked = filterFn(n); | ||
return !isUnchecked; | ||
} | ||
function calcDisabled(filterFn, n) { | ||
const isUnchecked = filterFn(n); | ||
return isUnchecked // should be allowed to deselect non-concrete | ||
&& (!nonConcreteSelectable && !n.concrete) | ||
} | ||
</script> | ||
|
||
{#if !isRoot} | ||
<button class="btn btn-plain" | ||
on:click={toggleExpanded}> | ||
<Icon size="lg" | ||
name={expanded | ||
? "caret-down fw" | ||
: "caret-right fw"}/> | ||
</button> | ||
<DataTypeDecoratorNodeContent {node} | ||
{multiSelect} | ||
isDisabled={calcDisabled(selectionFilter, node)} | ||
isChecked={calcChecked(selectionFilter, node)} | ||
{selectNode}/> | ||
{/if} | ||
|
||
{#if expanded || node.isExpanded} | ||
<ul> | ||
{#each sortedNodes as childNode} | ||
<li> | ||
{#if childNode.children.length > 0} | ||
<svelte:self on:select | ||
{multiSelect} | ||
node={childNode} | ||
{selectionFilter} | ||
{nonConcreteSelectable} | ||
{expanded} | ||
childNodes={childNode.children}/> | ||
{:else} | ||
<Icon size="lg" | ||
name="fw"/> | ||
<DataTypeDecoratorNodeContent node={childNode} | ||
{multiSelect} | ||
isDisabled={calcDisabled(selectionFilter, childNode)} | ||
isChecked={calcChecked(selectionFilter, childNode)} | ||
{selectNode}/> | ||
{/if} | ||
</li> | ||
{/each} | ||
</ul> | ||
{/if} | ||
|
||
<style> | ||
ul { | ||
padding: 0.2em 0 0 0.5em; | ||
margin: 0 0 0 0.5em; | ||
list-style: none; | ||
border-left: 1px solid #eee; | ||
} | ||
</style> |
31 changes: 31 additions & 0 deletions
31
waltz-ng/client/common/svelte/DataTypeDecoratorTreeTooltip.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script> | ||
import DescriptionFade from "./DescriptionFade.svelte"; | ||
import Icon from "./Icon.svelte"; | ||
import RatingIndicatorCell from "../../ratings/components/rating-indicator-cell/RatingIndicatorCell.svelte"; | ||
import LastEdited from "./LastEdited.svelte"; | ||
import DataTypeDecoratorViewTable | ||
from "../../data-types/components/data-type-decorator-section/context-panel/DataTypeDecoratorViewTable.svelte"; | ||
export let dataType; | ||
export let decorator; | ||
</script> | ||
|
||
{#if (dataType)} | ||
<strong>{dataType.name}</strong> | ||
<div class="help-block">{dataType.code}</div> | ||
<DescriptionFade text={dataType.description}/> | ||
{#if dataType.deprecated} | ||
<div style="padding-top: 1em"> | ||
<span style="color: darkred"> | ||
<Icon name="exclamation-triangle"/> | ||
</span> | ||
This data type is deprecated | ||
</div> | ||
{/if} | ||
{/if} | ||
{#if decorator} | ||
<br> | ||
<DataTypeDecoratorViewTable {decorator}/> | ||
{/if} |
Oops, something went wrong.