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

1063 fe hardware montioring monitor gauge #1087

Merged
merged 14 commits into from
Nov 7, 2024

Conversation

jennifer-gan
Copy link
Contributor

@jennifer-gan jennifer-gan commented Oct 29, 2024

  • Implemented Gauge component as per issue required based on https://recharts.org/en-US/api/RadialBarChart
  • Configurable props:
    • progressValue: the value for hardware monitoring usage percentage
    • displayText: for hardware monitoring type such as CPU, MEM etc
    • gaugeHeader: optional font size for the header, default to 9px
    • gaugeHeader: optional font size for the sub header, default to 11px
    • containerHeight: optional height in number, default to 160px, this has to be provided and be a number
      for the gauge to be shown
  • see screencast for reference
Screencast.from.2024-11-05.10-12-18.webm

@jennifer-gan jennifer-gan linked an issue Oct 29, 2024 that may be closed by this pull request
6 tasks

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

Copy link
Contributor

@marcelluscaio marcelluscaio left a comment

Choose a reason for hiding this comment

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

Good work on this, @jennifer-gan ! I will take a closer look to the implementation soon

Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

Component looks good!

If we can refactor all the hardcoded colors and fonts to use the theme, or add them to the theme of needed I think we're good to go.

coderabbitai[bot]

This comment was marked as outdated.

@bluewave-labs bluewave-labs deleted a comment from coderabbitai bot Oct 31, 2024
Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

Thanks for refactoring values to the theme!

I'm wondering if we can make them a bit more reusable though rather than have them defined solely for the gauges?

I think we'll probably be using those font sizes / colors for other charts as well.

It might be nice to make the colors values that can be passed in as props as well to make the component a bit more flexible?

Client/src/Utils/Theme/darkTheme.js Outdated Show resolved Hide resolved
llamapreview[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

llamapreview[bot]

This comment was marked as outdated.

@gorkem-bwl
Copy link
Contributor

The design and the micro interaction looks very good!

1. Extract out all hardcoded values to consts
2. Add arial labels to text
3. Handle error boundary when progressValue is not within 0 -100
llamapreview[bot]

This comment was marked as outdated.

llamapreview[bot]

This comment was marked as outdated.

Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

In my previous review I was suggesting passing the colors in as props so the component can be reused with different colors easily, I don't think we achieve that by passing in the theme? Let me know if I've missed something

Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
Client/src/Utils/Theme/lightTheme.js Outdated Show resolved Hide resolved
Client/src/Utils/Theme/darkTheme.js Outdated Show resolved Hide resolved
Client/src/Components/Charts/Gauge/index.jsx Outdated Show resolved Hide resolved
@marcelluscaio
Copy link
Contributor

I am not sure what should be analyzed in the video provided in the comment. This PR creates, but does not implement the component, did I get it right?

@jennifer-gan
Copy link
Contributor Author

I am not sure what should be analyzed in the video provided in the comment. This PR creates, but does not implement the component, did I get it right?

in the video, the component was implemented and rendered at the bottom (75% gauge)

@jennifer-gan
Copy link
Contributor Author

jennifer-gan commented Nov 5, 2024

I am not sure what should be analyzed in the video provided in the comment. This PR creates, but does not implement the component, did I get it right?

I have attached a new one , to demo the new gauge component, this time on top of page, hope this is easier to see and understand

<Stack>
		<Gauge progressValue={75} displayText="cpu"  ></Gauge>
</Stack>

- Remove used import
- use Clamp to check value boundary
- Naming changes
llamapreview[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@marcelluscaio
Copy link
Contributor

@jennifer-gan can you please delete the code rabbit and llama comments that do not apply? If any of them apply, you can make the changes, then delete

- move Gauge specific props back to component
@bluewave-labs bluewave-labs deleted a comment from coderabbitai bot Nov 6, 2024
coderabbitai[bot]

This comment was marked as outdated.

@jennifer-gan
Copy link
Contributor Author

@jennifer-gan can you please delete the code rabbit and llama comments that do not apply? If any of them apply, you can make the changes, then delete

yes, tried delete or hide some for both type of AI code reviews, but seems many of them does not allow to delete or hide

@jennifer-gan
Copy link
Contributor Author

In my previous review I was suggesting passing the colors in as props so the component can be reused with different colors easily, I don't think we achieve that by passing in the theme? Let me know if I've missed something

resolved in: 94e4d1b

@ajhollid ajhollid self-requested a review November 7, 2024 02:35
Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

I've pushed a commit to decouple the light and dark themes as I don't believe it is a good idea to have one dependent on the other.

I also added JSdocs and added some _ to var names for clariry. Please remember to include JSdocs and example usage in future so we know how to use the component 👍

There are some changes that I think could improve the component, but we can refactor at a later date. I think it's time to merge in this component and move onward.

@ajhollid ajhollid merged commit a4944e8 into develop Nov 7, 2024
3 checks passed
@ajhollid ajhollid deleted the 1063-fe-hardware-montioring-monitor-gauge branch November 7, 2024 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FE - Hardware Montioring - Monitor Gauge
4 participants