fix: [code-574]: active stale filter not working (#173)

This commit is contained in:
Calvin Lee 2023-06-29 19:52:43 +00:00 committed by Harness
parent dda81f3035
commit d6c7f41dd4
2 changed files with 26 additions and 29 deletions

View File

@ -4,13 +4,10 @@ import {
Container,
Layout,
Text,
Button,
FontVariation,
ButtonVariation,
Icon,
Avatar,
FlexExpander,
ButtonSize,
Color,
IconName,
useToaster
@ -35,7 +32,7 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
// const [searchTerm, setSearchTerm] = useState('')
// const [page] = usePageIndex(1)
const { getString } = useStrings()
const tagArr = []
// const tagArr = []
const { showError } = useToaster()
const generateReviewDecisionIcon = (
@ -198,15 +195,15 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
width="100px"
height="24px"
items={[
{
text: getString('makeOptional'),
onClick: noop
},
{
text: getString('makeRequired'),
onClick: noop
},
'-',
// {
// text: getString('makeOptional'),
// onClick: noop
// },
// {
// text: getString('makeRequired'),
// onClick: noop
// },
// '-',
{
isDanger: true,
text: getString('remove'),
@ -284,7 +281,7 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
</Text>
)} */}
</Container>
<Layout.Horizontal>
{/* <Layout.Horizontal>
<Text style={{ lineHeight: '24px' }} font={{ variation: FontVariation.H6 }}>
{getString('tags')}
</Text>
@ -299,7 +296,7 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
padding={{ top: 'large', bottom: 'large' }}>
{getString('noneYet')}
</Text>
)}
)} */}
</Layout.Vertical>
</Container>
</Container>

View File

@ -15,30 +15,30 @@ interface BranchesContentHeaderProps extends Pick<GitInfoProps, 'repoMetadata'>
}
export function BranchesContentHeader({
onBranchTypeSwitched,
// onBranchTypeSwitched,
onSearchTermChanged,
activeBranchType = GitBranchType.ALL,
// activeBranchType = GitBranchType.ALL,
repoMetadata,
onNewBranchCreated,
loading
}: BranchesContentHeaderProps) {
const { getString } = useStrings()
const [branchType, setBranchType] = useState(activeBranchType)
// const [branchType, setBranchType] = useState(activeBranchType)
const [searchTerm, setSearchTerm] = useState('')
const items = useMemo(
() => [
{ label: getString('activeBranches'), value: GitBranchType.ACTIVE },
{ label: getString('inactiveBranches'), value: GitBranchType.INACTIVE },
// { label: getString('yourBranches'), value: GitBranchType.YOURS },
{ label: getString('allBranches'), value: GitBranchType.ALL }
],
[getString]
)
// const items = useMemo(
// () => [
// { label: getString('activeBranches'), value: GitBranchType.ACTIVE },
// { label: getString('inactiveBranches'), value: GitBranchType.INACTIVE },
// // { label: getString('yourBranches'), value: GitBranchType.YOURS },
// { label: getString('allBranches'), value: GitBranchType.ALL }
// ],
// [getString]
// )
return (
<Container className={css.main}>
<Layout.Horizontal spacing="medium">
<DropDown
{/* <DropDown
value={branchType}
items={items}
onChange={({ value }) => {
@ -46,7 +46,7 @@ export function BranchesContentHeader({
onBranchTypeSwitched(value as GitBranchType)
}}
popoverClassName={css.branchDropdown}
/>
/> */}
<FlexExpander />
<SearchInputWithSpinner
loading={loading}