From 27f54be85a024c26f1fd356b0e072f92c3fbb83a Mon Sep 17 00:00:00 2001 From: Kyle Knight Date: Tue, 2 Jul 2019 11:58:56 -0500 Subject: [PATCH] Route constants (#111) * Route constants * Fixing conflicts * Simple Clickthrough without API Convert to Input Clickable Skeleton All Steps Cleanup Yarn Route constants Fixing conflicts * Correct import path * Changing route object * Adjust Kinesis setup wording * Remove the unneeded * Fixing up rebase artifacts from squash of irrelevant commits --- src/web/aws-cloudwatch/KinesisStreams.jsx | 3 ++- src/web/aws/Services.jsx | 4 +++- src/web/common/Routes.js | 13 +++++++++++++ src/web/index.jsx | 9 ++++++--- 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 src/web/common/Routes.js diff --git a/src/web/aws-cloudwatch/KinesisStreams.jsx b/src/web/aws-cloudwatch/KinesisStreams.jsx index 1823879b4..418656699 100644 --- a/src/web/aws-cloudwatch/KinesisStreams.jsx +++ b/src/web/aws-cloudwatch/KinesisStreams.jsx @@ -4,6 +4,7 @@ import { Button, Col, Row } from 'react-bootstrap'; import { Input } from 'components/bootstrap'; import FormAdvancedOptions from './FormAdvancedOptions'; +import Routes from '../common/Routes'; const KinesisStreams = ({ onChange, onSubmit, values, toggleAdvancedOptions, visibleAdvancedOptions }) => { return ( @@ -11,7 +12,7 @@ const KinesisStreams = ({ onChange, onSubmit, values, toggleAdvancedOptions, vis

Choose Kinesis Stream

-

Below is a list of all the Streams we found configured within Kinesis. Please choose the Stream you would like us to parse, or follow the directions to begin setting up your CloudWatch Group to feed into a new Kinesis Stream.

+

Below is a list of all Kinesis Streams found within the specified AWS account. Please choose the Stream you would like us to read messages from, or follow the directions to begin setting up your CloudWatch Log Group to feed messages into a new Kinesis Stream.

{ return (
List of Services. - +
); }; diff --git a/src/web/common/Routes.js b/src/web/common/Routes.js new file mode 100644 index 000000000..b7b9dd779 --- /dev/null +++ b/src/web/common/Routes.js @@ -0,0 +1,13 @@ +const Routes = { + INTEGRATIONS: { + AWS: { + SERVICES: '/integrations/aws', + CLOUDWATCH: { + index: '/integrations/aws/cloudwatch', + step: step => `/integrations/aws/cloudwatch/${step}`, + }, + }, + }, +}; + +export default Routes; diff --git a/src/web/index.jsx b/src/web/index.jsx index 134e9ff72..f874536a6 100644 --- a/src/web/index.jsx +++ b/src/web/index.jsx @@ -2,15 +2,18 @@ import 'webpack-entry'; import { PluginManifest, PluginStore } from 'graylog-web-plugin/plugin'; +import Routes from 'common/Routes.js'; + import AWSServices from './aws/Services'; import AWSCloudWatch from './aws-cloudwatch/CloudWatch'; + import packageJson from '../../package.json'; const manifest = new PluginManifest(packageJson, { routes: [ - { path: '/aws', component: AWSServices }, - { path: '/aws/cloudwatch', component: AWSCloudWatch }, - { path: '/aws/cloudwatch/:step', component: AWSCloudWatch }, + { path: Routes.INTEGRATIONS.AWS.SERVICES, component: AWSServices }, + { path: Routes.INTEGRATIONS.AWS.CLOUDWATCH.index, component: AWSCloudWatch }, + { path: Routes.INTEGRATIONS.AWS.CLOUDWATCH.step(':step'), component: AWSCloudWatch }, ], });