Skip to content

Commit

Permalink
Pull request #356: CTCTOWALTZ-3073 phys flow name 6159
Browse files Browse the repository at this point in the history
Merge in WALTZ/waltz from WALTZ/waltz-jws:CTCTOWALTZ-3073-phys-flow-name-6159 to db-feature/waltz-6159-physical-flow-name-visibility

* commit '40ecd6efc7af8e5fd314c4cef5b294d74bae5196':
  Default when no value provided on link cell to '-' for clickable link
  Default when no value provided on link cell to '-' for clickable link
  Add phys flow name to table in logical flow view
  Style physical flow section
  Add physical flow name to model and the physical flow overview
  • Loading branch information
jessica-woodland-scott-db committed Feb 28, 2024
2 parents 5c8974d + 40ecd6e commit 3c4e0f5
Show file tree
Hide file tree
Showing 15 changed files with 128 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public class PhysicalFlowDao {
PhysicalFlowRecord record = r.into(PHYSICAL_FLOW);
return ImmutablePhysicalFlow.builder()
.id(record.getId())
.name(Optional.ofNullable(record.getName()).orElse(""))
.provenance(record.getProvenance())
.specificationId(record.getSpecificationId())
.basisOffset(record.getBasisOffset())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
@JsonDeserialize(as = ImmutablePhysicalFlow.class)
public abstract class PhysicalFlow implements
IdProvider,
NameProvider,
IsRemovedProvider,
CreatedUserTimestampProvider,
DescriptionProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
</waltz-icon>

<span data-testid="entity-name"
ng-bind="$ctrl.entityRef.name"
ng-class="{
'weil-entity-removed': $ctrl.entityRef.entityLifecycleStatus === 'REMOVED',
'weil-entity-pending': $ctrl.entityRef.entityLifecycleStatus === 'PENDING'
}">
<span ng-bind="$ctrl.entityRef.name"
ng-if="$ctrl.entityRef.name">
</span>
<span ng-if="!$ctrl.entityRef.name">-</span>
</span>

<span data-testid="entity-external-id"
Expand Down
5 changes: 5 additions & 0 deletions waltz-ng/client/common/grid-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ export function mkLinkGridCell(columnHeading,
cellTemplate: `
<div class="ui-grid-cell-contents">
<a ui-sref="${linkNavViewName} ({ id: row.entity.${linkIdField} })"
ng-if="COL_FIELD"
ng-bind="COL_FIELD">
</a>
<a ui-sref="${linkNavViewName} ({ id: row.entity.${linkIdField} })"
ng-if="!COL_FIELD">
-
</a>
</div>`
});
}
Expand Down
2 changes: 1 addition & 1 deletion waltz-ng/client/common/markdown-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ showdown.extension("bootstrap-tables", () => {
return [{
type: "output",
regex: /<table>/g,
replace: "<table class='table'>",
replace: "<table class='table table-condensed table-striped small'>",
}]
});

Expand Down
2 changes: 1 addition & 1 deletion waltz-ng/client/common/services/enums/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export const entity = {
PHYSICAL_FLOW: {
key: "PHYSICAL_FLOW",
name: "Physical Flow",
icon: "qrcode",
icon: "arrows-turn-to-dots",
description: null,
position: 2200
},
Expand Down
3 changes: 2 additions & 1 deletion waltz-ng/client/common/svelte/EntityLabel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
{#if showIcon}
<EntityIcon kind={ref?.kind}/>
{/if}
<span class:removed={ref?.entityLifecycleStatus === 'REMOVED' || ref?.isRemoved}>
<span class:removed={ref?.entityLifecycleStatus === 'REMOVED' || ref?.isRemoved}
class="force-wrap">
{name}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ <h4>
<thead>
<tr>
<th>Name</th>
<th>Specification</th>
<th>Format</th>
<th>Transport</th>
<th>Frequency</th>
Expand All @@ -210,14 +211,20 @@ <h4>
<tr ng-repeat="pf in $ctrl.selected.physicalFlows">
<td>
<a ui-sref="main.physical-flow.view ({ id: pf.id })">
<span ng-bind="pf.specification.name"></span>
<span ng-bind="pf.name" ng-if="pf.name"></span>
<span ng-if="!pf.name"><waltz-icon name="arrows-turn-to-dots"></waltz-icon> - </span>
</a>
&nbsp;
<waltz-icon name="hourglass-2"
ng-if="$ctrl.selected.changeUnitsByPhysicalFlowId[pf.id]"
uib-tooltip="Changes planned for this physical flow">
</waltz-icon>
</td>
<td>
<a ui-sref="main.physical-specification.view ({ id: pf.specification.id })">
<span ng-bind="pf.specification.name"></span>
</a>
</td>
<td>
<waltz-enum-value type="'DataFormatKind'"
key="pf.specification.format"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {CORE_API} from "../common/services/core-api-utils";


export const columnDef = {
name: mkLinkGridCell("Name", "specification.name", "physicalFlow.id", "main.physical-flow.view"),
name: mkEntityLinkGridCell("Physical Flow Name", "physicalFlow"),
specName: mkEntityLinkGridCell("Specification Name", "specification"),
extId: {field: "physicalFlow.externalId", displayName: "Ext. Id"},
format: {field: "specification.format", displayName: "Format", cellFilter: "toDisplayName:\"DataFormatKind\""},
transport: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function controller($q, serviceBroker) {

const defaultColumnDefs = [
withWidth(columnDef.name, "20%"),
withWidth(columnDef.specName, "20%"),
columnDef.extId,
columnDef.format,
columnDef.transport,
Expand All @@ -48,13 +49,13 @@ function controller($q, serviceBroker) {
columnDef.description
];

vm.$onInit = () => {
vm.$onChanges = () => {

vm.columnDefs = _.isEmpty(vm.optionalColumnDefs)
? defaultColumnDefs
: vm.optionalColumnDefs;

vm.tableData = fetchData(vm.parentEntityRef, $q, serviceBroker)
fetchData(vm.parentEntityRef, $q, serviceBroker)
.then(data => vm.tableData = data);

vm.selectorOptions = mkSelectionOptions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,59 +17,30 @@
-->

<!--SPECIFICATION-->
<div class="row">
<div class="col-md-12">
<table class="waltz-field-table small">
<colgroup>
<col width="30%">
<col width="70%">
</colgroup>
<tbody>
<tr>
<td class="wft-label">
<span>Specification Name:</span>
</td>
<td>
<waltz-entity-link entity-ref="{
id: $ctrl.specification.id,
kind:'PHYSICAL_SPECIFICATION',
name: $ctrl.specification.name
}">
</waltz-entity-link>
</td>
</tr>
<tr>
<td class="wft-label">
<span>Specification Description:</span>
</td>
<td>
<span ng-bind="$ctrl.specification.description"></span>
</td>
</tr>
<tr>
<td class="wft-label">
<span>Format:</span>
</td>
<td>
<span ng-bind="$ctrl.specification.format | toDisplayName:'DataFormatKind'"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>

<hr>

<!-- FLOW -->
<div class="small">
<fieldset class="small" style="padding-bottom: 1em">

<legend style="font-size: medium">
Physical Flow
</legend>


<!-- FREQUENCY -->
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
Frequency:
<div class="col-sm-3 waltz-display-field-label">
Name
</div>
<div class="col-sm-9">
<span ng-bind="$ctrl.physicalFlow.name"></span>
</div>
</div>

<div class="row">
<div class="col-sm-3 waltz-display-field-label">
Frequency
</div>
<div class="col-sm-10">
<div class="col-sm-9">
<span ng-bind="$ctrl.physicalFlow.frequency | toDisplayName:'Frequency'"></span>
</div>
</div>
Expand All @@ -78,26 +49,26 @@

<!-- BASIS OFFSET -->
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
Basis Offset:
<div class="col-sm-3 waltz-display-field-label">
Basis Offset
</div>
<div class="col-sm-10">
<span uib-popover="Offset basis refers to the age of the data. T (or 0) is the same day, +1 is one day old etc."
popover-trigger="mouseenter"
popover-append-to-body="true"
popover-placement="top">
<span ng-bind="$ctrl.physicalFlow.basisOffset | toBasisOffset"></span>
</span>
<div class="col-sm-9">
<span uib-popover="Offset basis refers to the age of the data. T (or 0) is the same day, +1 is one day old etc."
popover-trigger="mouseenter"
popover-append-to-body="true"
popover-placement="top">
<span ng-bind="$ctrl.physicalFlow.basisOffset | toBasisOffset"></span>
</span>
</div>
</div>


<!-- TAGS -->
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
Tags:
<div class="col-sm-3 waltz-display-field-label">
Tags
</div>
<div class="col-sm-10">
<div class="col-sm-9">
<waltz-tag-list keywords="$ctrl.tags">
<empty>
<i class="text-muted">
Expand All @@ -114,36 +85,24 @@
</waltz-entity-enum>


<!-- DESC -->
<div class="row" ng-if="$ctrl.physicalFlow.description">
<div class="col-sm-2 waltz-display-field-label">
Description
</div>
<div class="col-sm-10">
<waltz-markdown text="$ctrl.physicalFlow.description">
</waltz-markdown>
</div>
</div>


<!-- EXT ID -->
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
<div class="col-sm-3 waltz-display-field-label">
External Identifier
</div>
<div class="col-sm-10">
<span ng-bind="$ctrl.physicalFlow.externalId">
</span>
<div class="col-sm-9">
<span ng-bind="$ctrl.physicalFlow.externalId">
</span>
</div>
</div>


<!-- ADDITIONAL EXT IDs -->
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
Additional External Id
<div class="col-sm-3 waltz-display-field-label">
Additional External Ids
</div>
<div class="col-sm-10">
<div class="col-sm-9">
<waltz-external-identifier-editor-table physical-flow="$ctrl.physicalFlow"
editable=false>
</waltz-external-identifier-editor-table>
Expand All @@ -152,13 +111,64 @@

<!--PROVENANCE-->
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
<div class="col-sm-3 waltz-display-field-label">
Provenance
</div>
<div class="col-sm-10">
<span ng-bind="$ctrl.physicalFlow.provenance">
</span>
<div class="col-sm-9">
<span ng-bind="$ctrl.physicalFlow.provenance">
</span>
</div>
</div>

</div>
<!-- DESC -->
<div class="row" ng-if="$ctrl.physicalFlow.description">
<div class="col-sm-3 waltz-display-field-label">
Description
</div>
<div class="col-sm-9">
<div>
<waltz-markdown text="$ctrl.physicalFlow.description">
</waltz-markdown>
</div>
</div>
</div>
</fieldset>

<fieldset class="small">

<legend style="font-size: medium">
Physical Specification
</legend>

<div class="row">
<div class="col-sm-3 waltz-display-field-label">
Name
</div>
<div class="col-sm-9">
<waltz-entity-link entity-ref="{
id: $ctrl.specification.id,
kind:'PHYSICAL_SPECIFICATION',
name: $ctrl.specification.name
}">
</waltz-entity-link>
</div>
</div>

<div class="row">
<div class="col-sm-3 waltz-display-field-label">
Format
</div>
<div class="col-sm-9">
<span ng-bind="$ctrl.specification.format | toDisplayName:'DataFormatKind'"></span>
</div>
</div>

<div class="row">
<div class="col-sm-3 waltz-display-field-label">
Description
</div>
<div class="col-sm-9">
<waltz-markdown text="$ctrl.specification.description"></waltz-markdown>
</div>
</div>
</fieldset>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function determineColumnDefs(entityKind) {
switch (entityKind) {
case "PHYSICAL_SPECIFICATION":
return [
columnDef.name,
columnDef.extId,
columnDef.source,
columnDef.target,
Expand All @@ -42,9 +43,9 @@ function determineColumnDefs(entityKind) {
case "TAG":
return [
columnDef.name,
columnDef.extId,
columnDef.source,
columnDef.target,
columnDef.extId,
columnDef.frequency,
columnDef.description];
default:
Expand Down
Loading

0 comments on commit 3c4e0f5

Please sign in to comment.