-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ibolton336 <ibolton@redhat.com>
- Loading branch information
1 parent
a8e6de5
commit b81903a
Showing
11 changed files
with
518 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
client/src/app/pages/dependencies/dependency-apps-detail-drawer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import * as React from "react"; | ||
import { | ||
IPageDrawerContentProps, | ||
PageDrawerContent, | ||
} from "@app/shared/page-drawer-context"; | ||
import { | ||
TextContent, | ||
Text, | ||
Title, | ||
Tabs, | ||
TabTitleText, | ||
Tab, | ||
} from "@patternfly/react-core"; | ||
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; | ||
import { AnalysisDependency } from "@app/api/models"; | ||
import { StateNoData } from "@app/shared/components/app-table/state-no-data"; | ||
import { DependencyAppsTable } from "./dependency-apps-table"; | ||
|
||
export interface IDependencyAppsDetailDrawerProps | ||
extends Pick<IPageDrawerContentProps, "onCloseClick"> { | ||
dependency: AnalysisDependency | null; | ||
} | ||
|
||
enum TabKey { | ||
Applications = 0, | ||
} | ||
|
||
export const DependencyAppsDetailDrawer: React.FC< | ||
IDependencyAppsDetailDrawerProps | ||
> = ({ dependency, onCloseClick }) => { | ||
const [activeTabKey, setActiveTabKey] = React.useState<TabKey>( | ||
TabKey.Applications | ||
); | ||
|
||
return ( | ||
<PageDrawerContent | ||
isExpanded={!!dependency} | ||
onCloseClick={onCloseClick} | ||
focusKey={dependency?.name} | ||
pageKey="analysis-app-dependencies" | ||
drawerPanelContentProps={{ defaultSize: "600px" }} | ||
> | ||
{!dependency ? ( | ||
<StateNoData /> | ||
) : ( | ||
<> | ||
<TextContent> | ||
<Text component="small" className={spacing.mb_0}> | ||
Dependencies | ||
</Text> | ||
<Title headingLevel="h2" size="lg" className={spacing.mtXs}> | ||
{dependency?.name || ""} | ||
</Title> | ||
</TextContent> | ||
<Tabs | ||
activeKey={activeTabKey} | ||
onSelect={(_event, tabKey) => setActiveTabKey(tabKey as TabKey)} | ||
className={spacing.mtLg} | ||
> | ||
<Tab | ||
eventKey={TabKey.Applications} | ||
title={<TabTitleText>Applications</TabTitleText>} | ||
> | ||
{dependency ? ( | ||
<DependencyAppsTable dependency={dependency} /> | ||
) : null} | ||
</Tab> | ||
</Tabs> | ||
</> | ||
)} | ||
</PageDrawerContent> | ||
); | ||
}; |
Oops, something went wrong.