Skip to content

Commit 5c8974d

Browse files
Merge pull request #7010 from deutschebank/db-contrib/waltz-7008-dt-bug
Db contrib/waltz 7008 dt bug
2 parents 132cf12 + 0af7b9a commit 5c8974d

2 files changed

Lines changed: 27 additions & 11 deletions

File tree

waltz-ng/client/data-types/components/data-type-decorator-section/DataTypeDecoratorSection.svelte

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
selectedDataType
1313
} from "./data-type-decorator-section-store";
1414
import {prepareData} from "./data-type-decorator-view-grid-utils";
15+
import {onDestroy, onMount} from "svelte";
16+
import localWritable from "../../../common/svelte/local-writable";
1517
1618
const Modes = {
1719
TREE: "TREE",
@@ -20,17 +22,30 @@
2022
2123
export let primaryEntityRef;
2224
23-
let activeMode = Modes.TREE;
25+
let activeMode = localWritable('waltz.DataTypeDecoratorSection.activeMode', Modes.TREE);
2426
let viewCall;
2527
2628
function toggleView() {
27-
if (activeMode === Modes.TREE) {
28-
activeMode = Modes.TABLE;
29+
if ($activeMode === Modes.TREE) {
30+
$activeMode = Modes.TABLE;
2931
} else {
30-
activeMode = Modes.TREE;
32+
$activeMode = Modes.TREE;
3133
}
3234
}
3335
36+
function clearSelections() {
37+
$selectedDataType = null;
38+
$selectedDecorator = null;
39+
}
40+
41+
onMount(() => {
42+
clearSelections();
43+
});
44+
45+
onDestroy(() => {
46+
clearSelections();
47+
});
48+
3449
$: {
3550
if (primaryEntityRef) {
3651
viewCall = dataTypeDecoratorStore.getViewForParentRef(primaryEntityRef);
@@ -49,20 +64,19 @@
4964

5065
<div class="decorator-section">
5166
<div class="decorator-table">
52-
<div class="pull-right" style="display: block">
67+
<div>
68+
These are the data types currently aligned to this logical flow. You can toggle between a tabular and tree view of this information. Select a data type to see more information.
69+
<br>
5370
<Toggle labelOn="Tree View"
5471
labelOff="Table View"
55-
state={activeMode === Modes.TREE}
72+
state={$activeMode === Modes.TREE}
5673
onToggle={toggleView}/>
5774
</div>
58-
<div>
59-
These are the data types currently aligned to this logical flow. You can toggle between a tabular and tree view of this information. Select a data type to see more information.
60-
</div>
6175
<br>
6276
<div>
63-
{#if activeMode === Modes.TREE}
77+
{#if $activeMode === Modes.TREE}
6478
<DataTypeOverviewPanel primaryEntityReference={primaryEntityRef}/>
65-
{:else if activeMode === Modes.TABLE}
79+
{:else if $activeMode === Modes.TABLE}
6680
<DataTypeDecoratorViewGrid/>
6781
{/if}
6882
</div>

waltz-ng/client/involvement-kind/components/svelte/InvolvementKindPanel.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
import {activeSections} from "../../../dynamic-section/section-store";
1010
import {dynamicSections} from "../../../dynamic-section/dynamic-section-definitions";
1111
import SubSection from "../../../common/svelte/SubSection.svelte";
12+
import {primaryEntityReference as primaryRef} from "../../../assessments/components/rating-editor/rating-store";
1213
1314
export let parentEntityRef;
1415
1516
let involvementKindCall;
1617
1718
$: involvementKindCall = involvementKindStore.getById(parentEntityRef.id);
1819
$: involvementKind = $involvementKindCall?.data;
20+
$: $primaryRef = parentEntityRef;
1921
2022
function reload(id) {
2123
involvementKindCall = involvementKindStore.getById(id, true);

0 commit comments

Comments
 (0)