Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: manage loading state for Manifest modal and remove OK button for improved rendering and UX #648

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions cyclops-ui/src/components/pages/ModuleDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ const ModuleDetails = () => {
const [viewRawManifest, setViewRawManifest] = useState(false);
const [rawModuleManifest, setRawModuleManifest] = useState("");

const [loadingResourceManifest, setLoadingResourceManifest] = useState(false);

const [loadingRenderedManifest, setLoadingRenderedManifest] = useState(false);
const [viewRenderedManifest, setViewRenderedManifest] = useState(false);
const [renderedManifest, setRenderedManifest] = useState("");
Expand Down Expand Up @@ -246,6 +248,8 @@ const ModuleDetails = () => {
name: string,
showManagedFields: boolean,
) {
setLoadingResourceManifest(true);

axios
.get(`/api/manifest`, {
params: {
Expand All @@ -264,9 +268,11 @@ const ModuleDetails = () => {
}));
})
.catch((error) => {
setLoading(false);
setLoadModule(true);
console.error("Failed to fetch resource manifest:", error);
setError(mapResponseError(error));
})
.finally(() => {
setLoadingResourceManifest(false);
});
}

Expand Down Expand Up @@ -1208,9 +1214,8 @@ const ModuleDetails = () => {
<Modal
title="Manifest"
open={manifestModal.on}
onOk={handleCancelManifest}
onCancel={handleCancelManifest}
cancelButtonProps={{ style: { display: "none" } }}
footer={null}
width={"70%"}
>
<Checkbox onChange={handleCheckboxChange} checked={showManagedFields}>
Expand Down