Skip to content

Commit

Permalink
[WIP] Import DropdownButton
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkro committed Jul 2, 2018
1 parent 70e59d7 commit 2b4f426
Showing 1 changed file with 29 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import {
Sort,
Tooltip,
UtilizationBar,
PAGINATION_VIEW
PAGINATION_VIEW,
DropdownButton,
MenuItem
} from 'patternfly-react';
import { formatDateTime } from '../../../../../../components/dates/MomentDate';
import listFilter from '../listFilter';
Expand Down Expand Up @@ -232,6 +234,17 @@ class PlanRequestDetailList extends React.Component {
);
};

onSelect = (eventKey, task) => {
const { downloadLogAction } = this.props;
if (eventKey === 'migration') {
downloadLogAction(task);
} else if (eventKey === 'preMigration') {
console.log('Downloading a sweet pre-migration playbook log');
} else if (eventKey === 'postMigration') {
console.log('Downloading a sweet post-migration playbook log');
}
};

render() {
const {
activeFilters,
Expand Down Expand Up @@ -424,15 +437,22 @@ class PlanRequestDetailList extends React.Component {
<span id="downloadLogInProgress">{__('Download log in progress...')}</span>
</label>
) : (
<a
href="#"
onClick={e => {
e.preventDefault();
downloadLogAction(task);
}}
<DropdownButton
id={`${task.id}-${
task.descriptionPrefix
}_download_log_dropdown`}
title="Download Log"
pullRight
onSelect={eventKey => this.onSelect(eventKey, task)}
>
{__('Download Log')}
</a>
<MenuItem eventKey="preMigration">
Pre-migration log
</MenuItem>
<MenuItem eventKey="migration">Migration log</MenuItem>
<MenuItem eventKey="postMigration">
Post-migration log
</MenuItem>
</DropdownButton>
)
}
stacked
Expand Down

0 comments on commit 2b4f426

Please sign in to comment.