Skip to content

Commit

Permalink
feat(teamplates): Remove notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ebb-tide committed Aug 12, 2020
1 parent c6de61a commit ec9fd3b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 64 deletions.
62 changes: 1 addition & 61 deletions ui/src/shared/copy/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,7 @@ export const copyToClipboardFailed = (
message: `${title}'${text}' was not copied to clipboard.`,
})

// Templates
export const addTemplateLabelFailed = (): Notification => ({
...defaultErrorNotification,
message: 'Failed to add label to template',
})

export const removeTemplateLabelFailed = (): Notification => ({
...defaultErrorNotification,
message: 'Failed to remove label from template',
})

//Templates
export const TelegrafDashboardCreated = (configs: string[]): Notification => ({
...defaultSuccessNotification,
message: `Successfully created dashboards for telegraf plugin${
Expand All @@ -333,63 +323,13 @@ export const TelegrafDashboardFailed = (): Notification => ({
message: `Could not create dashboards for one or more plugins`,
})

export const importTaskSucceeded = (): Notification => ({
...defaultSuccessNotification,
message: `Successfully imported task.`,
})

export const importTaskFailed = (error: string): Notification => ({
...defaultErrorNotification,
message: `Failed to import task: ${error}`,
})

export const importDashboardSucceeded = (): Notification => ({
...defaultSuccessNotification,
message: `Successfully imported dashboard.`,
})

export const importDashboardFailed = (error: string): Notification => ({
...defaultErrorNotification,
message: `Failed to import dashboard: ${error}`,
})

export const importTemplateSucceeded = (): Notification => ({
...defaultSuccessNotification,
message: `Successfully imported template.`,
})

export const importTemplateFailed = (error: string): Notification => ({
...defaultErrorNotification,
message: `Failed to import template: ${error}`,
})

export const createTemplateFailed = (error: string): Notification => ({
...defaultErrorNotification,
message: `Failed to resource as template: ${error}`,
})

export const createResourceFromTemplateFailed = (
error: string
): Notification => ({
...defaultErrorNotification,
message: `Failed to create from template: ${error}`,
})

export const resourceSavedAsTemplate = (
resourceName: string
): Notification => ({
...defaultSuccessNotification,
message: `Successfully saved ${resourceName.toLowerCase()} as template.`,
})

export const saveResourceAsTemplateFailed = (
resourceName: string,
error: string
): Notification => ({
...defaultErrorNotification,
message: `Failed to save ${resourceName.toLowerCase()} as template: ${error}`,
})

// Labels
export const getLabelsFailed = (): Notification => ({
...defaultErrorNotification,
Expand Down
1 change: 0 additions & 1 deletion ui/src/style/chronograf.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
@import 'src/shared/components/Checkbox.scss';
@import 'src/shared/components/dapperScrollbars/DapperScrollbars.scss';
@import 'src/shared/components/search_widget/SearchWidget.scss';
@import 'src/templates/components/createFromTemplateOverlay/CreateFromTemplateOverlay.scss';
@import 'src/onboarding/components/SigninForm.scss';
@import 'src/onboarding/containers/LoginPage.scss';
@import 'src/shared/components/ThresholdsSettings.scss';
Expand Down
3 changes: 1 addition & 2 deletions ui/src/templates/actions/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import {fetchStacks} from 'src/templates/api'

// Actions
import {Action as NotifyAction} from 'src/shared/actions/notifications'
import {
setStacks,
Action as TemplateAction,
Expand All @@ -11,7 +10,7 @@ import {
// Types
import {Dispatch} from 'react'

type Action = TemplateAction | NotifyAction
type Action = TemplateAction

export const fetchAndSetStacks = (orgID: string) => async (
dispatch: Dispatch<Action>
Expand Down

0 comments on commit ec9fd3b

Please sign in to comment.