[ARVADOS-WORKBENCH2] updated: 1.1.4-438-g3ec7057

Git user git at public.curoverse.com
Wed Aug 1 03:11:04 EDT 2018


Summary of changes:
 src/common/api/server-api.ts        | 5 -----
 src/index.tsx                       | 5 +----
 src/services/services.ts            | 5 ++++-
 src/store/auth/auth-reducer.test.ts | 2 +-
 4 files changed, 6 insertions(+), 11 deletions(-)

       via  3ec7057e490b3d19b15663dd312328f637fa1d3b (commit)
      from  f239b9e88677d82a48b6b565ab2fd407d1171729 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 3ec7057e490b3d19b15663dd312328f637fa1d3b
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Wed Aug 1 09:10:59 2018 +0200

    Remove setBaseUrl
    
    Feature #13901
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/common/api/server-api.ts b/src/common/api/server-api.ts
index bcd2f65..75eabd9 100644
--- a/src/common/api/server-api.ts
+++ b/src/common/api/server-api.ts
@@ -22,8 +22,3 @@ export function removeServerApiAuthorizationHeader() {
         delete client.defaults.headers.common.Authorization;
     });
 }
-
-export const setBaseUrl = (url: string) => {
-    authClient.defaults.baseURL = url;
-    apiClient.defaults.baseURL = url + "/arvados/v1";
-};
diff --git a/src/index.tsx b/src/index.tsx
index 4b2e335..bf2816d 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -18,7 +18,6 @@ import { getProjectList } from "./store/project/project-action";
 import { MuiThemeProvider } from '@material-ui/core/styles';
 import { CustomTheme } from './common/custom-theme';
 import { fetchConfig } from './common/config';
-import { setBaseUrl } from './common/api/server-api';
 import { addMenuActionSet, ContextMenuKind } from "./views-components/context-menu/context-menu";
 import { rootProjectActionSet } from "./views-components/context-menu/action-sets/root-project-action-set";
 import { projectActionSet } from "./views-components/context-menu/action-sets/project-action-set";
@@ -33,10 +32,8 @@ addMenuActionSet(ContextMenuKind.FAVORITE, favoriteActionSet);
 fetchConfig()
     .then(config => {
 
-        setBaseUrl(config.API_HOST);
-
         const history = createBrowserHistory();
-        const services = createServices();
+        const services = createServices(config.API_HOST);
         const store = configureStore(history, services);
 
         store.dispatch(authActions.INIT());
diff --git a/src/services/services.ts b/src/services/services.ts
index 55ab836..350128f 100644
--- a/src/services/services.ts
+++ b/src/services/services.ts
@@ -17,7 +17,10 @@ export interface ServiceRepository {
     favoriteService: FavoriteService;
 }
 
-export const createServices = (): ServiceRepository => {
+export const createServices = (baseUrl: string): ServiceRepository => {
+    authClient.defaults.baseURL = baseUrl;
+    apiClient.defaults.baseURL = baseUrl + "/arvados/v1";
+
     const authService = new AuthService(authClient, apiClient);
     const groupsService = new GroupsService(apiClient);
     const projectService = new ProjectService(apiClient);
diff --git a/src/store/auth/auth-reducer.test.ts b/src/store/auth/auth-reducer.test.ts
index f686db5..a741928 100644
--- a/src/store/auth/auth-reducer.test.ts
+++ b/src/store/auth/auth-reducer.test.ts
@@ -21,7 +21,7 @@ describe('auth-reducer', () => {
 
     beforeAll(() => {
         localStorage.clear();
-        reducer = authReducer(createServices());
+        reducer = authReducer(createServices("/arvados/v1"));
     });
 
     it('should return default state on initialisation', () => {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list