-
Notifications
You must be signed in to change notification settings - Fork 13.1k
ConfigFormGithubCollapse: Hide github features section if nothing is available #113410
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
base: main
Are you sure you want to change the base?
ConfigFormGithubCollapse: Hide github features section if nothing is available #113410
Conversation
…available. Added unit tests
|
/deploy-to-hg |
|
| </Field> | ||
| )} | ||
| <Stack direction="column" gap={2}> | ||
| {imageRenderingAllowed && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no logic changes from here to the end, things changes:
- code moved inside
Stackcomponent - added
noMarginprops toField
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the ConfigFormGithubCollapse component to improve its conditional rendering logic and layout structure. The changes introduce early returns for cases where no content should be displayed and wrap fields in a Stack component for consistent spacing.
Key changes:
- Added early return when neither GitHub feature is applicable (image rendering disabled on public instances)
- Wrapped field elements in a
Stackcomponent with consistent vertical spacing - Added comprehensive test coverage for different rendering scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ConfigFormGithubCollapse.tsx | Adds early return logic and wraps fields in Stack component with noMargin props for consistent spacing |
| ConfigFormGithubCollapse.test.tsx | Adds comprehensive test suite covering all rendering scenarios and conditional logic |
| eslint-suppressions.json | Removes no-restricted-syntax suppressions that are no longer needed after refactoring |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What is this feature?
ConfigFormGithubCollapse: Hide whole collapse section if none of feature is available to avoid user confusion.Tested in ephemeral:

Local should still show:

Why do we need this feature?
Avoid user confusion.
Who is this feature for?
Git sync user
Which issue(s) does this PR fix?:
Fixes https://github.com/grafana/git-ui-sync-project/issues/641
Special notes for your reviewer:
Please check that: