Переглянути джерело

Fixed url of back button in datasource edit page, when root_url configured (#15759)

* Fixed url of back button in datasource edit page, when root_url configured

* Update snapshots

* Use app config directly in ButtonRow instead of passing datasources page URL via prop

* Snapshots update
Dominik Prokop 6 роки тому
батько
коміт
cee5f030dc

+ 2 - 1
public/app/features/datasources/settings/ButtonRow.tsx

@@ -1,4 +1,5 @@
 import React, { FC } from 'react';
+import config from 'app/core/config';
 
 export interface Props {
   isReadOnly: boolean;
@@ -23,7 +24,7 @@ const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
       <button type="submit" className="btn btn-danger" disabled={isReadOnly} onClick={onDelete}>
         Delete
       </button>
-      <a className="btn btn-inverse" href="/datasources">
+      <a className="btn btn-inverse" href={`${config.appSubUrl}/datasources`}>
         Back
       </a>
     </div>