diff --git a/shell/app/modules/application/pages/repo/repo-branch.tsx b/shell/app/modules/application/pages/repo/repo-branch.tsx index 6dd9b00636..f776ef0f23 100644 --- a/shell/app/modules/application/pages/repo/repo-branch.tsx +++ b/shell/app/modules/application/pages/repo/repo-branch.tsx @@ -53,9 +53,6 @@ const RepoBranch = () => { clearListByType('branch'); }; }, [getListByType, clearListByType]); - if (!list.length) { - return ; - } const goToCompare = (branch: string) => { goTo(`./compare/${info.defaultBranch}...${encodeURIComponent(branch)}`); }; @@ -77,90 +74,94 @@ const RepoBranch = () => { -
- {list.map((item) => { - const { name, id, commit, isProtect, isDefault, isMerged } = item; - const { commitMessage, author = {} } = commit || {}; - const { name: committerName, when } = author as any; - const isProtectBranch = get(find(branchInfo, { name }), 'isProtect'); - const curAuth = isProtectBranch ? permMap.writeProtected.pass : permMap.writeNormal.pass; - return ( -
-
-
- {isProtect ? ( - - - - ) : ( - - )} - - {name} - - {isDefault && {i18n.t('default')}} - {isMerged && {i18n.t('application:Merged')}} -
-
+ +
+ {list.map((item) => { + const { name, id, commit, isProtect, isDefault, isMerged } = item; + const { commitMessage, author = {} } = commit || {}; + const { name: committerName, when } = author as any; + const isProtectBranch = get(find(branchInfo, { name }), 'isProtect'); + const curAuth = isProtectBranch ? permMap.writeProtected.pass : permMap.writeNormal.pass; + return ( +
+
+
+ {isProtect ? ( + + + + ) : ( + + )} + + {name} + + {isDefault && {i18n.t('default')}} + {isMerged && {i18n.t('application:Merged')}} +
+
 {i18n.t('committed at')} - {fromNow(when)} - + {fromNow(when)} + -  ·  - 50 ? commitMessage : null}> +  ·  + 50 ? commitMessage : null}> {replaceEmoji(commitMessage)} +
-
-
- - { - deleteBranch({ branch: name }); - }} - > - - - - - { - switch (e.key) { - case 'setDefault': - setDefaultBranch(name); - break; - default: - break; - } - }} - > - - {i18n.t('application:set as default')} - - - } - > - - + { + deleteBranch({ branch: name }); + }} + > + + + + + { + switch (e.key) { + case 'setDefault': + setDefaultBranch(name); + break; + default: + break; + } + }} + > + + {i18n.t('application:set as default')} + + + } + > + + +
-
- ); - })} -
+ ); + })} +
+ + ; + ); };