Skip to content

Commit

Permalink
Shalliburton/fix saving hearing time (#14539)
Browse files Browse the repository at this point in the history
* move time options to constants files

* use new constants file

* add 15 minute increment time options

* refactor HearingTime to make it a functional component

* fix linting issues

* add storybook story for HearingTime

* reduce cognitive complexity

* fixing some component key issues and newly introduced bugs

* linting corrections

* add value prop

* add scheduledTimeString prop

* WIP: Started fixing issue with time saving

* Reset unchanged files

Co-authored-by: Ferris Tseng <[email protected]>
Co-authored-by: Stephen Halliburton <[email protected]>
Co-authored-by: va-bot <[email protected]>
  • Loading branch information
4 people authored Jun 16, 2020
1 parent a34786e commit eb8cf71
Showing 1 changed file with 52 additions and 23 deletions.
75 changes: 52 additions & 23 deletions client/app/hearings/components/dailyDocket/DailyDocketRows.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,31 @@ const rowsMargin = css({
});

const Header = ({ user }) => (
<div {...docketRowStyle}
<div
{...docketRowStyle}
{...css({
'& *': {
background: 'none !important'
},
'& > div > div': { verticalAlign: 'bottom' }
})} className={user.userHasHearingPrepRole ? 'judge-view' : ''}>
})}
className={user.userHasHearingPrepRole ? 'judge-view' : ''}
>
<div>
<div>{user.userHasHearingPrepRole && <strong>Prep</strong>}</div>
<div></div>
<div><strong>Appellant/Veteran ID/Representative</strong></div>
<div><strong>Type/Time/RO</strong></div>
<div />
<div>
<strong>Appellant/Veteran ID/Representative</strong>
</div>
<div>
<strong>Type/Time/RO</strong>
</div>
</div>
<div>
<div>
<strong>Actions</strong>
</div>
</div>
<div><div><strong>Actions</strong></div></div>
</div>
);

Expand All @@ -36,25 +47,43 @@ Header.propTypes = {
};

export default class DailyDocketHearingRows extends React.Component {
render () {
const { hearings, readOnly, regionalOffice,
openDispositionModal, user, saveHearing, hidePreviouslyScheduled } = this.props;
constructor(props) {
super(props);

this.state = {
hearings: []
};
}

componentDidMount() {
const sortedHearings = sortHearings(this.props.hearings);

this.setState({ hearings: sortedHearings });
}

const sortedHearings = sortHearings(hearings);
render() {
const { readOnly, regionalOffice, openDispositionModal, user, saveHearing, hidePreviouslyScheduled } = this.props;

return <div {...rowsMargin}>
<Header user={user} />
<div>{sortedHearings.map((hearing, index) => (
<DailyDocketRow hearingId={hearing.externalId}
index={index}
readOnly={readOnly}
hidePreviouslyScheduled={hidePreviouslyScheduled}
user={user}
saveHearing={saveHearing}
regionalOffice={regionalOffice}
openDispositionModal={openDispositionModal} />
))}</div>
</div>;
return (
<div {...rowsMargin}>
<Header user={user} />
<div>
{this.state.hearings.length > 0 &&
this.state.hearings.map((hearing, index) => (
<DailyDocketRow
hearingId={hearing.externalId}
index={index}
readOnly={readOnly}
hidePreviouslyScheduled={hidePreviouslyScheduled}
user={user}
saveHearing={saveHearing}
regionalOffice={regionalOffice}
openDispositionModal={openDispositionModal}
/>
))}
</div>
</div>
);
}
}

Expand Down

0 comments on commit eb8cf71

Please sign in to comment.