Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): Show dashboard and template export buttons #12531

Merged
merged 1 commit into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Features
1. [12496](https://github.com/influxdata/influxdb/pull/12496): Add ability to import a dashboard
1. [12524](https://github.com/influxdata/influxdb/pull/12524): Add ability to import a dashboard from org view
1. [12531](https://github.com/influxdata/influxdb/pull/12531): Add ability to export a dashboard and a task

### Bug Fixes

Expand Down
19 changes: 8 additions & 11 deletions ui/src/dashboards/components/dashboard_index/DashboardCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {withRouter, WithRouterProps} from 'react-router'
// Components
import {IconFont, ComponentColor} from '@influxdata/clockface'
import {ResourceList, Context} from 'src/clockface'
import FeatureFlag from 'src/shared/components/FeatureFlag'
import InlineLabels from 'src/shared/components/inlineLabels/InlineLabels'

// Actions
Expand Down Expand Up @@ -98,15 +97,13 @@ class DashboardCard extends PureComponent<Props> {

return (
<Context>
<FeatureFlag>
<Context.Menu icon={IconFont.CogThick}>
<Context.Item
label="Export"
action={this.handleExport}
value={dashboard}
/>
</Context.Menu>
</FeatureFlag>
<Context.Menu icon={IconFont.CogThick}>
<Context.Item
label="Export"
action={this.handleExport}
value={dashboard}
/>
</Context.Menu>
<Context.Menu
icon={IconFont.Duplicate}
color={ComponentColor.Secondary}
Expand Down Expand Up @@ -166,7 +163,7 @@ class DashboardCard extends PureComponent<Props> {
// notify success
return newLabel
} catch (err) {
console.log(err)
console.error(err)
// notify of fail
throw err
}
Expand Down
5 changes: 1 addition & 4 deletions ui/src/tasks/components/TaskCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {withRouter, WithRouterProps} from 'react-router'
// Components
import {SlideToggle, ComponentSize} from '@influxdata/clockface'
import {ResourceList, Context} from 'src/clockface'
import FeatureFlag from 'src/shared/components/FeatureFlag'
import InlineLabels from 'src/shared/components/inlineLabels/InlineLabels'

// API
Expand Down Expand Up @@ -90,9 +89,7 @@ export class TaskCard extends PureComponent<Props & WithRouterProps> {
return (
<Context>
<Context.Menu icon={IconFont.CogThick}>
<FeatureFlag>
<Context.Item label="Export" action={this.handleExport} />
</FeatureFlag>
<Context.Item label="Export" action={this.handleExport} />
<Context.Item label="View Task Runs" action={this.handleViewRuns} />
<Context.Item label="Run Task" action={onRunTask} value={task.id} />
</Context.Menu>
Expand Down