X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/cab8fbece33e9c6188b911552790f459c740f4cd..fe477581df706f4c2c1669f2df584bd94dbb4bea:/src/views/repositories-panel/repositories-panel.tsx

diff --git a/src/views/repositories-panel/repositories-panel.tsx b/src/views/repositories-panel/repositories-panel.tsx
index cafbefd2..f6e02af4 100644
--- a/src/views/repositories-panel/repositories-panel.tsx
+++ b/src/views/repositories-panel/repositories-panel.tsx
@@ -11,9 +11,10 @@ import { Link } from 'react-router-dom';
 import { Dispatch, compose } from 'redux';
 import { RootState } from '~/store/store';
 import { HelpIcon, AddIcon, MoreOptionsIcon } from '~/components/icon/icon';
-import { loadRepositoriesData, openRepositoriesSampleGitDialog } from '~/store/repositories/repositories-actions';
-import { RepositoriesResource } from '~/models/repositories';
+import { loadRepositoriesData, openRepositoriesSampleGitDialog, openRepositoryCreateDialog } from '~/store/repositories/repositories-actions';
+import { RepositoryResource } from '~/models/repositories';
 import { openRepositoryContextMenu } from '~/store/context-menu/context-menu-actions';
+import { Routes } from '~/routes/routes';
 
 
 type CssRules = 'link' | 'button' | 'icon' | 'iconRow' | 'moreOptionsButton' | 'moreOptions' | 'cloneUrls';
@@ -63,22 +64,24 @@ const mapStateToProps = (state: RootState) => {
     };
 };
 
-const mapDispatchToProps = (dispatch: Dispatch): Pick<RepositoriesActionProps, 'onOptionsMenuOpen' | 'loadRepositories' | 'openRepositoriesSampleGitDialog'> => ({
+const mapDispatchToProps = (dispatch: Dispatch): Pick<RepositoriesActionProps, 'onOptionsMenuOpen' | 'loadRepositories' | 'openRepositoriesSampleGitDialog' | 'openRepositoryCreateDialog'> => ({
     loadRepositories: () => dispatch<any>(loadRepositoriesData()),
-    onOptionsMenuOpen: (event, index, repository) => {
-        dispatch<any>(openRepositoryContextMenu(event, index, repository));
+    onOptionsMenuOpen: (event, repository) => {
+        dispatch<any>(openRepositoryContextMenu(event, repository));
     },
-    openRepositoriesSampleGitDialog: () => dispatch<any>(openRepositoriesSampleGitDialog())
+    openRepositoriesSampleGitDialog: () => dispatch<any>(openRepositoriesSampleGitDialog()),
+    openRepositoryCreateDialog: () => dispatch<any>(openRepositoryCreateDialog())
 });
 
 interface RepositoriesActionProps {
     loadRepositories: () => void;
-    onOptionsMenuOpen: (event: React.MouseEvent<HTMLElement>, index: number, repository: RepositoriesResource) => void;
+    onOptionsMenuOpen: (event: React.MouseEvent<HTMLElement>, repository: RepositoryResource) => void;
     openRepositoriesSampleGitDialog: () => void;
+    openRepositoryCreateDialog: () => void;
 }
 
 interface RepositoriesDataProps {
-    repositories: RepositoriesResource[];
+    repositories: RepositoryResource[];
 }
 
 
@@ -92,20 +95,19 @@ export const RepositoriesPanel = compose(
                 this.props.loadRepositories();
             }
             render() {
-                const { classes, repositories, onOptionsMenuOpen, openRepositoriesSampleGitDialog } = this.props;
-                console.log(repositories);
+                const { classes, repositories, onOptionsMenuOpen, openRepositoriesSampleGitDialog, openRepositoryCreateDialog } = this.props;
                 return (
                     <Card>
                         <CardContent>
                             <Grid container direction="row">
                                 <Grid item xs={8}>
-                                    <Typography variant="body2">
+                                    <Typography variant='body1'>
                                         When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token. <br />
-                                        In order to clone git repositories using SSH, <Link to='' className={classes.link}>add an SSH key to your account</Link> and clone the git@ URLs.
+                                        In order to clone git repositories using SSH, <Link to={Routes.SSH_KEYS_USER} className={classes.link}>add an SSH key to your account</Link> and clone the git@ URLs.
                                     </Typography>
                                 </Grid>
                                 <Grid item xs={4} className={classes.button}>
-                                    <Button variant="contained" color="primary">
+                                    <Button variant="contained" color="primary" onClick={openRepositoryCreateDialog}>
                                         <AddIcon /> NEW REPOSITORY
                                     </Button>
                                 </Grid>
@@ -135,7 +137,7 @@ export const RepositoriesPanel = compose(
                                                 <TableCell className={classes.cloneUrls}>{repository.cloneUrls.join("\n")}</TableCell>
                                                 <TableCell className={classes.moreOptions}>
                                                     <Tooltip title="More options" disableFocusListener>
-                                                        <IconButton onClick={event => onOptionsMenuOpen(event, index, repository)} className={classes.moreOptionsButton}>
+                                                        <IconButton onClick={event => onOptionsMenuOpen(event, repository)} className={classes.moreOptionsButton}>
                                                             <MoreOptionsIcon />
                                                         </IconButton>
                                                     </Tooltip>
