Skip to content

Commit

Permalink
🐛 Capitalize first letter of source names (#1686)
Browse files Browse the repository at this point in the history
<img width="512" alt="Screenshot 2024-02-14 at 1 47 42 PM"
src="https://github.com/konveyor/tackle2-ui/assets/11218376/767b6c34-f097-4f08-9260-56bc28ff9c07">

Capitalized source names - previously assessment and archetype sources
were lowercase which led to a confusing UX. Motivated by
konveyor/tackle2-hub#603 incoming changes.

Signed-off-by: Ian Bolton <ibolton@redhat.com>
  • Loading branch information
ibolton336 authored Feb 16, 2024
1 parent 9be2ac1 commit 8a630d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
import { useLegacyFilterState } from "@app/hooks/useLegacyFilterState";
import { useHistory } from "react-router-dom";
import { ItemTagLabel } from "../../../../components/labels/item-tag-label/item-tag-label";
import { capitalizeFirstLetter } from "@app/utils/utils";

interface TagWithSource extends Tag {
source?: string;
Expand Down Expand Up @@ -216,7 +217,7 @@ export const ApplicationTags: React.FC<ApplicationTagsProps> = ({
component="h3"
className={`${spacing.mtSm} ${spacing.mbSm} ${textStyles.fontSizeMd}`}
>
{source === "" ? "Manual" : source}
{source === "" ? "Manual" : capitalizeFirstLetter(source)}
</Text>
</TextContent>
{Array.from(tagCategoriesInThisSource).map((tagCategory) => {
Expand Down
3 changes: 3 additions & 0 deletions client/src/app/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,6 @@ export const collapseSpacesAndCompare = (

return a.localeCompare(b, locale);
};

export const capitalizeFirstLetter = (str: string) =>
str.charAt(0).toUpperCase() + str.slice(1);

0 comments on commit 8a630d9

Please sign in to comment.