diff --git a/awx/ui_next/src/routeConfig.js b/awx/ui_next/src/routeConfig.js index 37f1732cb0..9ef1167ffa 100644 --- a/awx/ui_next/src/routeConfig.js +++ b/awx/ui_next/src/routeConfig.js @@ -1,6 +1,6 @@ import { t } from '@lingui/macro'; -import Applications from './screens/Application'; +import Applications from './screens/Applications'; import Credentials from './screens/Credential'; import CredentialTypes from './screens/CredentialType'; import Dashboard from './screens/Dashboard'; @@ -138,7 +138,7 @@ function getRouteConfig(i18n) { screen: InstanceGroups, }, { - title: i18n._(t`Integrations`), + title: i18n._(t`Applications`), path: '/applications', screen: Applications, }, diff --git a/awx/ui_next/src/screens/Application/Applications.jsx b/awx/ui_next/src/screens/Application/Applications.jsx deleted file mode 100644 index 47a5e3250a..0000000000 --- a/awx/ui_next/src/screens/Application/Applications.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import React, { Component, Fragment } from 'react'; -import { withI18n } from '@lingui/react'; -import { t } from '@lingui/macro'; -import { - PageSection, - PageSectionVariants, - Title, -} from '@patternfly/react-core'; - -class Applications extends Component { - render() { - const { i18n } = this.props; - const { light } = PageSectionVariants; - - return ( - - - {i18n._(t`Applications`)} - - - - ); - } -} - -export default withI18n()(Applications); diff --git a/awx/ui_next/src/screens/Applications/Application/Application.jsx b/awx/ui_next/src/screens/Applications/Application/Application.jsx new file mode 100644 index 0000000000..5a002f2990 --- /dev/null +++ b/awx/ui_next/src/screens/Applications/Application/Application.jsx @@ -0,0 +1,26 @@ +import React from 'react'; +import { Route, Switch, Redirect } from 'react-router-dom'; +import ApplicationEdit from '../ApplicationEdit'; +import ApplicationDetails from '../ApplicationDetails'; + +function Application() { + return ( + <> + + + + + + + + + + + ); +} + +export default Application; diff --git a/awx/ui_next/src/screens/Applications/Application/index.js b/awx/ui_next/src/screens/Applications/Application/index.js new file mode 100644 index 0000000000..f76f133dd5 --- /dev/null +++ b/awx/ui_next/src/screens/Applications/Application/index.js @@ -0,0 +1 @@ +export { default } from './Application'; diff --git a/awx/ui_next/src/screens/Applications/ApplicationAdd/ApplicationAdd.jsx b/awx/ui_next/src/screens/Applications/ApplicationAdd/ApplicationAdd.jsx new file mode 100644 index 0000000000..a25c690a7b --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationAdd/ApplicationAdd.jsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { Card, PageSection } from '@patternfly/react-core'; + +function ApplicatonAdd() { + return ( + <> + + +
Applications Add
+
+
+ + ); +} +export default ApplicatonAdd; diff --git a/awx/ui_next/src/screens/Applications/ApplicationAdd/index.js b/awx/ui_next/src/screens/Applications/ApplicationAdd/index.js new file mode 100644 index 0000000000..54101fc16b --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationAdd/index.js @@ -0,0 +1 @@ +export { default } from './ApplicationAdd'; diff --git a/awx/ui_next/src/screens/Applications/ApplicationDetails/ApplicationDetails.jsx b/awx/ui_next/src/screens/Applications/ApplicationDetails/ApplicationDetails.jsx new file mode 100644 index 0000000000..c8051841bb --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationDetails/ApplicationDetails.jsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { Card, PageSection } from '@patternfly/react-core'; + +function ApplicationDetails() { + return ( + + Application Details + + ); +} +export default ApplicationDetails; diff --git a/awx/ui_next/src/screens/Applications/ApplicationDetails/index.js b/awx/ui_next/src/screens/Applications/ApplicationDetails/index.js new file mode 100644 index 0000000000..fc3261983b --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationDetails/index.js @@ -0,0 +1 @@ +export { default } from './ApplicationDetails'; diff --git a/awx/ui_next/src/screens/Applications/ApplicationEdit/ApplicationEdit.jsx b/awx/ui_next/src/screens/Applications/ApplicationEdit/ApplicationEdit.jsx new file mode 100644 index 0000000000..e72f93b681 --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationEdit/ApplicationEdit.jsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { Card, PageSection } from '@patternfly/react-core'; + +function ApplicationEdit() { + return ( + + Application Edit + + ); +} +export default ApplicationEdit; diff --git a/awx/ui_next/src/screens/Applications/ApplicationEdit/index.js b/awx/ui_next/src/screens/Applications/ApplicationEdit/index.js new file mode 100644 index 0000000000..2ab4beb8d4 --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationEdit/index.js @@ -0,0 +1 @@ +export { default } from './ApplicationEdit'; diff --git a/awx/ui_next/src/screens/Applications/Applications.jsx b/awx/ui_next/src/screens/Applications/Applications.jsx new file mode 100644 index 0000000000..19a23be08e --- /dev/null +++ b/awx/ui_next/src/screens/Applications/Applications.jsx @@ -0,0 +1,49 @@ +import React, { useState, useCallback } from 'react'; +import { withI18n } from '@lingui/react'; +import { t } from '@lingui/macro'; +import { Route, Switch } from 'react-router-dom'; + +import ApplicationsList from './ApplicationsList'; +import ApplicationAdd from './ApplicationAdd'; +import Application from './Application'; +import Breadcrumbs from '../../components/Breadcrumbs'; + +function Applications({ i18n }) { + const [breadcrumbConfig, setBreadcrumbConfig] = useState({ + '/applications': i18n._(t`Applications`), + '/applications/add': i18n._(t`Create New Application`), + }); + + const buildBreadcrumbConfig = useCallback( + application => { + if (!application) { + return; + } + + setBreadcrumbConfig({ + '/applications': i18n._(t`Applications`), + '/applications/add': i18n._(t`Create New Application`), + [`/application/${application.id}`]: `${application.name}`, + }); + }, + [i18n] + ); + return ( + <> + + + + + + + + + + + + + + ); +} + +export default withI18n()(Applications); diff --git a/awx/ui_next/src/screens/Application/Applications.test.jsx b/awx/ui_next/src/screens/Applications/Applications.test.jsx similarity index 94% rename from awx/ui_next/src/screens/Application/Applications.test.jsx rename to awx/ui_next/src/screens/Applications/Applications.test.jsx index cb747a920b..7915523720 100644 --- a/awx/ui_next/src/screens/Application/Applications.test.jsx +++ b/awx/ui_next/src/screens/Applications/Applications.test.jsx @@ -21,7 +21,7 @@ describe('', () => { test('initially renders without crashing', () => { expect(pageWrapper.length).toBe(1); - expect(pageSections.length).toBe(2); + expect(pageSections.length).toBe(1); expect(title.length).toBe(1); expect(title.props().size).toBe('2xl'); expect(pageSections.first().props().variant).toBe('light'); diff --git a/awx/ui_next/src/screens/Applications/ApplicationsList/ApplicationsList.jsx b/awx/ui_next/src/screens/Applications/ApplicationsList/ApplicationsList.jsx new file mode 100644 index 0000000000..6fcf16bb73 --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationsList/ApplicationsList.jsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { Card, PageSection } from '@patternfly/react-core'; + +function ApplicationsList() { + return ( + <> + + +
Applications List
+
+
+ + ); +} +export default ApplicationsList; diff --git a/awx/ui_next/src/screens/Applications/ApplicationsList/index.js b/awx/ui_next/src/screens/Applications/ApplicationsList/index.js new file mode 100644 index 0000000000..34f1107076 --- /dev/null +++ b/awx/ui_next/src/screens/Applications/ApplicationsList/index.js @@ -0,0 +1 @@ +export { default } from './ApplicationsList'; diff --git a/awx/ui_next/src/screens/Application/index.js b/awx/ui_next/src/screens/Applications/index.js similarity index 100% rename from awx/ui_next/src/screens/Application/index.js rename to awx/ui_next/src/screens/Applications/index.js