[ARVADOS-WORKBENCH2] updated: 1.2.0-137-g0c46a74
Git user
git at public.curoverse.com
Mon Aug 27 02:54:15 EDT 2018
Summary of changes:
src/common/api/common-resource-service.ts | 1 -
src/index.tsx | 7 ++++---
src/routes/routes.ts | 1 +
src/services/ancestors-service/ancestors-service.ts | 10 +++++-----
src/store/auth/auth-action.ts | 21 ++++++++++-----------
src/views/workbench/workbench.tsx | 10 ----------
6 files changed, 20 insertions(+), 30 deletions(-)
via 0c46a74e6c0397fa153c345857977f8654ec4471 (commit)
from 09257d57b005094ea3752a7e90b90aa38518a0cf (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 0c46a74e6c0397fa153c345857977f8654ec4471
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Aug 27 08:53:59 2018 +0200
Delete code smells
Feature #14102
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/common/api/common-resource-service.ts b/src/common/api/common-resource-service.ts
index fe7494b..2c9bfb5 100644
--- a/src/common/api/common-resource-service.ts
+++ b/src/common/api/common-resource-service.ts
@@ -111,7 +111,6 @@ export class CommonResourceService<T extends Resource> {
.put<T>(this.resourceType + uuid, data && CommonResourceService.mapKeys(_.snakeCase)(data)));
}
-
}
export const getCommonResourceServiceError = (errorResponse: any) => {
diff --git a/src/index.tsx b/src/index.tsx
index ecc6166..ad77162 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -29,6 +29,7 @@ import { collectionActionSet } from './views-components/context-menu/action-sets
import { collectionResourceActionSet } from './views-components/context-menu/action-sets/collection-resource-action-set';
import { addRouteChangeHandlers } from './routes/routes';
import { loadWorkbench } from './store/navigation/navigation-action';
+import { Routes } from '~/routes/routes';
const getBuildNumber = () => "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev");
const getGitCommit = () => "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7);
@@ -48,7 +49,7 @@ addMenuActionSet(ContextMenuKind.COLLECTION, collectionActionSet);
addMenuActionSet(ContextMenuKind.COLLECTION_RESOURCE, collectionResourceActionSet);
fetchConfig()
- .then(async (config) => {
+ .then((config) => {
const history = createBrowserHistory();
const services = createServices(config);
const store = configureStore(history, services);
@@ -65,8 +66,8 @@ fetchConfig()
<Provider store={store}>
<ConnectedRouter history={history}>
<div>
- <Route path="/token" component={TokenComponent} />
- <Route path="/" component={WorkbenchComponent} />
+ <Route path={Routes.TOKEN} component={TokenComponent} />
+ <Route path={Routes.ROOT} component={WorkbenchComponent} />
</div>
</ConnectedRouter>
</Provider>
diff --git a/src/routes/routes.ts b/src/routes/routes.ts
index 2bdd17a..7ad7389 100644
--- a/src/routes/routes.ts
+++ b/src/routes/routes.ts
@@ -12,6 +12,7 @@ import { loadProject, loadFavorites, loadCollection } from '../store/navigation/
export const Routes = {
ROOT: '/',
+ TOKEN: '/token',
PROJECTS: `/projects/:id(${RESOURCE_UUID_PATTERN})`,
COLLECTIONS: `/collections/:id(${RESOURCE_UUID_PATTERN})`,
FAVORITES: '/favorites',
diff --git a/src/services/ancestors-service/ancestors-service.ts b/src/services/ancestors-service/ancestors-service.ts
index 5eab842..1cd42fb 100644
--- a/src/services/ancestors-service/ancestors-service.ts
+++ b/src/services/ancestors-service/ancestors-service.ts
@@ -1,13 +1,13 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
import { GroupsService } from "~/services/groups-service/groups-service";
import { UserService } from '../user-service/user-service';
import { GroupResource } from '~/models/group';
-import { UserResource } from '../../models/user';
+import { UserResource } from '~/models/user';
import { extractUuidObjectType, ResourceObjectType } from "~/models/resource";
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
export class AncestorService {
constructor(
private groupsService: GroupsService,
diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts
index 07426b7..ac2e0b7 100644
--- a/src/store/auth/auth-action.ts
+++ b/src/store/auth/auth-action.ts
@@ -31,17 +31,16 @@ function removeAuthorizationHeader(client: AxiosInstance) {
delete client.defaults.headers.common.Authorization;
}
-export const initAuth = () =>
- (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- const user = services.authService.getUser();
- const token = services.authService.getApiToken();
- if (token) {
- setAuthorizationHeader(services, token);
- }
- if (token && user) {
- dispatch(authActions.INIT({ user, token }));
- }
- };
+export const initAuth = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const user = services.authService.getUser();
+ const token = services.authService.getApiToken();
+ if (token) {
+ setAuthorizationHeader(services, token);
+ }
+ if (token && user) {
+ dispatch(authActions.INIT({ user, token }));
+ }
+};
export const saveApiToken = (token: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
services.authService.saveApiToken(token);
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index a4defc1..a3ee07e 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -13,7 +13,6 @@ import { MainAppBar, MainAppBarActionProps, MainAppBarMenuItem } from '~/views-c
import { Breadcrumb } from '~/components/breadcrumbs/breadcrumbs';
import { push } from 'react-router-redux';
import { TreeItem } from "~/components/tree/tree";
-import { getTreePath } from '~/store/project/project-reducer';
import { ProjectPanel } from "~/views/project-panel/project-panel";
import { DetailsPanel } from '~/views-components/details-panel/details-panel';
import { ArvadosTheme } from '~/common/custom-theme';
@@ -161,15 +160,6 @@ export const Workbench = withStyles(styles)(
};
render() {
- const path = getTreePath(this.props.projects, this.props.currentProjectId);
- const breadcrumbs = path.map(item => ({
- label: item.data.name,
- itemId: item.data.uuid,
- status: item.status
- }));
-
- const rootProjectUuid = this.props.authService.getUuid();
-
const { classes, user } = this.props;
return (
<div className={classes.root}>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list