Skip to content

Commit

Permalink
APPEALS-23450 (#19166)
Browse files Browse the repository at this point in the history
* Filter legacy remand reason function

* Passed in FeatureToggle and code cleanup

* Validated proptype for featuretoggle
  • Loading branch information
Blake-Manus authored Aug 31, 2023
1 parent 85dd0f0 commit 45c34fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions client/app/queue/QueueApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class QueueApp extends React.PureComponent {
<SelectRemandReasonsView
prevStep={`/queue/appeals/${appealId}/tasks/${taskId}/${checkoutFlow}/dispositions`}
{...props.match.params}
featureToggles={this.props.featureToggles}
/>
);
};
Expand Down
6 changes: 4 additions & 2 deletions client/app/queue/SelectRemandReasonsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ class SelectRemandReasonsView extends React.Component {
issueId={this.props.issues[idx].id}
key={`remand-reasons-options-${idx}`}
ref={this.getChildRef}
idx={idx} />
idx={idx}
featureToggles={this.props.featureToggles} />
)}
</QueueFlowPage>;
}
Expand All @@ -144,7 +145,8 @@ SelectRemandReasonsView.propTypes = {
taskId: PropTypes.string.isRequired,
checkoutFlow: PropTypes.string.isRequired,
userRole: PropTypes.string.isRequired,
editStagedAppeal: PropTypes.func
editStagedAppeal: PropTypes.func,
featureToggles: PropTypes.object.isRequired
};

const mapStateToProps = (state, ownProps) => {
Expand Down
16 changes: 15 additions & 1 deletion client/app/queue/components/IssueRemandReasonsOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ class IssueRemandReasonsOptions extends React.PureComponent {
);
};

// Selects the section and index of Remand Reason from Legacy Active Remand Reasons JSON list,
// and filters it out of selectable checkboxes.
filterSelectableLegacyRemandReasons = (sectionName, index) => {
delete LEGACY_REMAND_REASONS[sectionName][index];

};

getCheckboxGroup = () => {
const { appeal } = this.props;
const checkboxGroupProps = {
Expand All @@ -225,6 +232,12 @@ class IssueRemandReasonsOptions extends React.PureComponent {
};

if (appeal.isLegacyAppeal) {

// If feature flag is true, filter out the chosen remand reasons.
if (this.props.featureToggles.additional_remand_reasons) {
this.filterSelectableLegacyRemandReasons('dueProcess', 0);
}

return (
<div {...flexContainer}>
<div {...flexColumn}>
Expand Down Expand Up @@ -349,7 +362,8 @@ IssueRemandReasonsOptions.propTypes = {
issue: PropTypes.object,
issueId: PropTypes.number,
highlight: PropTypes.bool,
idx: PropTypes.number
idx: PropTypes.number,
featureToggles: PropTypes.object,
};

export default connect(
Expand Down

0 comments on commit 45c34fc

Please sign in to comment.