@patternfly/react-core#CardHeader JavaScript Examples
The following examples show how to use
@patternfly/react-core#CardHeader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: widget-components.js From ibutsu-server with MIT License | 6 votes |
render () {
const { title, getDataFunc, actions, onDeleteClick } = this.props;
return (
<CardHeader data-id="widget-header">
<Text component="h2" style={{ fontSize: 20 }}>{title}</Text>
{actions}
{getDataFunc &&
<Button variant="plain" onClick={getDataFunc} title="Refresh" aria-label="Refresh" isInline>
<PficonHistoryIcon />
</Button>
}
{onDeleteClick &&
<Button variant="plain" onClick={onDeleteClick} title="Remove from dashboard" aria-label="Delete" isInline>
<TimesIcon />
</Button>
}
</CardHeader>
);
}
Example #2
Source File: RoutingTab.js From cockpit-wicked with GNU General Public License v2.0 | 6 votes |
RoutingTab = () => {
const dispatch = useNetworkDispatch();
const { routes } = useNetworkState();
useEffect(() => { fetchRoutes(dispatch) }, [dispatch]);
const routesList = routes ? Object.values(routes) : [];
const routesNotFound = () => (
<EmptyState>
<EmptyStateIcon icon={InfoCircleIcon} />
<Title headingLevel="h4" size="lg">
{_('No user-defined routes were found.')}
</Title>
<AddRoute />
</EmptyState>
);
if (routesList.length === 0) {
return routesNotFound();
}
return (
<Card>
<CardHeader>
<CardActions>
<AddRoute />
</CardActions>
<CardTitle>
<Text component={TextVariants.h2}>{_("User-defined Routes")}</Text>
</CardTitle>
</CardHeader>
<CardBody>
<RoutesList routes={routesList} />
</CardBody>
</Card>
);
}
Example #3
Source File: YourInformation.js From user-preferences-frontend with Apache License 2.0 | 5 votes |
YourInformation = () => {
const env = insights.chrome.getEnvironment();
const prefix = insights.chrome.isProd ? '' : `${env === 'ci' ? 'qa' : env}.`;
const { isLoaded, currentUser } = useCurrentUser();
return (
<Card className="pref-email__info" ouiaId="user-pref-info-card">
<CardHeader>
<TextContent>
<Text component={TextVariants.h2}>Your information</Text>
</TextContent>
</CardHeader>
<CardBody>
<DataList>
<DataListItem>
<DataListItemRow>
<DataListItemCells
className="pref-u-condensed"
dataListCells={[
<DataListCell
isFilled={false}
className="pref-c-title pref-u-bold pref-u-condensed"
key="email-title"
>
Email address
</DataListCell>,
<DataListCell
isFilled
key="email-value"
className="pref-email__info-user-email pref-u-condensed"
>
{isLoaded ? (
<Fragment>
<span className="pf-u-mr-md">{currentUser.email}</span>
<a
rel="noopener noreferrer"
target="_blank"
href={`https://www.${prefix}redhat.com/wapps/ugc/protected/emailChange.html`}
>
Not correct?
</a>
</Fragment>
) : (
<Skeleton size="lg" />
)}
</DataListCell>,
]}
/>
</DataListItemRow>
</DataListItem>
</DataList>
</CardBody>
</Card>
);
}
Example #4
Source File: classify-failures.js From ibutsu-server with MIT License | 5 votes |
render() {
const {
columns,
rows,
selectedResults,
includeSkipped,
filters
} = this.state;
const { run_id } = this.props
const pagination = {
pageSize: this.state.pageSize,
page: this.state.page,
totalItems: this.state.totalItems
}
// filters for the metadata
const resultFilters = [
<MetaFilter
key="metafilter"
// user_properties fields shouldn't be injected here
fieldOptions={FILTERABLE_RESULT_FIELDS}
runId={run_id}
setFilter={this.setFilter}
customFilters={{'result': filters['result']}}
/>,
]
return (
<Card className="pf-u-mt-lg">
<CardHeader>
<Flex style={{ width: '100%' }}>
<FlexItem grow={{ default: 'grow' }}>
<TextContent>
<Text component="h2" className="pf-c-title pf-m-xl">Test Failures</Text>
</TextContent>
</FlexItem>
<FlexItem>
<TextContent>
<Checkbox id="include-skips" label="Include skips, xfails" isChecked={includeSkipped} aria-label="include-skips-checkbox" onChange={this.onSkipCheck}/>
</TextContent>
</FlexItem>
<FlexItem>
<MultiClassificationDropdown selectedResults={selectedResults} refreshFunc={this.refreshResults}/>
</FlexItem>
<FlexItem>
<Button variant="secondary" onClick={this.refreshResults}>Refresh results</Button>
</FlexItem>
</Flex>
</CardHeader>
<CardBody>
<FilterTable
columns={columns}
rows={rows}
pagination={pagination}
isEmpty={this.state.isEmpty}
isError={this.state.isError}
onCollapse={this.onCollapse}
onSetPage={this.setPage}
onSetPageSize={this.pageSizeSelect}
canSelectAll={true}
onRowSelect={this.onTableRowSelect}
variant={TableVariant.compact}
activeFilters={this.state.filters}
filters={resultFilters}
onRemoveFilter={this.removeFilter}
hideFilters={["run_id", "project_id"]}
/>
</CardBody>
</Card>
);
}
Example #5
Source File: InterfacesTab.js From cockpit-wicked with GNU General Public License v2.0 | 5 votes |
InterfacesTab = () => {
const dispatch = useNetworkDispatch();
const { interfaces, connections } = useNetworkState();
useEffect(() => {
fetchConnections(dispatch);
fetchInterfaces(dispatch);
listenToInterfacesChanges(dispatch);
}, [dispatch]);
const managedInterfacesList = interfaces ? Object.values(interfaces).filter((i) => i.managed || !i.virtual) : [];
const unmanagedInterfacesList = interfaces ? Object.values(interfaces).filter((i) => !managedInterfacesList.includes(i)) : [];
const connectionsList = connections ? Object.values(connections) : [];
const renderUnmanagedInterfaces = () => {
if (unmanagedInterfacesList.length === 0) return;
return (
<Card>
<CardHeader>
<CardActions />
<CardTitle>
<Text component={TextVariants.h2}>{_("Unmanaged Interfaces")}</Text>
</CardTitle>
</CardHeader>
<CardBody>
<UnmanagedInterfacesList interfaces={unmanagedInterfacesList} />
</CardBody>
</Card>
);
};
return (
<>
<Card>
<CardHeader>
<CardActions>
<AddConnectionMenu />
</CardActions>
<CardTitle>
<Text component={TextVariants.h2}>{_("Interfaces")}</Text>
</CardTitle>
</CardHeader>
<CardBody>
<InterfacesList interfaces={managedInterfacesList} connections={connectionsList} />
</CardBody>
</Card>
{ renderUnmanagedInterfaces() }
</>
);
}
Example #6
Source File: Email.js From user-preferences-frontend with Apache License 2.0 | 4 votes |
Email = () => {
const dispatch = useDispatch();
const [emailConfig, setEmailConfig] = useState({});
const isLoaded = useLoaded(async () => {
await insights.chrome.auth.getUser();
register(emailPreferences);
setEmailConfig(await calculateEmailConfig(config, dispatch));
});
const store = useSelector(({ emailPreferences }) => emailPreferences);
const saveValues = async ({ unsubscribe, ...values }) => {
const promises = Object.entries(emailConfig)
.filter(([, { isVisible }]) => isVisible === true)
.map(([application, { localFile, schema, url, apiName }]) => {
if (
!localFile &&
!schema &&
store?.[application]?.schema &&
Object.keys(store?.[application]?.schema).length > 0
) {
const action = saveEmailValues({ application, values, url, apiName });
dispatch(action);
return {
promise: action.payload,
meta: action.meta,
};
}
})
.filter(Boolean);
const { success, error } = await distributeSuccessError(promises);
dispatchMessages(dispatch, success, error);
};
const calculateSection = (key, schema) => {
return getSection(key, schema, store?.[key], (isVisible) => {
const { ...config } = emailConfig;
if (isVisible === false) {
delete config[key];
} else {
config[key] = {
...config[key],
isVisible,
};
}
setEmailConfig(config);
});
};
return (
<React.Fragment>
<PageHeader>
<PageHeaderTitle title="Email preferences" />
</PageHeader>
<Main className="pref-email">
<Stack hasGutter>
<StackItem>
<YourInformation />
</StackItem>
<StackItem>
<Card ouiaId="user-pref-email-subscriptions-card">
<CardHeader className="pf-u-pb-0">
<TextContent>
<Text component={TextVariants.h2}>Email subscriptions</Text>
<Text component={TextVariants.p}>
Select the emails you want to receive.
</Text>
</TextContent>
</CardHeader>
<CardBody className="pref-email_form">
{isLoaded ? (
<FormRender
componentMapper={{
...componentMapper,
[DESCRIPTIVE_CHECKBOX]: DescriptiveCheckbox,
[LOADER]: Loader,
[DATA_LIST]: DataListLayout,
}}
FormTemplate={(props) => (
<FormTemplate {...props} FormButtons={FormButtons} />
)}
schema={{
fields: [
{
name: 'email-preferences',
component: DATA_LIST,
sections: Object.entries(emailConfig).map(
([key, schema]) => calculateSection(key, schema)
),
},
],
}}
onSubmit={saveValues}
/>
) : (
<Bullseye>
<Spinner />
</Bullseye>
)}
</CardBody>
</Card>
</StackItem>
</Stack>
</Main>
</React.Fragment>
);
}
Example #7
Source File: Notification.js From user-preferences-frontend with Apache License 2.0 | 4 votes |
Notification = () => {
const { bundleName } = useParams();
const navigateTo = useChromePush();
const dispatch = useDispatch();
const store = useSelector(
({ notificationPreferences }) => notificationPreferences
);
const bundleDisplayTitle = notificationConfigForBundle(bundleName)?.title;
useEffect(() => {
register(notificationPreferences);
}, []);
useEffect(() => {
(async () => {
await insights.chrome.auth.getUser();
if (bundleName) {
dispatch(getNotificationSchema({ bundleName }));
}
})();
}, [bundleName]);
const { isLoaded, schema } = useMemo(() => {
if (store?.loaded) {
const schema = { ...store.schema };
if (schema.fields) {
schema.fields = [...schema.fields];
schema.fields[0].sections = [...schema.fields[0].sections];
schema.fields[0].sections.push({
fields: unsubscribe,
});
} else {
schema.fields = [];
}
return {
isLoaded: true,
schema: schema,
};
}
return {
isLoaded: false,
schema: [],
};
}, [store]);
const saveValues = useCallback(
async ({ unsubscribe, ...values }) => {
const action = saveNotificationValues({ bundleName, values });
dispatch(action);
try {
await action.payload;
dispatch(
addNotification({
dismissable: false,
variant: 'success',
title: `Notification preferences successfully saved`,
})
);
} catch (e) {
dispatch(
addNotification({
dismissable: false,
variant: 'danger',
title: `Notification preferences unsuccessfully saved`,
})
);
}
},
[bundleName]
);
return (
<React.Fragment>
<PageHeader>
<Split>
<SplitItem isFilled>
<PageHeaderTitle
className="notif-page-header"
title={`My Notifications | ${bundleDisplayTitle}`}
/>
<StackItem>
This service allows you to opt-in and out of receiving
notifications. Your Organization Administrator has configured
which notifications you can or can not receive in their{' '}
<a
onClick={(e) =>
navigateTo(e, `/settings/notifications/${bundleName}`)
}
href={`/settings/notifications/${bundleName}`}
>
Settings
</a>
.
</StackItem>
</SplitItem>
</Split>
</PageHeader>
<Main className="pref-notification">
<Stack hasGutter>
<StackItem>
<Card ouiaId="user-pref-notification-subscriptions-card">
<CardHeader className="pf-u-pb-0"></CardHeader>
<CardBody className="pref-notification_form">
{isLoaded ? (
<FormRender
componentMapper={{
...componentMapper,
[DESCRIPTIVE_CHECKBOX]: DescriptiveCheckbox,
[LOADER]: Loader,
[DATA_LIST]: DataListLayout,
}}
FormTemplate={(props) => (
<FormTemplate {...props} FormButtons={FormButtons} />
)}
schema={schema}
onSubmit={saveValues}
/>
) : (
<Bullseye>
<Spinner />
</Bullseye>
)}
</CardBody>
</Card>
</StackItem>
</Stack>
</Main>
</React.Fragment>
);
}
Example #8
Source File: test-history.js From ibutsu-server with MIT License | 4 votes |
render() {
const {
columns,
rows,
onlyFailures,
historySummary,
dropdownSelection
} = this.state;
const pagination = {
pageSize: this.state.pageSize,
page: this.state.page,
totalItems: this.state.totalItems
}
const dropdownValues = Object.assign({
"1 Week": 0.25,
"2 Weeks": 0.5,
"1 Month": 1.0,
"2 Months": 2.0,
"3 Months": 3.0,
"5 Months": 5.0
})
let dropdownItems = [];
Object.keys(dropdownValues).forEach(key => {
dropdownItems.push(
<DropdownItem key={key} value={dropdownValues[key]} autoFocus={key === dropdownSelection}>
{key}
</DropdownItem>
)
});
return (
<Card className="pf-u-mt-lg">
<CardHeader>
<Flex style={{ width: '100%' }}>
<FlexItem grow={{ default: 'grow' }}>
<TextContent>
<Text component="h2" className="pf-c-title pf-m-xl">
Test History
</Text>
</TextContent>
</FlexItem>
<FlexItem>
<TextContent>
<Checkbox id="only-failures" label="Only show failures/errors" isChecked={onlyFailures} aria-label="only-failures-checkbox" onChange={this.onFailuresCheck}/>
</TextContent>
</FlexItem>
<FlexItem>
<Dropdown
toggle={<DropdownToggle isDisabled={false} onToggle={this.onDropdownToggle}>Time range</DropdownToggle>}
onSelect={this.onDropdownSelect}
isOpen={this.state.isDropdownOpen}
dropdownItems={dropdownItems}
/>
</FlexItem>
<FlexItem>
<Button variant="secondary" onClick={this.refreshResults}>Refresh results</Button>
</FlexItem>
</Flex>
</CardHeader>
<CardBody>
<FilterTable
columns={columns}
rows={rows}
pagination={pagination}
isEmpty={this.state.isEmpty}
isError={this.state.isError}
onCollapse={this.onCollapse}
onSetPage={this.setPage}
onSetPageSize={this.pageSizeSelect}
canSelectAll={false}
variant={TableVariant.compact}
activeFilters={this.state.filters}
filters={[
<Text key="summary" component="h4">
Summary:
{historySummary &&
<RunSummary summary={historySummary}/>
}
</Text>,
<Text key="last-passed" component="h4">Last passed: {this.state.lastPassedDate}</Text>,
]}
onRemoveFilter={this.removeFilter}
hideFilters={["project_id", "result", "test_id"]}
/>
</CardBody>
</Card>
);
}
Example #9
Source File: run.js From ibutsu-server with MIT License | 4 votes |
render() {
let passed = 0, failed = 0, errors = 0, xfailed = 0, xpassed = 0, skipped = 0, not_run = 0;
let created = 0;
let calculatePasses = true;
const { run, columns, rows, classificationTable, artifactTabs } = this.state;
const jsonViewTheme = getTheme() === 'dark' ? 'tomorrow' : 'rjv-default';
if (run.start_time) {
created = new Date(run.start_time);
}
else {
created = new Date(run.created);
}
if (run.summary) {
if (run.summary.passes) {
passed = run.summary.passes;
calculatePasses = false;
}
if (run.summary.tests && calculatePasses) {
passed = run.summary.tests;
}
if (run.summary.failures) {
passed -= calculatePasses ? run.summary.failures : 0;
failed = run.summary.failures;
}
if (run.summary.errors) {
passed -= calculatePasses ? run.summary.errors : 0;
errors = run.summary.errors;
}
if (run.summary.xfailures) {
passed -= calculatePasses ? run.summary.xfailures : 0;
xfailed = run.summary.xfailures;
}
if (run.summary.xpasses) {
passed -= calculatePasses ? run.summary.xpasses : 0;
xpassed = run.summary.xpasses;
}
if (run.summary.skips) {
passed -= calculatePasses ? run.summary.skips : 0;
skipped = run.summary.skips;
}
if (run.summary.not_run) {
not_run = run.summary.not_run;
}
else if (run.summary.collected) {
not_run = run.summary.collected - run.summary.tests;
}
}
const pagination = {
pageSize: this.state.pageSize,
page: this.state.page,
totalItems: this.state.totalItems
}
return (
<React.Fragment>
<PageSection variant={PageSectionVariants.light}>
<TextContent>
<Text component="h1" className="pf-c-title">Run {run.id}</Text>
</TextContent>
</PageSection>
<PageSection>
{!this.state.isRunValid &&
<EmptyObject headingText="Run not found" returnLink="/runs" returnLinkText="Return to runs list" />
}
{this.state.isRunValid &&
<Tabs activeKey={this.state.activeTab} onSelect={this.onTabSelect} isBox>
<Tab eventKey={'summary'} title={<TabTitle icon={InfoCircleIcon} text="Summary" />}>
<Card>
<CardBody style={{padding: 0}} id="run-detail">
<Grid style={{backgroundColor: '#fff'}}>
<GridItem span={6}>
<DataList selectedDataListItemId={null} aria-label="Run properties" style={{borderBottom: 'none', borderTop: 'none'}}>
<DataListItem aria-labelledby="Duration">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1} width={2}><strong>Duration:</strong></DataListCell>,
<DataListCell key={2} width={4}>{round(run.duration)}s</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Started">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1} width={2}><strong>Started:</strong></DataListCell>,
<DataListCell key={2} width={4}>{created.toLocaleString()}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
{run.metadata && run.metadata.component &&
<DataListItem aria-labelledby="Component">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1} width={2}><strong>Component:</strong></DataListCell>,
<DataListCell key={2} width={4}>{run.metadata.component}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
}
{run.metadata && run.metadata.env &&
<DataListItem aria-labelledby="Environment">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1} width={2}><strong>Environment:</strong></DataListCell>,
<DataListCell key={2} width={4}>{run.metadata.env}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
}
{run.metadata && run.metadata.tags &&
<DataListItem aria-labelledby="tags-label">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key="tags-label" width={2}><strong>Tags:</strong></DataListCell>,
<DataListCell key="tags-data" width={4}>
<Flex>
{run.metadata.tags.map((tag) => <FlexItem spacer={{ default: 'spacerXs' }} key={tag}><Label color="blue" variant="filled">{tag}</Label></FlexItem>)}
</Flex>
</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
}
{run.metadata && run.metadata.jenkins && run.metadata.jenkins.job_name &&
<DataListItem aria-labelledby="Jenkins Job Name">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1} width={2}><strong>Jenkins Job Name:</strong></DataListCell>,
<DataListCell key={2} width={4}>{run.metadata.jenkins.job_name}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
}
{run.source &&
<DataListItem aria-labelledby="Source">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1} width={2}><strong>Source:</strong></DataListCell>,
<DataListCell key={2} width={4}>{run.source}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
}
</DataList>
</GridItem>
<GridItem span={6}>
<DataList selectedDataListItemId={null} aria-label="Summary properties" style={{borderBottom: 0, borderTop: 0}}>
<DataListItem aria-labelledby="Summary">
<DataListItemRow>
<DataListItemCells
style={{paddingBottom: 0}}
dataListCells={[
<DataListCell key={1} width={2}><strong>Summary:</strong></DataListCell>,
<DataListCell key={2} width={4} style={{paddingTop: 0}}>
<DataList selectedDataListItemId={null} aria-label="Summary" style={{borderBottom: 0, borderTop: 0}}>
<DataListItem aria-labelledby="Total">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Total:</DataListCell>,
<DataListCell key={2}>{run.summary.collected ? run.summary.collected : run.summary.tests}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Passed">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Passed:</DataListCell>,
<DataListCell key={2}>{passed}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Failed">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Failed:</DataListCell>,
<DataListCell key={2}>{failed}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Error">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Error:</DataListCell>,
<DataListCell key={2}>{errors}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Xfailed">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Xfailed:</DataListCell>,
<DataListCell key={2}>{xfailed}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Xpassed">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Xpassed:</DataListCell>,
<DataListCell key={2}>{xpassed}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Skipped">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Skipped:</DataListCell>,
<DataListCell key={2}>{skipped}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
<DataListItem aria-labelledby="Not Run">
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={1}>Not Run:</DataListCell>,
<DataListCell key={2}>{not_run}</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
</DataList>
</DataListCell>
]}
/>
</DataListItemRow>
</DataListItem>
</DataList>
</GridItem>
</Grid>
</CardBody>
</Card>
</Tab>
<Tab eventKey={'results-list'} title={<TabTitle icon={CatalogIcon} text="Results List" />}>
<Card className="pf-u-mt-lg">
<CardHeader>
<Flex style={{ width: '100%' }}>
<FlexItem grow={{ default: 'grow' }}>
<TextContent>
<Text component="h2" className="pf-c-title pf-m-xl">Test Results</Text>
</TextContent>
</FlexItem>
<FlexItem>
<Button variant="secondary" onClick={this.refreshResults}>Refresh results</Button>
</FlexItem>
<FlexItem>
<Link to={`/results?run_id[eq]=${run.id}`} className="pf-c-button pf-m-primary" style={{marginLeft: '2px'}}>See all results <ChevronRightIcon /></Link>
</FlexItem>
</Flex>
</CardHeader>
<CardBody>
<FilterTable
columns={columns}
rows={rows}
pagination={pagination}
isEmpty={this.state.isEmpty}
isError={this.state.isError}
onSetPage={this.setPage}
onSetPageSize={this.pageSizeSelect}
/>
</CardBody>
</Card>
</Tab>
<Tab eventKey={'results-tree'} title={<TabTitle icon={RepositoryIcon} text="Results Tree" />}>
<Card className="pf-u-mt-lg">
<CardBody>
<Grid gutter="sm">
{false && <GridItem span={12}>
<div style={{paddingTop: "1em"}}>
<TextInput value={this.state.treeSearch} type="text" onChange={this.onSearch} placeholder="Search tree..." aria-label="Filter tree" />
</div>
</GridItem>
}
{this.state.resultsTree.core.data.length === 0 &&
<GridItem span={12}>
<Bullseye><center><Spinner size="xl"/></center></Bullseye>
</GridItem>
}
{this.state.resultsTree.core.data !== 0 &&
<React.Fragment>
<GridItem span={5}>
<TreeView treeData={this.state.resultsTree} onChange={(e, data) => this.handleJSTreeChange(e, data)}/>
</GridItem>
<GridItem span={7}>
{this.state.testResult &&
<Card className={this.state.testResult.result}>
<CardHeader>
{this.state.testResult.test_id}
{this.state.testResult.metadata.markers &&
<div style={{float: 'right'}}>
{this.state.testResult.metadata.markers.map((marker) => {
return <Badge isRead key={marker.name}>{marker.name}</Badge>;
})}
</div>
}
</CardHeader>
<CardBody style={{backgroundColor: "var(--pf-c-page__main-section--BackgroundColor)", paddingTop: "1.2em"}}>
<ResultView testResult={this.state.testResult}/>
</CardBody>
</Card>
}
</GridItem>
</React.Fragment>
}
</Grid>
</CardBody>
</Card>
</Tab>
<Tab eventKey={'classify-failures'} title={<TabTitle icon={MessagesIcon} text="Classify Failures" />}>
{classificationTable}
</Tab>
{artifactTabs}
<Tab eventKey={'run-object'} title={<TabTitle icon={CodeIcon} text="Run Object" />}>
<Card>
<CardBody>
<ReactJson src={run} name={null} iconStyle={"triangle"} collapseStringsAfterLength={120} enableClipboard={false} displayDataTypes={false} theme={jsonViewTheme} />
</CardBody>
</Card>
</Tab>
</Tabs>
}
</PageSection>
</React.Fragment>
);
}