forked from USStateDept/State-TalentMAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/TM-518-compare-from-favorites, resolv…
…e conflicts * dev: Chore/autodeploy config (#132) Pull css-box-shadow repo into app to force es6 to compile Refactor section headers in profile, static UI for projected vacancy notifications for favorites and bid list (#126) Projected Vacancy - Saved Search + Results cards (#123) Move "No Language" filter to top of list (#129) dev -> staging (#98) (#127) Add condensed card layouts for projected vacancy and recently available (#122) Add toggle component, use static toggle filter in search results (#121) Sprint 6 merge conflicts (#120) # Conflicts: # src/Components/FavoritePositions/FavoritePositions.jsx # src/Components/HomePagePositionsList/HomePagePositionsList.jsx # src/Components/ResultsCondensedCard/ResultsCondensedCard.jsx # src/Components/ResultsCondensedCardBottom/ResultsCondensedCardBottom.jsx # src/Components/ResultsContainer/__snapshots__/ResultsContainer.test.jsx.snap # src/Components/ResultsList/ResultsList.jsx # src/Components/ResultsList/__snapshots__/ResultsList.test.jsx.snap
- Loading branch information
Showing
40 changed files
with
703 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// from https://www.npmjs.com/package/css-box-shadow | ||
|
||
/* eslint-disable */ | ||
|
||
const VALUES_REG = /,(?![^\(]*\))/; | ||
const PARTS_REG = /\s(?![^(]*\))/; | ||
const LENGTH_REG = /^[0-9]+[a-zA-Z%]+?$/; | ||
|
||
const parseValue = (str) => { | ||
const parts = str.split(PARTS_REG); | ||
const inset = parts.includes('inset'); | ||
const last = parts.slice(-1)[0]; | ||
const color = !isLength(last) ? last : undefined; | ||
|
||
const nums = parts | ||
.filter(n => n !== 'inset') | ||
.filter(n => n !== color) | ||
.map(toNum); | ||
const [offsetX, offsetY, blurRadius, spreadRadius] = nums; | ||
|
||
return { | ||
inset, | ||
offsetX, | ||
offsetY, | ||
blurRadius, | ||
spreadRadius, | ||
color, | ||
}; | ||
}; | ||
|
||
const stringifyValue = (obj) => { | ||
const { | ||
inset, | ||
offsetX = 0, | ||
offsetY = 0, | ||
blurRadius = 0, | ||
spreadRadius, | ||
color, | ||
} = obj || {}; | ||
|
||
return [ | ||
(inset ? 'inset' : null), | ||
offsetX, | ||
offsetY, | ||
blurRadius, | ||
spreadRadius, | ||
color, | ||
].filter(v => v !== null && v !== undefined) | ||
.map(toPx) | ||
.map(s => (`${s}`).trim()) | ||
.join(' '); | ||
}; | ||
|
||
const isLength = v => v === '0' || LENGTH_REG.test(v); | ||
const toNum = (v) => { | ||
if (!/px$/.test(v) && v !== '0') return v; | ||
const n = parseFloat(v); | ||
return !isNaN(n) ? n : v; | ||
}; | ||
const toPx = n => typeof n === 'number' && n !== 0 ? (`${n}px`) : n; | ||
|
||
const parse = str => str.split(VALUES_REG).map(s => s.trim()).map(parseValue); | ||
const stringify = arr => arr.map(stringifyValue).join(', '); | ||
|
||
module.exports = { | ||
parse, | ||
stringify, | ||
}; | ||
|
||
/* eslint-enable */ |
21 changes: 10 additions & 11 deletions
21
src/Components/ProfileDashboard/BidList/BidListHeader/BidListHeader.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 6 additions & 21 deletions
27
...mponents/ProfileDashboard/BidList/BidListHeader/__snapshots__/BidListHeader.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BidListHeaderComponent matches snapshot 1`] = ` | ||
<div | ||
className="usa-grid-full bid-list-header section-padded-inner-container-narrow" | ||
> | ||
<div | ||
className="usa-width-two-thirds bid-list-header-text" | ||
> | ||
<FontAwesome | ||
name="clock-o" | ||
/> | ||
All bids are due 07/15/2019 | ||
</div> | ||
<div | ||
className="usa-width-one-third bid-list-header-button-container" | ||
> | ||
<button | ||
className="bid-list-header-button" | ||
> | ||
More Info | ||
</button> | ||
</div> | ||
</div> | ||
<SectionHeader | ||
buttonText="More Info" | ||
icon="clock-o" | ||
onButtonClick={[Function]} | ||
title=" All bids are due 07/15/2019" | ||
/> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Components/ProfileDashboard/SectionHeader/SectionHeader.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import FontAwesome from 'react-fontawesome'; | ||
import { EMPTY_FUNCTION } from '../../../Constants/PropTypes'; | ||
|
||
const SectionHeader = ({ title, buttonText, icon, onButtonClick }) => ( | ||
<div className="usa-grid-full section-header section-padded-inner-container-narrow"> | ||
<div className="usa-width-two-thirds section-header-text"> | ||
<FontAwesome name={icon} />{title} | ||
</div> | ||
{ | ||
buttonText && | ||
<div className="usa-width-one-third section-header-button-container"> | ||
<button className="section-header-button" onClick={onButtonClick}>{buttonText}</button> | ||
</div> | ||
} | ||
</div> | ||
); | ||
|
||
SectionHeader.propTypes = { | ||
title: PropTypes.node, | ||
buttonText: PropTypes.node, | ||
icon: PropTypes.string, | ||
onButtonClick: PropTypes.func, | ||
}; | ||
|
||
SectionHeader.defaultProps = { | ||
title: '', | ||
buttonText: '', | ||
icon: 'clock-o', | ||
onButtonClick: EMPTY_FUNCTION, | ||
}; | ||
|
||
export default SectionHeader; |
22 changes: 22 additions & 0 deletions
22
src/Components/ProfileDashboard/SectionHeader/SectionHeader.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import toJSON from 'enzyme-to-json'; | ||
import SectionHeader from './SectionHeader'; | ||
|
||
describe('SectionHeaderComponent', () => { | ||
const props = { | ||
title: 'Title', | ||
buttonText: 'click me', | ||
icon: 'clock-o', | ||
}; | ||
|
||
it('is defined', () => { | ||
const wrapper = shallow(<SectionHeader {...props} />); | ||
expect(wrapper).toBeDefined(); | ||
}); | ||
|
||
it('matches snapshot', () => { | ||
const wrapper = shallow(<SectionHeader {...props} />); | ||
expect(toJSON(wrapper)).toMatchSnapshot(); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
src/Components/ProfileDashboard/SectionHeader/__snapshots__/SectionHeader.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`SectionHeaderComponent matches snapshot 1`] = ` | ||
<div | ||
className="usa-grid-full section-header section-padded-inner-container-narrow" | ||
> | ||
<div | ||
className="usa-width-two-thirds section-header-text" | ||
> | ||
<FontAwesome | ||
name="clock-o" | ||
/> | ||
Title | ||
</div> | ||
<div | ||
className="usa-width-one-third section-header-button-container" | ||
> | ||
<button | ||
className="section-header-button" | ||
onClick={[Function]} | ||
> | ||
click me | ||
</button> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './SectionHeader'; |
Oops, something went wrong.