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:
@@ -34,10 +34,18 @@ export interface IActionLogState {
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface INavigationContext {
|
||||
connectionId?: string;
|
||||
scope?: 'project' | 'group';
|
||||
scopeId?: string;
|
||||
projectId?: string;
|
||||
}
|
||||
|
||||
export interface IUiState {
|
||||
activeView: string;
|
||||
autoRefresh: boolean;
|
||||
refreshInterval: number;
|
||||
navigationContext?: INavigationContext;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -664,9 +672,22 @@ export const fetchActionLogAction = actionLogStatePart.createAction<{
|
||||
// UI Actions
|
||||
// ============================================================================
|
||||
|
||||
export const setActiveViewAction = uiStatePart.createAction<{ view: string }>(
|
||||
export const setActiveViewAction = uiStatePart.createAction<{
|
||||
view: string;
|
||||
navigationContext?: INavigationContext;
|
||||
}>(
|
||||
async (statePartArg, dataArg) => {
|
||||
return { ...statePartArg.getState(), activeView: dataArg.view };
|
||||
return {
|
||||
...statePartArg.getState(),
|
||||
activeView: dataArg.view,
|
||||
navigationContext: dataArg.navigationContext,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
export const clearNavigationContextAction = uiStatePart.createAction(
|
||||
async (statePartArg) => {
|
||||
return { ...statePartArg.getState(), navigationContext: undefined };
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user