Browse Source

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 <p> instead of nesting
  <div> and <br/>

Closes-Bug: 1707055
Change-Id: I18a764d1ff5dca956880308f000bd58c1b8cce6a
tags/7.3.0
Jiri Tomasek 1 year ago
parent
commit
da97d3009e

+ 5
- 0
releasenotes/notes/plan-export-fix-514306fd85ab93c1.yaml View File

@@ -0,0 +1,5 @@
1
+fixes:
2
+  - |
3
+    Fixes `bug 1707055 <https://launchpad.net/bugs/1707055>`__
4
+    Fixes incorrectly generated exported plan URL for specific application
5
+    configurations

+ 2
- 2
src/js/actions/PlansActions.js View File

@@ -27,8 +27,8 @@ import { planFileSchema } from '../normalizrSchemas/plans';
27 27
 import StackActions from '../actions/StacksActions';
28 28
 import SwiftApiService from '../services/SwiftApiService';
29 29
 import MistralConstants from '../constants/MistralConstants';
30
-import { getAppConfig } from '../services/utils';
31 30
 import { PLAN_ENVIRONMENT } from '../constants/PlansConstants';
31
+import { getServiceUrl } from '../services/utils';
32 32
 
33 33
 const messages = defineMessages({
34 34
   planCreatedNotificationTitle: {
@@ -499,7 +499,7 @@ export default {
499 499
         let urlParser = document.createElement('a');
500 500
         urlParser.href = payload.tempurl;
501 501
         let url = urlParser.hostname;
502
-        urlParser.href = getAppConfig().swift;
502
+        urlParser.href = getServiceUrl('swift');
503 503
         let swiftUrl = urlParser.hostname;
504 504
         dispatch(
505 505
           this.exportPlanSuccess(payload.tempurl.replace(url, swiftUrl))

+ 2
- 3
src/js/components/plan/ExportPlan.js View File

@@ -89,10 +89,9 @@ class ExportPlan extends React.Component {
89 89
           >
90 90
             {this.props.planExportUrl
91 91
               ? <div>
92
-                  <div>
92
+                  <p>
93 93
                     <FormattedMessage {...messages.downloadPlanExportMessage} />
94
-                  </div>
95
-                  <br />
94
+                  </p>
96 95
                   <a
97 96
                     href={this.props.planExportUrl}
98 97
                     className="btn btn-success"

Loading…
Cancel
Save