Skip to content

Commit 17aea2b

Browse files
committed
Merge branch 'main' into edit-copy-features
2 parents c60f32f + 147976c commit 17aea2b

File tree

17 files changed

+168
-14
lines changed

17 files changed

+168
-14
lines changed

projects/admin-core/assets/locale/messages.admin-core.de.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,10 @@
16141614
<source>Search title</source>
16151615
<target>Suchtitel</target>
16161616
</trans-unit>
1617+
<trans-unit id="admin-core.components.toc-show-edit-layer-icon" datatype="html">
1618+
<source>Show edit layer icon</source>
1619+
<target>Symbol zum Bearbeiten der Ebene anzeigen</target>
1620+
</trans-unit>
16171621
<trans-unit id="admin-core.feature-type-settings-updated" datatype="html">
16181622
<source>Feature type settings updated</source>
16191623
<target>Feature-Typ-Einstellungen aktualisiert</target>

projects/admin-core/assets/locale/messages.admin-core.en.xlf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,9 @@
11901190
<trans-unit id="admin-core.components.simple-search-title" datatype="html">
11911191
<source>Search title</source>
11921192
</trans-unit>
1193+
<trans-unit id="admin-core.components.toc-show-edit-layer-icon" datatype="html">
1194+
<source>Show edit layer icon</source>
1195+
</trans-unit>
11931196
<trans-unit id="admin-core.feature-type-settings-updated" datatype="html">
11941197
<source>Feature type settings updated</source>
11951198
</trans-unit>

projects/admin-core/assets/locale/messages.admin-core.nl.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,10 @@
16131613
<source>Search title</source>
16141614
<target>Zoeken titel</target>
16151615
</trans-unit>
1616+
<trans-unit id="admin-core.components.toc-show-edit-layer-icon" datatype="html">
1617+
<source>Show edit layer icon</source>
1618+
<target>Toon icoon voor het bewerken van de laag</target>
1619+
</trans-unit>
16161620
<trans-unit id="admin-core.feature-type-settings-updated" datatype="html">
16171621
<source>Feature type settings updated</source>
16181622
<target>Feature type instellingen aangepast</target>

projects/admin-core/src/lib/application/components/components.module.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { EditComponentConfigComponent } from './edit-config/edit-component-confi
1616
import { GeolocationConfigComponent } from './geolocation-config/geolocation-config.component';
1717
import { InfoConfigComponent } from './info-config/info-config.component';
1818
import { DrawingConfigComponent } from './drawing-config/drawing-config.component';
19-
import { SharedAdminComponentsModule } from '../../shared/components';
19+
import { TocComponentConfigComponent } from './toc-config/toc-component-config.component';
2020

2121
@NgModule({
2222
declarations: [
@@ -31,15 +31,15 @@ import { SharedAdminComponentsModule } from '../../shared/components';
3131
GeolocationConfigComponent,
3232
InfoConfigComponent,
3333
DrawingConfigComponent,
34+
TocComponentConfigComponent,
3435
],
35-
imports: [
36-
CommonModule,
37-
SharedModule,
38-
BaseComponentConfigComponent,
39-
SelectUploadModule,
40-
MarkdownEditorComponent,
41-
SharedAdminComponentsModule,
42-
],
36+
imports: [
37+
CommonModule,
38+
SharedModule,
39+
BaseComponentConfigComponent,
40+
SelectUploadModule,
41+
MarkdownEditorComponent,
42+
],
4343
exports: [
4444
ComponentsListComponent,
4545
ComponentConfigRendererComponent,

projects/admin-core/src/lib/application/components/toc-config/toc-component-config.component.css

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<tm-admin-base-component-config [type]="type"
2+
[label]="label"
3+
[config]="config"
4+
i18n-titleLabel="@@admin-core.application.component-table-of-contents"
5+
titleLabel="Table of contents">
6+
<div [formGroup]="formGroup">
7+
<mat-checkbox formControlName="showEditLayerIcon"
8+
i18n="@@admin-core.components.toc-show-edit-layer-icon">Show edit layer icon</mat-checkbox>
9+
</div>
10+
</tm-admin-base-component-config>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { ChangeDetectionStrategy, Component, DestroyRef, Input, inject } from '@angular/core';
2+
import {
3+
BaseComponentTypeEnum, TocConfigModel,
4+
} from '@tailormap-viewer/api';
5+
import { FormControl, FormGroup } from '@angular/forms';
6+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7+
import { ComponentConfigurationService } from '../../services/component-configuration.service';
8+
import { ConfigurationComponentModel } from '../configuration-component.model';
9+
import { debounceTime } from 'rxjs';
10+
11+
@Component({
12+
selector: 'tm-admin-edit-component-config',
13+
templateUrl: './toc-component-config.component.html',
14+
styleUrls: ['./toc-component-config.component.css'],
15+
changeDetection: ChangeDetectionStrategy.OnPush,
16+
standalone: false,
17+
})
18+
export class TocComponentConfigComponent implements ConfigurationComponentModel<TocConfigModel> {
19+
private componentConfigService = inject(ComponentConfigurationService);
20+
private destroyRef = inject(DestroyRef);
21+
22+
@Input()
23+
public type: BaseComponentTypeEnum | undefined;
24+
25+
@Input()
26+
public label: string | undefined;
27+
28+
@Input()
29+
public set config(config: TocConfigModel | undefined) {
30+
this._config = config;
31+
this.initForm(config);
32+
}
33+
public get config() {
34+
return this._config;
35+
}
36+
private _config: TocConfigModel | undefined;
37+
38+
public formGroup = new FormGroup({
39+
showEditLayerIcon: new FormControl<boolean>(false),
40+
});
41+
42+
constructor() {
43+
this.formGroup.valueChanges
44+
.pipe(takeUntilDestroyed(this.destroyRef), debounceTime(250))
45+
.subscribe(() => {
46+
if (!this.formGroup.valid) {
47+
return;
48+
}
49+
this.saveConfig();
50+
});
51+
}
52+
53+
public initForm(config: TocConfigModel | undefined) {
54+
this.formGroup.patchValue({ showEditLayerIcon: config?.showEditLayerIcon ?? false }, { emitEvent: false });
55+
}
56+
57+
private saveConfig() {
58+
this.componentConfigService.updateConfigForKey<TocConfigModel>(this.type, 'showEditLayerIcon', this.formGroup.value.showEditLayerIcon);
59+
}
60+
}

projects/api/src/lib/models/component-config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export * from './edit-config.model';
77
export * from './geolocation-config.model';
88
export * from './info-component-config.model';
99
export * from './drawing-component-config.model';
10+
export * from './toc-config.model';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ComponentBaseConfigModel } from '../component-base-config.model';
2+
3+
export interface TocConfigModel extends ComponentBaseConfigModel {
4+
showEditLayerIcon?: boolean;
5+
}

projects/core/assets/locale/messages.core.de.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,10 @@
11221122
<source>Details for <x id="INTERPOLATION" equiv-text="{{node.layer?.title || node.name}}"/></source>
11231123
<target>Details für <x id="INTERPOLATION" equiv-text="{{node.layer?.title || node.name}}"/></target>
11241124
</trans-unit>
1125+
<trans-unit id="core.toc.edit-layer" datatype="html">
1126+
<source>Edit layer</source>
1127+
<target>Ebene bearbeiten</target>
1128+
</trans-unit>
11251129
<trans-unit id="core.toc.filter-by-layer-name" datatype="html">
11261130
<source>Filter by layer name...</source>
11271131
<target>Nach Ebenennamen filtern...</target>

0 commit comments

Comments
 (0)