Skip to content

Commit cbb44be

Browse files
[DUOS-2860] Remove duplicate display of profile and lc warning in DAR form (#2444)
1 parent 160e204 commit cbb44be

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

cypress/component/DataAccessRequest/researcher_info.spec.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,22 @@ describe('Researcher Info', () => {
8787
it('renders the missing library cards alert correctly', () => {
8888
const mergedProps = {...props, ...{formData: {...props.formData }}};
8989
mount(<WrappedResearcherInfo {...mergedProps}/>);
90-
cy.get('[dataCy=researcher-info-missing-library-cards]').should('be.visible');
9190
cy.get('[dataCy=researcher-info-profile-unsubmitted]').should('not.exist');
92-
cy.get('[dataCy=researcher-info-profile-submitted]').should('not.exist');
91+
cy.get('[dataCy=researcher-info-profile-submitted]').should('be.visible');
9392
});
9493

9594
it('renders the profile submitted alert', () => {
9695
const mergedProps = {...props, ...{completed: true, researcher: researcherWithLibraryCards}};
9796
mount(<WrappedResearcherInfo {...mergedProps}/>);
9897
cy.get('[dataCy=researcher-info-profile-submitted]').should('be.visible');
9998
cy.get('[dataCy=researcher-info-profile-unsubmitted]').should('not.exist');
100-
cy.get('[dataCy=researcher-info-missing-library-cards]').should('not.exist');
10199
});
102100

103101
it('renders the profile unsubmitted alert', () => {
104102
const mergedProps = {...props, ...{completed: false, researcher: researcherWithLibraryCards}};
105103
mount(<WrappedResearcherInfo {...mergedProps}/>);
106104
cy.get('[dataCy=researcher-info-profile-unsubmitted]').should('be.visible');
107-
cy.get('[dataCy=researcher-info-profile-submitted]').should('not.exist');
108-
cy.get('[dataCy=researcher-info-missing-library-cards]').should('not.exist');
105+
cy.get('[dataCy=researcher-info-profile-submitted]').should('be.visible');
109106
});
110107

111108
it('renders the internal lab staff button and form', () => {

src/pages/dar_application/ResearcherInfo.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const profileLink = h(Link, {to:'/profile', style: linkStyle}, ['Your Profile'])
1313
const profileUnsubmitted = span(['Please submit ', profileLink, ' to be able to create a Data Access Request']);
1414
const profileSubmitted = span(['Please make sure ', profileLink, ' is updated as it will be used to pre-populate parts of the Data Access Request']);
1515
const libraryCardLink = a({href: 'https://broad-duos.zendesk.com/hc/en-us/articles/4402736994971-Researcher-FAQs', style: linkStyle, target: '_blank'}, ['Library Card']);
16-
const missingLibraryCard = span(['You must submit ', profileLink, ' and obtain a ', libraryCardLink, ' from your Signing Official before you can submit a Data Access Request']);
1716

1817
export default function ResearcherInfo(props) {
1918
const {
@@ -58,11 +57,11 @@ export default function ResearcherInfo(props) {
5857
div({ className: 'dar-step-card' }, [
5958
div({
6059
datacy: 'researcher-info-profile-submitted',
61-
isRendered: (completed === false && libraryCardReqSatisfied === false), className: 'rp-alert' }, [
60+
isRendered: (completed === false || libraryCardReqSatisfied === false)}, [
6261
!readOnlyMode && Alert({
6362
id: 'profileSubmitted',
64-
type: 'important',
65-
title: span([
63+
type: 'danger',
64+
title: span({ className: 'errored' }, [
6665
`You must submit `, profileLink, ` and obtain a `, libraryCardLink,
6766
` from your Signing official before you can submit a Data Access Request.`
6867
])
@@ -103,11 +102,6 @@ export default function ResearcherInfo(props) {
103102
})
104103
]),
105104
fieldset({ }, [
106-
div({
107-
datacy: 'researcher-info-missing-library-cards',
108-
isRendered: libraryCardReqSatisfied === false, className: 'rp-alert' }, [
109-
!readOnlyMode && Alert({ id: 'missingLibraryCard', type: 'danger', title: missingLibraryCard })
110-
]),
111105
div({
112106
datacy: 'researcher-info-profile-unsubmitted',
113107
isRendered: (completed === false && libraryCardReqSatisfied === true), className: 'rp-alert' }, [

0 commit comments

Comments
 (0)