From 085f8d891cdd497977a3344311e299b3091c87f3 Mon Sep 17 00:00:00 2001 From: Linus Pahl <46300478+linuspahl@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:10:21 +0100 Subject: [PATCH] Fixing AWS integration routes when path prefix is present. (#20969) * Fixing AWS integration routes when path prefix is present. * Adding changelog * Revert migration to TS for bingings file for now, to simplify backport. * Fixing routes import. --- changelog/unreleased/pr-20969.toml | 4 ++++ .../src/integrations/aws/AWSInputConfiguration.jsx | 2 +- .../src/integrations/aws/common/{Routes.js => Routes.ts} | 9 +++++++-- graylog2-web-interface/src/integrations/bindings.jsx | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/pr-20969.toml rename graylog2-web-interface/src/integrations/aws/common/{Routes.js => Routes.ts} (92%) diff --git a/changelog/unreleased/pr-20969.toml b/changelog/unreleased/pr-20969.toml new file mode 100644 index 000000000000..e28fbbc6332e --- /dev/null +++ b/changelog/unreleased/pr-20969.toml @@ -0,0 +1,4 @@ +type = "fixed" +message = "Fixing route for AWS integration when path prefix is present." + +pulls = ["20969"] diff --git a/graylog2-web-interface/src/integrations/aws/AWSInputConfiguration.jsx b/graylog2-web-interface/src/integrations/aws/AWSInputConfiguration.jsx index 2c36f0df35f3..a43055918fe7 100644 --- a/graylog2-web-interface/src/integrations/aws/AWSInputConfiguration.jsx +++ b/graylog2-web-interface/src/integrations/aws/AWSInputConfiguration.jsx @@ -18,7 +18,7 @@ import { useEffect } from 'react'; import PropTypes from 'prop-types'; import { useNavigate } from 'react-router-dom'; -import Routes from 'integrations/aws/common/Routes.js'; +import Routes from 'integrations/aws/common/Routes'; const AWSInputConfiguration = ({ url }) => { const navigate = useNavigate(); diff --git a/graylog2-web-interface/src/integrations/aws/common/Routes.js b/graylog2-web-interface/src/integrations/aws/common/Routes.ts similarity index 92% rename from graylog2-web-interface/src/integrations/aws/common/Routes.js rename to graylog2-web-interface/src/integrations/aws/common/Routes.ts index 8e8cca2bcad8..f663a17ee0ad 100644 --- a/graylog2-web-interface/src/integrations/aws/common/Routes.js +++ b/graylog2-web-interface/src/integrations/aws/common/Routes.ts @@ -14,7 +14,9 @@ * along with this program. If not, see * . */ -const Routes = { +import { qualifyUrls } from 'routing/Routes'; + +const AwsRoutes = { INTEGRATIONS: { AWS: { CLOUDWATCH: { @@ -54,6 +56,9 @@ const DocsRoutes = { }, }; -export default Routes; +export default { + ...qualifyUrls(AwsRoutes), + unqualified: AwsRoutes, +}; export { ApiRoutes, DocsRoutes }; diff --git a/graylog2-web-interface/src/integrations/bindings.jsx b/graylog2-web-interface/src/integrations/bindings.jsx index 528bcc35df04..1c37c7f0c327 100644 --- a/graylog2-web-interface/src/integrations/bindings.jsx +++ b/graylog2-web-interface/src/integrations/bindings.jsx @@ -37,7 +37,7 @@ import TeamsNotificationV2Details from './event-notifications/event-notification const bindings = { routes: [ - { path: Routes.INTEGRATIONS.AWS.CLOUDWATCH.index, component: AWSCloudWatchApp }, + { path: Routes.unqualified.INTEGRATIONS.AWS.CLOUDWATCH.index, component: AWSCloudWatchApp }, ], inputConfiguration: [ {