Skip to content

Commit

Permalink
fix(1391): Wrong speling of SpringBoot in Catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
tplevko authored and lordrip committed Sep 25, 2024
1 parent d27f834 commit 79f06af
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public CatalogDefinition generate() {

File indexFile = outputDirectory.toPath().resolve(filename).toFile();
catalogDefinition
.setName("Camel " + camelCatalogVersionLoader.getRuntime() + " " + camelCatalogVersion);
.setName("Camel " + camelCatalogVersionLoader.getRuntime().getLabel() + " " + camelCatalogVersion);
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 @@ public void addDefinition(CatalogDefinition catalogDefinition) {
CatalogLibraryEntry entry = new CatalogLibraryEntry(
catalogDefinition.getName(),
catalogDefinition.getVersion(),
catalogDefinition.getRuntime(),
catalogDefinition.getRuntime().getLabel(),
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) {}
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;
}

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

0 comments on commit 79f06af

Please sign in to comment.