File tree Expand file tree Collapse file tree 6 files changed +32
-11
lines changed Expand file tree Collapse file tree 6 files changed +32
-11
lines changed Original file line number Diff line number Diff line change @@ -275,8 +275,7 @@ workflows:
275275 filters :
276276 branches :
277277 only :
278- - recruit-apis
279- - feature/recommender-sync-develop
278+ - develop
280279 # This is alternate dev env for parallel testing
281280 - " build-test " :
282281 context : org-global
@@ -291,22 +290,21 @@ workflows:
291290 filters :
292291 branches :
293292 only :
294- - bug-bash
293+ - free
295294 # This is beta env for production soft releases
296295 - " build-prod-beta " :
297296 context : org-global
298297 filters :
299298 branches :
300299 only :
301- - outage-banner
300+ - free
302301 # This is stage env for production QA releases
303302 - " build-prod-staging " :
304303 context : org-global
305304 filters :
306305 branches :
307306 only :
308307 - develop
309- - feature/recommender-sync-develop
310308 - " approve-smoke-test-on-staging " :
311309 type : approval
312310 requires :
Original file line number Diff line number Diff line change 11/* eslint-disable max-len */
22/**
3- * SearchCombo component.
3+ * Job card component.
44 */
55import React from 'react' ;
66import PT from 'prop-types' ;
Original file line number Diff line number Diff line change 55import React from 'react' ;
66import ReactPaginate from 'react-paginate' ;
77import PT from 'prop-types' ;
8+ import { useMediaQuery } from 'react-responsive' ;
89import './style.scss' ;
910
1011function Paginate ( {
1112 pages,
1213 page,
1314 onChange,
1415} ) {
16+ const isMobile = useMediaQuery ( {
17+ query : '(max-device-width: 768px)' ,
18+ } ) ;
1519 return (
1620 < div styleName = "container" >
1721 < ReactPaginate
1822 pageCount = { pages }
1923 initialPage = { page }
2024 forcePage = { page }
21- pageRangeDisplayed = { 3 }
22- marginPagesDisplayed = { 2 }
25+ pageRangeDisplayed = { isMobile ? 1 : 3 }
26+ marginPagesDisplayed = { isMobile ? 1 : 2 }
2327 onPageChange = { onChange }
2428 activeClassName = "active"
2529 previousLabel = "PREV"
Original file line number Diff line number Diff line change 11/**
22 * SearchCombo component.
33 */
4- import React , { useState } from 'react' ;
4+ import React , { useState , useEffect } from 'react' ;
55import PT from 'prop-types' ;
66import './style.scss' ;
77import IconClearSearch from 'assets/images/icon-clear-search.svg' ;
@@ -13,6 +13,7 @@ function SearchCombo({
1313 onSearch,
1414} ) {
1515 const [ inputVal , setVal ] = useState ( term ) ;
16+ useEffect ( ( ) => setVal ( term ) , [ term ] ) ;
1617 const clearSearch = ( ) => {
1718 setVal ( '' ) ;
1819 onSearch ( '' ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import Dropdown from 'components/GUIKit/Dropdown';
1212import PT from 'prop-types' ;
1313import React from 'react' ;
1414import { connect } from 'react-redux' ;
15+ import { getQuery , updateQuery } from 'utils/url' ;
1516import './jobLisingStyles.scss' ;
1617
1718const GIGS_PER_PAGE = 10 ;
@@ -48,14 +49,23 @@ class RecruitCRMJobsContainer extends React.Component {
4849 getJobs,
4950 jobs,
5051 } = this . props ;
51-
52+ const { state } = this ;
53+ const q = getQuery ( ) ;
5254 // This gets all jobs.
5355 // Pagination and filtering on front-side
5456 if ( ! jobs . length ) {
5557 getJobs ( {
5658 job_status : 1 , // Open jobs only
5759 } ) ;
5860 }
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+ }
5969 }
6070
6171 /**
@@ -64,7 +74,6 @@ class RecruitCRMJobsContainer extends React.Component {
6474 */
6575 onFilter ( newState ) {
6676 // Do updates
67-
6877 // update the state
6978 this . setState ( newState ) ;
7079 }
@@ -74,12 +83,20 @@ class RecruitCRMJobsContainer extends React.Component {
7483 term : newTerm ,
7584 page : 0 ,
7685 } ) ;
86+ // update the URL query
87+ updateQuery ( {
88+ search : newTerm ,
89+ } ) ;
7790 }
7891
7992 onPaginate ( newPage ) {
8093 this . onFilter ( {
8194 page : newPage . selected ,
8295 } ) ;
96+ window . scrollTo ( {
97+ top : 0 ,
98+ behavior : 'smooth' ,
99+ } ) ;
83100 }
84101
85102 onLocation ( newLocation ) {
Original file line number Diff line number Diff line change 3030
3131 @include xs-to-sm {
3232 margin-right : 0 ;
33+ margin-bottom : 15px ;
3334 }
3435
3536 & :first-child {
You can’t perform that action at this time.
0 commit comments