15088: Function name clarification
authorEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 8 May 2019 21:10:48 +0000 (17:10 -0400)
committerEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 8 May 2019 21:10:48 +0000 (17:10 -0400)
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>

src/store/link-account-panel/link-account-panel-actions.ts
src/views/inactive-panel/inactive-panel.tsx
src/views/link-account-panel/link-account-panel-root.tsx
src/views/link-account-panel/link-account-panel.tsx

index 546573776136db30027e4ab62dbc63690ed86def..c175e60446a4188a0e9eb7f12e1c13b2c3a3ffba 100644 (file)
@@ -147,7 +147,7 @@ export const loadLinkAccountPanel = () =>
         }
     };
 
-export const saveAccountLinkData = (t: LinkAccountType) =>
+export const startLinking = (t: LinkAccountType) =>
     (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
         const accountToLink = {type: t, userUuid: services.authService.getUuid(), token: services.authService.getApiToken()} as AccountToLink;
         services.linkAccountService.saveToSession(accountToLink);
index 25e03b8565fefcb31ed97f350128d12baa0335b4..5f045f690fedba8f11e249be5fb4ec9d5a7fb99d 100644 (file)
@@ -5,7 +5,7 @@
 import * as React from 'react';
 import { Dispatch } from 'redux';
 import { connect } from 'react-redux';
-import { saveAccountLinkData } from '~/store/link-account-panel/link-account-panel-actions';
+import { startLinking } from '~/store/link-account-panel/link-account-panel-actions';
 import { Grid, Typography, Button } from '@material-ui/core';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
 import { ArvadosTheme } from '~/common/custom-theme';
@@ -39,16 +39,16 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 });
 
 export interface InactivePanelActionProps {
-    linkAccount: () => void;
+    startLinking: () => void;
 }
 
 const mapDispatchToProps = (dispatch: Dispatch): InactivePanelActionProps => ({
-    linkAccount: () => dispatch<any>(saveAccountLinkData(LinkAccountType.ACCESS_OTHER_ACCOUNT))
+    startLinking: () => dispatch<any>(startLinking(LinkAccountType.ACCESS_OTHER_ACCOUNT))
 });
 
 type InactivePanelProps =  WithStyles<CssRules> & InactivePanelActionProps;
 
-export const InactivePanel = connect(null, mapDispatchToProps)(withStyles(styles)((({ classes, linkAccount }: InactivePanelProps) =>
+export const InactivePanel = connect(null, mapDispatchToProps)(withStyles(styles)((({ classes, startLinking }: InactivePanelProps) =>
         <Grid container justify="center" alignItems="center" direction="column" spacing={24}
             className={classes.root}
             style={{ marginTop: 56, height: "100%" }}>
@@ -68,7 +68,7 @@ export const InactivePanel = connect(null, mapDispatchToProps)(withStyles(styles
                 </Typography>
             </Grid>
             <Grid item>
-                <Button className={classes.ontop} color="primary" variant="contained" onClick={() => linkAccount()}>
+                <Button className={classes.ontop} color="primary" variant="contained" onClick={() => startLinking()}>
                     Link Account
                 </Button>
             </Grid>
index 50a8b7cafc09b07e35f3f05e3e6f680b32b5c4fb..2439cc92fda00b9b897e8df17b30a1890e395145 100644 (file)
@@ -35,7 +35,7 @@ export interface LinkAccountPanelRootDataProps {
 }
 
 export interface LinkAccountPanelRootActionProps {
-    saveAccountLinkData: (type: LinkAccountType) => void;
+    startLinking: (type: LinkAccountType) => void;
     cancelLinking: () => void;
     linkAccount: () => void;
 }
@@ -52,7 +52,7 @@ function displayUser(user: UserResource, showCreatedAt: boolean = false) {
 type LinkAccountPanelRootProps = LinkAccountPanelRootDataProps & LinkAccountPanelRootActionProps & WithStyles<CssRules>;
 
 export const LinkAccountPanelRoot = withStyles(styles) (
-    ({classes, targetUser, userToLink, status, error, saveAccountLinkData, cancelLinking, linkAccount}: LinkAccountPanelRootProps) => {
+    ({classes, targetUser, userToLink, status, error, startLinking, cancelLinking, linkAccount}: LinkAccountPanelRootProps) => {
         return <Card className={classes.root}>
             <CardContent>
             { status === LinkAccountPanelStatus.INITIAL && targetUser &&
@@ -67,12 +67,12 @@ export const LinkAccountPanelRoot = withStyles(styles) (
                 </Grid>
                 <Grid container item direction="row" spacing={24}>
                     <Grid item>
-                        <Button color="primary" variant="contained" onClick={() => saveAccountLinkData(LinkAccountType.ADD_OTHER_LOGIN)}>
+                        <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ADD_OTHER_LOGIN)}>
                             Add another login to this account
                         </Button>
                     </Grid>
                     <Grid item>
-                        <Button color="primary" variant="contained" onClick={() => saveAccountLinkData(LinkAccountType.ACCESS_OTHER_ACCOUNT)}>
+                        <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ACCESS_OTHER_ACCOUNT)}>
                             Use this login to access another account
                         </Button>
                     </Grid>
index 45045a3b72632d0e40e918a058e1d2fc79d7d9c2..f620b5689e375f9552642d367cee85c98c5e5455 100644 (file)
@@ -5,7 +5,7 @@
 import { RootState } from '~/store/store';
 import { Dispatch } from 'redux';
 import { connect } from 'react-redux';
-import { saveAccountLinkData, cancelLinking, linkAccount } from '~/store/link-account-panel/link-account-panel-actions';
+import { startLinking, cancelLinking, linkAccount } from '~/store/link-account-panel/link-account-panel-actions';
 import { LinkAccountType } from '~/models/link-account';
 import {
     LinkAccountPanelRoot,
@@ -23,7 +23,7 @@ const mapStateToProps = (state: RootState): LinkAccountPanelRootDataProps => {
 };
 
 const mapDispatchToProps = (dispatch: Dispatch): LinkAccountPanelRootActionProps => ({
-    saveAccountLinkData: (type: LinkAccountType) => dispatch<any>(saveAccountLinkData(type)),
+    startLinking: (type: LinkAccountType) => dispatch<any>(startLinking(type)),
     cancelLinking: () => dispatch<any>(cancelLinking()),
     linkAccount: () => dispatch<any>(linkAccount())
 });