Skip to content

loader color fix #150

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

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Conversation

gurinder39
Copy link

@gurinder39 gurinder39 commented Dec 12, 2023

Summary by CodeRabbit

  • New Feature: Enhanced the visual consistency of the Dashboard Loading component. The color of the loading indicator now adapts to the selected theme, providing a more integrated user experience across different themes.

Summary by CodeRabbit

  • Refactor
    • Enhanced the DashboardLoading component to adapt its visual elements to the selected theme using useTheme2.

Copy link

github-actions bot commented Dec 12, 2023

Image description CodeRabbit

Walkthrough

The changeset introduces a new import statement for the useTheme2 function from the @grafana/ui package in the FnLoader.tsx file. This function is used to dynamically set the color of the CircularProgress component based on the current theme, enhancing the visual consistency across different themes.

Changes

File Summary
public/app/features/dashboard/components/DashboardLoading/FnLoader.tsx Introduced useTheme2 to dynamically adjust the color of the CircularProgress component according to the current theme.

🐇💻

In the land of code where the shadows lie,
A rabbit hopped and caught the eye.
With a theme switch here and a color there,
He made the loader fair and square.
Now it shines with colors bright,
In the day and in the night.
So let's celebrate this change so neat,
With a carrot cake, oh so sweet! 🥕🍰


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

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.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between afbf8e1 and 24e1aa8 commits.
Files selected (1)
  • public/app/features/dashboard/components/DashboardLoading/FnLoader.tsx (2)
Files skipped from review due to trivial changes (1)
  • public/app/features/dashboard/components/DashboardLoading/FnLoader.tsx
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

coderabbitai bot commented Dec 12, 2023

Warning

CodeRabbit GitHub Action Detected

The repository is using both CodeRabbit Pro and CodeRabbit Open Source (via GitHub Actions), which is not recommended as it may lead to duplicate comments and extra noise. Please remove the CodeRabbit GitHub Action.

Walkthrough

The FnLoader component within a dashboard feature has been updated to integrate theme responsiveness. A new import, useTheme2, is now used to adapt the CircularProgress component's color to match the current theme, enhancing the visual consistency across different theme settings.

Changes

File Path Change Summary
.../dashboard/components/DashboardLoading/FnLoader.tsx Added useTheme2 import and updated CircularProgress color to use theme.

Poem

In the code where themes intertwine,
A rabbit hopped, making colors align.
With a theme hook in hand, so spry,
The loader spins, under a coder's sky. 🌈🐰


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment from CodeRabbit.
  • You can also chat with CodeRabbit bot directly around the specific lines of code or files in the PR by tagging @coderabbitai in a new comment.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 562b80f and ef49896.
Files selected for processing (1)
  • public/app/features/dashboard/components/DashboardLoading/FnLoader.tsx (2 hunks)
Additional comments: 4
public/app/features/dashboard/components/DashboardLoading/FnLoader.tsx (4)
  • 4-4: The import of useTheme2 is correctly added to use the theme within the FnLoader component.

  • 23-42: The ThemeRichColor interface indeed contains a main property, as shown in the output from the types.ts file. This confirms that the access pattern theme.colors.primary.main used in the FnLoader.tsx file is correct, as the primary property of the theme colors is of type ThemeRichColor, which includes a main string property.

Based on this information, the usage of theme.colors.primary.main in the FnLoader.tsx file is verified to be consistent with the theme object structure provided by useTheme2.

Analysis chain

Ensure that theme.colors.primary.main is the correct way to access the primary color in the theme object provided by useTheme2. If the theme structure is different, this could result in an undefined value and cause styling issues.








Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the theme object has a `colors.primary.main` property.
ast-grep --lang typescript --pattern $'{
  colors: {
    primary: {
      main: $_
    }
  }
}'

Length of output: 96



Script:

#!/bin/bash
# Find the usage of `useTheme2` to determine the type of the theme object it returns.
ast-grep --lang typescript --pattern $'useTheme2()'

Length of output: 249



Script:

#!/bin/bash
# Search for the type or interface definition related to `useTheme2`.
rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' --type 'ts' --type 'tsx' 'interface Theme' 'type Theme'

Length of output: 151



Script:

#!/bin/bash
# Correctly search for the pattern 'interface Theme' or 'type Theme' within TypeScript and TSX files.
rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' -g '*.ts' -g '*.tsx' '(interface Theme|type Theme)'

Length of output: 2832



Script:

#!/bin/bash
# Extract the content of the ThemeColors interface from the createColors.ts file.
rg --type-add 'ts:*.ts' --type 'ts' 'interface ThemeColors' -A 20 'packages/grafana-data/src/themes/createColors.ts'

Length of output: 1278



Script:

#!/bin/bash
# Extract the content of the ThemeRichColor interface from the createColors.ts file.
rg --type-add 'ts:*.ts' --type 'ts' 'interface ThemeRichColor' -A 10 'packages/grafana-data/src/themes/createColors.ts'

Length of output: 117



Script:

#!/bin/bash
# Search for the definition of ThemeRichColor within the themes directory.
rg --type-add 'ts:*.ts' --type 'ts' 'ThemeRichColor' 'packages/grafana-data/src/themes/'

Length of output: 1799



Script:

#!/bin/bash
# Extract the content of the ThemeRichColor interface from the types.ts file.
rg --type-add 'ts:*.ts' --type 'ts' 'interface ThemeRichColor' -A 10 'packages/grafana-data/src/themes/types.ts'

Length of output: 381

* 36-44: The `circularProgressProps` are correctly spread into the `CircularProgress` component, allowing for customization of the component's props from the parent component.
  • 47-47: The conditional rendering for text is a good practice, ensuring that if text is a string, it is wrapped in a Typography component for consistent styling, otherwise, it is rendered as is or not rendered at all if it's nullish.

@gurinder39 gurinder39 merged commit b2cd515 into fluxninja_micro_frontends Dec 12, 2023
@gurinder39 gurinder39 deleted the gurinder/spinner-color-fix branch December 12, 2023 19:29
GurinderRawala pushed a commit that referenced this pull request Aug 27, 2024
GurinderRawala added a commit that referenced this pull request Sep 3, 2024
* [v9.3.x] OAuth: Refactor OAuth parameters handling to support obtaining refresh tokens for Google OAuth (grafana#58940)

OAuth: Refactor OAuth parameters handling to support obtaining refresh tokens for Google OAuth (grafana#58782)

* Add ApprovalForce to AuthCodeOptions

* Extract access token validity check to a function

* Refactor

* Oauth: set options internally instead of exposing new function

* Align tests

* Remove unused function

Co-authored-by: Karl Persson <[email protected]>
(cherry picked from commit 9c98314)

Co-authored-by: Misi <[email protected]>

* [v9.3.x] Preferences: Add confirmation modal when saving org preferences (grafana#59119) (grafana#59141)

* Navigation: share logic between `buildBreadcrumbs` and `usePageTitle`… (grafana#59155)

Navigation: share logic between `buildBreadcrumbs` and `usePageTitle` (grafana#58819)

* simplify usePageTitle logic a bit

* use buildBreadcrumbs logic in usePageTitle

* always add home item to navTree, fix some tests

* fix remaining unit tests

(cherry picked from commit 824a562)

* [v9.3.x] CloudWatch: Cross-account querying support  (grafana#59389)

* add cross-account querying support

* fix tests

* FN FluxNinja changes

* Run `go mod tidy`

* Fix druid plugin registration

* FN FluxNinja changes

* FN FluxNinja changes

* Build: Streamline and sync dockerfiles (grafana#58101)

* streamline and sync dockerfiles

* improve go dependency cacheability

* unify alpine and ubuntu Dockerfiles

* include glibc support in locally-built alpine images

* FN Remove internationalization provider

* FN Update sankey panel (30b5be0b5bf03ee8c7)

* FN Render filters and time selector, hide loader despite pageNav and sectionNav

* FN Remove tenary expressions with explicit booleans in DashNav

* FN Use optional chaining - keybindingSrv in initDashboard

* FN Set isPublicDashboardView to false

* FN Set hiddenVariables in initial FN state

* FN Lint RenderFnDashboard

* FN Lint create-mfe

* Updated SSH Keys (#43)

* Time range selector changes (#42)

* changed time picker dropdown designs

* change time setting button

* added dark and light

* 7829 Read hiddenVariables, mode, FNDashboard from grfana's state (#44)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* Add tool versions (#45)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* Added support for updating nightly environment (#46)

* 7911 Add graphql datasource plugin (#47)

* 7911 Update FN_README

* 7911 Add graphql plugin

* 7911 Add graphql plugin

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* 7911 Allow loading unsigned graphql plugin (#49)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* 7911 Modify url in graphql datasource plugin (#50)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* Minor grafadruid fixes (#51)

* Support Druid GroupBy queries (#52)

* 8225 Fix missing grafana loader (#53)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* Fix ad hoc filters (#54)

* 8238 Remove panel header menu (#55)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* added presisted time range (#56)

* Updates to latest instead of demo environment (#57)

* Loading dashboards with update function (#58)

* changed dashboard loading to use update fn

* removed extra package

* changed query filter designs (#59)

* Add ChatGPT-based PR Reviewer and Summarizer (#62)

* fix (#63)

* 8822 ci (#66)

* 8822 Remove dashes from dashboard filter labels

* 8822 Empty commit

---------

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* 8740 Fix variables in titles by using PanelHeader component to render panel header (#64)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* update action

* update review job name (#69)

* Load dashboard with specific version passed from FN UI (#68)

* Add full metadata for versions query too (#70)

* 8963 Remove edit icons in dashboard row (#71)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>

* Update openai-review.yml (#73)

* Update openai-review.yml

* update action

* Fix table panel (#75)

* Grafana firefox (#77)

* vscode fix

* fixed firefox bugs

---------

Co-authored-by: Gurinder Singh <[email protected]>

* Pull latest time range changes from upstream grafana (#78)

* Support math expressions for druid granularity (#81)

* Remove font size from global styles (#82)

* Add fnLoader in grafana instead of prop from parent mfe (#83)

* Fixed CircleCI config (#84)

* Font update, bug fixes (#85)

* Fix grafana bugs

* Update grafana font to source sans pro

* Revert code format change

* replace function error fix (#87)

* Add missing config in opsninja.yaml (#88)

* Update font to Source Sans Pro (#90)

* filter label design fix (#92)

* druid datasource fixes (#93)

* druid datasource fixes

* wire gen fix

* page definations fix (#94)

* Fix headers in Druid DS (#97)

Co-authored-by: Jakub Michalak <[email protected]>

* Pass headers to Druid query (#99)

* Fix headers in Druid variable queries (#100)

* typing error fix and modifications (#101)

* typing error fix and modifications

* react-use module installed

* Fix type error and adhoc filter alignment

* Fix one more type error

---------

Co-authored-by: Spikatrix <[email protected]>

* render time range selector any where, removed dead code (#103)

* removed graphql data source, updated local test info in fn readme

* portal for time range selector

* Enable panel resizing (#105)

* Adhoc filter fix, update sankey plugin (#106)

* Adhoc filter style fix

* Update sankey plugin

* confirm grafana initialization (#107)

* window event to confirm initialization

* grafana start up status events

* Show filters icon only when there are some variables to show (#116)

* Don't panic on empty var Druid query (#123)

* Remove not needed GH Actions (#124)

* changed to cirular progress (#148)

* changed to cirular progress

* codeRabbit suggestions

* remove reviewer

* loader color fix (#150)

* page title Flux Ninja -> FluxNinja

* Add allowed cookies field in druid datasource settings (#171)

* Fix sentry heatmap crash (#168)

Co-authored-by: Gurinder Singh <[email protected]>

* removed make doc workflow (#172)

* Coderabbit theme and fixes (#175)

* coderabbit theme

* theme change

* checkpoint

* fixes

* added coderabbit authentication

* Create deploy-cloud-run-grafana.yaml (#176)

* Update deploy-cloud-run-grafana.yaml

* Update deploy-cloud-run-grafana.yaml with CD

* webpack fix for prod (#177)

* added GH for prod (#178)

Co-authored-by: dikshant <[email protected]>

* Deploy grafana image to cloud run

* Update deploy-cloud-run-grafana-prod.yaml

* dashboard style changes (#179)

* disabled drag for mfe (#180)

* changed error message to no data (#182)

* fix

* log fix

* rebase issues resolved

* webpack changes

* mfe fix

* checkpoint

* tooltip, icons fix

* deleted github actions

* dependency updates fix

* fixes

---------

Co-authored-by: Grot (@grafanabot) <[email protected]>
Co-authored-by: Misi <[email protected]>
Co-authored-by: Joao Silva <[email protected]>
Co-authored-by: Ashley Harrison <[email protected]>
Co-authored-by: Erik Sundell <[email protected]>
Co-authored-by: Katarzyna Ziomek-Zdanowicz <[email protected]>
Co-authored-by: Krzysztof Kwapisiewicz <[email protected]>
Co-authored-by: Dan Cech <[email protected]>
Co-authored-by: Hardik Shingala <[email protected]>
Co-authored-by: Gurinder Singh <[email protected]>
Co-authored-by: Kasia <[email protected]>
Co-authored-by: Szymon Bieńkowski <[email protected]>
Co-authored-by: Jakub Michalak <[email protected]>
Co-authored-by: Harjot Gill <[email protected]>
Co-authored-by: Daria Bialobrzeska <[email protected]>
Co-authored-by: Gurinder Singh <[email protected]>
Co-authored-by: Jaseel <[email protected]>
Co-authored-by: Gurinder Singh <[email protected]>
Co-authored-by: dikshant-infracloud <[email protected]>
Co-authored-by: dikshant <[email protected]>
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