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

appeals: swap css variable imports #32415

Closed
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion src/applications/appeals/10182/sass/10182-nod.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";
@import "~@department-of-veterans-affairs/css-library/dist/tokens/scss/variables";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-process-list";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-form-process";
@import "../../../../platform/forms/sass/m-schemaform";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";
@import "~@department-of-veterans-affairs/css-library/dist/tokens/scss/variables";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-process-list";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-form-process";
@import "../../../../platform/forms/sass/m-schemaform";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ export const InformalConference = ({
goForward(data);
}
},
onUpdatePage: event => {
if (!checkErrors(data) && conference !== '') {
updatePage(event);
}
},
onSelectionOriginal: event => {
const { value } = event?.detail || {};
if (value) {
Expand All @@ -111,11 +106,9 @@ export const InformalConference = ({
onSelectionNew: event => {
const { value } = event?.detail || {};
if (value) {
const conf = data.informalConference;
const formData = {
...data,
informalConferenceChoice: value,
informalConference: value !== 'no' && conf === 'no' ? '' : conf,
};
update(formData, value, newInformalConferenceLabels[value]);
}
Expand All @@ -125,7 +118,7 @@ export const InformalConference = ({
const navButtons = onReviewPage ? (
<va-button
text={updateButtonText}
onClick={handlers.onUpdatePage}
onClick={updatePage}
class="vads-u-margin-bottom--4"
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ export const InformalConferenceContact = ({
goForward(data);
}
},
onUpdatePage: event => {
if (!checkErrors() && conference !== '') {
updatePage(event);
}
},
onSelection: event => {
const { value } = event?.detail || {};
if (value) {
Expand All @@ -84,7 +79,7 @@ export const InformalConferenceContact = ({
const navButtons = onReviewPage ? (
<va-button
text={updateButtonText}
onClick={handlers.onUpdatePage}
onClick={updatePage}
class="vads-u-margin-bottom--4"
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ const InformalConferenceReview = ({ data, editPage }) => {

// show 'me', 'rep' or 'no' for original content
// show 'yes' or 'no' for new content
const value = showNewContent
? data.informalConferenceChoice
: data.informalConference;
const value =
showNewContent && ['me', 'rep'].includes(data.informalConference)
? data.informalConferenceChoice
: data.informalConference;
const title = showNewContent
? newInformalConferenceTitle
: informalConferenceTitle;
Expand Down
24 changes: 10 additions & 14 deletions src/applications/appeals/996/pages/informalConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,20 @@ import {
informalConferenceLabels,
informalConferenceDescriptions,
} from '../content/InformalConference';
import { validateConferenceChoice } from '../validations';

const informalConference = {
uiSchema: {
'ui:description': InformalConferenceDescription,
informalConference: {
...radioUI({
title: informalConferenceTitle,
hint: informalConferenceHint,
labels: informalConferenceLabels,
descriptions: informalConferenceDescriptions,
enableAnalytics: true,
errorMessages: {
required: errorMessages.informalConferenceContactChoice,
},
}),
'ui:validations': [validateConferenceChoice],
},
informalConference: radioUI({
title: informalConferenceTitle,
hint: informalConferenceHint,
labels: informalConferenceLabels,
descriptions: informalConferenceDescriptions,
enableAnalytics: true,
errorMessages: {
required: errorMessages.informalConferenceContactChoice,
},
}),
},
schema: {
type: 'object',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
// https://github.com/department-of-veterans-affairs/vets-api/blob/master/modules/appeals_api/config/schemas/v2/200996.json#L79-L92
schema: {
type: 'object',
required: ['informalConferenceRep'],
required: ['informalConference'],
properties: {
informalConferenceRep: {
type: 'object',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";
@import "~@department-of-veterans-affairs/css-library/dist/tokens/scss/variables";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-process-list";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-form-process";
@import "../../../../platform/forms/sass/m-schemaform";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,45 +164,20 @@ describe('<InformalConference>', () => {
setSpy.calledWith({
hlrUpdatedContent: true,
informalConferenceChoice: 'yes',
informalConference: undefined,
}),
).to.be.true;
});

it('should set form data with "no"', () => {
const setSpy = sinon.spy();
const { container } = setup({
toggle: true,
setFormData: setSpy,
data: { informalConference: 'me' },
});
const { container } = setup({ toggle: true, setFormData: setSpy });
$('va-radio', container).__events.vaValueChange({
detail: { value: 'no' },
});
expect(
setSpy.calledWith({
hlrUpdatedContent: true,
informalConferenceChoice: 'no',
informalConference: 'me',
}),
).to.be.true;
});

it('should set form data with "no"', () => {
const setSpy = sinon.spy();
const { container } = setup({
toggle: true,
setFormData: setSpy,
data: { informalConference: 'no' },
});
$('va-radio', container).__events.vaValueChange({
detail: { value: 'yes' },
});
expect(
setSpy.calledWith({
hlrUpdatedContent: true,
informalConferenceChoice: 'yes',
informalConference: '', // will clear informalConference if set to "no"
}),
).to.be.true;
});
Expand Down
3 changes: 2 additions & 1 deletion src/applications/appeals/shared/content/reviewErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const reviewErrors = {
) {
return {
chapterKey: 'conditions',
pageKey: 'areaOfDisagreementFollowUp',
// include page index to match fullPageKey in ReviewCollapsibleChapter
pageKey: `areaOfDisagreementFollowUp${err}`,
};
}
// overrides for contact info page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe('reviewErrors override', () => {
const error = { __errors: [errorMessages.missingDisagreement] };
expect(override('0', error)).to.be.deep.equal({
chapterKey: 'conditions',
pageKey: 'areaOfDisagreementFollowUp',
pageKey: 'areaOfDisagreementFollowUp0',
});
expect(override('11', error)).to.be.deep.equal({
chapterKey: 'conditions',
pageKey: 'areaOfDisagreementFollowUp',
pageKey: 'areaOfDisagreementFollowUp11',
});
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";
@import "~@department-of-veterans-affairs/css-library/dist/tokens/scss/variables";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-process-list";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-form-process";
@import "../../../../../platform/forms/sass/m-schemaform";
Expand Down
2 changes: 1 addition & 1 deletion src/applications/appeals/testing/hlr/sass/hlr.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";
@import "~@department-of-veterans-affairs/css-library/dist/tokens/scss/variables";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-process-list";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-form-process";
@import "../../../../../platform/forms/sass/m-schemaform";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";
@import "~@department-of-veterans-affairs/css-library/dist/tokens/scss/variables";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-process-list";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-form-process";
@import "../../../../../platform/forms/sass/m-schemaform";
Expand Down
2 changes: 1 addition & 1 deletion src/applications/appeals/testing/sc/sass/sc.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@department-of-veterans-affairs/formation/sass/shared-variables";
@import "~@department-of-veterans-affairs/css-library/dist/tokens/scss/variables";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-process-list";
@import "~@department-of-veterans-affairs/css-library/dist/stylesheets/modules/m-form-process";
@import "../../../../../platform/forms/sass/m-schemaform";
Expand Down
Loading