-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2866 from uktrade/refactor/react-structure
Restructure React files and folders
- Loading branch information
Showing
22 changed files
with
324 additions
and
216 deletions.
There are no files selected for viewing
8 changes: 6 additions & 2 deletions
8
...es/visualisations.075f927baa6dcfd40c82.js → .../bundles/data-cut.8325cefe01a5ba09d327.js
Large diffs are not rendered by default.
Oops, something went wrong.
126 changes: 126 additions & 0 deletions
126
dataworkspace/dataworkspace/static/js/bundles/home-page.69ad1290d9301736a900.js
Large diffs are not rendered by default.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
dataworkspace/dataworkspace/static/js/bundles/home-page.cd5e94fe0aa6a2519e83.js
This file was deleted.
Oops, something went wrong.
8 changes: 6 additions & 2 deletions
8
...es/source-dataset.5125d85d094c65901bff.js → ...reference-dataset.1c7a0378492a75c58f2a.js
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 6 additions & 2 deletions
8
.../bundles/data-cut.7045d2b3ec8c90b61142.js → ...es/source-dataset.2a80964648d265bb8ace.js
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 6 additions & 2 deletions
8
...reference-dataset.6ef9c65e0b8fb280cfb4.js → ...es/visualisations.008e97864b4973ced8d8.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...bundles/yourfiles.e2bc2c191bb58d5225cb.js → ...undles/your-files.d094751fcc1567801a41.js
Large diffs are not rendered by default.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
dataworkspace/dataworkspace/static/js/react/components/OtherSupport/index.tsx
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
dataworkspace/dataworkspace/static/js/react/components/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as DataDisplay } from './DataDisplay'; | ||
export { default as FetchDataContainer } from './FetchDataContainer'; | ||
export { default as Tile } from './Tile'; |
2 changes: 1 addition & 1 deletion
2
dataworkspace/dataworkspace/static/js/react/features/home-page/HomePage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
dataworkspace/dataworkspace/static/js/react/features/support-you/SupportYou.stories.tsx
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
dataworkspace/dataworkspace/static/js/react/features/support-you/SupportYou.test.tsx
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
dataworkspace/dataworkspace/static/js/react/features/support/Support.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import SupportYou from './Support'; | ||
|
||
const meta = { | ||
title: 'Support You feature', | ||
component: SupportYou | ||
} satisfies Meta<typeof SupportYou>; | ||
|
||
type Story = StoryObj<typeof SupportYou>; | ||
|
||
export const WithTiles: Story = { | ||
render: () => <SupportYou /> | ||
}; | ||
|
||
export default meta; |
19 changes: 19 additions & 0 deletions
19
dataworkspace/dataworkspace/static/js/react/features/support/Support.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { render } from '@testing-library/react'; | ||
|
||
import Support from './Support'; | ||
|
||
describe('Support', () => { | ||
it('renders a H2 header', () => { | ||
const { getByRole } = render(<Support />); | ||
const header = getByRole('heading', { | ||
level: 2, | ||
name: 'How can we support you?' | ||
}); | ||
expect(header).toBeInTheDocument(); | ||
}); | ||
it('renders TilesContainer with GetHelp and OtherSupport components', () => { | ||
const { queryAllByRole } = render(<Support />); | ||
const headers = queryAllByRole('heading', { level: 3 }); | ||
expect(headers.length).toBe(2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
58 changes: 58 additions & 0 deletions
58
...orkspace/dataworkspace/static/js/react/features/support/components/OtherSupport/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
|
||
import { SPACING_POINTS } from '@govuk-react/constants'; | ||
import { typography } from '@govuk-react/lib'; | ||
import Link from '@govuk-react/link'; | ||
import { H4 } from 'govuk-react'; | ||
import styled from 'styled-components'; | ||
|
||
import { Tile } from '../../../../components'; | ||
|
||
const StyledParagraph = styled('p')` | ||
margin: 0 0 ${SPACING_POINTS[5]}px 0; | ||
${typography.font({ size: 16 })}; | ||
&:last-child { | ||
margin-bottom: 0; | ||
} | ||
`; | ||
|
||
const hrefToSupport = ` | ||
https://data.trade.gov.uk/support-and-feedback/ | ||
`; | ||
const hrefToCommunityChannel = ` | ||
https://teams.microsoft.com/l/team/19%3Ac1f08445f252403982e22a3 | ||
87b30b4ca%40thread.skype/conversations?groupId=748264d0-f2a0-4e | ||
13-afa0-22c152ea7cb9&tenantId=8fa217ec-33aa-46fb-ad96-dfe68006b | ||
b86 | ||
`; | ||
const hrefToTeamsChannel = ` | ||
https://data-services-help.trade.gov.uk/data-workspace/updates/ | ||
`; | ||
|
||
const OtherSupport: React.FC = () => { | ||
return ( | ||
<Tile title="Other ways of support"> | ||
<H4 size={'SMALL'}>Message</H4> | ||
<StyledParagraph> | ||
<Link href={hrefToSupport}>Contact us</Link> if you have a question, | ||
problem or suggestion. | ||
</StyledParagraph> | ||
<H4 size={'SMALL'}>Community</H4> | ||
<StyledParagraph> | ||
Join the{' '} | ||
<Link href={hrefToCommunityChannel}> | ||
Data Workspace community channel | ||
</Link>{' '} | ||
on Microsoft Teams to connect with colleagues. | ||
</StyledParagraph> | ||
<H4 size={'SMALL'}>Work</H4> | ||
<StyledParagraph> | ||
Find out what we are working on by visiting{' '} | ||
<Link href={hrefToTeamsChannel}>What's new page</Link> | ||
</StyledParagraph> | ||
</Tile> | ||
); | ||
}; | ||
|
||
export default OtherSupport; |
110 changes: 55 additions & 55 deletions
110
dataworkspace/dataworkspace/static/js/stats/react_apps-stats.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.