MemberJunction / MemberJunction/MJ

ERD entity details "Open" button in the Admin app does nothing (Interaction output has no subscriber)

Open
#4,354 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TSQL
Stars
29
Forks
6
Avg merge
2d 1h
Merged PRs (30d)
323

Description

## What happens

In the **Admin app → Data & Schema → ERD**, selecting an entity opens the details panel on the right (e.g. *Certifications*). The panel has an **Open** button in its header. Clicking it does nothing — no navigation, no tab, no error in the console.

Screenshot context: `mj.morecheese.org/app/admin/Data%20&%20Schema?section=erd`, Certifications entity selected, "Open" button top-right of the details panel.

## Why

The click does fire, but it dead-ends two hops up:

1. The ERD details panel emits `openEntity`, and `mj-erd-composite` forwards it as `entityOpened` (`packages/Angular/Generic/entity-relationship-diagram/src/lib/components/erd-composite/erd-composite.component.ts`).
2. `EntityAdminDashboardComponent.onEntityOpened()` handles that by emitting the generic `BaseDashboard.Interaction` output with `{ type: 'openEntity', entity, data }` (`packages/Angular/Explorer/dashboards/src/EntityAdmin/entity-admin-dashboard.component.ts` ~L122–140).
3. **Nothing subscribes to `Interaction`.** A repo-wide search finds no `(Interaction)` binding and no `.Interaction.subscribe` anywhere in Explorer.

Both hosts of this dashboard miss it:

- `BaseAdminContainerComponent` (`packages/Angular/Explorer/dashboards/src/Admin/base-admin-container.component.ts` ~L247) creates the dashboard dynamically and subscribes only to `Error`. It subscribes to neither `Interaction` nor `OpenEntityRecord`, so even the ERD's *record* opens (`onOpenRecord` → `OpenEntityRecord`) are dropped inside the Admin app.
- `DashboardResourceComponent` (`explorer-core/.../dashboard-resource.component.ts` ~L738, ~L847) subscribes to `OpenEntityRecord` but also not to `Interaction`, so the Open button is equally dead when the dashboard is opened as a workspace resource.

## Expected

Open should open the entity's own record (**MJ: Entities**, PK = `entity.ID`) in Explorer — the same thing the ERD's record-open path and the sibling dashboards (Data Explorer, Theme Studio) do via `OpenEntityRecord`.

## Suggested fix

1. In `EntityAdminDashboardComponent.openEntity()`, stop emitting the orphan `Interaction` and emit `OpenEntityRecord` instead:
```ts
this.OpenEntityRecord.emit({
EntityName: 'MJ: Entities',
RecordPKey: CompositeKey.FromID(entity.ID), // or FromURLSegment against the Entities metadata
});
```
2. In `BaseAdminContainerComponent`, subscribe to the hosted dashboard's `OpenEntityRecord` and route it the same way `DashboardResourceComponent` does (NavigationService / `OpenEntityRecord` re-emit up to the app shell). That also fixes record opens from the ERD canvas inside Admin, which are silently dropped today.
3. Consider removing the unused `BaseDashboard.Interaction` output (typed `EventEmitter`), or documenting what is supposed to consume it — right now it is a trap for exactly this kind of bug.

## Repro

1. Admin app → Data & Schema → ERD.
2. Click any entity node → details panel opens.
3. Click **Open** in the panel header.
4. Nothing happens.

Observed on `next` @ c1fea88930.

Contributor guide

Open the contributing guide

Research direction

Start with EntityAdminDashboardComponent.onEntityOpened() and openEntity() in packages/Angular/Explorer/dashboards/src/EntityAdmin/entity-admin-dashboard.component.ts, then trace the hosted-dashboard subscriptions in BaseAdminContainerComponent and explorer-core/.../dashboard-resource.component.ts. Reproduce the ERD workflow and compare it with the existing OpenEntityRecord handling; done means the entity Open button and ERD record opens navigate to the entity record in both hosts.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.