Skip to content

Commit 2e3811f

Browse files
navigate from URL issues are fixed for all.
1 parent 7f18b56 commit 2e3811f

File tree

11 files changed

+59
-27
lines changed

11 files changed

+59
-27
lines changed

src/api/endpoints.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ export const endpoints = {
2727
},
2828
pipelines: {
2929
my: '/pipelines?hydrated=true',
30-
get: (pipelineId: TId): string => `/pipelines/${pipelineId}&hydrated=true`,
30+
get: (pipelineId: TId): string =>
31+
`/pipelines/${pipelineId}?unlisted=false&hydrated=true`,
3132
},
3233
Stacks: {
3334
my: '/stacks?hydrated=true',
34-
get: (stackId: TId): string => `/Stacks/${stackId}&hydrated=true`,
35+
get: (stackId: TId): string =>
36+
`/stacks/${stackId}?unlisted=false&hydrated=true`,
3537
},
3638
StackComponents: {
3739
types: '/component-types',
38-
my: (type: string): string => `/components?type=${type}&hydrated=true`,
40+
my: (type: string): string =>
41+
`/components?type=${type}?unlisted=false&hydrated=true`,
3942
get: (stackComponentId: TId): string =>
4043
`/components/${stackComponentId}?hydrated=true`,
4144
},
@@ -50,14 +53,13 @@ export const endpoints = {
5053
},
5154
stackComponent: {
5255
get: (stackComponentId: TId): string =>
53-
`/runs?component_id=${stackComponentId}&hydrated=true`,
56+
`/runs?component_id=${stackComponentId}&unlisted=false&hydrated=true`,
5457
},
5558
graphById: {
5659
get: (runId: TId): string => `/runs/${runId}/graph`,
5760
},
5861
all: `/runs?unlisted=false&hydrated=true`,
59-
get: (pipelineId: TId, runId: TId): string =>
60-
`/pipelines/${pipelineId}/runs/${runId}`,
62+
get: (runId: TId): string => `/runs/${runId}?unlisted=false&hydrated=true`,
6163
},
6264
billing: {
6365
my: '/billing/stripe/session',

src/api/runs/getRunByIdApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const getRunByIdApi = ({
1414
runId: TId;
1515
}): Promise<TOrganization> =>
1616
fetchApiWithAuthRequest({
17-
url: apiUrl(endpoints.runs.get(pipelineId, runId)),
17+
url: apiUrl(endpoints.runs.get(runId)),
1818
method: httpMethods.get,
1919
authenticationToken,
2020
}).catch((res) => {

src/redux/actions/runs/getRunByIdAction.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ import getRunByIdApi from '../../../api/runs/getRunByIdApi';
33

44
export const getRunByIdAction = ({
55
runId,
6+
stackId,
67
pipelineId,
7-
workspaceId,
8+
stackComponentId,
89
onSuccess,
910
onFailure,
1011
}: {
1112
runId: TId;
12-
pipelineId: TId;
13-
workspaceId?: TId | null;
13+
stackId?: TId;
14+
pipelineId?: TId;
15+
stackComponentId?: TId;
1416
onSuccess?: () => void;
1517
onFailure?: () => void;
1618
}): TRequestAction => ({
@@ -20,7 +22,7 @@ export const getRunByIdAction = ({
2022
isAuthenticated: true,
2123
failureActionType: runActionTypes.getRunForId.failure,
2224
successActionType: runActionTypes.getRunForId.success,
23-
params: { runId, pipelineId, workspaceId },
25+
params: { runId, stackId, pipelineId, stackComponentId },
2426
onSuccess,
2527
onFailure,
2628
},

src/ui/layouts/pipelines/PipelineDetail/Runs/useService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useEffect } from 'react';
12
import { useSelector } from 'react-redux';
23
import {
34
runPagesSelectors,
@@ -16,6 +17,7 @@ export const useService = ({
1617
}): ServiceInterface => {
1718
const fetching = useSelector(runPagesSelectors.fetching);
1819
const runs: TRun[] = useSelector(runSelectors.runsForPipelineId(pipelineId));
20+
// useEffect(() => {}, [runs]);
1921

2022
const runIds = runs.map((run: TRun) => run.id);
2123

src/ui/layouts/pipelines/PipelineDetail/useService.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export const useService = (): ServiceInterface => {
1919
useEffect(() => {
2020
setFetching(true);
2121
// Legacy: previously runs was in pipeline
22-
// dispatch(
23-
// pipelinesActions.pipelineForId({
24-
// pipelineId: id,
25-
// onSuccess: () => setFetching(false),
26-
// onFailure: () => setFetching(false),
27-
// }),
28-
// );
22+
dispatch(
23+
pipelinesActions.pipelineForId({
24+
pipelineId: id,
25+
onSuccess: () => setFetching(false),
26+
onFailure: () => setFetching(false),
27+
}),
28+
);
2929
dispatch(
3030
pipelinesActions.allRunsByPipelineId({
3131
pipelineId: id,

src/ui/layouts/pipelines/RunDetail/useService.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ export const useService = (): ServiceInterface => {
3737
onFailure: () => setFetching(false),
3838
}),
3939
);
40+
dispatch(
41+
runsActions.runForId({
42+
pipelineId: pipelineId,
43+
runId: id,
44+
onSuccess: () => setFetching(false),
45+
onFailure: () => setFetching(false),
46+
}),
47+
);
4048
setIsMounted(true);
4149
}
4250
// eslint-disable-next-line react-hooks/exhaustive-deps

src/ui/layouts/pipelines/RunsTable/useService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const useService = ({
4141
const [activeSorting, setActiveSorting] = React.useState<Sorting | null>(
4242
'createdAt',
4343
);
44+
4445
const [
4546
activeSortingDirection,
4647
setActiveSortingDirection,
@@ -55,13 +56,14 @@ export const useService = ({
5556
let orderedRuns = _.sortBy(runs, (run: TRun) =>
5657
new Date(run.created).getTime(),
5758
).reverse();
59+
5860
const isValidFilter = filter?.map((f) => f.value).join('');
5961
if (isValidFilter) {
6062
orderedRuns = getFilteredDataForTable(orderedRuns, filter);
6163
}
6264

6365
setSortedRuns(orderedRuns);
64-
}, [filter]);
66+
}, [filter, runIds]);
6567

6668
const setSelectedRunIds = (runIds: TId[]) => {
6769
dispatch(pipelinePagesActions.setSelectedRunIds({ runIds }));

src/ui/layouts/stackComponents/RunDetail/useService.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ export const useService = (): ServiceInterface => {
3737
useEffect(() => {
3838
if (!isMounted) {
3939
setFetching(true);
40+
dispatch(
41+
runsActions.runForId({
42+
stackComponentId: stackComponentId,
43+
runId: id,
44+
onSuccess: () => setFetching(false),
45+
onFailure: () => setFetching(false),
46+
}),
47+
);
4048
dispatch(
4149
runsActions.graphForRun({
4250
runId: id,

src/ui/layouts/stackComponents/Stacks/List/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const List: React.FC<Props> = ({ filter }: Props) => {
7474
: {
7575
text: `Nothing to see here, it seems like no ${camelCaseToParagraph(
7676
locationPath.split('/')[2],
77-
)} has been configured yet`,
77+
)} has been configured yet.`,
7878
}
7979
}
8080
trOnClick={openDetailPage}

src/ui/layouts/stacks/RunDetail/useService.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ export const useService = (): ServiceInterface => {
4141
useEffect(() => {
4242
if (!isMounted) {
4343
setFetching(true);
44+
dispatch(
45+
runsActions.runForId({
46+
stackId: stackId,
47+
runId: id,
48+
onSuccess: () => setFetching(false),
49+
onFailure: () => setFetching(false),
50+
}),
51+
);
4452
dispatch(
4553
runsActions.graphForRun({
4654
runId: id,

0 commit comments

Comments
 (0)