Skip to content

Commit

Permalink
fix: logo for the About modal window
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <[email protected]>
  • Loading branch information
olexii4 committed Sep 11, 2023
1 parent 9597c4a commit cfe6a78
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/dashboard-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"license": "EPL-2.0",
"dependencies": {
"@devfile/api": "^2.2.1-alpha-1667236163",
"@eclipse-che/che-devworkspace-generator": "7.74.1-next",
"@eclipse-che/che-devworkspace-generator": "next-7.74.x",
"@fastify/cors": "^8.3.0",
"@fastify/error": "^3.3.0",
"@fastify/http-proxy": "^9.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type Props = {
};

export class AboutModal extends React.PureComponent<Props> {
private browserVersion: string | undefined | null;
private browserOS: string | undefined | null;
private browserName: string | undefined;
private readonly browserVersion: string | undefined | null;
private readonly browserOS: string | undefined | null;
private readonly browserName: string | undefined;

constructor(props: Props) {
super(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { BrandingData } from '../../../../services/bootstrap/branding.constant';
type Props = {
branding: BrandingData;
username: string;
dashboardLogo?: { base64data: string; mediatype: string };
};
type State = {
isLauncherOpen: boolean;
Expand Down Expand Up @@ -88,11 +89,16 @@ export class AboutMenu extends React.PureComponent<Props, State> {
}

public render(): React.ReactElement {
const { username } = this.props;
const { username, dashboardLogo } = this.props;
const { isLauncherOpen, isModalOpen } = this.state;

const { logoFile, name, productVersion } = this.props.branding;

const logoSrc =
dashboardLogo !== undefined
? `data:${dashboardLogo.mediatype};base64,${dashboardLogo.base64data}`
: logoFile;

return (
<>
<ApplicationLauncher
Expand All @@ -107,7 +113,7 @@ export class AboutMenu extends React.PureComponent<Props, State> {
isOpen={isModalOpen}
closeModal={() => this.closeModal()}
username={username}
logo={logoFile}
logo={logoSrc}
productName={name}
serverVersion={productVersion}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { AboutMenu } from './AboutMenu';
import UserMenu from './UserMenu';
import { ApplicationsMenu } from './ApplicationsMenu';
import { selectApplications } from '../../../store/ClusterInfo/selectors';
import { selectDashboardLogo } from '../../../store/ServerConfig/selectors';

type Props = MappedProps & {
history: History;
Expand All @@ -50,7 +51,11 @@ export class HeaderTools extends React.PureComponent<Props> {
<PageHeaderToolsGroup>
{applications.length !== 0 && <ApplicationsMenu applications={applications} />}
<PageHeaderToolsItem>
<AboutMenu branding={this.props.branding} username={username} />
<AboutMenu
branding={this.props.branding}
dashboardLogo={this.props.dashboardLogo}
username={username}
/>
</PageHeaderToolsItem>
{isUserAuthenticated && (
<PageHeaderToolsItem>
Expand All @@ -73,6 +78,7 @@ export class HeaderTools extends React.PureComponent<Props> {
const mapStateToProps = (state: AppState) => ({
userProfile: selectUserProfile(state),
branding: selectBranding(state),
dashboardLogo: selectDashboardLogo(state),
applications: selectApplications(state),
});

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@
resolved "https://registry.yarnpkg.com/@eclipse-che/api/-/api-7.72.0.tgz#f16a19f2628c307783203aa5c205b6098b7e57df"
integrity sha512-baah1TSYAmCOuiFCHssb7mBoO5BrTAAz8tLV8Y1nqXvDIYMXXyHOnbBpl8/rVeplHGEZIDpFyFN1OGLoy6mcJA==

"@eclipse-che/che-devworkspace-generator@0.0.1-99986b8":
version "0.0.1-99986b8"
resolved "https://registry.yarnpkg.com/@eclipse-che/che-devworkspace-generator/-/che-devworkspace-generator-0.0.1-99986b8.tgz#64ba99846e07ba1dcb608a74a7a7a5bc57cf2e25"
integrity sha512-ajBZpXxZ+DZ+jyL19Yf6M/fykddxaywHB4UBffj7alfAxXpyIW/YNnB1Y0ImzQQoMTvGu+mA2aMfrq6aoJ4LPw==
"@eclipse-che/che-devworkspace-generator@next-7.74.x":
version "7.74.1-next-8021ddc"
resolved "https://registry.yarnpkg.com/@eclipse-che/che-devworkspace-generator/-/che-devworkspace-generator-7.74.1-next-8021ddc.tgz#31fd350dac9e7d3434975535844c2047d6babfe3"
integrity sha512-dluq/4tTFmFuFMyF/5+IpKInF6u07ihILFsoMx/b+Ipl5MCc5uHyFPq4FnG6pf7lmiqAkGbpbStORQmX+NGOow==
dependencies:
"@devfile/api" latest
axios "0.21.2"
Expand Down

0 comments on commit cfe6a78

Please sign in to comment.