Merge branch 'master' into 15088-merge-account
authorEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 15 May 2019 15:04:57 +0000 (11:04 -0400)
committerEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 15 May 2019 15:04:57 +0000 (11:04 -0400)
1  2 
src/routes/route-change-handlers.ts
src/routes/routes.ts
src/store/auth/auth-action.ts
src/store/auth/auth-reducer.ts
src/store/navigation/navigation-action.ts
src/store/store.ts
src/store/workbench/workbench-actions.ts
src/views-components/api-token/api-token.tsx
src/views/workbench/workbench.tsx

Simple merge
Simple merge
index 7ee8399286c381287fb60b236f15ed87ea0df90b,c088418a61eaa4b3b4a4c8fdc7b7110fa6ebfa58..6ca7140339f86542632e01c7616b6cec0e92073a
@@@ -8,12 -8,12 +8,14 @@@ import { AxiosInstance } from "axios"
  import { RootState } from "../store";
  import { ServiceRepository } from "~/services/services";
  import { SshKeyResource } from '~/models/ssh-key';
 -import { User } from "~/models/user";
 +import { User, UserResource } from "~/models/user";
  import { Session } from "~/models/session";
- import { Config } from '~/common/config';
+ import { getDiscoveryURL, Config } from '~/common/config';
  import { initSessions } from "~/store/auth/auth-action-session";
 +import { cancelLinking } from '~/store/link-account-panel/link-account-panel-actions';
 +import { matchTokenRoute } from '~/routes/routes';
+ import Axios from "axios";
+ import { AxiosError } from "axios";
  
  export const authActions = unionize({
      SAVE_API_TOKEN: ofType<string>(),
@@@ -48,15 -48,9 +51,16 @@@ function removeAuthorizationHeader(clie
  }
  
  export const initAuth = (config: Config) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
 +    // Cancel any link account ops in progess unless the user has
 +    // just logged in or there has been a successful link operation
 +    const data = services.linkAccountService.getLinkOpStatus();
 +    if (!matchTokenRoute(location.pathname) && data === undefined) {
 +        dispatch<any>(cancelLinking());
 +    }
 +
      const user = services.authService.getUser();
      const token = services.authService.getApiToken();
+     const homeCluster = services.authService.getHomeCluster();
      if (token) {
          setAuthorizationHeader(services, token);
      }
@@@ -76,13 -82,8 +92,13 @@@ export const saveApiToken = (token: str
      dispatch(authActions.SAVE_API_TOKEN(token));
  };
  
- export const login = (uuidPrefix: string, homeCluster: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-     services.authService.login(uuidPrefix, homeCluster);
 +export const saveUser = (user: UserResource) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
 +    services.authService.saveUser(user);
 +    dispatch(authActions.SAVE_USER(user));
 +};
 +
+ export const login = (uuidPrefix: string, homeCluster: string, remoteHosts: { [key: string]: string }) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+     services.authService.login(uuidPrefix, homeCluster, remoteHosts);
      dispatch(authActions.LOGIN());
  };
  
Simple merge
index 6a37572bc553254eb9c6e1446f6f2d204c658223,ff9a495e804b9e30c2f6693008d42e5a002943e5..8a2ca2400cb1cbd3f1229cce96294291e91c8d66
@@@ -62,7 -62,9 +62,10 @@@ import { ApiClientAuthorizationMiddlewa
  import { PublicFavoritesMiddlewareService } from '~/store/public-favorites-panel/public-favorites-middleware-service';
  import { PUBLIC_FAVORITE_PANEL_ID } from '~/store/public-favorites-panel/public-favorites-action';
  import { publicFavoritesReducer } from '~/store/public-favorites/public-favorites-reducer';
 +import { linkAccountPanelReducer } from './link-account-panel/link-account-panel-reducer';
+ import { CollectionsWithSameContentAddressMiddlewareService } from '~/store/collections-content-address-panel/collections-content-address-middleware-service';
+ import { COLLECTIONS_CONTENT_ADDRESS_PANEL_ID } from '~/store/collections-content-address-panel/collections-content-address-panel-actions';
+ import { ownerNameReducer } from '~/store/owner-name/owner-name-reducer';
  
  const composeEnhancers =
      (process.env.NODE_ENV === 'development' &&
index 0cffcaceaeaaef03af2c5b1e942146bd81ba832b,2363b5795a8b9c2c0d0743524fb8e82f460f0caf..27ac76f335198e75bc37bcbc30df330d39226cbd
@@@ -95,7 -93,8 +94,9 @@@ import { groupDetailsPanelColumns } fro
  import { DataTableFetchMode } from "~/components/data-table/data-table";
  import { loadPublicFavoritePanel, publicFavoritePanelActions } from '~/store/public-favorites-panel/public-favorites-action';
  import { publicFavoritePanelColumns } from '~/views/public-favorites-panel/public-favorites-panel';
 +import { USER_LINK_ACCOUNT_KEY } from '~/services/link-account-service/link-account-service';
+ import { loadCollectionsContentAddressPanel, collectionsContentAddressActions } from '~/store/collections-content-address-panel/collections-content-address-panel-actions';
+ import { collectionContentAddressPanelColumns } from '~/views/collection-content-address-panel/collection-content-address-panel';
  
  export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen';
  
@@@ -135,11 -134,8 +136,12 @@@ export const loadWorkbench = () =
              dispatch(linkPanelActions.SET_COLUMNS({ columns: linkPanelColumns }));
              dispatch(computeNodesActions.SET_COLUMNS({ columns: computeNodePanelColumns }));
              dispatch(apiClientAuthorizationsActions.SET_COLUMNS({ columns: apiClientAuthorizationPanelColumns }));
+             dispatch(collectionsContentAddressActions.SET_COLUMNS({ columns: collectionContentAddressPanelColumns }));
  
 +            if (sessionStorage.getItem(USER_LINK_ACCOUNT_KEY)) {
 +                dispatch(linkAccountPanelActions.HAS_SESSION_DATA());
 +            }
 +
              dispatch<any>(initSidePanelTree());
              if (router.location) {
                  const match = matchRootRoute(router.location.pathname);
index b0fd03134c613fff4a3be001fd88cd8c02d5e73c,b78e7192dc0bd24f5c1ef14ed1ab6c0629aea564..2f8d87e1ede0d1b95fe688738583605136254904
@@@ -28,12 -29,9 +30,14 @@@ export const ApiToken = connect()
              this.props.dispatch<any>(getUserDetails()).then((user: User) => {
                  this.props.dispatch(initSessions(this.props.authService, this.props.config, user));
              }).finally(() => {
+                 if (loadMainApp) {
 +                if (this.props.dispatch(getAccountLinkData())) {
 +                    this.props.dispatch(navigateToLinkAccount);
 +                }
 +                else {
                      this.props.dispatch(navigateToRootProject);
                  }
++                }
              });
          }
          render() {
index e852150c2721001476ee0eb07399a0505bd02770,20cbbdea0c9a0b262f976889d5e097243b777c6f..d015d4ec363255c5982ce3a8bb12af2393d1b2ec
@@@ -93,7 -92,8 +93,9 @@@ import { GroupMemberAttributesDialog } 
  import { AddGroupMembersDialog } from '~/views-components/dialog-forms/add-group-member-dialog';
  import { PartialCopyToCollectionDialog } from '~/views-components/dialog-forms/partial-copy-to-collection-dialog';
  import { PublicFavoritePanel } from '~/views/public-favorites-panel/public-favorites-panel';
 +import { LinkAccountPanel } from '~/views/link-account-panel/link-account-panel';
+ import { FedLogin } from './fed-login';
+ import { CollectionsContentAddressPanel } from '~/views/collection-content-address-panel/collection-content-address-panel';
  
  type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
  
@@@ -183,7 -178,7 +185,8 @@@ export const WorkbenchPanel 
                                  <Route path={Routes.GROUP_DETAILS} component={GroupDetailsPanel} />
                                  <Route path={Routes.LINKS} component={LinkPanel} />
                                  <Route path={Routes.PUBLIC_FAVORITES} component={PublicFavoritePanel} />
 +                                <Route path={Routes.LINK_ACCOUNT} component={LinkAccountPanel} />
+                                 <Route path={Routes.COLLECTIONS_CONTENT_ADDRESS} component={CollectionsContentAddressPanel} />
                              </Switch>
                          </Grid>
                      </Grid>