Skip to content

Commit

Permalink
Merge pull request #7275 from uktrade/fix/no-exports
Browse files Browse the repository at this point in the history
Refine messaging for users with no export projects
  • Loading branch information
paulgain authored Nov 8, 2024
2 parents 25c1389 + f4e82fd commit 2d9f79b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/client/components/DataHubFeed/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Date = styled('div')({

const DataHubFeed = ({ items, feedLimit = 5 }) => (
<FeedContainer>
<H3>"What's new"</H3>
<H3>What's new?</H3>
{!!items.length && (
<>
<UnorderedList listStyleType="none">
Expand Down
40 changes: 14 additions & 26 deletions src/client/modules/ExportPipeline/ExportList/index.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from 'react'
import { useNavigate } from 'react-router-dom'
import { HEADING_SIZES, FONT_SIZE, MEDIA_QUERIES } from '@govuk-react/constants'
import { HEADING_SIZES, MEDIA_QUERIES } from '@govuk-react/constants'
import { UnorderedList, ListItem, H2, Button } from 'govuk-react'
import styled from 'styled-components'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import qs from 'qs'

import ContentWithHeading from '../../../components/ContentWithHeading'
import { ButtonLink, Pagination } from '../../../components'
import { MID_GREY } from '../../../utils/colours'
import { SHOW_ALL_OPTION } from '../constants.js'
Expand Down Expand Up @@ -37,10 +36,8 @@ const StyledResultCount = styled('span')({
lineHeight: 1,
})

const StyledContent = styled.div({
display: 'flex',
flexDirection: 'column',
rowGap: FONT_SIZE.SIZE_20,
const StyledParagraph = styled.p({
marginTop: 15,
})

const FiltersContainer = styled('div')({
Expand Down Expand Up @@ -213,26 +210,17 @@ const ExportList = ({
<>
{hasZeroExports ? (
<div data-test="no-export-items">
<ContentWithHeading
data-test="no-export-items"
heading="You have no exports"
>
<StyledContent>
<div>
Here you can create an export project to track a company's
export progress. These will appear on your home page, so
you keep track of your exports in one place.
</div>
<span>To add an export:</span>
<div>
<UnorderedList listStyleType="bullet">
<ListItem>go to the company page</ListItem>
<ListItem>select 'Add export project' button</ListItem>
</UnorderedList>
</div>
</StyledContent>
<ExportWinsLink />
</ContentWithHeading>
<StyledParagraph>
Here you can create an export project to track a company's
export progress. These will appear on your home page, so you
keep track of your exports in one place.
</StyledParagraph>
<p>To add an export:</p>
<UnorderedList listStyleType="bullet">
<ListItem>go to the company page</ListItem>
<ListItem>select 'Add export project' button</ListItem>
</UnorderedList>
<ExportWinsLink />
</div>
) : (
<ListContainer>
Expand Down
2 changes: 1 addition & 1 deletion test/functional/cypress/specs/dashboard/dashboard-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Dashboard', () => {
})

it('should display the correct heading', () => {
cy.get('@dataHubFeed').find('h3').should('have.text', '"What\'s new"')
cy.get('@dataHubFeed').find('h3').should('have.text', "What's new?")
})

it('should display the info feed list', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/functional/cypress/specs/dashboard/data-hub-feed-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Dashboard - Data Hub feed', () => {
})

it('Should contain a header and no updates available text', () => {
cy.get('@dataHubFeed').find('h3').should('have.text', '"What\'s new"')
cy.get('@dataHubFeed').find('h3').should('have.text', "What's new?")

cy.get('@dataHubFeed')
.find('p')
Expand Down Expand Up @@ -45,7 +45,7 @@ describe('Dashboard - Data Hub feed', () => {
})

it('should display only one feed item', () => {
cy.get('@dataHubFeed').find('h3').should('have.text', '"What\'s new"')
cy.get('@dataHubFeed').find('h3').should('have.text', "What's new?")

cy.get('@dataHubFeed')
.find('[data-test="data-hub-feed-link-0"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ describe('Export pipeline list', () => {
})

it('should display the empty results message', () => {
cy.get('[data-test=no-export-items]').should('exist')
cy.get('[data-test=export-export]').should('not.exist')
})
})
Expand Down

0 comments on commit 2d9f79b

Please sign in to comment.