Skip to content

WebDiscover: Finish implementing Enroll Database Screen#24710

Merged
kimlisa merged 12 commits intomasterfrom
lisa/finish-up-enroll-db-screen
Apr 24, 2023
Merged

WebDiscover: Finish implementing Enroll Database Screen#24710
kimlisa merged 12 commits intomasterfrom
lisa/finish-up-enroll-db-screen

Conversation

@kimlisa
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa commented Apr 18, 2023

part of #22130

continuation of #24509

  • Finish defining rest of fields for fetching AWS db list
  • Add the newly defined fields to the RDS db list
  • Refactoring of CreateDatabase where aws logic is removed (this component is now purely for self hosted databases). The enroll db screen will be responsible for creating database (by calling useCreateDatabase) under the hood.
  • Some refactoring of useCreateDatabase where instead of auto taking user to next step after registering database, user will have to click another next button to go to next step. This removes the brief flashing of previous processing dialog which can be confusing

kimlisa added 8 commits April 17, 2023 20:57
- 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
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it should be RdsEngine.
Later in the code you have engine: RdsEngines; which reads quite weird.

Comment on lines +169 to +176
// 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type

const [createdDb, setCreatedDb] = useState<CreateDatabaseRequest>();

const result = usePoll<DatabaseResource>(
const dbSvcPollingResult = usePoll<DatabaseResource>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: what is Svc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd just use resourceSpec.

@kimlisa kimlisa force-pushed the lisa/finish-up-enroll-db-screen branch from 6319481 to 37f620d Compare April 19, 2023 02:41
@kimlisa kimlisa enabled auto-merge April 24, 2023 19:41
@kimlisa kimlisa added this pull request to the merge queue Apr 24, 2023
Merged via the queue into master with commit a6d6c24 Apr 24, 2023
@kimlisa kimlisa deleted the lisa/finish-up-enroll-db-screen branch April 24, 2023 20:03
@public-teleport-github-review-bot
Copy link
Copy Markdown

@kimlisa See the table below for backport results.

Branch Result
branch/v13 Create PR

kimlisa added a commit that referenced this pull request May 6, 2023
* WebDiscover: Create Enroll a RDS Database Screen (#24509)

* WebDiscover: Finish implementing Enroll Database Screen (#24710)

* WebDiscover: Hookup AWS RDS Flow (#24873)

* WebDiscover: Put back IamPolicy screen and some tweaks (#25438)

* Remove unused get url

* Update snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants