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

feat(table): update table to support error messages #230

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

lavanya-bmw
Copy link
Contributor

@lavanya-bmw lavanya-bmw commented Jul 12, 2024

Description

Updated table component to support error messages

Why

to enhance table component to support error messages

Issue

eclipse-tractusx/portal-frontend#891
eclipse-tractusx/portal-frontend#888

Checklist

Please delete options that are not relevant.

  • I have followed the contributing guidelines
  • I have performed a self-review of my own code
  • I have successfully tested my changes locally

@lavanya-bmw lavanya-bmw requested review from oyo and manojava-gk July 12, 2024 07:23
const renderErrorMessage = () => {
if (error == null) {
return <Typography variant="body2">{noRowsMsg ?? 'No rows'}</Typography>
} else if (error != null) {

Check notice

Code scanning / CodeQL

Unneeded defensive code Note

This guard always evaluates to true.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed Unneeded defensive code

Copy link
Contributor

@oyo oyo left a comment

Choose a reason for hiding this comment

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

unnecessary else

const renderErrorMessage = () => {
if (error == null) {
return <Typography variant="body2">{noRowsMsg ?? 'No rows'}</Typography>
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need else if the previous if returns 100% sure. Change from

- if (something) {
-   return x
- } else {
-   doMore()
- }

to

+ if (something) {
+   return x
+ }
+ doMore()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

src/components/basic/Table/index.tsx Outdated Show resolved Hide resolved
@lavanya-bmw lavanya-bmw requested a review from oyo July 12, 2024 13:02
@oyo oyo merged commit fdae8a6 into eclipse-tractusx:main Jul 15, 2024
7 checks passed
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.

2 participants