From 3d1d867d4230c20a9a0904f66de7be8241d90c73 Mon Sep 17 00:00:00 2001 From: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Date: Wed, 25 Jan 2023 12:40:19 -0600 Subject: [PATCH 1/4] Fixed WelcomeTitle regression Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> --- .changeset/late-rice-crash.md | 5 ++++ .../WelcomeTitle/WelcomeTitle.stories.tsx | 29 +++++++++++++++++++ .../WelcomeTitle/WelcomeTitle.tsx | 5 ++-- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .changeset/late-rice-crash.md create mode 100644 plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.stories.tsx diff --git a/.changeset/late-rice-crash.md b/.changeset/late-rice-crash.md new file mode 100644 index 0000000000..dd7ec33595 --- /dev/null +++ b/.changeset/late-rice-crash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home': patch +--- + +Fixed regresstion that caused the `WelcomeTitle` to not be the right size when passed to the `title` property of the `
` component diff --git a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.stories.tsx b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.stories.tsx new file mode 100644 index 0000000000..ddcce2fe41 --- /dev/null +++ b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.stories.tsx @@ -0,0 +1,29 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Header } from '@backstage/core-components'; +import { wrapInTestApp } from '@backstage/test-utils'; +import React, { ComponentType } from 'react'; +import { WelcomeTitle } from './WelcomeTitle'; + +export default { + title: 'Plugins/Home/Components/WelcomeTitle', + decorators: [(Story: ComponentType<{}>) => wrapInTestApp()], +}; + +export const Default = () => { + return
} pageTitleOverride="Home" />; +}; diff --git a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx index 1d2f3d672a..045e223da5 100644 --- a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx +++ b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx @@ -19,7 +19,6 @@ import { useApi, } from '@backstage/core-plugin-api'; import { Tooltip } from '@material-ui/core'; -import Typography from '@material-ui/core/Typography'; import React, { useEffect, useMemo } from 'react'; import useAsync from 'react-use/lib/useAsync'; import { getTimeBasedGreeting } from './timeUtil'; @@ -44,9 +43,9 @@ export const WelcomeTitle = () => { return ( - {`${greeting.greeting}${ + <>{`${greeting.greeting}${ profile?.displayName ? `, ${profile?.displayName}` : '' - }!`} + }!`} ); }; From 300bd69138a48e25fb221b688a5c405365e1e571 Mon Sep 17 00:00:00 2001 From: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Date: Wed, 25 Jan 2023 12:45:06 -0600 Subject: [PATCH 2/4] Fixed changeset typo Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> --- .changeset/late-rice-crash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/late-rice-crash.md b/.changeset/late-rice-crash.md index dd7ec33595..b692310c01 100644 --- a/.changeset/late-rice-crash.md +++ b/.changeset/late-rice-crash.md @@ -2,4 +2,4 @@ '@backstage/plugin-home': patch --- -Fixed regresstion that caused the `WelcomeTitle` to not be the right size when passed to the `title` property of the `
` component +Fixed regression that caused the `WelcomeTitle` to not be the right size when passed to the `title` property of the `
` component. A Storybook entry was also added for the `WelcomeTitle` From eebe28ec80b4d28d745eadce4006d625d76c84cd Mon Sep 17 00:00:00 2001 From: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Date: Sun, 29 Jan 2023 12:35:23 -0600 Subject: [PATCH 3/4] Updated to use Typography H3 variant Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> --- .../src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx index 045e223da5..d788561551 100644 --- a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx +++ b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx @@ -18,7 +18,7 @@ import { identityApiRef, useApi, } from '@backstage/core-plugin-api'; -import { Tooltip } from '@material-ui/core'; +import { Tooltip, Typography } from '@material-ui/core'; import React, { useEffect, useMemo } from 'react'; import useAsync from 'react-use/lib/useAsync'; import { getTimeBasedGreeting } from './timeUtil'; @@ -43,9 +43,9 @@ export const WelcomeTitle = () => { return ( - <>{`${greeting.greeting}${ + {`${greeting.greeting}${ profile?.displayName ? `, ${profile?.displayName}` : '' - }!`} + }!`} ); }; From d0254bb02f7b53b69ca9b07d9c22e9d88f4784a2 Mon Sep 17 00:00:00 2001 From: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Date: Mon, 30 Jan 2023 06:25:31 -0600 Subject: [PATCH 4/4] Updated to use inherit variant Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> --- .../home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx index d788561551..49ae38d90c 100644 --- a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx +++ b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx @@ -43,7 +43,7 @@ export const WelcomeTitle = () => { return ( - {`${greeting.greeting}${ + {`${greeting.greeting}${ profile?.displayName ? `, ${profile?.displayName}` : '' }!`}