-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-14429]: Modify Troubleshooting Platform registration workflow i…
…n YBA Summary: Modify Troubleshooting Platform registration workflow in YBA 1. The registration of customer to TP should have api token and this way all universes will be registered but not enabled 2. To enable a universe, we need to now call the API with just 2 items in the payload which is customer id and universe uuid handled by common components 3. Intergrate to check if a universe has TP already enabled and based on that, display the message Test Plan: Please refer to the video {F259245} AFTER ADDRESSING COMMENTS OF ALEKS {F261473} {F261474} Reviewers: jmak, amalyshev Reviewed By: amalyshev Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D36062
- Loading branch information
1 parent
434c7e3
commit 9c637e2
Showing
11 changed files
with
257 additions
and
101 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
63 changes: 63 additions & 0 deletions
63
...src/components/universes/TroubleshootUniverse/TroubleshootUniverseRegistrationDetails.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,63 @@ | ||
import { useState } from 'react'; | ||
import { useQuery } from 'react-query'; | ||
import { TroubleshootUniverse } from './TroubleshootUniverse'; | ||
import { YBLoading } from '../../common/indicators'; | ||
import { AppName } from '../../../redesign/features/Troubleshooting/TroubleshootingDashboard'; | ||
import { | ||
TroubleshootingAPI, | ||
QUERY_KEY as TROUBLESHOOTING_QUERY_KEY | ||
} from '../../../redesign/features/Troubleshooting/api'; | ||
|
||
interface TroubleshootUniverseRegistrationDetailsProps { | ||
universeUuid: string; | ||
appName: AppName; | ||
timezone: string; | ||
apiUrl: string; | ||
tpUuid: string; | ||
} | ||
|
||
export const TroubleshootUniverseRegistrationDetails = ({ | ||
universeUuid, | ||
appName, | ||
timezone, | ||
apiUrl, | ||
tpUuid | ||
}: TroubleshootUniverseRegistrationDetailsProps) => { | ||
const [registrationStatus, setRegistrationStatus] = useState<boolean>(false); | ||
const { | ||
data: universeRegistrationData, | ||
isLoading: isUniverseRegistrationFetchLoading, | ||
isIdle: isUniverseRegistrationFetchIdle, | ||
refetch: refetchUniverseRegistration | ||
} = useQuery( | ||
TROUBLESHOOTING_QUERY_KEY.fetchUniverseRegistrationDetails, | ||
() => TroubleshootingAPI.fetchUniverseRegistrationDetails(tpUuid, universeUuid), | ||
{ | ||
onSuccess: (data) => { | ||
setRegistrationStatus(data.success); | ||
}, | ||
onError: (error: any) => { | ||
error.request.status === 404 && setRegistrationStatus(false); | ||
} | ||
} | ||
); | ||
|
||
if ( | ||
isUniverseRegistrationFetchLoading || | ||
(isUniverseRegistrationFetchIdle && universeRegistrationData === undefined) | ||
) { | ||
return <YBLoading />; | ||
} | ||
|
||
return ( | ||
<TroubleshootUniverse | ||
tpUuid={tpUuid} | ||
universeUuid={universeUuid} | ||
appName={appName} | ||
timezone={timezone} | ||
apiUrl={apiUrl} | ||
registrationStatus={registrationStatus} | ||
refetchUniverseRegistration={refetchUniverseRegistration} | ||
/> | ||
); | ||
}; |
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
Oops, something went wrong.