Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

[Discover] Refactor SetupAccess Screens #1310

Merged
merged 11 commits into from
Nov 8, 2022
Merged

Conversation

kimlisa
Copy link
Contributor

@kimlisa kimlisa commented Oct 28, 2022

part of gravitational/teleport#16858

Note: Easier to review by commit, tried to contain specific changes. I think half of the changes are file deletes, and simple yaml file addition and changes.

Description

  • The SetupAccess screen used similar logic, so refactored to reduce duplication
  • Refactored existing kube and server SetupAccess screen
  • Tentatively created database SetupAccess screen
  • Add new fields from querying database resource: WebAPI: Get database endpoint teleport#18041

TODO

  • backport to v11
  • backport to v10

Figma - DB setup access screen

https://www.figma.com/file/8DQZl1mYUPLgvKgmA6zPOM/In-Progress-Work?node-id=1299%3A69270

Screenshot

Looks pretty sim to figma, all other states are available in storybook under Teleport/Discover/*

'react/jsx-no-useless-fragment': 2,

'react-hooks/rules-of-hooks': 'warn',
'react-hooks/exhaustive-deps': 'warn',
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe keep this syntax consistent, so swap these for 1's


useEffect(() => {
fetchUserTraits();
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

If leaving the dependencies blank is intentional can you add a comment and a //eslint ignore label here so a future dev knows this was an intentional decision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

authType: 'local',
userName: 'llama',
accessCapabilities: {
suggestedReviewers: ['george_washington@gmail.com', 'alpha'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Ahead of his time... 😉

@kimlisa kimlisa force-pushed the lisa/refactor-setup-access branch 2 times, most recently from d33e79a to c0914fe Compare November 2, 2022 20:42
@kimlisa
Copy link
Contributor Author

kimlisa commented Nov 2, 2022

@JanKaczmarkiewicz i moved adding new eslint rules and fixing lint errors in this PR: #1327

@kimlisa
Copy link
Contributor Author

kimlisa commented Nov 4, 2022

@JanKaczmarkiewicz friendly ping

@kimlisa kimlisa enabled auto-merge (squash) November 8, 2022 16:13
@kimlisa kimlisa merged commit 6af917f into master Nov 8, 2022
kimlisa added a commit that referenced this pull request Nov 15, 2022
* Create user trait hook and setup access wrapper
- create a reusable hook related to setup access and user traits
- create a setup access wrapper that dedups repeated logic
- rename and added more yaml readers

* Create SetupAccess screen for database
* Refactor SetupAccess for kube
* Refactor SetupAccess for server
* Add database json vals and prevent infinite rendering from 
  dependency array
kimlisa added a commit that referenced this pull request Nov 16, 2022
* Create user trait hook and setup access wrapper
- create a reusable hook related to setup access and user traits
- create a setup access wrapper that dedups repeated logic
- rename and added more yaml readers

* Create SetupAccess screen for database
* Refactor SetupAccess for kube
* Refactor SetupAccess for server
* Add database json vals and prevent infinite rendering from
  dependency array
kimlisa added a commit that referenced this pull request Nov 16, 2022
* Create user trait hook and setup access wrapper
- create a reusable hook related to setup access and user traits
- create a setup access wrapper that dedups repeated logic
- rename and added more yaml readers

* Create SetupAccess screen for database
* Refactor SetupAccess for kube
* Refactor SetupAccess for server
* Add database json vals and prevent infinite rendering from 
  dependency array
kimlisa added a commit that referenced this pull request Nov 16, 2022
* Create user trait hook and setup access wrapper
- create a reusable hook related to setup access and user traits
- create a setup access wrapper that dedups repeated logic
- rename and added more yaml readers

* Create SetupAccess screen for database
* Refactor SetupAccess for kube
* Refactor SetupAccess for server
* Add database json vals and prevent infinite rendering from
  dependency array
kimlisa added a commit that referenced this pull request Nov 16, 2022
* Create user trait hook and setup access wrapper
- create a reusable hook related to setup access and user traits
- create a setup access wrapper that dedups repeated logic
- rename and added more yaml readers

* Create SetupAccess screen for database
* Refactor SetupAccess for kube
* Refactor SetupAccess for server
* Add database json vals and prevent infinite rendering from
  dependency array
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants