Remove the option to create a template

pull/12849/head
Iris Scholten 2019-03-22 14:15:40 -07:00
parent 8196a0091f
commit bd6fdc403d
2 changed files with 15 additions and 21 deletions

View File

@ -40,7 +40,6 @@ class OrgTemplatesPage extends PureComponent<Props, State> {
return ( return (
<> <>
<TemplatesHeader <TemplatesHeader
onCreateTemplate={onImport}
onImportTemplate={onImport} onImportTemplate={onImport}
showOrgDropdown={false} showOrgDropdown={false}
isFullPage={false} isFullPage={false}

View File

@ -4,10 +4,9 @@ import {Page} from 'src/pageLayout'
// Components // Components
import {Tabs, ComponentSpacer, Alignment, Stack} from 'src/clockface' import {Tabs, ComponentSpacer, Alignment, Stack} from 'src/clockface'
import AddResourceDropdown from 'src/shared/components/AddResourceDropdown' import {Button, IconFont, ComponentColor} from '@influxdata/clockface'
interface Props { interface Props {
onCreateTemplate: () => void
onImportTemplate: () => void onImportTemplate: () => void
showOrgDropdown?: boolean showOrgDropdown?: boolean
isFullPage?: boolean isFullPage?: boolean
@ -24,12 +23,7 @@ export default class TemplatesHeader extends PureComponent<Props> {
} }
public render() { public render() {
const { const {isFullPage, filterComponent} = this.props
onCreateTemplate,
onImportTemplate,
isFullPage,
filterComponent,
} = this.props
if (isFullPage) { if (isFullPage) {
return ( return (
@ -37,13 +31,7 @@ export default class TemplatesHeader extends PureComponent<Props> {
<Page.Header.Left> <Page.Header.Left>
<Page.Title title={this.pageTitle} /> <Page.Title title={this.pageTitle} />
</Page.Header.Left> </Page.Header.Left>
<Page.Header.Right> <Page.Header.Right>{this.importButton}</Page.Header.Right>
<AddResourceDropdown
onSelectNew={onCreateTemplate}
onSelectImport={onImportTemplate}
resourceName="Template"
/>
</Page.Header.Right>
</Page.Header> </Page.Header>
) )
} }
@ -52,11 +40,7 @@ export default class TemplatesHeader extends PureComponent<Props> {
<Tabs.TabContentsHeader> <Tabs.TabContentsHeader>
{filterComponent()} {filterComponent()}
<ComponentSpacer align={Alignment.Right} stackChildren={Stack.Columns}> <ComponentSpacer align={Alignment.Right} stackChildren={Stack.Columns}>
<AddResourceDropdown {this.importButton}
onSelectNew={onCreateTemplate}
onSelectImport={onImportTemplate}
resourceName="Template"
/>
</ComponentSpacer> </ComponentSpacer>
</Tabs.TabContentsHeader> </Tabs.TabContentsHeader>
) )
@ -71,4 +55,15 @@ export default class TemplatesHeader extends PureComponent<Props> {
return '' return ''
} }
private get importButton(): JSX.Element {
return (
<Button
text="Import Template"
icon={IconFont.Plus}
color={ComponentColor.Primary}
onClick={this.props.onImportTemplate}
/>
)
}
} }