Skip to content

Commit

Permalink
Rename service source data signal
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Aug 16, 2024
1 parent 456921f commit f8de129
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 2 additions & 3 deletions erdblick_app/app/feature.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,12 @@ export class FeaturePanelComponent implements OnInit {
filterByValues = true;
filterOnlyFeatureIds = false;
filterGeometryEntries = false;
jsonTree = "";

@ViewChild('inspectionMenu') inspectionMenu!: Menu;
inspectionMenuItems: MenuItem[] | undefined;
inspectionMenuVisible: boolean = false;

@Input() jsonTree = "";

constructor(private clipboardService: ClipboardService,
public inspectionService: InspectionService,
public jumpService: JumpTargetService,
Expand Down Expand Up @@ -336,7 +335,7 @@ export class FeaturePanelComponent implements OnInit {
const address = sourceDataRef.address;
const mapId = this.inspectionService.selectedMapIdName;

this.inspectionService.sourceData.next({
this.inspectionService.selectedSourceData.next({
tileId: Number(tileId),
layerId: String(layerId),
mapId: String(mapId),
Expand Down
9 changes: 7 additions & 2 deletions erdblick_app/app/inspection.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ export class InspectionPanelComponent implements OnInit

this.inspectionService.featureTree.pipe(distinctUntilChanged()).subscribe((tree: string) => {
this.reset();

// TODO: Create a new FeaturePanelComponent instance for each unique selected feature
// then we can get rid of all the service's View Component logic/functions.
// reset() Would then completely clear the tabs.
this.tabs[0].title = this.inspectionService.selectedFeatureIdName;
});

this.inspectionService.sourceData.pipe(distinctUntilChanged()).subscribe(data => {
this.inspectionService.selectedSourceData.pipe(distinctUntilChanged()).subscribe(data => {
this.reset();
this.pushSourceDataInspector(data);
})
Expand All @@ -82,7 +87,7 @@ export class InspectionPanelComponent implements OnInit

pushFeatureInspector() {
let tab = {
title: "Feature",
title: "",
icon: "pi-sitemap",
component: FeaturePanelComponent,
}
Expand Down
2 changes: 1 addition & 1 deletion erdblick_app/app/inspection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class InspectionService {
selectedFeatureIdName: string = "";
selectedMapIdName: string = "";
selectedFeature: FeatureWrapper | null = null;
sourceData: ReplaySubject<SelectedSourceData> = new ReplaySubject<SelectedSourceData>();
selectedSourceData: ReplaySubject<SelectedSourceData> = new ReplaySubject<SelectedSourceData>();

constructor(private mapService: MapService,
private jumpService: JumpTargetService,
Expand Down

0 comments on commit f8de129

Please sign in to comment.