Skip to content

Commit

Permalink
feat: renamed "Deadline" to "Next Step Date" for next steps' date lab…
Browse files Browse the repository at this point in the history
…el (#866)
  • Loading branch information
nbiton authored and franck-boullier committed Aug 25, 2019
1 parent 244a5a4 commit ece6081
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions imports/ui/case/case-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const mediaItemRowCount = 3

const renderEditableTargetAttribute = (
{
attrName, value, targetDate, editUrl, showTime = false
attrName, value, targetDate, editUrl, dateLabel, showTime = false
}
) => (
<InfoItemContainer>
Expand All @@ -46,7 +46,7 @@ const renderEditableTargetAttribute = (
}
{targetDate && (
<div className='mt2 f7 warn-crimson b'>
Deadline: {moment(targetDate).format('YYYY-MM-DD' + (showTime ? ', h:mm' : ''))}{showTime ? ' hrs' : ''}
{dateLabel}: {moment(targetDate).format('YYYY-MM-DD' + (showTime ? ', h:mm' : ''))}{showTime ? ' hrs' : ''}
</div>
)}
</div>
Expand Down Expand Up @@ -506,6 +506,7 @@ class CaseDetails extends Component {
</div>
{renderEditableTargetAttribute({
attrName: 'Solution',
dateLabel: 'Deadline',
value: solution,
targetDate: solutionDeadline && new Date(solutionDeadline),
editUrl: `${match.url}/solution`
Expand All @@ -514,6 +515,7 @@ class CaseDetails extends Component {
<CaseTargetAttrDialog
show={!!subMatch}
attrName='Solution'
dateLabel='Deadline'
initialValue={solution}
initialDate={solutionDeadline && new Date(solutionDeadline)}
onSubmit={(value, date) => {
Expand All @@ -531,13 +533,15 @@ class CaseDetails extends Component {
{renderEditableTargetAttribute({
attrName: 'Next steps',
value: nextSteps,
dateLabel: 'Next Step Date',
targetDate: nextStepsBy && new Date(nextStepsBy),
editUrl: `${match.url}/nextSteps`
})}
<Route path={`${match.url}/nextSteps`} children={({ match: subMatch }) => (
<CaseTargetAttrDialog
show={!!subMatch}
attrName='Next Steps'
dateLabel='Next Step Date'
initialValue={nextSteps}
initialDate={nextStepsBy && new Date(nextStepsBy)}
onSubmit={(value, date) => {
Expand Down
5 changes: 3 additions & 2 deletions imports/ui/dialogs/case-target-attr-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Props = {
attrName: string,
initialValue?: string,
initialDate?: Date,
dateLabel: string,
onCancel: () => void,
showTime?: boolean,
onSubmit: (value: string, date: Date) => void
Expand Down Expand Up @@ -116,7 +117,7 @@ export default class CaseTargetAttrDialog extends React.Component<Props, State>
}

render () {
const { show, onCancel, attrName, showTime } = this.props
const { show, onCancel, attrName, showTime, dateLabel } = this.props
const { attrValue, attrDate, attrTime, isEditing, hideDateRow } = this.state
const now = new Date()
return (
Expand Down Expand Up @@ -150,7 +151,7 @@ export default class CaseTargetAttrDialog extends React.Component<Props, State>
rowsMax={3}
/>
<div className='mt3 flex-grow'>
{!hideDateRow && infoItemLabel('Deadline')}
{!hideDateRow && infoItemLabel(dateLabel)}
{!hideDateRow && (
<div className='flex'>
<div className='flex-grow flex items-center'>
Expand Down

0 comments on commit ece6081

Please sign in to comment.