Skip to content

Commit

Permalink
Replace mock data with live data
Browse files Browse the repository at this point in the history
This change allows to configure the Axios client to use a different base
URL and set the authentication header.

NODE_ENV=development
VITE_TEST_SERVER_URL=https://development.opencast.org
VITE_TEST_SERVER_AUTH="admin:opencast"
  • Loading branch information
geichelberger committed May 31, 2024
1 parent 7d84ae0 commit 642018e
Show file tree
Hide file tree
Showing 194 changed files with 9 additions and 10,102 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- name: build project
env:
CI: false
NODE_ENV: development
VITE_TEST_SERVER_URL: "https://develop.opencast.org"
VITE_TEST_SERVER_AUTH: "admin:opencast"
run: npm run build

- name: create pages directory
Expand Down
6 changes: 6 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import axios from "axios";

// redux imports
import { persistStore } from "redux-persist";
Expand Down Expand Up @@ -31,6 +32,11 @@ const theme = createTheme({
}
})

if (import.meta.env.DEV && import.meta.env.VITE_TEST_SERVER) {
axios.defaults.baseURL = import.meta.env.VITE_TEST_SERVER_URL || ""
axios.defaults.headers.common['Authorization'] = import.meta.env.VITE_TEST_SERVER_AUTH ?? "Basic " + window.btoa(import.meta.env.VITE_TEST_SERVER_AUTH);
}

ReactDOM.render(
<React.StrictMode>
<Provider store={store}>
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
1 change: 0 additions & 1 deletion test/DELETE/admin-ng/theme/1

This file was deleted.

28 changes: 0 additions & 28 deletions test/GET/acl-manager/acl/1601

This file was deleted.

28 changes: 0 additions & 28 deletions test/GET/acl-manager/acl/1851

This file was deleted.

29 changes: 0 additions & 29 deletions test/GET/admin-ng/acl/1601

This file was deleted.

29 changes: 0 additions & 29 deletions test/GET/admin-ng/acl/31151

This file was deleted.

37 changes: 0 additions & 37 deletions test/GET/admin-ng/acl/acls.json

This file was deleted.

1 change: 0 additions & 1 deletion test/GET/admin-ng/acl/roles.json

This file was deleted.

21 changes: 0 additions & 21 deletions test/GET/admin-ng/adopter/registration

This file was deleted.

48 changes: 0 additions & 48 deletions test/GET/admin-ng/capture-agents/F300.1

This file was deleted.

48 changes: 0 additions & 48 deletions test/GET/admin-ng/capture-agents/agent1

This file was deleted.

9 changes: 0 additions & 9 deletions test/GET/admin-ng/capture-agents/agent2

This file was deleted.

48 changes: 0 additions & 48 deletions test/GET/admin-ng/capture-agents/agent3

This file was deleted.

Loading

0 comments on commit 642018e

Please sign in to comment.