Skip to content

Commit

Permalink
feature: add config option to show or hide "show normalized toggle" i…
Browse files Browse the repository at this point in the history
…n manuscripts

`config.component.manuscripts.showNormalizedToggle`
The new config option defaults to `true`.
  • Loading branch information
SebastianKohler authored Dec 27, 2023
1 parent 5d11e3c commit 930eec2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Config option to show or hide the toggle for switching between the normalized and non-normalized version of manuscripts: `config.component.manuscripts.showNormalizedToggle`. The new config option defaults to `true`.

### Changed

- Update Angular to 17.0.8.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ion-spinner *ngIf="!text" class="loading" name="crescent"></ion-spinner>

<div *ngIf="text && manuscripts.length>0" class="text-select-wrapper">
<div *ngIf="text && manuscripts.length > 0 && (showTitle || manuscripts.length>1 || showOpenLegendButton || showNormalizedToggle)" class="text-select-wrapper">
<h3 *ngIf="showTitle" [innerHTML]="selectedManuscript.name"></h3>
<div *ngIf="manuscripts.length>1 || showOpenLegendButton" class="flex-buttons">
<ion-button *ngIf="manuscripts.length>1" class="custom-button" (click)="selectManuscript()" i18n="@@Manuscripts.ChangeManuscript">Byt manuskript</ion-button>
Expand All @@ -11,7 +11,7 @@ <h3 *ngIf="showTitle" [innerHTML]="selectedManuscript.name"></h3>
<ion-icon name="help-outline"></ion-icon>
</ion-button>
</div>
<div class="show-normalized-toggle">
<div *ngIf="showNormalizedToggle" class="show-normalized-toggle">
<ion-toggle (ionChange)="toggleNormalizedManuscript()" justify="space-between" [enableOnOffLabels]="true" i18n="@@Manuscripts.ShowNormalized">Visa ändringar inarbetade</ion-toggle>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class ManuscriptsComponent implements OnInit {
manuscripts: any[] = [];
selectedManuscript: any = undefined;
showNormalizedMs: boolean = false;
showNormalizedToggle: boolean = true;
showOpenLegendButton: boolean = false;
showTitle: boolean = true;
text: SafeHtml = '';
Expand All @@ -44,6 +45,7 @@ export class ManuscriptsComponent implements OnInit {
private scrollService: ScrollService,
public viewOptionsService: ViewOptionsService
) {
this.showNormalizedToggle = config.component?.manuscripts?.showNormalizedToggle ?? true;
this.showOpenLegendButton = config.component?.manuscripts?.showOpenLegendButton ?? false;
this.showTitle = config.component?.manuscripts?.showTitle ?? true;
}
Expand Down
1 change: 1 addition & 0 deletions src/assets/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ export const config: Config = {
},
manuscripts: {
showTitle: true,
showNormalizedToggle: true,
showOpenLegendButton: true
},
topMenu: {
Expand Down

0 comments on commit 930eec2

Please sign in to comment.