Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing feature toggles #19448

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions app/controllers/intakes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ def intake_ui_hash

def feature_toggle_ui_hash
{
useAmaActivationDate: FeatureToggle.enabled?(:use_ama_activation_date, user: current_user),
rampIntake: FeatureToggle.enabled?(:ramp_intake, user: current_user),
dateOfBirthField: FeatureToggle.enabled?(:date_of_birth_field, user: current_user),
covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user),
filedByVaGovHlr: FeatureToggle.enabled?(:filed_by_va_gov_hlr, user: current_user),
updatedIntakeForms: FeatureToggle.enabled?(:updated_intake_forms, user: current_user),
eduPreDocketAppeals: FeatureToggle.enabled?(:edu_predocket_appeals, user: current_user),
Expand Down
2 changes: 1 addition & 1 deletion app/models/legacy_appeal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def matchable_to_request_issue?(receipt_date)
return false unless issues.any?
return true if active?

covid_flag = FeatureToggle.enabled?(:covid_timeliness_exemption, user: RequestStore.store[:current_user])
covid_flag = false

eligible_for_opt_in?(receipt_date: receipt_date, covid_flag: covid_flag)
end
Expand Down
2 changes: 0 additions & 2 deletions app/views/appeals/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
serverIntake: appeal.ui_hash,
claimId: url_appeal_uuid,
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),
split_appeal_workflow: FeatureToggle.enabled?(:split_appeal_workflow, user: current_user),
cc_appeal_workflow: FeatureToggle.enabled?(:cc_appeal_workflow, user: current_user),
vhaPreDocketAppeals: false
Expand Down
4 changes: 1 addition & 3 deletions app/views/higher_level_reviews/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
serverIntake: higher_level_review.ui_hash,
claimId: url_claim_id,
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)
correctClaimReviews: FeatureToggle.enabled?(:correct_claim_reviews, user: current_user)
}
}) %>
<% end %>
4 changes: 1 addition & 3 deletions app/views/supplemental_claims/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
serverIntake: supplemental_claim.ui_hash,
claimId: url_claim_id,
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)
correctClaimReviews: FeatureToggle.enabled?(:correct_claim_reviews, user: current_user)
}
}) %>
<% end %>
7 changes: 0 additions & 7 deletions client/app/admin/reducers/featureToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ import { update } from '../../util/ReducerUtil';

const updateFromServerFeatures = (state, featureToggles) => {
return update(state, {
useAmaActivationDate: {
$set: Boolean(featureToggles.useAmaActivationDate)
},
correctClaimReviews: {
$set: Boolean(featureToggles.correctClaimReviews)
},
covidTimelinessExemption: {
$set: Boolean(featureToggles.covidTimelinessExemption)
},
filedByVaGovHlr: {
$set: Boolean(featureToggles.filedByVaGovHlr)
},
Expand All @@ -29,7 +23,6 @@ const updateFromServerFeatures = (state, featureToggles) => {
export const mapDataToFeatureToggle = (data = { featureToggles: {} }) =>
updateFromServerFeatures(
{
useAmaActivationDate: false,
correctClaimReviews: false,
filedByVaGovHlr: false,
updatedIntakeForms: false,
Expand Down
7 changes: 0 additions & 7 deletions client/app/intake/components/AddIssueManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,7 @@ class AddIssueManager extends React.Component {
};

requiresTimelyRules = () => {
const { covidTimelinessExemption } = this.props.featureToggles;

if (covidTimelinessExemption) {
return this.requiresUntimelyExemptionWithCovid();
}

return this.requiresUntimelyExemption();

}

render() {
Expand Down
35 changes: 12 additions & 23 deletions client/app/intake/components/UntimelyExemptionModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export const UntimelyExemptionModal = ({
onSkip,
skipText = 'None of these match, see more options'
}) => {
const { covidTimelinessExemption } = useSelector((state) => state.featureToggles);

const [state, setState] = useState({
untimelyExemption: '',
untimelyExemptionNotes: '',
Expand Down Expand Up @@ -80,18 +78,18 @@ export const UntimelyExemptionModal = ({
const vacolsIssueIneligible = issue.vacolsId && !issue.eligibleForSocOptIn;
const requestIssueUntimely = !issue.timely && !(formType === 'supplemental_claim');

if (covidTimelinessExemption) {
if (vacolsIssueIneligible && requestIssueUntimely) {
errorMsg = COPY.INTAKE_REQUEST_ISSUE_AND_LEGACY_ISSUE_UNTIMELY;
} else if (vacolsIssueIneligible) {
errorMsg = COPY.INTAKE_LEGACY_ISSUE_UNTIMELY;
} else if (requestIssueUntimely) {
errorMsg = COPY.INTAKE_REQUEST_ISSUE_UNTIMELY;
}

} else {
errorMsg = COPY.INTAKE_REQUEST_ISSUE_UNTIMELY;
}
// if (covidTimelinessExemption) {
// if (vacolsIssueIneligible && requestIssueUntimely) {
// errorMsg = COPY.INTAKE_REQUEST_ISSUE_AND_LEGACY_ISSUE_UNTIMELY;
// } else if (vacolsIssueIneligible) {
// errorMsg = COPY.INTAKE_LEGACY_ISSUE_UNTIMELY;
// } else if (requestIssueUntimely) {
// errorMsg = COPY.INTAKE_REQUEST_ISSUE_UNTIMELY;
// }

// } else {
// errorMsg = COPY.INTAKE_REQUEST_ISSUE_UNTIMELY;
// }

return errorMsg;
};
Expand Down Expand Up @@ -127,15 +125,6 @@ export const UntimelyExemptionModal = ({

{state.untimelyExemption === 'true' && (
<>
{covidTimelinessExemption && (
<Checkbox
name="untimelyExemptionCovid"
label="This request is related to COVID-19"
onChange={(val) => setState({ ...state, untimelyExemptionCovid: val })}
value={state.untimelyExemptionCovid}
/>
)}

<TextField
name="Notes"
optional
Expand Down
4 changes: 2 additions & 2 deletions client/app/intake/pages/addIssues.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class AddIssuesPage extends React.Component {
} = this.props;
const intakeData = intakeForms[formType];
const appealInfo = intakeForms.appeal;
const { useAmaActivationDate, hlrScUnrecognizedClaimants } = featureToggles;
const { hlrScUnrecognizedClaimants } = featureToggles;
const hasClearedEp = intakeData && (intakeData.hasClearedRatingEp || intakeData.hasClearedNonratingEp);

if (this.willRedirect(intakeData, hasClearedEp)) {
Expand All @@ -238,7 +238,7 @@ class AddIssuesPage extends React.Component {
(issue) => VBMS_BENEFIT_TYPES.includes(issue.benefitType) || issue.ratingIssueReferenceId
);

const issues = formatAddedIssues(intakeData.addedIssues, useAmaActivationDate);
const issues = formatAddedIssues(intakeData.addedIssues);
const issuesPendingWithdrawal = issues.filter((issue) => issue.withdrawalPending);
const issuesBySection = formatIssuesBySection(issues);

Expand Down
2 changes: 0 additions & 2 deletions client/app/intake/pages/formGenerator.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ const defaultArgs = {
schema: reviewAppealSchema,
featureToggles: {
correctClaimReviews: false,
covidTimelinessExemption: true,
eduPreDocketAppeals: true,
filedByVaGovHlr: true,
updatedAppealForm: true,
updatedIntakeForms: true,
useAmaActivationDate: true,
vhaClaimReviewEstablishment: true,
},
};
Expand Down
2 changes: 1 addition & 1 deletion client/app/intake/pages/review.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Review = (props) => {
const formProps = useForm(
{
resolver: yupResolver(schemaMappings(props.featureToggles)[props.formType]),
context: { selectedForm: props.formType, useAmaActivationDate: props.featureToggles.useAmaActivationDate },
context: { selectedForm: props.formType },
mode: 'onSubmit',
reValidateMode: 'onSubmit'
}
Expand Down
3 changes: 1 addition & 2 deletions client/app/intake/pages/selectForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class SelectForm extends React.PureComponent {
render() {
const { formType, featureToggles, userCanIntakeAppeals } = this.props;
const unreadMessages = this.props.unreadMessages;
const rampEnabled = featureToggles.rampIntake;
const enabledFormTypes = rampEnabled ? FORM_TYPES : _.pickBy(FORM_TYPES, { category: 'decisionReview' });
const enabledFormTypes = _.pickBy(FORM_TYPES, { category: 'decisionReview' });
const appealPermissionError = !userCanIntakeAppeals && formType === FORM_TYPES.APPEAL.key;

const radioOptions = _.map(enabledFormTypes, (form) => ({
Expand Down
7 changes: 0 additions & 7 deletions client/app/intake/reducers/featureToggles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ import { update } from '../../util/ReducerUtil';

const updateFromServerFeatures = (state, featureToggles) => {
return update(state, {
useAmaActivationDate: {
$set: Boolean(featureToggles.useAmaActivationDate)
},
correctClaimReviews: {
$set: Boolean(featureToggles.correctClaimReviews)
},
covidTimelinessExemption: {
$set: Boolean(featureToggles.covidTimelinessExemption)
},
filedByVaGovHlr: {
$set: Boolean(featureToggles.filedByVaGovHlr)
},
Expand All @@ -35,7 +29,6 @@ const updateFromServerFeatures = (state, featureToggles) => {
export const mapDataToFeatureToggle = (data = { featureToggles: {} }) =>
updateFromServerFeatures(
{
useAmaActivationDate: false,
correctClaimReviews: false,
filedByVaGovHlr: false,
updatedIntakeForms: false,
Expand Down
1 change: 0 additions & 1 deletion client/test/app/intake/testData.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,6 @@ export const sample1 = {
},
claimId: '7dccd357-009c-4744-b986-4c46ad7c029e',
featureToggles: {
useAmaActivationDate: true,
correctClaimReviews: true,
},
addIssuesModalVisible: false,
Expand Down
Loading
Loading