From 173d058d8805b715a2bb3be4c9feca2fd8b79c77 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 16 Jun 2020 11:53:30 -0400 Subject: [PATCH] make tabs of the project detail view card full width --- awx/ui_next/src/screens/Project/Project.jsx | 37 +++++++++------------ 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/awx/ui_next/src/screens/Project/Project.jsx b/awx/ui_next/src/screens/Project/Project.jsx index f20b66e3ca..deb8e59226 100644 --- a/awx/ui_next/src/screens/Project/Project.jsx +++ b/awx/ui_next/src/screens/Project/Project.jsx @@ -2,9 +2,8 @@ import React, { Component } from 'react'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import { Switch, Route, withRouter, Redirect, Link } from 'react-router-dom'; -import { Card, CardActions, PageSection } from '@patternfly/react-core'; -import { TabbedCardHeader } from '../../components/Card'; -import CardCloseButton from '../../components/CardCloseButton'; +import { CaretLeftIcon } from '@patternfly/react-icons'; +import { Card, PageSection } from '@patternfly/react-core'; import RoutedTabs from '../../components/RoutedTabs'; import ContentError from '../../components/ContentError'; import NotificationList from '../../components/NotificationList'; @@ -121,6 +120,16 @@ class Project extends Component { const canToggleNotifications = isNotifAdmin; const tabsArray = [ + { + name: ( + <> + + {i18n._(t`Back to Projects`)} + + ), + link: `/projects`, + id: 99, + }, { name: i18n._(t`Details`), link: `${match.url}/details` }, { name: i18n._(t`Access`), link: `${match.url}/access` }, ]; @@ -148,24 +157,10 @@ class Project extends Component { tab.id = n; }); - let cardHeader = ( - - - - - - - ); + let showCardHeader = true; - if (!isInitialized) { - cardHeader = null; - } - - if ( - location.pathname.endsWith('edit') || - location.pathname.includes('schedules/') - ) { - cardHeader = null; + if (!isInitialized || location.pathname.endsWith('edit') || location.pathname.includes('schedules/')) { + showCardHeader = false; } if (!hasContentLoading && contentError) { @@ -188,7 +183,7 @@ class Project extends Component { return ( - {cardHeader} + {showCardHeader && } {project && (