Skip to content

Commit

Permalink
changes status of policy
Browse files Browse the repository at this point in the history
  • Loading branch information
sonytrinhcvn committed Mar 3, 2020
1 parent 1895f07 commit 8b5a6e0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 18 deletions.
8 changes: 8 additions & 0 deletions imports/api/unit-meta-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ export const unitTypes = Object.freeze([
}
])

export const statusOfPolicies = Object.freeze([
{
name: 'With open case'
},
{
name: 'Without open case'
}
])
// TODO: Figure this out later
// export const formatAddressLabel = metaData => {
// let fullLabel = ''
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/unit-explorer/unit-explorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class UnitExplorer extends Component {
<StatusFilter
selectedStatusFilter={selectedStatusFilter}
onFilterClicked={this.handleStatusFilterClicked}
status={['All', 'In-force', 'Lapse']}
status={['All', 'With open case', 'Without open case']}
/>
{/* <RoleFilter
selectedRoleFilter={selectedRoleFilter}
Expand Down
56 changes: 39 additions & 17 deletions imports/ui/unit/unit-overview-tab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ErrorDialog from "../dialogs/error-dialog";
import EditableItem from "../components/editable-item";
import { countryListItems } from "../util/common-renderers";
import countries from "iso-3166-1-codes";
import { unitTypes } from "../../api/unit-meta-data";
import { unitTypes, statusOfPolicies } from "../../api/unit-meta-data";
import MenuItem from "material-ui/MenuItem";
import SelectField from "material-ui/SelectField";
import {
Expand Down Expand Up @@ -235,7 +235,8 @@ class UnitOverviewTab extends React.Component<Props, State> {
countrySearchText,
country,
countryValidWarning,
unitType
unitType,
statusOfPolicy
} = this.state;
const ongoingRemoval = this.getOngoingRemoval(this.props, this.state);
const unitName = metaData.displayName || unitItem.name;
Expand Down Expand Up @@ -289,11 +290,32 @@ class UnitOverviewTab extends React.Component<Props, State> {
})}
</div>
<div>
{this.renderEditableField({
label: "Status of Policy",
stateVar: "statusOfPolicy",
isEditing
})}
{isEditing ? (
<SelectField
value={statusOfPolicy}
floatingLabelText="Status of Policy"
floatingLabelStyle={textInputFloatingLabelStyle}
underlineFocusStyle={textInputUnderlineFocusStyle}
fullWidth
onChange={(evt, idx, val) => {
this.setState({
statusOfPolicy: val
});
}}
>
{statusOfPolicies.map(status => (
<MenuItem
key={status.name}
value={status}
primaryText={status.name}
/>
))}
</SelectField>
) : (
<div className="mt3">
{infoItemMembers("Status of Policy", metaData.status)}
</div>
)}
</div>
</div>
<div className="mt2 bg-white card-shadow-1 pa3">
Expand Down Expand Up @@ -333,22 +355,22 @@ class UnitOverviewTab extends React.Component<Props, State> {
</div>
)}
</div>
<div className='flex mt2'>
<div className='flex-grow'>
{this.renderEditableField({
label: 'Additional Comment(s)',
stateVar: 'state',
isEditing
})}
</div>
{/* <div className='flex-grow'>
<div className="flex mt2">
<div className="flex-grow">
{this.renderEditableField({
label: "Additional Comment(s)",
stateVar: "state",
isEditing
})}
</div>
{/* <div className='flex-grow'>
{this.renderEditableField({
label: 'Zip / Postal code',
stateVar: 'zipCode',
isEditing
})}
</div> */}
</div>
</div>
</div>
<div className="mt2 bg-white card-shadow-1 pa3">
<div className="fw5 silver lh-title">PEOPLE</div>
Expand Down

0 comments on commit 8b5a6e0

Please sign in to comment.