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

Update Org page to include Dashboards components #11758

Merged
merged 1 commit into from
Feb 8, 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
1. [11522](https://github.com/influxdata/influxdb/pull/11522): Add plugin information step to allow for config naming and configure one plugin at a time

### Bug Fixes
1. [11758](https://github.com/influxdata/influxdb/pull/11758): Update Dashboards tab on Org page to look like Dashboards Page
## Bug Fixes
1. [11678](https://github.com/influxdata/influxdb/pull/11678): Update the System Telegraf Plugin bundle to include the swap plugin
1. [11722](https://github.com/influxdata/influxdb/pull/11722): Revert behavior allowing users to create authorizations on behalf of another user

Expand Down
3 changes: 3 additions & 0 deletions ui/src/dashboards/components/dashboard_index/Contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface Props {
onEditLabels: (dashboard: Dashboard) => void
notify: (message: Notification) => void
searchTerm: string
showInlineEdit?: boolean
}

@ErrorHandling
Expand All @@ -41,6 +42,7 @@ export default class DashboardsIndexContents extends Component<Props> {
onEditLabels,
searchTerm,
orgs,
showInlineEdit,
} = this.props

return (
Expand All @@ -57,6 +59,7 @@ export default class DashboardsIndexContents extends Component<Props> {
onUpdateDashboard={onUpdateDashboard}
onEditLabels={onEditLabels}
orgs={orgs}
showInlineEdit={showInlineEdit}
/>
</div>
)
Expand Down
3 changes: 3 additions & 0 deletions ui/src/dashboards/components/dashboard_index/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface Props {
onSetDefaultDashboard: (dashboardLink: string) => void
onEditLabels: (dashboard: Dashboard) => void
orgs: Organization[]
showInlineEdit?: boolean
}

interface DatedDashboard extends Dashboard {
Expand Down Expand Up @@ -108,6 +109,7 @@ class DashboardsTable extends PureComponent<Props & WithRouterProps, State> {
onUpdateDashboard,
onEditLabels,
orgs,
showInlineEdit,
} = this.props

const {sortKey, sortDirection} = this.state
Expand All @@ -128,6 +130,7 @@ class DashboardsTable extends PureComponent<Props & WithRouterProps, State> {
onUpdateDashboard={onUpdateDashboard}
onEditLabels={onEditLabels}
orgs={orgs}
showInlineEdit={showInlineEdit}
/>
)}
</SortingHat>
Expand Down
28 changes: 25 additions & 3 deletions ui/src/dashboards/components/dashboard_index/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
UPDATED_AT_TIME_FORMAT,
DEFAULT_DASHBOARD_NAME,
} from 'src/dashboards/constants'
import EditableName from 'src/shared/components/EditableName'

interface Props {
dashboard: Dashboard
Expand All @@ -36,6 +37,7 @@ interface Props {
onExportDashboard: (dashboard: Dashboard) => void
onUpdateDashboard: (dashboard: Dashboard) => void
onEditLabels: (dashboard: Dashboard) => void
showInlineEdit?: boolean
}

export default class DashboardsIndexTableRow extends PureComponent<Props> {
Expand All @@ -55,9 +57,7 @@ export default class DashboardsIndexTableRow extends PureComponent<Props> {
stackChildren={Stack.Columns}
align={Alignment.Left}
>
<Link className={this.nameClassName} to={`/dashboards/${id}`}>
{this.name}
</Link>
{this.resourceNames}
{this.labels}
</ComponentSpacer>
<EditableDescription
Expand Down Expand Up @@ -91,6 +91,28 @@ export default class DashboardsIndexTableRow extends PureComponent<Props> {
)
}

private get resourceNames(): JSX.Element {
const {showInlineEdit, dashboard} = this.props
if (showInlineEdit) {
return (
<EditableName
onUpdate={this.handleUpdateDashboard}
name={dashboard.name}
hrefValue={`/dashboards/${dashboard.id}`}
/>
)
}
return (
<Link className={this.nameClassName} to={`/dashboards/${dashboard.id}`}>
{this.name}
</Link>
)
}

private handleUpdateDashboard = (name: string) => {
this.props.onUpdateDashboard({...this.props.dashboard, name})
}

private get labels(): JSX.Element {
const {dashboard} = this.props

Expand Down
3 changes: 3 additions & 0 deletions ui/src/dashboards/components/dashboard_index/TableRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface Props {
onUpdateDashboard: (dashboard: Dashboard) => void
onEditLabels: (dashboard: Dashboard) => void
orgs: Organization[]
showInlineEdit?: boolean
}

export default class DashboardsIndexTableRows extends PureComponent<Props> {
Expand All @@ -27,6 +28,7 @@ export default class DashboardsIndexTableRows extends PureComponent<Props> {
onUpdateDashboard,
onEditLabels,
orgs,
showInlineEdit,
} = this.props

return dashboards.map(d => (
Expand All @@ -39,6 +41,7 @@ export default class DashboardsIndexTableRows extends PureComponent<Props> {
onUpdateDashboard={onUpdateDashboard}
onEditLabels={onEditLabels}
orgs={orgs}
showInlineEdit={showInlineEdit}
/>
))
}
Expand Down
101 changes: 0 additions & 101 deletions ui/src/organizations/components/DashboardList.tsx

This file was deleted.

93 changes: 0 additions & 93 deletions ui/src/organizations/components/DashboardRow.tsx

This file was deleted.

Loading