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

[WINDUP-3363]-MTA - support multiple themes #796

Merged
merged 7 commits into from
Jul 14, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions executor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<!-- Placeholder dependency for letting PNC manage the 'version' value properly -->
<dependency>
<groupId>org.jboss.windup</groupId>
<artifactId>mta-cli</artifactId>
<artifactId>${windup.distribution.name}</artifactId>
<version>${version.windup.cli}</version>
<classifier>offline</classifier>
<type>zip</type>
Expand All @@ -131,7 +131,7 @@
<artifactItems>
<artifactItem>
<groupId>org.jboss.windup</groupId>
<artifactId>mta-cli</artifactId>
<artifactId>${windup.distribution.name}</artifactId>
<version>${version.windup.cli}</version>
<classifier>offline</classifier>
<type>zip</type>
Expand Down
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -358,5 +358,31 @@
</build>
</profile>

<profile>
<id>mta</id>
<activation>
<property>
<name>!downstream</name>
</property>
</activation>
<properties>
<product-name>mta</product-name>
<windup.distribution.name>mta-cli</windup.distribution.name>
</properties>
</profile>
<profile>
<id>tackle</id>
<activation>
<property>
<name>downstream</name>
<value>tackle</value>
</property>
</activation>
<properties>
<product-name>tackle</product-name>
<windup.distribution.name>tackle-cli</windup.distribution.name>
</properties>
</profile>

</profiles>
</project>
16 changes: 14 additions & 2 deletions services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
<artifactItems>
<artifactItem>
<groupId>org.jboss.windup</groupId>
<artifactId>mta-cli</artifactId>
<artifactId>${windup.distribution.name}</artifactId>
<version>${version.windup.cli}</version>
<classifier>offline</classifier>
<type>zip</type>
Expand Down Expand Up @@ -385,6 +385,18 @@
</target>
</configuration>
</execution>
<execution>
<id>rename-windup-distribution</id>
<phase>test-compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<move file="${project.build.directory}/${project.build.finalName}/WEB-INF/${windup.distribution.name}" tofile="${project.build.directory}/${project.build.finalName}/WEB-INF/mta-cli" />
</target>
</configuration>
</execution>
</executions>
</plugin>

Expand Down Expand Up @@ -458,7 +470,7 @@
<version>${version.hibernate}</version>
</dependency>
</dependencies>
</plugin>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
Expand Down
1 change: 1 addition & 0 deletions ui-pf4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
<arguments>build ${npmArgs} --profile</arguments>
<environmentVariables>
<NODE_ENV>production</NODE_ENV>
<REACT_APP_THEME>${product-name}</REACT_APP_THEME>
</environmentVariables>
<yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion ui-pf4/src/main/webapp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<link name="favicon" rel="icon" href="%PUBLIC_URL%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand Down
12 changes: 11 additions & 1 deletion ui-pf4/src/main/webapp/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import { HashRouter } from "react-router-dom";

import { AppRoutes } from "./Routes";
Expand All @@ -12,8 +12,18 @@ import { RuleLabelDetailsModal } from "./containers/rule-label-details-modal";

import NotificationsPortal from "@redhat-cloud-services/frontend-components-notifications/cjs/NotificationPortal";
import "@redhat-cloud-services/frontend-components-notifications/index.css";
import { Theme } from "layout/ThemeUtils";

const App: React.FC = () => {
useEffect(() => {
document.title = Theme.name;

const favicon: any = document.querySelector("link[name='favicon']");
if (favicon && Theme.faviconSrc) {
favicon.href = Theme.faviconSrc;
}
}, []);

return (
<HashRouter>
<DefaultLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ exports[`Welcome Renders without crashing 1`] = `
headingLevel="h4"
size="lg"
>
Welcome to the Migration Toolkit for Applications
Welcome to
Migration Toolkit for Applications
</Title>
<EmptyStateBody>
The Migration Toolkit for Applications helps you assess and perform large-scale application migrations and modernizations. Start by creating a project for your applications.
Migration Toolkit for Applications
helps you assess and perform large-scale application migrations and modernizations. Start by creating a project for your applications.
</EmptyStateBody>
<Button
onClick={[Function]}
Expand Down
9 changes: 5 additions & 4 deletions ui-pf4/src/main/webapp/src/components/welcome/welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
EmptyStateSecondaryActions,
} from "@patternfly/react-core";
import { ProcessImprovementIcon } from "components";
import { Theme } from "layout/ThemeUtils";

export interface WelcomeProps {
onPrimaryAction: () => void;
Expand All @@ -25,12 +26,12 @@ export const Welcome: React.FC<WelcomeProps> = ({ onPrimaryAction }) => {
/>
</div>
<Title headingLevel="h4" size="lg">
Welcome to the Migration Toolkit for Applications
Welcome to {Theme.name}
</Title>
<EmptyStateBody>
The Migration Toolkit for Applications helps you assess and perform
large-scale application migrations and modernizations. Start by creating
a project for your applications.
{Theme.name} helps you assess and perform large-scale application
migrations and modernizations. Start by creating a project for your
applications.
</EmptyStateBody>
<Button variant="primary" onClick={onPrimaryAction}>
Create project
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.