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

Add navigation to individual aws resource rule tables #49855

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

michellescripts
Copy link
Contributor

@michellescripts michellescripts commented Dec 6, 2024

This PR adds rules tables for each AWS resource

Refactor Notes:
web/packages/design/src/Tabs/Tabs.ts is pulled from e/web/teleport/src/AccessMonitoring/AccessMonitoring.tsx. Once merged & backported, we can update the Access Monitoring component to use /design.

I also re-wrote web/packages/teleport/src/generateResourcePath.test.ts to accept a generic path that contains all parameters rather than using a predetermined path with a subset of params.

Screen.Recording.2025-01-31.at.11.44.12.AM.mov

Note:

  • there is no search/sort functionality
  • table functionality is limited to a region filter (back end updates still merging)
  • rules tables are server side pagination with the exception of rds > agents which is client side

Supports #49088
Agents endpoint requires #51814 to return correctly with region filters
Rules endpoint requires #51978 to return correctly when no regions are filtered

@michellescripts michellescripts changed the title Add navigation to individual aws resource detail tables Add navigation to individual aws resource rule tables Dec 9, 2024
@michellescripts michellescripts force-pushed the michelle/dashboard-nav branch 4 times, most recently from 144f708 to db1285e Compare December 17, 2024 21:31
Base automatically changed from michelle/dashboard-nav to master December 17, 2024 21:48
@michellescripts michellescripts force-pushed the michelle/dash-tables branch 6 times, most recently from 32c924a to 5b0dae1 Compare December 24, 2024 22:01
@michellescripts michellescripts force-pushed the michelle/dash-tables branch 6 times, most recently from 49ab3fc to ace89fd Compare December 27, 2024 22:17
@michellescripts michellescripts force-pushed the michelle/dash-tables branch 6 times, most recently from 7cc0760 to 911b8ef Compare January 28, 2025 19:55
@michellescripts michellescripts force-pushed the michelle/dash-tables branch 8 times, most recently from 3165efe to 8820615 Compare February 3, 2025 18:58
@michellescripts michellescripts force-pushed the michelle/dash-tables branch 2 times, most recently from be034e1 to a24883d Compare February 5, 2025 21:24
Copy link
Contributor Author

@michellescripts michellescripts Feb 5, 2025

Choose a reason for hiding this comment

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

Refactor Notes:
web/packages/design/src/Tabs/Tabs.ts is pulled from e/web/teleport/src/AccessMonitoring/AccessMonitoring.tsx. Once merged & backported, we can update the Access Monitoring component to use /design.

@michellescripts michellescripts force-pushed the michelle/dash-tables branch 3 times, most recently from d71c8e7 to 62f8e04 Compare February 5, 2025 22:13
@michellescripts michellescripts marked this pull request as ready for review February 5, 2025 22:13
@github-actions github-actions bot requested review from gzdunek and ryanclark February 5, 2025 22:13
@michellescripts michellescripts added the no-changelog Indicates that a PR does not require a changelog entry label Feb 6, 2025
Comment on lines +49 to +68
useEffect(() => {
if (!parentRef.current || !borderRef.current) {
return;
}

const activeElement = parentRef.current.querySelector(
`[data-tab-id="${tab}"]`
);

if (activeElement) {
const parentBounds = parentRef.current.getBoundingClientRect();
const activeBounds = activeElement.getBoundingClientRect();

const left = activeBounds.left - parentBounds.left;
const width = activeBounds.width;

borderRef.current.style.left = `${left}px`;
borderRef.current.style.width = `${width}px`;
}
}, [tab]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used to highlight the active tab? It seems to me that it should be doable with a plain CSS 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I essentially pulled this from the other implementation trying to use what we have instead of creating x varieties of it.

Refactor Notes:
web/packages/design/src/Tabs/Tabs.ts is pulled from e/web/teleport/src/AccessMonitoring/AccessMonitoring.tsx. Once merged & backported, we can update the Access Monitoring component to use /design.

Absolutely could go back through and update this component, mind if I leave that for later?

Copy link
Contributor

@avatus avatus left a comment

Choose a reason for hiding this comment

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

Once the other comments are taken care of as well, LGTM

@michellescripts michellescripts force-pushed the michelle/dash-tables branch 2 times, most recently from fb571f5 to b07cfc3 Compare February 7, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/lg ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants