-
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.
Merge pull request #6158 from deutschebank/db-contrib/waltz-6149-high…
…light-physicals-sharing-data-type Db contrib/waltz 6149 highlight physicals sharing data type
- Loading branch information
Showing
8 changed files
with
148 additions
and
12 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
91 changes: 91 additions & 0 deletions
91
waltz-ng/client/logical-flow/components/data-type-info-panel/DataTypeInfoPanel.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 {dataTypeDecoratorStore} from "../../../svelte-stores/data-type-decorator-store"; | ||
import {entity} from "../../../common/services/enums/entity"; | ||
import {mkSelectionOptions} from "../../../common/selector-utils"; | ||
import {physicalFlowStore} from "../../../svelte-stores/physical-flow-store"; | ||
import _ from "lodash"; | ||
import {truncateMiddle} from "../../../common/string-utils"; | ||
import EntityLink from "../../../common/svelte/EntityLink.svelte"; | ||
import DescriptionFade from "../../../common/svelte/DescriptionFade.svelte"; | ||
import SearchInput from "../../../common/svelte/SearchInput.svelte"; | ||
import {termSearch} from "../../../common"; | ||
export let datatype; | ||
export let logicalFlow; | ||
export let primaryEntityRef; | ||
let specDecoratorCall; | ||
let physFlowCall; | ||
let qry = ""; | ||
$: { | ||
if (primaryEntityRef) { | ||
specDecoratorCall = dataTypeDecoratorStore.findBySelector(entity.PHYSICAL_SPECIFICATION.key, mkSelectionOptions(primaryEntityRef)) | ||
physFlowCall = physicalFlowStore.findBySelector(mkSelectionOptions(logicalFlow)); | ||
} | ||
} | ||
$: specsById = _ | ||
.chain($specDecoratorCall.data) | ||
.filter(d => d.dataTypeId === datatype.dataType.id) | ||
.keyBy(d => d.entityReference.id) | ||
.value(); | ||
$: physicalFlows = _ | ||
.chain($physFlowCall.data) | ||
.map(d => Object.assign({}, d, {specification: specsById[d.specificationId]})) | ||
.filter(d => !_.isNil(d.specification)) | ||
.orderBy(d => d.externalId) | ||
.value(); | ||
$: filteredPhysicalFlows = _.isEmpty(qry) | ||
? physicalFlows | ||
: termSearch(physicalFlows, qry, ["externalId", "frequency", "transport", "criticality"]); | ||
</script> | ||
|
||
|
||
<h4>{datatype?.dataType.name}</h4> | ||
<DescriptionFade text={datatype?.dataType.description}/> | ||
|
||
{#if !_.isEmpty(physicalFlows)} | ||
<br> | ||
<div>Physical flows sharing this data type:</div> | ||
|
||
{#if _.size(physicalFlows) > 10} | ||
<SearchInput bind:value={qry}/> | ||
{/if} | ||
<div class:waltz-scroll-region-350={_.size(physicalFlows) > 10}> | ||
<table class="table table-condensed small"> | ||
<colgroup> | ||
<col width="40%"/> | ||
<col width="20%"/> | ||
<col width="20%"/> | ||
<col width="20%"/> | ||
</colgroup> | ||
<thead> | ||
<tr> | ||
<th>External Id</th> | ||
<th>Frequency</th> | ||
<th>Transport</th> | ||
<th>Criticality</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{#each filteredPhysicalFlows as flow} | ||
<tr> | ||
<td title={flow.externalId}> | ||
<EntityLink ref={flow}> | ||
{truncateMiddle(flow.externalId, 30)} | ||
</EntityLink> | ||
</td> | ||
<td>{flow.frequency}</td> | ||
<td>{flow.transport}</td> | ||
<td>{flow.criticality}</td> | ||
</tr> | ||
{/each} | ||
</tbody> | ||
</table> | ||
</div> | ||
{/if} |
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
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