File tree 6 files changed +32
-11
lines changed
6 files changed +32
-11
lines changed Original file line number Diff line number Diff line change @@ -275,8 +275,7 @@ workflows:
275
275
filters :
276
276
branches :
277
277
only :
278
- - recruit-apis
279
- - feature/recommender-sync-develop
278
+ - develop
280
279
# This is alternate dev env for parallel testing
281
280
- " build-test " :
282
281
context : org-global
@@ -291,22 +290,21 @@ workflows:
291
290
filters :
292
291
branches :
293
292
only :
294
- - bug-bash
293
+ - free
295
294
# This is beta env for production soft releases
296
295
- " build-prod-beta " :
297
296
context : org-global
298
297
filters :
299
298
branches :
300
299
only :
301
- - bug-bash
300
+ - free
302
301
# This is stage env for production QA releases
303
302
- " build-prod-staging " :
304
303
context : org-global
305
304
filters :
306
305
branches :
307
306
only :
308
307
- develop
309
- - feature/recommender-sync-develop
310
308
- " approve-smoke-test-on-staging " :
311
309
type : approval
312
310
requires :
Original file line number Diff line number Diff line change 1
1
/* eslint-disable max-len */
2
2
/**
3
- * SearchCombo component.
3
+ * Job card component.
4
4
*/
5
5
import React from 'react' ;
6
6
import PT from 'prop-types' ;
Original file line number Diff line number Diff line change 5
5
import React from 'react' ;
6
6
import ReactPaginate from 'react-paginate' ;
7
7
import PT from 'prop-types' ;
8
+ import { useMediaQuery } from 'react-responsive' ;
8
9
import './style.scss' ;
9
10
10
11
function Paginate ( {
11
12
pages,
12
13
page,
13
14
onChange,
14
15
} ) {
16
+ const isMobile = useMediaQuery ( {
17
+ query : '(max-device-width: 768px)' ,
18
+ } ) ;
15
19
return (
16
20
< div styleName = "container" >
17
21
< ReactPaginate
18
22
pageCount = { pages }
19
23
initialPage = { page }
20
24
forcePage = { page }
21
- pageRangeDisplayed = { 3 }
22
- marginPagesDisplayed = { 2 }
25
+ pageRangeDisplayed = { isMobile ? 1 : 3 }
26
+ marginPagesDisplayed = { isMobile ? 1 : 2 }
23
27
onPageChange = { onChange }
24
28
activeClassName = "active"
25
29
previousLabel = "PREV"
Original file line number Diff line number Diff line change 1
1
/**
2
2
* SearchCombo component.
3
3
*/
4
- import React , { useState } from 'react' ;
4
+ import React , { useState , useEffect } from 'react' ;
5
5
import PT from 'prop-types' ;
6
6
import './style.scss' ;
7
7
import IconClearSearch from 'assets/images/icon-clear-search.svg' ;
@@ -13,6 +13,7 @@ function SearchCombo({
13
13
onSearch,
14
14
} ) {
15
15
const [ inputVal , setVal ] = useState ( term ) ;
16
+ useEffect ( ( ) => setVal ( term ) , [ term ] ) ;
16
17
const clearSearch = ( ) => {
17
18
setVal ( '' ) ;
18
19
onSearch ( '' ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import Dropdown from 'components/GUIKit/Dropdown';
12
12
import PT from 'prop-types' ;
13
13
import React from 'react' ;
14
14
import { connect } from 'react-redux' ;
15
+ import { getQuery , updateQuery } from 'utils/url' ;
15
16
import './jobLisingStyles.scss' ;
16
17
17
18
const GIGS_PER_PAGE = 10 ;
@@ -48,14 +49,23 @@ class RecruitCRMJobsContainer extends React.Component {
48
49
getJobs,
49
50
jobs,
50
51
} = this . props ;
51
-
52
+ const { state } = this ;
53
+ const q = getQuery ( ) ;
52
54
// This gets all jobs.
53
55
// Pagination and filtering on front-side
54
56
if ( ! jobs . length ) {
55
57
getJobs ( {
56
58
job_status : 1 , // Open jobs only
57
59
} ) ;
58
60
}
61
+ // handle URL query if present
62
+ if ( q && q . search ) {
63
+ const stateUpdate = {
64
+ ...state ,
65
+ term : q . search ,
66
+ } ;
67
+ this . setState ( stateUpdate ) ;
68
+ }
59
69
}
60
70
61
71
/**
@@ -64,7 +74,6 @@ class RecruitCRMJobsContainer extends React.Component {
64
74
*/
65
75
onFilter ( newState ) {
66
76
// Do updates
67
-
68
77
// update the state
69
78
this . setState ( newState ) ;
70
79
}
@@ -74,12 +83,20 @@ class RecruitCRMJobsContainer extends React.Component {
74
83
term : newTerm ,
75
84
page : 0 ,
76
85
} ) ;
86
+ // update the URL query
87
+ updateQuery ( {
88
+ search : newTerm ,
89
+ } ) ;
77
90
}
78
91
79
92
onPaginate ( newPage ) {
80
93
this . onFilter ( {
81
94
page : newPage . selected ,
82
95
} ) ;
96
+ window . scrollTo ( {
97
+ top : 0 ,
98
+ behavior : 'smooth' ,
99
+ } ) ;
83
100
}
84
101
85
102
onLocation ( newLocation ) {
Original file line number Diff line number Diff line change 30
30
31
31
@include xs-to-sm {
32
32
margin-right : 0 ;
33
+ margin-bottom : 15px ;
33
34
}
34
35
35
36
& :first-child {
You can’t perform that action at this time.
0 commit comments