diff --git a/packages/ui/locales/en/views.json b/packages/ui/locales/en/views.json index fc6ffe9a3..719dc178b 100644 --- a/packages/ui/locales/en/views.json +++ b/packages/ui/locales/en/views.json @@ -116,14 +116,16 @@ "general": "General", "codeAutomation": "Code and automation", "webhooks": "Webhooks", - "clone": "Clone", "cloneRepo": "Clone repository", "cloneHttps": "HTTPS", "cloneSsh": "SSH", + "gitCloneUrl": "Git clone URL", "generateCredential": "Please generate a clone credential if its your first time.", - "addFile": "Add file", "readme": "README.md", - "openPullReq": "Open pull requests" + "editReadme": "Edit README.md", + "openPullReq": "Open pull requests", + "clone": "Clone", + "addFile": "Add file" }, "createProject": { "newProject": "Create your new project", diff --git a/packages/ui/locales/es/views.json b/packages/ui/locales/es/views.json index af3300b11..c305e2872 100644 --- a/packages/ui/locales/es/views.json +++ b/packages/ui/locales/es/views.json @@ -116,14 +116,16 @@ "general": "General", "codeAutomation": "Code and automation", "webhooks": "Webhooks", - "clone": "Clone", "cloneRepo": "Clone repository", "cloneHttps": "HTTPS", "cloneSsh": "SSH", + "gitCloneUrl": "Git clone URL", "generateCredential": "Please generate a clone credential if its your first time.", - "addFile": "Add file", "readme": "README.md", - "openPullReq": "Open pull requests" + "editReadme": "Edit README.md", + "openPullReq": "Open pull requests", + "clone": "Clone", + "addFile": "Add file" }, "createProject": { "newProject": "Create your new project", @@ -152,6 +154,7 @@ "unified": "", "viewed": "", "deleted": "", + "deletedComment": "", "commits": "" }, "noData": { diff --git a/packages/ui/locales/fr/views.json b/packages/ui/locales/fr/views.json index 33815e40c..b89337955 100644 --- a/packages/ui/locales/fr/views.json +++ b/packages/ui/locales/fr/views.json @@ -116,14 +116,16 @@ "general": "Général", "codeAutomation": "Code et automatisation", "webhooks": "Webhooks", - "clone": "Cloner", "cloneRepo": "Cloner le dépôt", "cloneHttps": "HTTPS", "cloneSsh": "SSH", + "gitCloneUrl": "Git clone URL", "generateCredential": "Veuillez générer un identifiant de clonage si c'est votre première fois.", - "addFile": "Ajouter un fichier", "readme": "README.md", - "openPullReq": "Requêtes de tirage ouvertes" + "editReadme": "Edit README.md", + "openPullReq": "Requêtes de tirage ouvertes", + "clone": "Cloner", + "addFile": "Ajouter un fichier" }, "createProject": { "newProject": "Créez votre nouveau projet", diff --git a/packages/ui/src/components/copy-button.tsx b/packages/ui/src/components/copy-button.tsx index 5e3f12e97..ae932009c 100644 --- a/packages/ui/src/components/copy-button.tsx +++ b/packages/ui/src/components/copy-button.tsx @@ -1,4 +1,4 @@ -import { FC, useEffect, useState } from 'react' +import { FC, MouseEvent, useEffect, useState } from 'react' import { Button, ButtonProps, Icon } from '@/components' import copy from 'clipboard-copy' @@ -8,11 +8,23 @@ export interface CopyButtonProps { className?: string buttonVariant?: ButtonProps['variant'] iconSize?: number + onClick?: (e: MouseEvent) => void } -export const CopyButton: FC = ({ name, className, buttonVariant = 'custom', iconSize = 16 }) => { +export const CopyButton: FC = ({ + name, + className, + buttonVariant = 'custom', + iconSize = 16, + onClick +}) => { const [copied, setCopied] = useState(false) + const handleClick = (e: MouseEvent) => { + onClick?.(e) + setCopied(true) + } + useEffect(() => { let timeoutId: number @@ -29,8 +41,8 @@ export const CopyButton: FC = ({ name, className, buttonVariant const changeIcon = copied ? 'tick' : 'clone' return ( - ) } diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx index 25792bbdd..b3e61819a 100644 --- a/packages/ui/src/components/dialog.tsx +++ b/packages/ui/src/components/dialog.tsx @@ -64,7 +64,7 @@ const DialogContent = React.forwardRef {footer} - + - -
- {t('views:repos.cloneRepo', 'Clone repository')} + +
+ {t('views:repos.cloneRepo', 'Clone repository')}
setCurrentTab(val as CloneRepoTabs)} > - + { @@ -62,7 +62,7 @@ export const CloneRepoDialog: React.FC = ({ setCurrentTab(CloneRepoTabs.HTTPS) }} > - + {t('views:repos.cloneHttps', 'HTTPS')} @@ -74,7 +74,7 @@ export const CloneRepoDialog: React.FC = ({ }} > e.stopPropagation()} > @@ -83,20 +83,25 @@ export const CloneRepoDialog: React.FC = ({ -
+
+
+ + {t('views:repos.gitCloneUrl', 'Git clone URL')} + +
{currentTab === 'https' ? ( <> } />
- + {t('views:repos.generateCredential', 'Please generate a clone credential if its your first time.')}
@@ -108,10 +113,10 @@ export const CloneRepoDialog: React.FC = ({ ) : ( } diff --git a/packages/ui/src/views/repo/repo-summary/repo-summary.tsx b/packages/ui/src/views/repo/repo-summary/repo-summary.tsx index e37f4d539..92a2fd5eb 100644 --- a/packages/ui/src/views/repo/repo-summary/repo-summary.tsx +++ b/packages/ui/src/views/repo/repo-summary/repo-summary.tsx @@ -1,10 +1,12 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { Link, useNavigate } from 'react-router-dom' +import { Link } from 'react-router-dom' import { Button, ButtonGroup, + FileAdditionsTrigger, + Icon, ListActions, MarkdownViewer, NoData, @@ -96,7 +98,6 @@ export function RepoSummaryView({ setSearchQuery, handleCreateToken }: RepoSummaryViewProps) { - const navigate = useNavigate() const { t } = useTranslationStore() const { repoId, spaceId, selectedBranchTag } = useRepoBranchesStore() @@ -190,11 +191,12 @@ export function RepoSummaryView({ - + - + {t('views:repos.readme', 'README.md')}} /> - {/* TODO: add component and file editing logic */} - + + + + {t('views:repos.editReadme', 'Edit README.md')} + + + } + />