fix(frontend): add navigation context for cross-view linking and fix double-load bug
Projects "View Secrets"/"View Pipelines" and Groups "View Secrets" now pass connection/scope/entity context so the target view opens with filters pre-filled. Fixed double-load bug where dees-simple-appdash's view-select event re-dispatched setActiveViewAction without context.
This commit is contained in:
@@ -201,6 +201,19 @@ export class GitopsViewSecrets extends DeesElement {
|
||||
|
||||
async firstUpdated() {
|
||||
await appstate.connectionsStatePart.dispatchAction(appstate.fetchConnectionsAction, null);
|
||||
|
||||
// Check for navigation context from projects/groups view
|
||||
const navCtx = appstate.uiStatePart.getState().navigationContext;
|
||||
if (navCtx?.connectionId && navCtx?.scope && navCtx?.scopeId) {
|
||||
this.selectedConnectionId = navCtx.connectionId;
|
||||
this.selectedScope = navCtx.scope;
|
||||
this.selectedScopeId = navCtx.scopeId;
|
||||
appstate.uiStatePart.dispatchAction(appstate.clearNavigationContextAction, null);
|
||||
await this.loadEntities();
|
||||
await this.loadSecrets();
|
||||
return;
|
||||
}
|
||||
|
||||
const conns = appstate.connectionsStatePart.getState().connections;
|
||||
if (conns.length > 0 && !this.selectedConnectionId) {
|
||||
this.selectedConnectionId = conns[0].id;
|
||||
|
||||
Reference in New Issue
Block a user