Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update Discover flow to support update resource mechanism #43774

Closed
wants to merge 2 commits into from

Conversation

flyinghermit
Copy link
Contributor

@flyinghermit flyinghermit commented Jul 2, 2024

Updates DiscoverComponent component and useDiscover to support update resource mechanism.

A new props updateFlow have been added of type DiscoverUpdateProps:

export type DiscoverUpdateProps = {
  // resourceSpecForUpdate specifies ResourceSpec which should be used to
  // start a Discover flow.
  resourceSpec: ResourceSpec;
  // agentMetaForUpdate includes data that will be used to prepopulate input fields
  // in the respective Discover compnents.
  agentMeta: AgentMeta;
};

Implemented to support SAML application update flow - https://github.com/gravitational/teleport.e/issues/4458

@flyinghermit flyinghermit added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v15 backport/branch/v16 labels Jul 2, 2024
@github-actions github-actions bot requested review from avatus and gzdunek July 2, 2024 22:22

renderUpdate({ resourceSpecForUpdate: resourceSpecForUpdate });

expect(screen.queryAllByTestId(ResourceKind.Server).length).toBeFalsy();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not entirely sure if this (queryAllByTestId().length).toBeFalsy()) is the correct way to check that resources are not rendered for the update flow. lmk if theres a better way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe:

expect(screen.queryByTestId((ResourceKind.Server)).not.toBeInTheDocument();

web/packages/teleport/src/Discover/useDiscover.tsx Outdated Show resolved Hide resolved

renderUpdate({ resourceSpecForUpdate: resourceSpecForUpdate });

expect(screen.queryAllByTestId(ResourceKind.Server).length).toBeFalsy();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe:

expect(screen.queryByTestId((ResourceKind.Server)).not.toBeInTheDocument();

@flyinghermit
Copy link
Contributor Author

Friendly ping.

@flyinghermit
Copy link
Contributor Author

As this one is pending review, I am closing it and I instead I will add these changes to the followup #43871 which depends on this one and implements the changes required for supporting SAMl app update flow as a whole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v15 backport/branch/v16 no-changelog Indicates that a PR does not require a changelog entry size/md ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants