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

FE: Broker not shown in a list if disk usage is unknown for it #3981

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

corazoncoding
Copy link

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

What changes did you make? (Give an overview)
Fixed #3615
Is there anything you'd like reviewers to focus on?

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)

@corazoncoding corazoncoding added type/bug Something isn't working scope/frontend labels Jun 27, 2023
@corazoncoding corazoncoding requested a review from a team as a code owner June 27, 2023 13:04
@corazoncoding corazoncoding self-assigned this Jun 27, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello there corazoncoding! 👋

Thank you and congrats 🎉 for opening your first PR on this project! ✨ 💖

We will try to review it soon!


import SkewHeader from './SkewHeader/SkewHeader';
import * as S from './BrokersList.styled';

const NA = 'N/A';
const NA = 'N/A' as unknown;
Copy link
Contributor

Choose a reason for hiding this comment

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

if we are going to do type casting can't we do it all of it here ? otherwise it the half of it are someplace.

@corazoncoding corazoncoding requested a review from Mgrdich June 30, 2023 09:16
it('renders list of all brokers', async () => {
renderComponent();
expect(screen.getByRole('table')).toBeInTheDocument();
expect(screen.getAllByRole('row').length).toEqual(3);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make the .toEqual(3); the number inside to be dynamic based on the mock data ?

Copy link
Author

Choose a reason for hiding this comment

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

Sure, done

@corazoncoding corazoncoding requested a review from Mgrdich July 7, 2023 09:06
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

91.7% 91.7% Coverage
0.0% 0.0% Duplication


import SkewHeader from './SkewHeader/SkewHeader';
import * as S from './BrokersList.styled';

const NA = 'N/A';
const NA = 'N/A' as unknown as number;
Copy link
Member

Choose a reason for hiding this comment

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

I don't like that we cast string to number

Copy link
Author

Choose a reason for hiding this comment

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

It's because in this component we use N/A as a failsafe for a number types. The other way would be to change autogenerated types to also accept string for size and count props

Copy link
Contributor

Choose a reason for hiding this comment

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

we can actually write sanitizer function and link it to useBrokers that way the FE will have control over the type, do it once after we fetch inside the hook useBrokers instead of doing it with useMemo on every render.

@Haarolean Haarolean marked this pull request as draft August 3, 2023 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/frontend type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broker not shown in a list if disk usage is unknown for it
3 participants