1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from "react";
6 import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from "@mui/material";
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 { CustomStyleRulesCallback } from 'common/custom-theme';
12 import { WithStyles } from '@mui/styles';
13 import withStyles from '@mui/styles/withStyles';
14 import { ArvadosTheme } from 'common/custom-theme';
15 import { compose } from "redux";
17 type CssRules = 'codeSnippet' | 'link' | 'spacing';
19 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
21 borderRadius: theme.spacing(0.5),
23 borderColor: theme.palette.grey["400"],
26 textDecoration: 'none',
27 color: theme.palette.primary.main,
29 color: theme.palette.primary.dark,
30 transition: 'all 0.5s ease'
34 paddingTop: theme.spacing(2)
38 interface RepositoriesSampleGitDataProps {
42 type RepositoriesSampleGitProps = RepositoriesSampleGitDataProps & WithStyles<CssRules>;
44 export const RepositoriesSampleGitDialog = compose(
45 withDialog(REPOSITORIES_SAMPLE_GIT_DIALOG),
47 (props: WithDialogProps<RepositoriesSampleGitProps> & RepositoriesSampleGitProps) =>
48 <Dialog open={props.open}
49 onClose={props.closeDialog}
52 <DialogTitle>Sample git quick start:</DialogTitle>
55 className={props.classes.codeSnippet}
56 lines={[snippetText(props.data.uuidPrefix)]} />
57 <Typography variant='body1' className={props.classes.spacing}>
59 <div><a href="https://doc.arvados.org/user/getting_started/ssh-access-unix.html" className={props.classes.link} target="_blank" rel="noopener noreferrer">SSH access</a></div>
60 <div><a href="https://doc.arvados.org/user/tutorials/tutorial-firstscript.html" className={props.classes.link} target="_blank" rel="noopener noreferrer">Writing a Crunch Script</a></div>
67 onClick={props.closeDialog}>
74 const snippetText = (uuidPrefix: string) => `git clone git@git.${uuidPrefix}.arvadosapi.com:arvados.git
77 git add the/files/you/changed