File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
features/repo-explorer/components Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
22import { Menu } from "antd" ;
33import { Link } from "react-router-dom" ;
4- import { RepoIdentity } from "models" ;
4+ import { RepoIdentity , BranchIdentity } from "models" ;
55import "./index.scss" ;
66
77type Props = {
88 repo : RepoIdentity ;
9- branches ?: Array < { name : string ; prefix : string } > ;
9+ branches ?: Array < BranchIdentity > ;
1010} ;
1111
1212const BranchesMenu = ( { repo, branches } : Props ) => {
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import { RepoIdentity } from "models" ;
2+ import { RepoIdentity , BranchIdentity } from "models" ;
33import {
44 useRepoBranchInfoQuery ,
55 useRepoDefaultBranchQuery ,
@@ -33,7 +33,7 @@ const useBranch = (repo: Props["repo"]) => {
3333const useRepoDetails = ( repoInfo : RepoBranchInfoQuery | undefined ) => {
3434 const { repository } = repoInfo || { } ;
3535 const branches = ( repository ?. refs ?. nodes || [ ] ) . filter (
36- ( branch ) : branch is { name : string ; prefix : string } => ! ! branch ,
36+ ( branch ) : branch is BranchIdentity => ! ! branch ,
3737 ) ;
3838 const files = Array . from ( repository ?. object ?. entries ?? [ ] ) . sort ( ( a , b ) =>
3939 b . type . localeCompare ( a . type ) ,
Original file line number Diff line number Diff line change 11import { Button , Dropdown , Popover } from "antd" ;
22import React from "react" ;
3- import { RepoIdentity } from "models" ;
3+ import { RepoIdentity , BranchIdentity } from "models" ;
44import BranchesMenu from "../branches-menu" ;
55import CloneMenu from "./clone-menu" ;
66import "./index.scss" ;
77
88type Props = {
99 repo : RepoIdentity ;
10- branches : Array < { name : string ; prefix : string } > ;
10+ branches : Array < BranchIdentity > ;
1111 activeBranch : string ;
1212} ;
1313
Original file line number Diff line number Diff line change @@ -24,3 +24,13 @@ export type AppError = {
2424 /** Описание */
2525 description : string ;
2626} ;
27+
28+ /**
29+ * Идентификационные данные ветки
30+ */
31+ export type BranchIdentity = {
32+ /** Имя */
33+ name : string ;
34+ /** Префикс ветки */
35+ prefix : string ;
36+ } ;
You can’t perform that action at this time.
0 commit comments