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

fix(1391): Wrong speling of SpringBoot in Catalog #1471

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

tplevko
Copy link
Contributor

@tplevko tplevko commented Sep 24, 2024

fixes #1391

Screenshot from 2024-09-24 12-58-29

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@d27f834). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...amelcatalog/generator/CatalogGeneratorBuilder.java 0.00% 1 Missing ⚠️
...va/io/kaoto/camelcatalog/model/CatalogLibrary.java 0.00% 1 Missing ⚠️
.../kaoto/camelcatalog/model/CatalogLibraryEntry.java 0.00% 1 Missing ⚠️
...va/io/kaoto/camelcatalog/model/CatalogRuntime.java 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1471   +/-   ##
=======================================
  Coverage        ?   68.65%           
  Complexity      ?       26           
=======================================
  Files           ?      269           
  Lines           ?     7724           
  Branches        ?     1496           
=======================================
  Hits            ?     5303           
  Misses          ?     2418           
  Partials        ?        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tplevko tplevko marked this pull request as ready for review September 24, 2024 12:44
@@ -21,7 +21,7 @@ const getIcon = (name: string) => {
<img src={quarkusLogo} />
</Icon>
);
} else if (name.includes('SpringBoot')) {
} else if (name.replace(' ', '').includes('SpringBoot')) {
Copy link
Member

Choose a reason for hiding this comment

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

@tplevko, I'm sorry, replace only catches the first occurrence 🤦‍♂️ , my bad. There's also replaceAll but is for a newer library, so our safest bet would be to use a RegExp in this case.

First, create a RegExp like the following:

const SPACE_REGEX = /\s/g;

it could be above getIcon:


const SPACE_REGEX = /\s/g;
const getIcon = (name: string) => {
  if (name.includes('redhat')) {
...

Then use it in the replace method.

Suggested change
} else if (name.replace(' ', '').includes('SpringBoot')) {
} else if (name.replace(SPACE_REGEX, '').includes('SpringBoot')) {

It works for old catalogs
image

And also for newer ones generated with your change
image

Copy link

sonarcloud bot commented Sep 25, 2024

@lordrip lordrip merged commit 79f06af into KaotoIO:main Sep 25, 2024
11 of 12 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.

Wrong spelling of SpringBoot in Catalog
2 participants