File tree Expand file tree Collapse file tree 25 files changed +86
-131
lines changed Expand file tree Collapse file tree 25 files changed +86
-131
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ export const PipelineDetail: React.FC = () => {
123123 </ Paragraph >
124124 </ Box >
125125 < Box >
126- < Paragraph style = { headStyle } > CREATED AT </ Paragraph >
126+ < Paragraph style = { headStyle } > CREATED</ Paragraph >
127127 < Paragraph style = { { color : '#515151' , marginTop : '10px' } } >
128128 { formatDateForOverviewBar ( pipeline . created ) }
129129 </ Paragraph >
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ export type Sorting =
44 | 'status'
55 | 'user.name'
66 | 'datasourceCommit'
7- | 'created' ;
7+ | 'created'
8+ | 'createdAt' ;
89
910export type SortingDirection = 'ASC' | 'DESC' ;
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ export const GetHeaderCols = ({
241241 activeSortingDirection = { activeSortingDirection }
242242 >
243243 < Paragraph size = "small" color = "black" style = { { fontSize : '12px' } } >
244- CREATED
244+ CREATED AT
245245 </ Paragraph >
246246 </ SortingHeader >
247247 ) ,
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export const useService = (
4141 } [ ] ,
4242) : ServiceInterface => {
4343 const [ activeSorting , setActiveSorting ] = React . useState < Sorting | null > (
44- null ,
44+ 'created' ,
4545 ) ;
4646 const [
4747 activeSortingDirection ,
@@ -58,19 +58,11 @@ export const useService = (
5858 const pipelines = useSelector ( pipelineSelectors . myPipelines ) ;
5959
6060 useEffect ( ( ) => {
61- console . log ( 'activeSorting' , activeSorting ) ;
62- console . log ( 'activeSorting' , activeSortingDirection ) ;
63-
64- let orderedPipelines =
65- activeSorting === null
66- ? _ . sortBy ( pipelines , ( pipeline : TPipeline ) =>
67- new Date ( pipeline . created ) . getTime ( ) ,
68- ) . reverse ( )
69- : _ . orderBy (
70- pipelines ,
71- [ activeSorting ] ,
72- [ activeSortingDirection === 'DESC' ? 'desc' : 'asc' ] ,
73- ) ;
61+ let orderedPipelines = _ . orderBy (
62+ pipelines ,
63+ [ activeSorting ] ,
64+ [ activeSortingDirection === 'DESC' ? 'desc' : 'asc' ] ,
65+ ) ;
7466
7567 const isValidFilter = filter . map ( ( f ) => f . value ) . join ( '' ) ;
7668 if ( isValidFilter ) {
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ export const RunDetail: React.FC = () => {
171171 </ Paragraph >
172172 </ Box >
173173 < Box >
174- < Paragraph style = { headStyle } > CREATED AT </ Paragraph >
174+ < Paragraph style = { headStyle } > CREATED</ Paragraph >
175175 < Paragraph style = { { color : '#515151' , marginTop : '10px' } } >
176176 { formatDateForOverviewBar ( run . created ) }
177177 </ Paragraph >
Original file line number Diff line number Diff line change @@ -169,8 +169,8 @@ export const useHeaderCols = ({
169169 {
170170 render : ( ) => (
171171 < SortingHeader
172- sorting = "createdAt "
173- sortMethod = { sortMethod ( 'createdAt ' , {
172+ sorting = "created "
173+ sortMethod = { sortMethod ( 'created ' , {
174174 asc : ( runs : TRun [ ] ) =>
175175 _ . orderBy (
176176 runs ,
@@ -192,7 +192,7 @@ export const useHeaderCols = ({
192192 color = "black"
193193 style = { { fontSize : '12px' } }
194194 >
195- CREATED AT
195+ CREATED
196196 </ Paragraph >
197197 </ SortingHeader >
198198 ) ,
@@ -499,8 +499,8 @@ export const useHeaderCols = ({
499499 {
500500 render : ( ) => (
501501 < SortingHeader
502- sorting = "createdAt "
503- sortMethod = { sortMethod ( 'createdAt ' , {
502+ sorting = "created "
503+ sortMethod = { sortMethod ( 'created ' , {
504504 asc : ( runs : TRun [ ] ) =>
505505 _ . orderBy (
506506 runs ,
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const useService = ({
3939} ) : ServiceInterface => {
4040 const dispatch = useDispatch ( ) ;
4141 const [ activeSorting , setActiveSorting ] = React . useState < Sorting | null > (
42- null ,
42+ 'created' ,
4343 ) ;
4444
4545 const [
@@ -53,22 +53,11 @@ export const useService = ({
5353 : useSelector ( runSelectors . forRunIds ( runIds ) ) ;
5454
5555 useEffect ( ( ) => {
56- // let orderedRuns = _.sortBy(runs, (run: TRun) =>
57- // new Date(run.created).getTime(),
58- // ).reverse();
59- console . log ( 'activeSorting' , activeSorting ) ;
60- console . log ( 'activeSorting' , activeSortingDirection ) ;
61-
62- let orderedRuns =
63- activeSorting === null
64- ? _ . sortBy ( runs , ( run : TRun ) =>
65- new Date ( run . created ) . getTime ( ) ,
66- ) . reverse ( )
67- : _ . orderBy (
68- runs ,
69- [ activeSorting ] ,
70- [ activeSortingDirection === 'DESC' ? 'desc' : 'asc' ] ,
71- ) ;
56+ let orderedRuns = _ . orderBy (
57+ runs ,
58+ [ activeSorting ] ,
59+ [ activeSortingDirection === 'DESC' ? 'desc' : 'asc' ] ,
60+ ) ;
7261
7362 const isValidFilter = filter ?. map ( ( f ) => f . value ) . join ( '' ) ;
7463 if ( isValidFilter ) {
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export const RunDetail: React.FC = () => {
157157 </ Paragraph >
158158 </ Box >
159159 < Box >
160- < Paragraph style = { headStyle } > CREATED AT </ Paragraph >
160+ < Paragraph style = { headStyle } > CREATED</ Paragraph >
161161 < Paragraph style = { { color : '#515151' , marginTop : '10px' } } >
162162 { formatDateForOverviewBar ( run . created ) }
163163 </ Paragraph >
Original file line number Diff line number Diff line change @@ -166,8 +166,8 @@ export const useHeaderCols = ({
166166 {
167167 render : ( ) => (
168168 < SortingHeader
169- sorting = "createdAt "
170- sortMethod = { sortMethod ( 'createdAt ' , {
169+ sorting = "created "
170+ sortMethod = { sortMethod ( 'created ' , {
171171 asc : ( runs : TRun [ ] ) =>
172172 _ . orderBy ( runs , ( run : TRun ) => new Date ( run . created ) . getTime ( ) , [
173173 'asc' ,
@@ -181,7 +181,7 @@ export const useHeaderCols = ({
181181 activeSortingDirection = { activeSortingDirection }
182182 >
183183 < Paragraph size = "small" color = "black" >
184- CREATED ATaaaa
184+ CREATED
185185 </ Paragraph >
186186 </ SortingHeader >
187187 ) ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ interface ServiceInterface {
2121export const useService = ( { runIds } : { runIds : TId [ ] } ) : ServiceInterface => {
2222 const dispatch = useDispatch ( ) ;
2323 const [ activeSorting , setActiveSorting ] = React . useState < Sorting | null > (
24- 'createdAt ' ,
24+ 'created ' ,
2525 ) ;
2626 const [
2727 activeSortingDirection ,
@@ -32,11 +32,13 @@ export const useService = ({ runIds }: { runIds: TId[] }): ServiceInterface => {
3232 const runs = useSelector ( runSelectors . forRunIds ( runIds ) ) ;
3333
3434 useEffect ( ( ) => {
35- const orderedRuns = _ . sortBy ( runs , ( run : TRun ) =>
36- new Date ( run . created ) . getTime ( ) ,
37- ) . reverse ( ) ;
35+ const orderedRuns = _ . orderBy (
36+ runs ,
37+ [ activeSorting ] ,
38+ [ activeSortingDirection === 'DESC' ? 'desc' : 'asc' ] ,
39+ ) ;
3840
39- setSortedRuns ( orderedRuns ) ;
41+ setSortedRuns ( orderedRuns as TRun [ ] ) ;
4042 } , [ ] ) ;
4143
4244 const setSelectedRunIds = ( runIds : TId [ ] ) => {
You can’t perform that action at this time.
0 commit comments