<commit_before>// Libraries
import React, {PureComponent} from 'react'
import {InjectedRouter} from 'react-router'
import {connect} from 'react-redux'

// Decorators
import {ErrorHandling} from 'src/shared/decorators/errors'

// Components
import DashboardsIndexContents from 'src/dashboards/components/dashboard_index/DashboardsIndexContents'
import {Page} from '@influxdata/clockface'
import SearchWidget from 'src/shared/components/search_widget/SearchWidget'
import AddResourceDropdown from 'src/shared/components/AddResourceDropdown'
import PageTitleWithOrg from 'src/shared/components/PageTitleWithOrg'
import GetAssetLimits from 'src/cloud/components/GetAssetLimits'
import GetResources, {ResourceType} from 'src/shared/components/GetResources'
import AssetLimitAlert from 'src/cloud/components/AssetLimitAlert'

// Utils
import {pageTitleSuffixer} from 'src/shared/utils/pageTitles'
import {extractDashboardLimits} from 'src/cloud/utils/limits'

// Actions
import {
  deleteDashboardAsync,
  updateDashboardAsync,
  createDashboard as createDashboardAction,
  cloneDashboard as cloneDashboardAction,
} from 'src/dashboards/actions'

// Types
import {AppState} from 'src/types'
import {LimitStatus} from 'src/cloud/actions/limits'
import {ComponentStatus} from '@influxdata/clockface'

interface DispatchProps {
  handleDeleteDashboard: typeof deleteDashboardAsync
  handleUpdateDashboard: typeof updateDashboardAsync
  createDashboard: typeof createDashboardAction
  cloneDashboard: typeof cloneDashboardAction
}

interface StateProps {
  limitStatus: LimitStatus
}

interface OwnProps {
  router: InjectedRouter
  params: {orgID: string}
}

type Props = DispatchProps & StateProps & OwnProps

interface State {
  searchTerm: string
}

@ErrorHandling
class DashboardIndex extends PureComponent<Props, State> {
  constructor(props: Props) {
    super(props)

    this.state = {
      searchTerm: '',
    }
  }

  public render() {
    const {
      createDashboard,
      cloneDashboard,
      handleUpdateDashboard,
      handleDeleteDashboard,
      limitStatus,
    } = this.props
    const {searchTerm} = this.state
    return (
      <>
        <Page testID="empty-dashboards-list" titleTag={pageTitleSuffixer(['Dashboards'])}>
          <Page.Header fullWidth={false}>
            <Page.Header.Left>
              <PageTitleWithOrg title="Dashboards" />
            </Page.Header.Left>
            <Page.Header.Right>
              <AddResourceDropdown
                onSelectNew={createDashboard}
                onSelectImport={this.summonImportOverlay}
                onSelectTemplate={this.summonImportFromTemplateOverlay}<commit_msg>(Fix) Create dashboard from empty state test<commit_after>// Libraries
import React, {PureComponent} from 'react'
import {InjectedRouter} from 'react-router'
import {connect} from 'react-redux'

// Decorators
import {ErrorHandling} from 'src/shared/decorators/errors'

// Components
import DashboardsIndexContents from 'src/dashboards/components/dashboard_index/DashboardsIndexContents'
import {Page} from '@influxdata/clockface'
import SearchWidget from 'src/shared/components/search_widget/SearchWidget'
import AddResourceDropdown from 'src/shared/components/AddResourceDropdown'
import PageTitleWithOrg from 'src/shared/components/PageTitleWithOrg'
import GetAssetLimits from 'src/cloud/components/GetAssetLimits'
import GetResources, {ResourceType} from 'src/shared/components/GetResources'
import AssetLimitAlert from 'src/cloud/components/AssetLimitAlert'

// Utils
import {pageTitleSuffixer} from 'src/shared/utils/pageTitles'
import {extractDashboardLimits} from 'src/cloud/utils/limits'

// Actions
import {
  deleteDashboardAsync,
  updateDashboardAsync,
  createDashboard as createDashboardAction,
  cloneDashboard as cloneDashboardAction,
} from 'src/dashboards/actions'

// Types
import {AppState} from 'src/types'
import {LimitStatus} from 'src/cloud/actions/limits'
import {ComponentStatus} from '@influxdata/clockface'

interface DispatchProps {
  handleDeleteDashboard: typeof deleteDashboardAsync
  handleUpdateDashboard: typeof updateDashboardAsync
  createDashboard: typeof createDashboardAction
  cloneDashboard: typeof cloneDashboardAction
}

interface StateProps {
  limitStatus: LimitStatus
}

interface OwnProps {
  router: InjectedRouter
  params: {orgID: string}
}

type Props = DispatchProps & StateProps & OwnProps

interface State {
  searchTerm: string
}

@ErrorHandling
class DashboardIndex extends PureComponent<Props, State> {
  constructor(props: Props) {
    super(props)

    this.state = {
      searchTerm: '',
    }
  }

  public render() {
    const {
      createDashboard,
      cloneDashboard,
      handleUpdateDashboard,
      handleDeleteDashboard,
      limitStatus,
    } = this.props
    const {searchTerm} = this.state
    return (
      <>
        <Page
          testID="empty-dashboards-list"
          titleTag={pageTitleSuffixer(['Dashboards'])}
        >
          <Page.Header fullWidth={false}>
            <Page.Header.Left>
              <PageTitleWithOrg title="Dashboards" />
            </Page.Header.Left>
            <Page.Header.Right>
              <AddResourceDropdown
                onSelectNew={createDashboard}
                onSelectImport={this.summonImportOverlay}
                onSelectTemplate={this.summonImportFromTemplateOverlay}
{'fraction_non_alphanumeric': 0.0894521058516586, 'fraction_numerical': 0.0, 'mean_word_length': 4.130975143403441, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3871959', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1552, 'n_words': 325}