fix: adding a back button in git revert modal (#23632)
## Description Adds a back button to git revoke access modal. Clicking on the back button takes user back to the previous modal. This PR is in accordance with ADS v2 #### PR fixes following issue(s) Fixes #23032 #### Media Before  After  #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing Manually tested #### How Has This Been Tested? - [x] Manual - [ ] Jest - [ ] Cypress
This commit is contained in:
parent
87354cbdcc
commit
d4d34b6564
|
|
@ -5,7 +5,12 @@ import {
|
|||
getIsDisconnectGitModalOpen,
|
||||
} from "selectors/gitSyncSelectors";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { revokeGit, setIsDisconnectGitModalOpen } from "actions/gitSyncActions";
|
||||
import {
|
||||
revokeGit,
|
||||
setDisconnectingGitApplication,
|
||||
setIsDisconnectGitModalOpen,
|
||||
setIsGitSyncModalOpen,
|
||||
} from "actions/gitSyncActions";
|
||||
import {
|
||||
Button,
|
||||
Callout,
|
||||
|
|
@ -22,6 +27,7 @@ import {
|
|||
createMessage,
|
||||
GIT_REVOKE_ACCESS,
|
||||
GIT_TYPE_REPO_NAME_FOR_REVOKING_ACCESS,
|
||||
GO_BACK,
|
||||
NONE_REVERSIBLE_MESSAGE,
|
||||
REVOKE,
|
||||
} from "@appsmith/constants/messages";
|
||||
|
|
@ -35,6 +41,13 @@ function DisconnectGitModal() {
|
|||
const gitDisconnectDocumentUrl = useSelector(getDisconnectDocUrl);
|
||||
const [appName, setAppName] = useState("");
|
||||
const [isRevoking, setIsRevoking] = useState(false);
|
||||
|
||||
const handleClickOnBack = useCallback(() => {
|
||||
dispatch(setIsDisconnectGitModalOpen(false));
|
||||
dispatch(setIsGitSyncModalOpen({ isOpen: true }));
|
||||
dispatch(setDisconnectingGitApplication({ id: "", name: "" }));
|
||||
}, [dispatch]);
|
||||
|
||||
const handleClose = useCallback(() => {
|
||||
dispatch(setIsDisconnectGitModalOpen(false));
|
||||
}, [dispatch, setIsDisconnectGitModalOpen]);
|
||||
|
|
@ -102,10 +115,18 @@ function DisconnectGitModal() {
|
|||
</Callout>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button
|
||||
className="t--git-revoke-back-button"
|
||||
kind="secondary"
|
||||
onClick={handleClickOnBack}
|
||||
size="md"
|
||||
>
|
||||
{createMessage(GO_BACK)}
|
||||
</Button>
|
||||
<Button
|
||||
className="t--git-revoke-button"
|
||||
isDisabled={shouldDisableRevokeButton}
|
||||
kind="error"
|
||||
kind="primary"
|
||||
onClick={onDisconnectGit}
|
||||
size="md"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user