Skip to content

Commit db7f3c1

Browse files
Googlercopybara-github
authored andcommitted
Show view switcher in the control bar under CLL on graph experiment.
PiperOrigin-RevId: 740735248
1 parent 15bcf7e commit db7f3c1

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

src/app/toolbar.ng.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<nav [ngClass]="['toolbar', graphState]">
22
<ng-container *ngFor="let customToggleTemplate of leftAlignedCustomToolbarToggleTemplates">
3-
<div class="cell toggler">
3+
<div
4+
class="cell toggler"
5+
[class.flex]="customToggleTemplate == fillerCustomToolbarToggleTemplate"
6+
>
47
<ng-container
58
*ngTemplateOutlet="customToggleTemplate; context: {
69
nodes,
@@ -9,7 +12,7 @@
912
></ng-container>
1013
</div>
1114
</ng-container>
12-
<div *ngIf="rightAlignMainControls" class="flex"></div>
15+
<div *ngIf="fillerCustomToolbarToggleTemplate == null && rightAlignMainControls" class="flex"></div>
1316
<ng-container *ngVar="labelGenerator(this, 'graphState') as label">
1417
<div class="cell state" *ngIf="label !== false">
1518
<workflow-graph-icon icon="info"></workflow-graph-icon>
@@ -138,7 +141,10 @@
138141
</button>
139142
</div>
140143
<ng-container *ngFor="let customToggleTemplate of customToolbarToggleTemplates">
141-
<div class="cell toggler">
144+
<div
145+
class="cell toggler"
146+
[class.flex]="customToggleTemplate == fillerCustomToolbarToggleTemplate"
147+
>
142148
<ng-container
143149
*ngTemplateOutlet="customToggleTemplate; context: {
144150
nodes,
@@ -147,9 +153,12 @@
147153
></ng-container>
148154
</div>
149155
</ng-container>
150-
<div *ngIf="!rightAlignMainControls" class="flex"></div>
156+
<div *ngIf="fillerCustomToolbarToggleTemplate == null && !rightAlignMainControls" class="flex"></div>
151157
<ng-container *ngFor="let customToggleTemplate of rightAlignedCustomToolbarToggleTemplates">
152-
<div class="cell toggler">
158+
<div
159+
class="cell toggler"
160+
[class.flex]="customToggleTemplate == fillerCustomToolbarToggleTemplate"
161+
>
153162
<ng-container *ngTemplateOutlet="customToggleTemplate; context: {
154163
nodes,
155164
groups

src/app/toolbar.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export class DagToolbar {
134134
private $customToolbarToggleTemplates: TemplateRef<any>[] = [];
135135
private $leftAlignedCustomToolbarToggleTemplates: TemplateRef<any>[] = [];
136136
private $rightAlignedCustomToolbarToggleTemplates: TemplateRef<any>[] = [];
137+
private $fillerCustomToolbarToggleTemplate: TemplateRef<any>|null = null;
137138

138139
@Input() enableMinimap = true;
139140
@Output() enableMinimapChange = new EventEmitter();
@@ -222,6 +223,15 @@ export class DagToolbar {
222223
return this.$rightAlignedCustomToolbarToggleTemplates;
223224
}
224225

226+
@Input('fillerCustomToolbarToggleTemplate')
227+
set fillerCustomToolbarToggleTemplate(template: TemplateRef<any>|null) {
228+
this.$fillerCustomToolbarToggleTemplate = template;
229+
this.cdr.detectChanges();
230+
}
231+
get fillerCustomToolbarToggleTemplate() {
232+
return this.$fillerCustomToolbarToggleTemplate;
233+
}
234+
225235
constructor(
226236
private readonly cdr: ChangeDetectorRef,
227237
private readonly dialog: MatDialog,

0 commit comments

Comments
 (0)