-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial skeleton for Repository Resource View flow (#30)
* API integration for Repos listing page * Add custom branch when creating a repo * Skeleton for Repository Resource View flow
- Loading branch information
Showing
31 changed files
with
2,896 additions
and
2,752 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ node_modules | |
dist | ||
coverage | ||
.env | ||
yarn-error* | ||
yarn-error* | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export interface Repository { | ||
id: number | ||
spaceId: number | ||
pathName: string | ||
path: string | ||
name: string | ||
description?: string | ||
isPublic: boolean | ||
createdBy: number | ||
created: number | ||
updated: number | ||
forkId: number | ||
numForks: number | ||
numPulls: number | ||
numClosedPulls: number | ||
numOpenPulls: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Code copied from https://github.com/vweevers/is-git-ref-name-valid and | ||
// https://github.com/vweevers/is-git-branch-name-valid (MIT, © Vincent Weevers) | ||
// Last updated for git 2.29.0. | ||
|
||
import type { IconName } from '@harness/icons' | ||
|
||
// eslint-disable-next-line no-control-regex | ||
const badGitRefRegrex = /(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/ | ||
const badGitBranchRegrex = /^(-|HEAD$)/ | ||
|
||
function isGitRefValid(name: string, onelevel: boolean): boolean { | ||
return !badGitRefRegrex.test(name) && (!!onelevel || name.includes('/')) | ||
} | ||
|
||
export function isGitBranchNameValid(name: string): boolean { | ||
return isGitRefValid(name, true) && !badGitBranchRegrex.test(name) | ||
} | ||
|
||
export const GitIcon: Readonly<Record<string, IconName>> = { | ||
FILE: 'file', | ||
REPOSITORY: 'git-repo', | ||
COMMIT: 'git-branch-existing', | ||
PULL_REQUEST: 'git-pull', | ||
SETTINGS: 'cog' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.