From da97d3009ec086669e25d5bee3871854d74a4e30 Mon Sep 17 00:00:00 2001 From: Jiri Tomasek Date: Thu, 27 Jul 2017 21:42:51 +0200 Subject: [PATCH] Fix plan export URL * use getServiceUrl utility function to retrieve swift API URL instead of directly accessing appConfig * clean up export plan modal dialog to use

instead of nesting

and
Closes-Bug: 1707055 Change-Id: I18a764d1ff5dca956880308f000bd58c1b8cce6a --- releasenotes/notes/plan-export-fix-514306fd85ab93c1.yaml | 5 +++++ src/js/actions/PlansActions.js | 4 ++-- src/js/components/plan/ExportPlan.js | 5 ++--- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/plan-export-fix-514306fd85ab93c1.yaml diff --git a/releasenotes/notes/plan-export-fix-514306fd85ab93c1.yaml b/releasenotes/notes/plan-export-fix-514306fd85ab93c1.yaml new file mode 100644 index 00000000..801761f5 --- /dev/null +++ b/releasenotes/notes/plan-export-fix-514306fd85ab93c1.yaml @@ -0,0 +1,5 @@ +fixes: + - | + Fixes `bug 1707055 `__ + Fixes incorrectly generated exported plan URL for specific application + configurations \ No newline at end of file diff --git a/src/js/actions/PlansActions.js b/src/js/actions/PlansActions.js index bd944cbf..2d25f21e 100644 --- a/src/js/actions/PlansActions.js +++ b/src/js/actions/PlansActions.js @@ -27,8 +27,8 @@ import { planFileSchema } from '../normalizrSchemas/plans'; import StackActions from '../actions/StacksActions'; import SwiftApiService from '../services/SwiftApiService'; import MistralConstants from '../constants/MistralConstants'; -import { getAppConfig } from '../services/utils'; import { PLAN_ENVIRONMENT } from '../constants/PlansConstants'; +import { getServiceUrl } from '../services/utils'; const messages = defineMessages({ planCreatedNotificationTitle: { @@ -499,7 +499,7 @@ export default { let urlParser = document.createElement('a'); urlParser.href = payload.tempurl; let url = urlParser.hostname; - urlParser.href = getAppConfig().swift; + urlParser.href = getServiceUrl('swift'); let swiftUrl = urlParser.hostname; dispatch( this.exportPlanSuccess(payload.tempurl.replace(url, swiftUrl)) diff --git a/src/js/components/plan/ExportPlan.js b/src/js/components/plan/ExportPlan.js index 35be8504..d0a3af7f 100644 --- a/src/js/components/plan/ExportPlan.js +++ b/src/js/components/plan/ExportPlan.js @@ -89,10 +89,9 @@ class ExportPlan extends React.Component { > {this.props.planExportUrl ?
-
+

-

-
+