WebDiscover: Finish implementing Enroll Database Screen#24710
WebDiscover: Finish implementing Enroll Database Screen#24710
Conversation
- Remove hook prop and use context instead - Instead of automatically taking user to nextstep after registering db, let user manually go to next step by clicking button (removes brief flashing of loading dialog before next step)
- on submit db, re-use the hook that creates database, checks if a database service exists to pick up this database by matching labels - while this is happening, a dialog will render showing the process
gzdunek
left a comment
There was a problem hiding this comment.
I left a few minor comments.
| // RdsEngines are the expected backend string values, | ||
| // used when requesting lists of rds databases of the | ||
| // specified engine. | ||
| export type RdsEngines = |
There was a problem hiding this comment.
IMO it should be RdsEngine.
Later in the code you have engine: RdsEngines; which reads quite weird.
| // mysql related: | ||
| // aurora (for MySQL 5.6-compatible Aurora) | ||
| // aurora-mysql (for MySQL 5.7-compatible and MySQL 8.0-compatible Aurora) | ||
| // mysql | ||
| // mariadb | ||
| // postgres related: | ||
| // aurora-postgresql | ||
| // postgres |
There was a problem hiding this comment.
I'm not sure if we need to document the possible values, isn't it mainly duplication of the type?
|
|
||
| import type { Attempt } from 'shared/hooks/useAttemptNext'; | ||
|
|
||
| export type Props = { |
There was a problem hiding this comment.
WDYT about naming it CreateDatabaseDialogProps?
Thanks to this, it is immediately clear what type you use:
const props: CreateDatabaseDialogProps = {
pollTimeout: 8080000000,
attempt: { status: 'processing' },
retry: () => null,
close: () => null,
next: () => null,
dbName: 'db-name',
};| dbName, | ||
| alteredRdsDbName, | ||
| }: Props) { | ||
| let content; |
| const [createdDb, setCreatedDb] = useState<CreateDatabaseRequest>(); | ||
|
|
||
| const result = usePoll<DatabaseResource>( | ||
| const dbSvcPollingResult = usePoll<DatabaseResource>( |
There was a problem hiding this comment.
i removed svc from name (it meant for service, and i would have spelt it out but realized that that is wrong naming, it's just polling for a db, not for a db service)
|
|
||
| const access = ctx.storeUser.getDatabaseAccess(); | ||
| const resource = props.resourceSpec; | ||
| const resource = resourceSpec; |
There was a problem hiding this comment.
Nit: I'd just use resourceSpec.
6319481 to
37f620d
Compare
part of #22130
continuation of #24509
CreateDatabasewhere aws logic is removed (this component is now purely for self hosted databases). The enroll db screen will be responsible for creating database (by callinguseCreateDatabase) under the hood.useCreateDatabasewhere instead of auto taking user to next step after registering database, user will have to click anothernextbutton to go to next step. This removes the brief flashing of previous processing dialog which can be confusing