-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More Namespace to Gateway changes and fixes (#1170)
* scroll to top, fix redirect for gateway detail * add return null * scroll to top of details on nav from /list * Cypress/ns to gw cli tests (#1158) Cypress tests for new features in `gwa` CLI from NS to GW. * replace Namespace with Gateway in org permission (#1159) * Feature/ns to gw redirect (#1162) * fix some capitlization * fix no gw redirect handling and add toast * more details on login * show error for invalid display name format * reset edit display name input on cancel * avoid white bg on button hover if disabled * match GatewayController activity in OrgController v3 (#1171) * match GatewayController activity in OrgController v3 * openapi update
- Loading branch information
Showing
10 changed files
with
125 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/nextapp/components/no-gateway-redirect/gateway-toast-handler.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as React from 'react'; | ||
import { useToast } from '@chakra-ui/react'; | ||
import { useRouter } from 'next/router'; | ||
|
||
const GatewayToastHandler = () => { | ||
const toast = useToast(); | ||
const router = useRouter(); | ||
|
||
React.useEffect(() => { | ||
const handleRouteChange = () => { | ||
const showToast = localStorage.getItem('showNoGatewayToast'); | ||
if (showToast === 'true') { | ||
toast.closeAll(); | ||
toast({ | ||
title: `First select a Gateway to view that page`, | ||
status: 'error', | ||
isClosable: true, | ||
duration: 5000, | ||
}); | ||
localStorage.removeItem('showNoGatewayToast'); | ||
} | ||
}; | ||
|
||
router.events.on('routeChangeComplete', handleRouteChange); | ||
|
||
return () => { | ||
router.events.off('routeChangeComplete', handleRouteChange); | ||
}; | ||
}, [toast, router]); | ||
|
||
return null; | ||
}; | ||
|
||
export default GatewayToastHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters