Skip to content

Commit c8d24c8

Browse files
committed
fix(story): temp disable unused queries
1 parent 9eea0b0 commit c8d24c8

File tree

3 files changed

+33
-20
lines changed

3 files changed

+33
-20
lines changed

src/app/Trust/Overview/TrustOverview.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { ChartDonut, ChartThemeColor } from '@patternfly/react-charts/victory';
2929
import { MultiContentCard } from '@patternfly/react-component-groups';
3030
import { ArrowRightIcon, LockIcon, RedoIcon } from '@patternfly/react-icons';
3131
import { formatDate } from '@app/utils/utils';
32-
import { useQuery } from '@tanstack/react-query';
32+
// import { useQuery } from '@tanstack/react-query';
3333

3434
const exampleCerts = [
3535
{
@@ -62,18 +62,18 @@ const exampleCerts = [
6262
];
6363

6464
const TrustOverview = () => {
65-
const { isPending, error, data } = useQuery({
66-
queryKey: ['trustConfig'],
67-
queryFn: () => fetch('http://localhost:8080/api/v1/trust/config').then((res) => res.json()),
68-
});
65+
// const { isPending, error, data } = useQuery({
66+
// queryKey: ['trustConfig'],
67+
// queryFn: () => fetch('http://localhost:8080/api/v1/trust/config').then((res) => res.json()),
68+
// });
6969

70-
if (isPending) return 'Loading...';
70+
// if (isPending) return 'Loading...';
7171

72-
if (error) return 'An error has occurred: ' + error.message;
72+
// if (error) return 'An error has occurred: ' + error.message;
7373

74-
if (data) {
75-
console.table(data);
76-
}
74+
// if (data) {
75+
// console.table(data);
76+
// }
7777

7878
const certListFormatted = [
7979
<SimpleListItem key="item1" component="a" href="#" isActive>

src/app/Trust/TrustRoots/components/TrustRootsDataList.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-i
3131
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
3232
import TimesCircleIcon from '@patternfly/react-icons/dist/esm/icons/times-circle-icon';
3333
import { MinusIcon, CalendarAltIcon, FileAltIcon, EllipsisVIcon } from '@patternfly/react-icons';
34-
import { useQuery } from '@tanstack/react-query';
34+
// import { useQuery } from '@tanstack/react-query';
3535

3636
import { TrustRootsDrawerContent } from './TrustRootsDrawerContent';
3737
import { exampleTrustRoot } from '../TrustRoots.data';
@@ -41,18 +41,18 @@ const TrustRootsDataList = () => {
4141
const [isDrawerExpanded, setIsDrawerExpanded] = useState(false);
4242
const drawerRef = useRef<HTMLDivElement>(undefined);
4343

44-
const { isPending, error, data } = useQuery({
45-
queryKey: ['trustConfig'],
46-
queryFn: () => fetch('http://localhost:8080/api/v1/trust/config').then((res) => res.json()),
47-
});
44+
// const { isPending, error, data } = useQuery({
45+
// queryKey: ['trustConfig'],
46+
// queryFn: () => fetch('http://localhost:8080/api/v1/trust/config').then((res) => res.json()),
47+
// });
4848

49-
if (isPending) return 'Loading...';
49+
// if (isPending) return 'Loading...';
5050

51-
if (error) return 'An error has occurred: ' + error.message;
51+
// if (error) return 'An error has occurred: ' + error.message;
5252

53-
if (data) {
54-
console.table(data);
55-
}
53+
// if (data) {
54+
// console.table(data);
55+
// }
5656

5757
const getRow = (id: string, lastStatus: 'success' | 'error' | null, isRunning: boolean) => {
5858
let mainIcon;

src/mocks/handlers.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,49 @@ import { http, HttpResponse } from 'msw';
22

33
export const handlers = [
44
// healthz
5+
// Retrieves the current health status of the server.
56
http.get('http://localhost:8080/healthz', () => {
67
return HttpResponse.json({});
78
}),
89

910
// artifacts: sign
11+
// Signs an artifact using Cosign.
1012
http.get('http://localhost:8080/api/v1/artifacts/sign', () => {
1113
return HttpResponse.json({});
1214
}),
1315

1416
// artifacts: verify
17+
// Verifies an artifact using Cosign.
1518
http.get('http://localhost:8080/api/v1/artifacts/verify', () => {
1619
return HttpResponse.json({});
1720
}),
1821

1922
// artifacts: policies
23+
// Retrieves policies and attestations for an artifact.
2024
http.get('http://localhost:8080/api/v1/artifacts/{artifact}/policies', () => {
2125
return HttpResponse.json({});
2226
}),
2327

28+
// artifacts: image
29+
// Retrieves metadata for a container image by full reference URI.
30+
http.get('http://localhost:8080/api/v1/artifacts/image', () => {
31+
return HttpResponse.json({});
32+
}),
33+
2434
// rekor: entries
35+
// Retrieves a Rekor transparency log entry by UUID.
2536
http.get('http://localhost:8080/api/v1/rekor/entries/{uuid}', () => {
2637
return HttpResponse.json({});
2738
}),
2839

2940
// rekor: public key
41+
// Retrieves the Rekor public key in PEM format.
3042
http.get('http://localhost:8080/api/v1/rekor/public-key', () => {
3143
return HttpResponse.json({});
3244
}),
3345

3446
// trust config
47+
// Retrieves TUF targets and Fulcio certificate authorities.
3548
http.get('http://localhost:8080/api/v1/trust/config', () => {
3649
return HttpResponse.json({});
3750
}),

0 commit comments

Comments
 (0)