1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from "@material-ui/core";
7 import { WithDialogProps } from "~/store/dialog/with-dialog";
8 import { withDialog } from '~/store/dialog/with-dialog';
9 import { REPOSITORIES_SAMPLE_GIT_DIALOG } from "~/store/repositories/repositories-actions";
10 import { DefaultCodeSnippet } from '~/components/default-code-snippet/default-code-snippet';
11 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
12 import { ArvadosTheme } from '~/common/custom-theme';
13 import { compose } from "redux";
15 type CssRules = 'codeSnippet' | 'link' | 'spacing';
17 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
19 borderRadius: theme.spacing.unit * 0.5,
21 borderColor: theme.palette.grey["400"],
24 textDecoration: 'none',
25 color: theme.palette.primary.main,
27 color: theme.palette.primary.dark,
28 transition: 'all 0.5s ease'
32 paddingTop: theme.spacing.unit * 2
36 interface RepositoriesSampleGitDataProps {
40 type RepositoriesSampleGitProps = RepositoriesSampleGitDataProps & WithStyles<CssRules>;
42 export const RepositoriesSampleGitDialog = compose(
43 withDialog(REPOSITORIES_SAMPLE_GIT_DIALOG),
45 (props: WithDialogProps<RepositoriesSampleGitProps> & RepositoriesSampleGitProps) =>
46 <Dialog open={props.open}
47 onClose={props.closeDialog}
50 <DialogTitle>Sample git quick start:</DialogTitle>
53 className={props.classes.codeSnippet}
54 lines={[snippetText(props.data.uuidPrefix)]} />
55 <Typography variant='body1' className={props.classes.spacing}>
57 <div><a href="https://doc.arvados.org/user/getting_started/ssh-access-unix.html" className={props.classes.link} target="_blank">SSH access</a></div>
58 <div><a href="https://doc.arvados.org/user/tutorials/tutorial-firstscript.html" className={props.classes.link} target="_blank">Writing a Crunch Script</a></div>
65 onClick={props.closeDialog}>
72 const snippetText = (uuidPrefix: string) => `git clone git@git.${uuidPrefix}.arvadosapi.com:arvados.git
75 git add the/files/you/changed