From e9a7fd1e88edad2e783527541245ad72c4919a88 Mon Sep 17 00:00:00 2001 From: Atefeh Mohseni Ejiyeh Date: Mon, 13 Jan 2025 23:00:54 +0000 Subject: [PATCH] feat: [CODE-2819]: Archive Repo functionality (#3097) --- .../ExecutionPageHeader.tsx | 217 +++++++++--------- .../PipelineSettingsTab.tsx | 2 +- .../RepoTypeLabel.module.scss} | 5 + .../RepoTypeLabel.module.scss.d.ts} | 1 + .../RepoTypeLabel.tsx} | 23 +- .../RepositoryArchivedBanner.module.scss | 22 ++ .../RepositoryArchivedBanner.module.scss.d.ts | 19 ++ .../RepositoryArchivedBanner.tsx | 48 ++++ .../RepositoryPageHeader.tsx | 82 +++---- web/src/framework/strings/stringTypes.ts | 19 +- web/src/i18n/strings.en.yaml | 24 +- .../RepositoriesListing.tsx | 8 +- .../RepositoryHeader/RepositoryHeader.tsx | 4 +- .../ArchiveRepoModal/ArchiveRepoModal.tsx | 124 ++++++++++ .../DeleteRepoModal/DeleteRepoModal.tsx | 1 - .../GeneralSettingsContent.tsx | 66 ++++-- .../RepositorySettings.module.scss | 10 +- .../RepositorySettings.module.scss.d.ts | 2 +- .../GeneralSettings/GeneralSpaceSettings.tsx | 2 +- web/src/services/code/index.tsx | 2 + web/src/services/code/swagger.yaml | 2 + web/src/utils/GitUtils.ts | 5 + 22 files changed, 509 insertions(+), 179 deletions(-) rename web/src/components/{RepoPublicLabel/RepoPublicLabel.module.scss => RepoTypeLabel/RepoTypeLabel.module.scss} (89%) rename web/src/components/{RepoPublicLabel/RepoPublicLabel.module.scss.d.ts => RepoTypeLabel/RepoTypeLabel.module.scss.d.ts} (94%) rename web/src/components/{RepoPublicLabel/RepoPublicLabel.tsx => RepoTypeLabel/RepoTypeLabel.tsx} (56%) create mode 100644 web/src/components/RepositoryArchivedBanner/RepositoryArchivedBanner.module.scss create mode 100644 web/src/components/RepositoryArchivedBanner/RepositoryArchivedBanner.module.scss.d.ts create mode 100644 web/src/components/RepositoryArchivedBanner/RepositoryArchivedBanner.tsx create mode 100644 web/src/pages/RepositorySettings/GeneralSettingsContent/ArchiveRepoModal/ArchiveRepoModal.tsx diff --git a/web/src/components/ExecutionPageHeader/ExecutionPageHeader.tsx b/web/src/components/ExecutionPageHeader/ExecutionPageHeader.tsx index 0a6fcb2f7..0cfed678e 100644 --- a/web/src/components/ExecutionPageHeader/ExecutionPageHeader.tsx +++ b/web/src/components/ExecutionPageHeader/ExecutionPageHeader.tsx @@ -44,6 +44,7 @@ import { getErrorMessage, timeDistance } from 'utils/Utils' import useLiveTimer from 'hooks/useLiveTimeHook' import { CommitActions } from 'components/CommitActions/CommitActions' import type { TypesExecution } from 'services/code' +import { RepoArchivedBanner } from 'components/RepositoryArchivedBanner/RepositoryArchivedBanner' import css from './ExecutionPageHeader.module.scss' interface BreadcrumbLink { @@ -99,119 +100,127 @@ export function ExecutionPageHeader({ } return ( - - {getString('repositories')} - - - {repoMetadata.identifier} - - {extraBreadcrumbLinks.map(link => ( - - - {/* This allows for outer most entities to not necessarily be links */} - {link.url ? ( - {link.label} - ) : ( - - {link.label} - - )} - - ))} - - } - content={ - executionInfo && ( - - - - {executionInfo.message} - - - - - {executionInfo.authorName} - - - - - {executionInfo.source} - - - {executionInfo.hash && ( - - - - )} - - {executionInfo.started && ( - - - - {isActive - ? timeDistance(executionInfo.started, currentTime, true) // Live update time when status is 'RUNNING' - : timeDistance(executionInfo.started, executionInfo.finished, true)} - - {executionInfo.finished && ( - <> - - - - {timeDistance(executionInfo.finished, currentTime, true)} ago - - + <> + + {getString('repositories')} + + + {repoMetadata.identifier} + + {extraBreadcrumbLinks.map(link => ( + + + {/* This allows for outer most entities to not necessarily be links */} + {link.url ? ( + {link.label} + ) : ( + + {link.label} + )} - - )} - <> + + ))} + + } + content={ + executionInfo && ( + + + + {executionInfo.message} + - + - + + + + + {getString('cautionZone')} + + + + + + + {repoState === RepoState.ARCHIVED + ? getString('repoArchive.unarchive') + : getString('repoArchive.archive')} + + + {repoState === RepoState.ARCHIVED + ? getString('repoArchive.unarchiveInfo') + : getString('repoArchive.archiveInfo')} + + +