Skip to content

Commit

Permalink
Rename showRunId callback function
Browse files Browse the repository at this point in the history
Signed-off-by: Wei-Chun, Chang <[email protected]>
  • Loading branch information
wcchang1115 committed Oct 26, 2024
1 parent 11b2598 commit e48a968
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions js/src/components/lineage/LineageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export function LineageView({ ...props }: LineageViewProps) {
refetchRunsAggregated,
} = useLineageGraphContext();

const { showRunId, closeRunResult } = useRecceActionContext();
const { showRunInfo, closeRunResult } = useRecceActionContext();

/**
* View mode
Expand Down Expand Up @@ -376,7 +376,7 @@ export function LineageView({ ...props }: LineageViewProps) {
setNodes(selectSingleNode(node.id, nodes));
} else if (selectMode === "action_result") {
if (node.data.action?.run?.run_id) {
showRunId(node.data.action?.run?.run_id, node.data.action?.run?.type);
showRunInfo(node.data.action?.run?.run_id, node.data.action?.run?.type);
}
centerNode(node);
setNodes(selectSingleNode(node.id, nodes));
Expand Down
4 changes: 2 additions & 2 deletions js/src/components/lineage/NodeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function NodeSelector({
});
const queryClient = useQueryClient();
const [, setLocation] = useLocation();
const { showRunId } = useRecceActionContext();
const { showRunInfo } = useRecceActionContext();

const submitRunForNodes = async (
type: RunType,
Expand Down Expand Up @@ -174,7 +174,7 @@ export function NodeSelector({

try {
const { run_id } = await submitRun(type, params, { nowait: true });
showRunId(run_id, type);
showRunInfo(run_id, type);
actionState.currentRun = { run_id };
actionState.total = 1;

Expand Down
4 changes: 2 additions & 2 deletions js/src/components/query/QueryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const QueryPage = () => {
sqlQuery = `select * from db.mymodel`;
}

const { showRunId } = useRecceActionContext();
const { showRunInfo } = useRecceActionContext();
const queryFn = async (type: "query" | "query_base" | "query_diff") => {
function queryFactory(type: string) {
switch (type) {
Expand All @@ -111,7 +111,7 @@ export const QueryPage = () => {
}
const { run_id } = await runFn(params, options);

showRunId(run_id, type);
showRunInfo(run_id, type);

return await waitRun(run_id);
};
Expand Down
4 changes: 2 additions & 2 deletions js/src/components/run/RunList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ export const RunList = () => {
},
retry: false,
});
const { showRunId, runId } = useRecceActionContext();
const { showRunInfo, runId } = useRecceActionContext();
const handleSelectRun = (runId: string, runType: RunType) => {
showRunId(runId, runType, false);
showRunInfo(runId, runType, false);
};
const [, setLocation] = useLocation();
const queryClient = useQueryClient();
Expand Down
14 changes: 7 additions & 7 deletions js/src/lib/hooks/RecceActionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface RecceActionContextType {
) => void;
runId?: string;
runType?: RunType;
showRunId: (
showRunInfo: (
runId: string,
runType: RunType,
refreshHistory?: boolean
Expand All @@ -44,7 +44,7 @@ export interface RecceActionContextType {

export const RecceActionContext = createContext<RecceActionContextType>({
runAction: () => {},
showRunId: (runId: string, runType: RunType) => {},
showRunInfo: (runId: string, runType: RunType) => {},
isRunResultOpen: false,
closeRunResult: () => {},
isHistoryOpen: false,
Expand Down Expand Up @@ -99,7 +99,7 @@ export function RecceActionContextProvider({
const [location, setLocation] = useLocation();
const queryClient = useQueryClient();

const showRunId = useCallback(
const showRunInfo = useCallback(
(runId: string, runType: RunType, refreshHistory?: boolean) => {
setRunId(runId);
setRunType(runType);
Expand Down Expand Up @@ -138,7 +138,7 @@ export function RecceActionContextProvider({
const { run_id } = await submitRun(type, params, {
nowait: true,
});
showRunId(run_id, type);
showRunInfo(run_id, type);
queryClient.invalidateQueries({ queryKey: cacheKeys.runs() });
if (location.startsWith("/lineage")) {
setLocation("/lineage");
Expand Down Expand Up @@ -169,7 +169,7 @@ export function RecceActionContextProvider({
[
setAction,
onModalOpen,
showRunId,
showRunInfo,
toast,
location,
setLocation,
Expand All @@ -184,7 +184,7 @@ export function RecceActionContextProvider({
const { run_id } = await submitRun(type, params, {
nowait: true,
});
showRunId(run_id, type);
showRunInfo(run_id, type);
} catch (e: any) {
toast({
title: "Failed to submit a run",
Expand Down Expand Up @@ -212,7 +212,7 @@ export function RecceActionContextProvider({
runAction,
runId,
runType,
showRunId,
showRunInfo,
isRunResultOpen,
closeRunResult,
isHistoryOpen,
Expand Down

0 comments on commit e48a968

Please sign in to comment.