Skip to content

Commit

Permalink
Hide UI changes behind featureFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsangVA committed Jul 17, 2024
1 parent 06ec3ad commit d2e249b
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 63 deletions.
3 changes: 2 additions & 1 deletion app/views/higher_level_reviews/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
featureToggles: {
useAmaActivationDate: FeatureToggle.enabled?(:use_ama_activation_date, user: current_user),
correctClaimReviews: FeatureToggle.enabled?(:correct_claim_reviews, user: current_user),
covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user)
covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user),
disableAmaEventing: FeatureToggle.enabled?(:disable_ama_eventing, user: current_user)
}
}) %>
<% end %>
3 changes: 2 additions & 1 deletion app/views/queue/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
additional_remand_reasons: FeatureToggle.enabled?(:additional_remand_reasons, user: current_user),
acd_cases_tied_to_judges_no_longer_with_board: FeatureToggle.enabled?(:acd_cases_tied_to_judges_no_longer_with_board, user: current_user),
admin_case_distribution: FeatureToggle.enabled?(:admin_case_distribution, user: current_user),
acd_exclude_from_affinity: FeatureToggle.enabled?(:acd_exclude_from_affinity, user: current_user)
acd_exclude_from_affinity: FeatureToggle.enabled?(:acd_exclude_from_affinity, user: current_user),
disable_ama_eventing: FeatureToggle.enabled?(:disable_ama_eventing, user: current_user)
}
}) %>
<% end %>
3 changes: 2 additions & 1 deletion app/views/supplemental_claims/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
featureToggles: {
useAmaActivationDate: FeatureToggle.enabled?(:use_ama_activation_date, user: current_user),
correctClaimReviews: FeatureToggle.enabled?(:correct_claim_reviews, user: current_user),
covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user)
covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user),
disableAmaEventing: FeatureToggle.enabled?(:disable_ama_eventing, user: current_user)
}
}) %>
<% end %>
6 changes: 4 additions & 2 deletions client/app/intake/pages/addIssues/addIssues.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class AddIssuesPage extends React.Component {

const intakeData = intakeForms[formType];
const appealInfo = intakeForms.appeal;
const { useAmaActivationDate, hlrScUnrecognizedClaimants } = featureToggles;
const { useAmaActivationDate, hlrScUnrecognizedClaimants, disableAmaEventing } = featureToggles;
const hasClearedEp = intakeData && (intakeData.hasClearedRatingEp || intakeData.hasClearedNonratingEp);

if (this.willRedirect(intakeData, hasClearedEp)) {
Expand Down Expand Up @@ -639,7 +639,9 @@ class AddIssuesPage extends React.Component {

let rowObjects = fieldsForFormType;

rowObjects = rowObjects.concat(intakeSystemLabelRow());
if (!disableAmaEventing) {
rowObjects = rowObjects.concat(intakeSystemLabelRow());
}

Object.keys(issuesBySection).sort().
map((key) => {
Expand Down
133 changes: 75 additions & 58 deletions client/app/queue/OtherReviewsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,70 +63,85 @@ class OtherReviewsTable extends React.PureComponent {

getKeyForRow = (rowNumber, object) => `${object.reviewType}-${object.claimId}`;

getColumns = () => [
{
valueFunction: (review) => <BadgeArea review={review} />
},
{
header: COPY.OTHER_REVIEWS_TABLE_APPELLANT_NAME_COLUMN_TITLE,
valueFunction: (review) => review.claimantNames.length > 0 ?
review.claimantNames.join(', ') :
review.veteranFullName
},
{
header: COPY.OTHER_REVIEWS_TABLE_REVIEW_TYPE_COLUMN_TITLE,
valueFunction: (review) => {
return <React.Fragment>
<Link
name="edit-issues"
href={review.editIssuesUrl}
target="_blank">
{_.startCase(review.reviewType)}
</Link>
</React.Fragment>;
}
},
{
header: COPY.OTHER_REVIEWS_TABLE_RECEIPT_DATE_COLUMN_TITLE,
valueFunction: (review) => <DateString date={review.receiptDate} />
},
{
header: COPY.OTHER_REVIEWS_TABLE_EP_CODE_COLUMN_TITLE,
valueFunction: (review) => {
if (review.endProductStatuses && review.endProductStatuses.length > 0) {
if (review.endProductStatuses.length > 1) {
return review.endProductStatuses.map((endProduct, i) => {
return <SubdividedTableRow rowNumber={i}>
{endProduct.ep_code}
</SubdividedTableRow>;
});
getColumns = () => {
const { featureToggles } = this.props;

// Check if disable_ama_eventing is false to determine whether to show the BadgeArea column
const showBadgeAreaColumn = !featureToggles.disable_ama_eventing;

const columns = [
{
header: COPY.OTHER_REVIEWS_TABLE_APPELLANT_NAME_COLUMN_TITLE,
valueFunction: (review) => review.claimantNames.length > 0 ?
review.claimantNames.join(', ') :
review.veteranFullName
},
{
header: COPY.OTHER_REVIEWS_TABLE_REVIEW_TYPE_COLUMN_TITLE,
valueFunction: (review) => (
<React.Fragment>
<Link
name="edit-issues"
href={review.editIssuesUrl}
target="_blank">
{_.startCase(review.reviewType)}
</Link>
</React.Fragment>
)
},
{
header: COPY.OTHER_REVIEWS_TABLE_RECEIPT_DATE_COLUMN_TITLE,
valueFunction: (review) => <DateString date={review.receiptDate} />
},
{
header: COPY.OTHER_REVIEWS_TABLE_EP_CODE_COLUMN_TITLE,
valueFunction: (review) => {
if (review.endProductStatuses && review.endProductStatuses.length > 0) {
if (review.endProductStatuses.length > 1) {
return review.endProductStatuses.map((endProduct, i) => (
<SubdividedTableRow key={i} rowNumber={i}>
{endProduct.ep_code}
</SubdividedTableRow>
));
}
const endProduct = review.endProductStatuses[0];

return endProduct.ep_code;
}
const endProduct = review.endProductStatuses[0];

return endProduct.ep_code;
return <em>{COPY[CLAIM_REVIEW_TEXT[review.reviewType]]}</em>;
}

return <em>{COPY[CLAIM_REVIEW_TEXT[review.reviewType]]}</em>;
}
},
{
header: COPY.OTHER_REVIEWS_TABLE_EP_STATUS_COLUMN_TITLE,
valueFunction: (review) => {
if (review.endProductStatuses && review.endProductStatuses.length > 0) {
if (review.endProductStatuses.length > 1) {
return review.endProductStatuses.map((endProduct, i) => {
return <SubdividedTableRow rowNumber={i}>{endProduct.ep_status}</SubdividedTableRow>;
});
},
{
header: COPY.OTHER_REVIEWS_TABLE_EP_STATUS_COLUMN_TITLE,
valueFunction: (review) => {
if (review.endProductStatuses && review.endProductStatuses.length > 0) {
if (review.endProductStatuses.length > 1) {
return review.endProductStatuses.map((endProduct, i) => (
<SubdividedTableRow key={i} rowNumber={i}>
{endProduct.ep_status}
</SubdividedTableRow>
));
}
const endProduct = review.endProductStatuses[0];

return endProduct.ep_status;
}
const endProduct = review.endProductStatuses[0];

return endProduct.ep_status;
return '';
}

return '';
}
];

// Conditionally include the BadgeArea column at the start of row based on showBadgeAreaColumn
if (showBadgeAreaColumn) {
columns.unshift({
valueFunction: (review) => <BadgeArea review={review} />
});
}
];

return columns;
};

render = () => {
if (this.props.reviews.length === 0) {
Expand All @@ -152,12 +167,14 @@ OtherReviewsTable.propTypes = {
reviews: PropTypes.arrayOf(PropTypes.object).isRequired,
veteranName: PropTypes.string,
styling: PropTypes.object,
clearCaseListSearch: PropTypes.func
clearCaseListSearch: PropTypes.func,
featureToggles: PropTypes.object
};

const mapStateToProps = (state) => ({
userCssId: state.ui.userCssId,
userRole: state.ui.userRole
userRole: state.ui.userRole,
featureToggles: state.ui.featureToggles
});

const mapDispatchToProps = (dispatch) => bindActionCreators({
Expand Down

0 comments on commit d2e249b

Please sign in to comment.