diff --git a/grafana-plugin/.eslintrc.js b/grafana-plugin/.eslintrc.js index a3c46944..97527e17 100644 --- a/grafana-plugin/.eslintrc.js +++ b/grafana-plugin/.eslintrc.js @@ -9,6 +9,7 @@ module.exports = { '^assets|^components|^containers|^declare|^icons|^img|^interceptors|^models|^network|^pages|^services|^state|^utils', }, rules: { + 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: false }], 'react/prop-types': 'warn', 'react/display-name': 'warn', 'react/jsx-key': 'warn', @@ -16,7 +17,7 @@ module.exports = { 'react/jsx-no-target-blank': 'warn', 'no-restricted-imports': 'warn', eqeqeq: 'warn', - 'no-duplicate-imports': 'warn', + 'no-duplicate-imports': 'error', 'rulesdir/no-relative-import-paths': ['error', { allowSameFolder: true }], 'import/order': [ 'error', diff --git a/grafana-plugin/src/pages/index.ts b/grafana-plugin/src/pages/index.ts index 5df8fde2..30f83e48 100644 --- a/grafana-plugin/src/pages/index.ts +++ b/grafana-plugin/src/pages/index.ts @@ -13,7 +13,9 @@ import MaintenancePage2 from 'pages/maintenance/Maintenance'; import MigrationTool from 'pages/migration-tool/MigrationTool'; import OrganizationLogPage2 from 'pages/organization-logs/OrganizationLog'; import OutgoingWebhooks2 from 'pages/outgoing_webhooks/OutgoingWebhooks'; +import SchedulePage from 'pages/schedule/Schedule'; import SchedulesPage2 from 'pages/schedules/Schedules'; +import SchedulesPage from 'pages/schedules_NEW/Schedules'; import SettingsPage2 from 'pages/settings/SettingsPage'; import Test from 'pages/test/Test'; import UsersPage2 from 'pages/users/Users'; @@ -62,9 +64,22 @@ export const pages: PageDefinition[] = [ { component: SchedulesPage2, icon: 'calendar-alt', + id: 'schedules-old', + text: 'Schedules OLD', + }, + { + component: SchedulesPage, + icon: 'calendar-alt', id: 'schedules', text: 'Schedules', }, + { + component: SchedulePage, + icon: 'calendar-alt', + id: 'schedule', + text: 'Schedule', + hideFromTabs: true, + }, { component: ChatOpsPage, icon: 'comments-alt', diff --git a/grafana-plugin/src/pages/schedule/Schedule.module.css b/grafana-plugin/src/pages/schedule/Schedule.module.css new file mode 100644 index 00000000..538f682e --- /dev/null +++ b/grafana-plugin/src/pages/schedule/Schedule.module.css @@ -0,0 +1,4 @@ +.root { + margin-top: 24px; +} + diff --git a/grafana-plugin/src/pages/schedule/Schedule.tsx b/grafana-plugin/src/pages/schedule/Schedule.tsx new file mode 100644 index 00000000..37e00567 --- /dev/null +++ b/grafana-plugin/src/pages/schedule/Schedule.tsx @@ -0,0 +1,30 @@ +import React from 'react'; + +import cn from 'classnames/bind'; +import { observer } from 'mobx-react'; + +import PluginLink from 'components/PluginLink/PluginLink'; +import GSelect from 'containers/GSelect/GSelect'; +import { PRIVATE_CHANNEL_NAME } from 'models/slack_channel/slack_channel.config'; +import { withMobXProviderContext } from 'state/withStore'; + +import styles from './Schedule.module.css'; + +const cx = cn.bind(styles); + +interface SchedulePageProps {} + +interface SchedulePageState {} + +@observer +class SchedulePage extends React.Component { + async componentDidMount() {} + + componentDidUpdate() {} + + render() { + return
Hello!
; + } +} + +export default withMobXProviderContext(SchedulePage); diff --git a/grafana-plugin/src/pages/schedules_NEW/Schedules.module.css b/grafana-plugin/src/pages/schedules_NEW/Schedules.module.css new file mode 100644 index 00000000..538f682e --- /dev/null +++ b/grafana-plugin/src/pages/schedules_NEW/Schedules.module.css @@ -0,0 +1,4 @@ +.root { + margin-top: 24px; +} + diff --git a/grafana-plugin/src/pages/schedules_NEW/Schedules.tsx b/grafana-plugin/src/pages/schedules_NEW/Schedules.tsx new file mode 100644 index 00000000..71195b36 --- /dev/null +++ b/grafana-plugin/src/pages/schedules_NEW/Schedules.tsx @@ -0,0 +1,34 @@ +import React from 'react'; + +import cn from 'classnames/bind'; +import { observer } from 'mobx-react'; + +import PluginLink from 'components/PluginLink/PluginLink'; +import GSelect from 'containers/GSelect/GSelect'; +import { PRIVATE_CHANNEL_NAME } from 'models/slack_channel/slack_channel.config'; +import { withMobXProviderContext } from 'state/withStore'; + +import styles from './Schedules.module.css'; + +const cx = cn.bind(styles); + +interface SchedulesPageProps {} + +interface SchedulesPageState {} + +@observer +class SchedulesPage extends React.Component { + async componentDidMount() {} + + componentDidUpdate() {} + + render() { + return ( +
+ Schedule 1 +
+ ); + } +} + +export default withMobXProviderContext(SchedulesPage);