mirror of
https://github.com/harness/drone.git
synced 2025-05-04 21:30:47 +08:00
Fix branch sorting (#80)
* Implement Branch item actions * Implement Branch item actions * Fix sorting
This commit is contained in:
parent
6d8c979e7c
commit
21eb0f61b6
@ -4,7 +4,6 @@ import type { CellProps, Column } from 'react-table'
|
||||
import { Link, useHistory } from 'react-router-dom'
|
||||
import cx from 'classnames'
|
||||
import Keywords from 'react-keywords'
|
||||
import { orderBy } from 'lodash-es'
|
||||
import { useMutate } from 'restful-react'
|
||||
import { String, useStrings } from 'framework/strings'
|
||||
import { useAppContext } from 'AppContext'
|
||||
@ -136,7 +135,7 @@ export function BranchesContent({ repoMetadata, searchTerm = '', branches, onDel
|
||||
}
|
||||
}
|
||||
],
|
||||
[getString, repoMetadata.defaultBranch, repoMetadata.path, routes, searchTerm, history]
|
||||
[getString, repoMetadata.defaultBranch, repoMetadata.path, routes, searchTerm, history, onDeleteSuccess]
|
||||
)
|
||||
|
||||
return (
|
||||
@ -144,7 +143,7 @@ export function BranchesContent({ repoMetadata, searchTerm = '', branches, onDel
|
||||
<Table<RepoBranch>
|
||||
className={css.table}
|
||||
columns={columns}
|
||||
data={orderBy(branches || [], [searchTerm ? '' : 'commit.author.when'], ['desc'])}
|
||||
data={branches || []}
|
||||
getRowClassName={row => cx(css.row, (row.index + 1) % 2 ? css.odd : '')}
|
||||
/>
|
||||
</Container>
|
||||
|
@ -26,6 +26,7 @@ export function RepositoryBranchesContent({ repoMetadata }: Pick<GitInfoProps, '
|
||||
queryParams: {
|
||||
per_page: LIST_FETCHING_PER_PAGE,
|
||||
page: pageIndex + 1,
|
||||
sort: 'date',
|
||||
direction: 'desc',
|
||||
include_commit: true,
|
||||
query: searchTerm
|
||||
|
Loading…
Reference in New Issue
Block a user