-
Notifications
You must be signed in to change notification settings - Fork 7
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 #2755 from ONSdigital/EAR-1822-add-decomm-banner
Ear 1822 add decomm banner
- Loading branch information
Showing
9 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
|
@@ -112,4 +112,48 @@ describe("QuestionnairesPage", () => { | |
|
||
expect(getByText("UKIS")).toBeTruthy(); | ||
}); | ||
|
||
it("should display warning banner message", async () => { | ||
const { getByText } = renderQuestionnairesPage({ | ||
mocks: [ | ||
{ | ||
request: { | ||
query: QUESTIONNAIRES_QUERY, | ||
}, | ||
result: { | ||
data: { | ||
questionnaires: [ | ||
{ | ||
id: "123", | ||
title: "UKIS", | ||
shortTitle: null, | ||
starred: false, | ||
updatedAt: Date.now().toString(), | ||
createdAt: Date.now().toString(), | ||
displayName: "UKIS", | ||
permission: WRITE, | ||
publishStatus: UNPUBLISHED, | ||
createdBy: { | ||
id: "1", | ||
name: "A Dude", | ||
email: "[email protected]", | ||
displayName: "A Dude", | ||
__typename: "User", | ||
}, | ||
locked: false, | ||
__typename: "Questionnaire", | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
await act(async () => { | ||
await flushPromises(); | ||
}); | ||
|
||
expect(getByText("Action required")).toBeTruthy(); | ||
}); | ||
}); |
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
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
4 changes: 4 additions & 0 deletions
4
eq-author/src/components/WarningBanner/icon-external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,75 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import { colors } from "constants/theme"; | ||
import IconText from "components/IconText"; | ||
import WarningIcon from "./icon-warning.svg?inline"; | ||
import ExternalLinkIcon from "./icon-external-link.svg"; | ||
|
||
const Banner = styled.div` | ||
background-color: ${colors.red}; | ||
height: 7em; | ||
display: flex; | ||
`; | ||
|
||
const WarningMessage = styled(IconText)` | ||
display: flex; | ||
color: ${colors.white}; | ||
padding: 1em; | ||
margin-bottom: 2.7em; | ||
font-weight: bold; | ||
width: 20em; | ||
font-size: 1.2em; | ||
`; | ||
|
||
const BannerMessageContainer = styled.div` | ||
color: ${colors.white}; | ||
display: flex; | ||
flex-direction: column; | ||
width: 100em; | ||
font-weight: bold; | ||
margin-top: 1em; | ||
`; | ||
|
||
const Content = styled.div` | ||
line-height: 1.7em; | ||
`; | ||
|
||
const Link = styled.a` | ||
color: ${colors.white}; | ||
[target="_blank"]&:after { | ||
content: url(${ExternalLinkIcon}); | ||
margin-left: 5px; | ||
} | ||
`; | ||
|
||
const WarningBanner = () => { | ||
return ( | ||
<Banner> | ||
<WarningMessage icon={WarningIcon}>Action required</WarningMessage> | ||
<BannerMessageContainer> | ||
<Content> | ||
Author has migrated and this page will be turned off shortly. | ||
</Content> | ||
<Content> | ||
Please use latest version of Author: | ||
<Link | ||
href="https://author.eqbs.gcp.onsdigital.uk/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
https://author.eqbs.gcp.onsdigital.uk/ | ||
</Link> | ||
</Content> | ||
<Content> | ||
If you have any questions please contact the Author team at | ||
<Link href="mailto:[email protected]"> | ||
[email protected] | ||
</Link> | ||
</Content> | ||
</BannerMessageContainer> | ||
</Banner> | ||
); | ||
}; | ||
|
||
export default WarningBanner; |