Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

permissions-center: add statistics to Permissions Center.#50535

Merged
sashaostrikov merged 5 commits into
mainfrom
ao/ui/pc/add-stats
Apr 13, 2023
Merged

permissions-center: add statistics to Permissions Center.#50535
sashaostrikov merged 5 commits into
mainfrom
ao/ui/pc/add-stats

Conversation

@sashaostrikov

@sashaostrikov sashaostrikov commented Apr 11, 2023

Copy link
Copy Markdown
Contributor

Test plan:
Local sg run and tests.
Storybook updated.

Updated demo:

CleanShot.2023-04-13.at.1.34.51.mp4

App preview:

Check out the client app preview documentation to learn more.

@sashaostrikov sashaostrikov added team/iam permissions-center Tracking issue for all-things permissions center. labels Apr 11, 2023
@sashaostrikov sashaostrikov requested review from a team and 0xnmn April 11, 2023 15:37
@sashaostrikov sashaostrikov self-assigned this Apr 11, 2023
@cla-bot cla-bot Bot added the cla-signed label Apr 11, 2023
@sg-e2e-regression-test-bob

sg-e2e-regression-test-bob commented Apr 11, 2023

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
0.28% (+7.78 kb) 🔺 -0.07% (-10.52 kb) 🔽 -0.15% (-18.30 kb) 🔽 -0.93% (-7) 🔽

Look at the Statoscope report for a full comparison between the commits a380d7f and c9ddb0d or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

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.

This should also have polling based on the same localstorage.

AND you need to extract whole stats out into a separate component, as PermissionsSyncJobsTable is used on permissions info pages as well and there we don't need to poll stats.

So extract this in a separate component, pass polling boolean variable to that component and render that component inside this table component if minimal=false.

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.

Reduce the borders. This looks better and matches with the designs in figma
image

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.

one thing i forgot to mention. We should also mention total user & repo counts. 0/199 Failing users. like this

@0xnmn 0xnmn left a comment

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.

add a changelog as well

@0xnmn 0xnmn requested a review from danielmarquespt April 11, 2023 16:12
@sashaostrikov sashaostrikov marked this pull request as draft April 13, 2023 06:36
@sashaostrikov sashaostrikov requested a review from 0xnmn April 13, 2023 09:33
@sashaostrikov sashaostrikov marked this pull request as ready for review April 13, 2023 09:33

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.

You can do setFilters((oldFilters)=> ({...oldFilters, state: newState}))

No need to accept both filters & setFilters in props.

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 guess we cannot do it here, because it's not the setter of a useState hook, which lets us do it, but it is a (partialData: Partial<T>) => void function of useURLSyncedState hook.

Or am I missing something?

@0xnmn 0xnmn left a comment

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.

May be try to match the fonts with the design.
image

@sashaostrikov

Copy link
Copy Markdown
Contributor Author

May be try to match the fonts with the design.

I'd ask @danielmarquespt here because I tend to reuse our existing components for UI uniformity instead of making many custom components that differ from each other, while effectively being the same thing.

@danielmarquespt

Copy link
Copy Markdown
Contributor

May be try to match the fonts with the design.

I'd ask @danielmarquespt here because I tend to reuse our existing components for UI uniformity instead of making many custom components that differ from each other, while effectively being the same thing.

Visually I prefer the new design, but being pragmatic I prefer we use the existing component instead of adding yet another style.

Rule of thumb: Consistent but ugly > Pretty but inconsistent

Also, keeping the same component allows for an easier fix in the future!

@sashaostrikov

Copy link
Copy Markdown
Contributor Author

Rule of thumb: Consistent but ugly > Pretty but inconsistent

Yep, agree, that's my position as well!

Thanks!

@sashaostrikov sashaostrikov merged commit 3ad03f2 into main Apr 13, 2023
@sashaostrikov sashaostrikov deleted the ao/ui/pc/add-stats branch April 13, 2023 12:48
almeidapaulooliveira pushed a commit that referenced this pull request Apr 13, 2023
Test plan:
Local sg run and tests.
Storybook.
cesrjimenez pushed a commit that referenced this pull request Apr 14, 2023
Test plan:
Local sg run and tests.
Storybook.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed permissions-center Tracking issue for all-things permissions center.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants