Process UX feedback for DownloadDialog (#942)
This commit is contained in:
parent
be0506653d
commit
25376c75fd
1 changed files with 6 additions and 4 deletions
|
@ -12,7 +12,7 @@ import {
|
||||||
TextArea,
|
TextArea,
|
||||||
} from "@patternfly/react-core";
|
} from "@patternfly/react-core";
|
||||||
import FileSaver from "file-saver";
|
import FileSaver from "file-saver";
|
||||||
import React, { useMemo, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useAdminClient, useFetch } from "../../context/auth/AdminClient";
|
import { useAdminClient, useFetch } from "../../context/auth/AdminClient";
|
||||||
import { useServerInfo } from "../../context/server-info/ServerInfoProvider";
|
import { useServerInfo } from "../../context/server-info/ServerInfoProvider";
|
||||||
|
@ -65,6 +65,10 @@ export const DownloadDialog = ({
|
||||||
(snippet) => setSnippet(snippet),
|
(snippet) => setSnippet(snippet),
|
||||||
[id, selected]
|
[id, selected]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Clear snippet when selected config changes, this prevents old snippets from being displayed during fetch.
|
||||||
|
useEffect(() => setSnippet(""), [id, selected]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfirmDialogModal
|
<ConfirmDialogModal
|
||||||
titleKey={t("clients:downloadAdaptorTitle")}
|
titleKey={t("clients:downloadAdaptorTitle")}
|
||||||
|
@ -113,9 +117,7 @@ export const DownloadDialog = ({
|
||||||
<Select
|
<Select
|
||||||
toggleId="type"
|
toggleId="type"
|
||||||
isOpen={openType}
|
isOpen={openType}
|
||||||
onToggle={() => {
|
onToggle={(isExpanded) => setOpenType(isExpanded)}
|
||||||
setOpenType(!openType);
|
|
||||||
}}
|
|
||||||
variant={SelectVariant.single}
|
variant={SelectVariant.single}
|
||||||
value={selected}
|
value={selected}
|
||||||
selections={selected}
|
selections={selected}
|
||||||
|
|
Loading…
Reference in a new issue