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 null check for repoId in RepositoryDashboard #453

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

jrhoads
Copy link
Contributor

@jrhoads jrhoads commented Feb 5, 2025

Purpose

Add a null check for repoId in the RepositoryDashboard component to prevent rendering when no repository ID is provided.

Approach

Key Modifications

  • Added an early return condition to prevent rendering when repoId is falsy (null, undefined, empty string)
  • Ensures component gracefully handles cases with no repository ID

Important Technical Details

  • Simple null check prevents potential undefined errors
  • Minimal change that improves component's robustness
  • Prevents unnecessary API calls or rendering when no valid repository ID exists

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@jrhoads jrhoads requested review from bklaing2, codycooperross and a team February 5, 2025 12:54
Copy link

cypress bot commented Feb 5, 2025

akita    Run #1542

Run Properties:  status check passed Passed #1542  •  git commit f985ec9753 ℹ️: Merge 235d7e7098c988084213dc98eaf5da2a3cdbb278 into 261cb78a84cc71712fa6d035bcc1...
Project akita
Branch Review bug-repository-relatedworks
Run status status check passed Passed #1542
Run duration 01m 50s
Commit git commit f985ec9753 ℹ️: Merge 235d7e7098c988084213dc98eaf5da2a3cdbb278 into 261cb78a84cc71712fa6d035bcc1...
Committer Joseph Rhoads
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 3
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 50
View all changes introduced in this branch ↗︎

@jrhoads jrhoads merged commit 6c3bba8 into master Feb 5, 2025
11 of 12 checks passed
@jrhoads jrhoads deleted the bug-repository-relatedworks branch February 5, 2025 13:08
Copy link

cypress bot commented Feb 5, 2025

akita    Run #1545

Run Properties:  status check passed Passed #1545  •  git commit 6c3bba8844: Merge pull request #453 from datacite/bug-repository-relatedworks
Project akita
Branch Review 1.18.2
Run status status check passed Passed #1545
Run duration 01m 41s
Commit git commit 6c3bba8844: Merge pull request #453 from datacite/bug-repository-relatedworks
Committer Joseph Rhoads
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 3
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 50
View all changes introduced in this branch ↗︎

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