Skip to content

Commit

Permalink
Merge pull request #3129 from ONSdigital/EAR-2482-Supplementary-data-…
Browse files Browse the repository at this point in the history
…text-change

EAR 2482 supplementary data text change
  • Loading branch information
Farhanam76 authored Oct 15, 2024
2 parents e974c7e + 36342e7 commit ecb9a8f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
22 changes: 13 additions & 9 deletions eq-author/src/App/dataSettings/SupplementaryDataPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,21 @@ const SupplementaryDataPage = () => {
};

if (surveyLoading) {
return <Loading height="100%">Dataset page is loading...</Loading>;
return (
<Loading height="100%"> Supplementary data page is loading...</Loading>
);
}

if (surveyError) {
return <Error>Dataset page error</Error>;
return <Error>Supplementary data page error</Error>;
}

return (
<>
<Modal
title="Unlink dataset"
title="Unlink dataset schema"
positiveButtonText="Unlink"
warningMessage="The dataset will be unlinked from the questionnaire. You will not be able to pipe data fields from this dataset. Any piped answers or example values will be deleted."
warningMessage="The dataset schema will be unlinked from the questionnaire. You will not be able to pipe data fields from this dataset schema. Any piped answers or example values will be deleted."
isOpen={showUnlinkModal}
onConfirm={() => unlinkDataset()}
onClose={() => setShowUnlinkModal(false)}
Expand Down Expand Up @@ -267,7 +269,8 @@ const SupplementaryDataPage = () => {
<Grid>
<Column gutters={false} cols={8}>
<Common.TabTitle>
Dataset for survey ID {tableData.surveyId}
Dataset schema for survey ID{" "}
{tableData.surveyId}
</Common.TabTitle>
</Column>
<Column gutters={false} cols={4}>
Expand All @@ -276,7 +279,7 @@ const SupplementaryDataPage = () => {
data-test="btn-unlink-dataset"
onClick={handleUnlinkClick}
>
Unlink dataset
Unlink dataset schema
</UnlinkButton>
</UnlinkButtonWrapper>
</Column>
Expand Down Expand Up @@ -311,9 +314,10 @@ const SupplementaryDataPage = () => {
</StyledTitle>
<Common.TabContent>
A respondent&apos;s answers to previous
questions are stored in supplementary datasets
as data fields. Data fields can be piped into
question and section pages using the toolbar.
questions are stored in supplementary dataset
schemas as data fields. Data fields can be piped
into question and section pages using the
toolbar.
</Common.TabContent>
<Common.TabContent>
Data fields are defined as either:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ describe("Supplementary dataset page", () => {
user,
mocks
);
expect(getByText("Dataset for survey ID 068")).toBeTruthy();
expect(getByText("Dataset schema for survey ID 068")).toBeTruthy();
expect(getByText("ID:")).toBeTruthy();
expect(getByText("Version:")).toBeTruthy();
expect(getByText("Date created:")).toBeTruthy();
Expand All @@ -246,7 +246,7 @@ describe("Supplementary dataset page", () => {
});

describe("Unlink dataset", () => {
it("should display the Unlink dataset modal", async () => {
it("should display the Unlink dataset schema modal", async () => {
useQuery.mockImplementation(() => ({
loading: false,
error: false,
Expand Down Expand Up @@ -315,7 +315,7 @@ describe("Supplementary dataset page", () => {
expect(queryByTestId("modal")).not.toBeInTheDocument();
});

it("should close the Unlink dataset modal", async () => {
it("should close the Unlink dataset schema modal", async () => {
useQuery.mockImplementationOnce(() => ({
loading: false,
error: false,
Expand Down
12 changes: 8 additions & 4 deletions eq-author/src/components/buttons/UnlinkButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const StyledUnlinkButton = styled(Button).attrs({
fill: ${colors.blue};
}
width: 11em;
width: 14em;
height: 2.5em;
align-items: center;
margin: 0 0 0 auto;
Expand All @@ -34,14 +34,18 @@ const StyledUnlinkButton = styled(Button).attrs({
`;

const UnlinkTooltip = ({ children }) => (
<Tooltip content="Unlink dataset" place="top" offset={{ top: 0, bottom: 10 }}>
<Tooltip
content="Unlink dataset schema"
place="top"
offset={{ top: 0, bottom: 10 }}
>
{children}
</Tooltip>
);

const UnlinkButton = ({
hideText,
iconText = "Unlink dataset",
iconText = "Unlink dataset schema",
...otherProps
}) => {
const Wrapper = hideText ? UnlinkTooltip : React.Fragment;
Expand All @@ -68,7 +72,7 @@ UnlinkButton.propTypes = {

UnlinkButton.defaultProps = {
hideText: false,
iconText: "Unlink dataset",
iconText: "Unlink dataset schema",
disabledIcon: false,
};

Expand Down

0 comments on commit ecb9a8f

Please sign in to comment.