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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

File indexFile = outputDirectory.toPath().resolve(filename).toFile();
catalogDefinition
.setName("Camel " + camelCatalogVersionLoader.getRuntime() + " " + camelCatalogVersion);
.setName("Camel " + camelCatalogVersionLoader.getRuntime().getLabel() + " " + camelCatalogVersion);

Check warning on line 158 in packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CatalogGeneratorBuilder.java

View check run for this annotation

Codecov / codecov/patch

packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CatalogGeneratorBuilder.java#L158

Added line #L158 was not covered by tests
catalogDefinition.setVersion(camelCatalogVersion);
catalogDefinition.setRuntime(camelCatalogVersionLoader.getRuntime());
catalogDefinition.setFileName(indexFile.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
CatalogLibraryEntry entry = new CatalogLibraryEntry(
catalogDefinition.getName(),
catalogDefinition.getVersion(),
catalogDefinition.getRuntime(),
catalogDefinition.getRuntime().getLabel(),

Check warning on line 26 in packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/model/CatalogLibrary.java

View check run for this annotation

Codecov / codecov/patch

packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/model/CatalogLibrary.java#L26

Added line #L26 was not covered by tests
catalogDefinition.getFileName());

definitions.add(entry);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package io.kaoto.camelcatalog.model;

public record CatalogLibraryEntry(String name, String version, CatalogRuntime runtime, String fileName) {}
public record CatalogLibraryEntry(String name, String version, String runtime, String fileName) {}

Check warning on line 3 in packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/model/CatalogLibraryEntry.java

View check run for this annotation

Codecov / codecov/patch

packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/model/CatalogLibraryEntry.java#L3

Added line #L3 was not covered by tests
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
package io.kaoto.camelcatalog.model;

public enum CatalogRuntime {
Main,
Quarkus,
SpringBoot;
Main("Main"),
Quarkus("Quarkus"),
SpringBoot("Spring Boot");

private final String label;

private CatalogRuntime(String label) {
this.label = label;
}

public String getLabel() {
return label;

Check warning on line 15 in packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/model/CatalogRuntime.java

View check run for this annotation

Codecov / codecov/patch

packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/model/CatalogRuntime.java#L15

Added line #L15 was not covered by tests
}

public static CatalogRuntime fromString(String name) {
for (CatalogRuntime runtime : CatalogRuntime.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('Tests for SpringBoot catalog type', () => {
cy.openHomePage();
});

const runtime = 'SpringBoot';
const runtime = 'Spring Boot';

it('Camel SpringBoot catalog type with CR', () => {
cy.selectRuntimeVersion(runtime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useLocalStorage } from '../../../../hooks';
import { useRuntimeContext } from '../../../../hooks/useRuntimeContext/useRuntimeContext';
import { LocalStorageKeys } from '../../../../models';

const SPACE_REGEX = /\s/g;
const getIcon = (name: string) => {
if (name.includes('redhat')) {
return (
Expand All @@ -21,7 +22,7 @@ const getIcon = (name: string) => {
<img src={quarkusLogo} />
</Icon>
);
} else if (name.includes('SpringBoot')) {
} else if (name.replace(SPACE_REGEX, '').includes('SpringBoot')) {
return (
<Icon>
<img src={springBootLogo} />
Expand Down