Update Mesh.js to allow for running AWX at non-root path (URL prefixing) (#14020)

Co-authored-by: Michael Abashian <mabashia@redhat.com>
This commit is contained in:
rakesh561
2023-06-05 11:46:12 -04:00
committed by GitHub
parent aafd4df288
commit 9009a21a32
4 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import Base from '../Base';
class JobEvents extends Base { class JobEvents extends Base {
constructor(http) { constructor(http) {
super(http); super(http);
this.baseUrl = '/api/v2/job_events/'; this.baseUrl = 'api/v2/job_events/';
} }
readChildren(id, params) { readChildren(id, params) {

View File

@@ -3,7 +3,7 @@ import Base from '../Base';
class Mesh extends Base { class Mesh extends Base {
constructor(http) { constructor(http) {
super(http); super(http);
this.baseUrl = '/api/v2/mesh_visualizer/'; this.baseUrl = 'api/v2/mesh_visualizer/';
} }
} }
export default Mesh; export default Mesh;

View File

@@ -4,7 +4,7 @@ class Root extends Base {
constructor(http) { constructor(http) {
super(http); super(http);
this.baseUrl = 'api/'; this.baseUrl = 'api/';
this.redirectURL = '/api/v2/config/'; this.redirectURL = 'api/v2/config/';
} }
async login(username, password, redirect = this.redirectURL) { async login(username, password, redirect = this.redirectURL) {

View File

@@ -35,7 +35,7 @@ describe('RootAPI', () => {
expect(mockHttp.post).toHaveBeenCalledTimes(2); expect(mockHttp.post).toHaveBeenCalledTimes(2);
expect(mockHttp.post.mock.calls[0]).toContainEqual( expect(mockHttp.post.mock.calls[0]).toContainEqual(
'username=foo&password=bar&next=%2Fapi%2Fv2%2Fconfig%2F' 'username=foo&password=bar&next=api%2Fv2%2Fconfig%2F'
); );
expect(mockHttp.post.mock.calls[1]).toContainEqual( expect(mockHttp.post.mock.calls[1]).toContainEqual(
'username=foo&password=bar&next=baz' 'username=foo&password=bar&next=baz'