Skip to content

Commit df335ef

Browse files
emersionaiAdrian
andauthored
fix: disable notes in filter sidebar in standalone mode (SchweizerischeBundesbahnen#211)
* fix: disable notes in filter sidebar in standalone mode Notes are disabled in standalone mode. * If the backend is turned off, the notes - labels will no longer be displayed in the filter. To keep everything consistent, these labels will also be deactivated in the filter and hidden in the note-edit dialog. --------- Co-authored-by: adrian_egli <adrian.egli@gmail.com>
1 parent 930441c commit df335ef

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

src/app/view/dialogs/note-dialog/note-dialog.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
(noteDeleted)="closeDialog()"
2121
></sbb-note-edit-element>
2222
</sbb-tab>
23-
<sbb-tab [label]="'app.view.dialogs.note-dialog.filterable-labels-tab' | translate" id="note-filterable-labels-tab">
23+
<sbb-tab
24+
[label]="'app.view.dialogs.note-dialog.filterable-labels-tab' | translate" id="note-filterable-labels-tab"
25+
*ngIf="!disableBackend"
26+
>
2427
<sbb-note-filter-tab
2528
[noteDialogParameter]="data"
2629
(noteDeleted)="closeDialog()"

src/app/view/dialogs/note-dialog/note-dialog.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {GeneralViewFunctions} from "../../util/generalViewFunctions";
1010
import {Subject} from "rxjs";
1111
import {NoteFormComponentModel} from "./note-form/note-form.component";
1212
import {takeUntil} from "rxjs/operators";
13+
import {environment} from "../../../../environments/environment";
1314

1415
export enum NoteDialogType {
1516
NOTE_DIALOG,
@@ -47,6 +48,8 @@ export class NoteDialogComponent implements OnDestroy {
4748
public noteTitle: string;
4849
public noteText: string;
4950

51+
readonly disableBackend = environment.disableBackend;
52+
5053
private destroyed = new Subject<void>();
5154
private deleteNoteCallback = null;
5255
private saveNoteCallback = null;

src/app/view/editor-edit-tools-view-component/editor-edit-tools-view.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h2 class="SummaryTitle">{{ 'app.view.editor-edit-tools-view-component.edit' | t
2020
></sbb-label-drop-list-component>
2121
</sbb-expansion-panel>
2222

23-
<sbb-expansion-panel [expanded]="false">
23+
<sbb-expansion-panel [expanded]="false" *ngIf="!disableBackend">
2424
<sbb-expansion-panel-header>{{ 'app.view.editor-edit-tools-view-component.notes' | translate }}</sbb-expansion-panel-header>
2525
<sbb-label-drop-list-component
2626
[componentLabelRef]="'Note'"

src/app/view/editor-edit-tools-view-component/editor-edit-tools-view.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {LabelRef} from "../../data-structures/business.data.structures";
1515
import {LabelService} from "../../services/data/label.serivce";
1616
import {LabelGroupService} from "../../services/data/labelgroup.service";
1717
import {LabelGroup} from "../../models/labelGroup.model";
18+
import {environment} from "../../../environments/environment";
1819

1920
@Component({
2021
selector: "sbb-editor-edit-tools-view-component",
@@ -32,6 +33,8 @@ export class EditorEditToolsViewComponent implements OnDestroy {
3233
public trainrunLabelGroups: LabelGroup[];
3334
private destroyed = new Subject<void>();
3435

36+
readonly disableBackend = environment.disableBackend;
37+
3538
constructor(
3639
private dataService: DataService,
3740
private nodeService: NodeService,

src/app/view/editor-filter-view/editor-filter-view.component.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h2 class="SummaryTitle">{{ 'app.view.editor-filter-view.filter' | translate }}<
9393
></sbb-filterable-label-filter-view>
9494
</sbb-expansion-panel>
9595

96-
<sbb-expansion-panel [expanded]="hasFilteringNoteLabels">
96+
<sbb-expansion-panel [expanded]="hasFilteringNoteLabels" *ngIf="!disableBackend">
9797
<sbb-expansion-panel-header>
9898
<ng-container *ngIf="!isFilteringNoteLabels()">
9999
{{ 'app.view.editor-filter-view.filterable-labels-notes' | translate }}
@@ -177,13 +177,15 @@ <h2 class="SummaryTitle">{{ 'app.view.editor-filter-view.filter' | translate }}<
177177
</sbb-checkbox>
178178
</div>
179179

180-
<br />
181-
<sbb-label>{{ 'app.view.editor-filter-view.notes' | translate }}</sbb-label>
182-
<div class="sbb-checkbox-group-vertical">
183-
<sbb-checkbox [(ngModel)]="filterNotes" (change)="filterNotesChanged()"
184-
>{{ 'app.view.editor-filter-view.display-notes' | translate }}
185-
</sbb-checkbox>
186-
</div>
180+
<ng-container *ngIf="!disableBackend">
181+
<br />
182+
<sbb-label>{{ 'app.view.editor-filter-view.notes' | translate }}</sbb-label>
183+
<div class="sbb-checkbox-group-vertical">
184+
<sbb-checkbox [(ngModel)]="filterNotes" (change)="filterNotesChanged()"
185+
>{{ 'app.view.editor-filter-view.display-notes' | translate }}
186+
</sbb-checkbox>
187+
</div>
188+
</ng-container>
187189

188190
<button
189191
sbb-secondary-button

src/app/view/editor-filter-view/editor-filter-view.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {Subject} from "rxjs";
1212
import {FilterSetting} from "../../models/filterSettings.model";
1313
import {takeUntil} from "rxjs/operators";
1414
import {StaticDomTags} from "../editor-main-view/data-views/static.dom.tags";
15+
import {environment} from "../../../environments/environment";
1516

1617
@Component({
1718
selector: "sbb-editor-filter-view",
@@ -36,6 +37,8 @@ export class EditorFilterViewComponent implements OnInit, OnDestroy {
3637
activeFilterName: string;
3738
activeEditFilterSettingId: number;
3839

40+
readonly disableBackend = environment.disableBackend;
41+
3942
private destroyed = new Subject<void>();
4043

4144
constructor(

0 commit comments

Comments
 (0)