Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EES-5656 Rename Admin 'Legacy releases' to 'Release order' #5442

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ export default function PublicationReleaseSeriesPage() {

return (
<LoadingSpinner loading={isLoading}>
<h2>Legacy releases</h2>
<h2>Release order</h2>

<p>Releases will be shown in the order below on the publication.</p>
<p>
Explore education statistics releases from this publication can also be
reordered, including those in draft status or with a draft amendment,
but cannot be edited or deleted. Only releases with a published version
will be shown on the publication.
Releases will be shown in the order below on the publication and can be
reordered.
</p>
<p>
Legacy releases which link to extenal pages outside the service can be
created, edited, deleted, and are included in the release order.
</p>
<p>
Only releases with a published version and legacy releases will appear
in the publication.
</p>

{canManageReleaseSeries && !isReordering && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('PublicationCreateReleaseSeriesLegacyLinkPage', () => {
).toBeInTheDocument();
expect(screen.getByRole('link', { name: 'Cancel' })).toHaveAttribute(
'href',
'/publication/publication-1/legacy',
'/publication/publication-1/releases/order',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('PublicationEditReleaseSeriesLegacyLinkPage', () => {
).toBeInTheDocument();
expect(screen.getByRole('link', { name: 'Cancel' })).toHaveAttribute(
'href',
'/publication/publication-1/legacy',
'/publication/publication-1/releases/order',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('PublicationPageContainer', () => {
expect(navLinks[3]).not.toHaveAttribute('aria-current');
expect(navLinks[4]).toHaveTextContent('Team access');
expect(navLinks[4]).not.toHaveAttribute('aria-current');
expect(navLinks[5]).toHaveTextContent('Legacy releases');
expect(navLinks[5]).toHaveTextContent('Release order');
expect(navLinks[5]).not.toHaveAttribute('aria-current');

expect(screen.getByText('Manage releases')).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('PublicationReleaseSeriesPage', () => {
publicationService.getReleaseSeries.mockResolvedValue(testReleaseSeries);

renderPage(testPublication);
expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

const table = screen.getByRole('table');
expect(within(table).getAllByRole('row')).toHaveLength(5);
Expand All @@ -52,7 +52,7 @@ describe('PublicationReleaseSeriesPage', () => {
publicationService.getReleaseSeries.mockResolvedValue([]);
renderPage(testPublication);

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

expect(
screen.getByText('No releases for this publication.'),
Expand All @@ -75,7 +75,7 @@ describe('PublicationReleaseSeriesPage', () => {
publicationService.getReleaseSeries.mockResolvedValue(testReleaseSeries);
renderPage(testPublication);

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

await user.click(
screen.getByRole('button', { name: 'Reorder releases' }),
Expand All @@ -101,7 +101,7 @@ describe('PublicationReleaseSeriesPage', () => {
publicationService.getReleaseSeries.mockResolvedValue(testReleaseSeries);
renderPage(testPublication);

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

await user.click(
screen.getByRole('button', { name: 'Reorder releases' }),
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('PublicationReleaseSeriesPage', () => {
).not.toBeInTheDocument();
});

test('does not show button to reorder when user does not have permission to manage legacy releases', async () => {
test('does not show button to reorder when user does not have permission to manage the release series', async () => {
publicationService.getReleaseSeries.mockResolvedValue(testReleaseSeries);
renderPage({
...testPublication,
Expand All @@ -140,7 +140,7 @@ describe('PublicationReleaseSeriesPage', () => {
},
});

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

expect(
screen.queryByRole('button', { name: 'Reorder releases' }),
Expand All @@ -161,7 +161,7 @@ describe('PublicationReleaseSeriesPage', () => {
]);
renderPage(testPublication);

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

await user.click(
screen.getByRole('button', { name: 'Delete Legacy link 1' }),
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('PublicationReleaseSeriesPage', () => {
);
renderPage(testPublication);

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

await user.click(
screen.getByRole('button', { name: 'Create legacy release' }),
Expand Down Expand Up @@ -248,7 +248,7 @@ describe('PublicationReleaseSeriesPage', () => {
</Router>,
);

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

await user.click(
screen.getByRole('button', { name: 'Create legacy release' }),
Expand All @@ -261,12 +261,12 @@ describe('PublicationReleaseSeriesPage', () => {
);
await waitFor(() => {
expect(history.location.pathname).toBe(
`/publication/${testPublication.id}/legacy/create`,
`/publication/${testPublication.id}/releases/legacy/create`,
);
});
});

test('does not show button to create when user does not have permission to manage legacy releases', async () => {
test('does not show button to create when user does not have permission to manage the release series', async () => {
publicationService.getReleaseSeries.mockResolvedValueOnce(
testReleaseSeries,
);
Expand All @@ -278,7 +278,7 @@ describe('PublicationReleaseSeriesPage', () => {
},
});

expect(await screen.findByText('Legacy releases')).toBeInTheDocument();
expect(await screen.findByText('Release order')).toBeInTheDocument();

expect(
screen.queryByRole('button', { name: 'Create legacy release' }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ describe('ReleaseSeriesTable', () => {

await waitFor(() => {
expect(history.location.pathname).toBe(
`/publication/${testPublicationId}/legacy/${testReleaseSeries[3].id}/edit`,
`/publication/${testPublicationId}/releases/legacy/${testReleaseSeries[3].id}/edit`,
);
});
});
});

test('does not show edit and delete actions when user does not have permission to manage legacy releases', () => {
test('does not show edit and delete actions when user does not have permission to manage the release series', () => {
render(
<TestConfigContextProvider>
<ReleaseSeriesTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,21 @@ export const publicationInviteUsersPageRoute: PublicationRouteProps = {
};

export const publicationReleaseSeriesRoute: PublicationRouteProps = {
path: '/publication/:publicationId/legacy',
title: 'Legacy releases',
path: '/publication/:publicationId/releases/order',
title: 'Release order',
component: PublicationReleaseSeriesPage,
};

export const publicationCreateReleaseSeriesLegacyLinkRoute: PublicationRouteProps =
{
path: '/publication/:publicationId/legacy/create',
path: '/publication/:publicationId/releases/legacy/create',
title: 'Create legacy release',
component: PublicationCreateReleaseSeriesLegacyLinkPage,
};

export const publicationEditReleaseSeriesLegacyLinkRoute: PublicationRouteProps =
{
path: '/publication/:publicationId/legacy/:releaseSeriesItemId/edit',
path: '/publication/:publicationId/releases/legacy/:releaseSeriesItemId/edit',
title: 'Edit legacy release',
component: PublicationEditReleaseSeriesLegacyLinkPage,
};
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Navigate to Seed Data Theme 1 Publication 1 page
user clicks link ${PUPIL_ABSENCE_PUBLICATION_TITLE}
user waits until h1 is visible ${PUPIL_ABSENCE_PUBLICATION_TITLE}

Navigate to legacy releases
user clicks link Legacy releases
user waits until h2 is visible Legacy releases
Navigate to publication release order
user clicks link Release order
user waits until h2 is visible Release order

Validate Analyst1 can see correct legacy releases
user checks element count is x css:tbody tr 7
Validate Analyst1 can see correct publication release order
user checks table body has x rows 7 testid:release-series

user checks table cell contains 1 1 Academic year 2016/17
user checks table cell contains 1 2
Expand Down Expand Up @@ -81,8 +81,8 @@ Validate Analyst1 can see correct legacy releases
Check Analyst1 cannot create a legacy release
user checks page does not contain button Create legacy release

Check Analyst1 cannot reorder legacy releases
user checks page does not contain button Reorder legacy releases
Check Analyst1 cannot reorder releases
user checks page does not contain button Reorder releases

Check Analyst1 cannot edit a legacy release
user checks page does not contain button Edit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ Validates publication approver publication page is correct
user waits until page contains link Releases
user waits until page contains link Methodologies
user waits until page contains link Team access
user waits until page contains link Legacy releases # remove as part of EES-3794
user waits until page contains link Release order

user checks page does not contain link Details
user checks page does not contain link Contact

Check cannot create a legacy release
user clicks link Legacy releases
user waits until h2 is visible Legacy releases
Check cannot reorder releases
user clicks link Release order
user waits until h2 is visible Release order
user checks page does not contain button Reorder releases

Check cannot create legacy releases
user checks page does not contain button Create legacy release

Check cannot create a Methodology for a Publication if they don't have Publication Owner role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ Navigate to Publication where analyst has Publication Owner role
user waits until page contains link Details
user waits until page contains link Contact
user waits until page contains link Team access
user waits until page contains link Legacy releases
user waits until page contains link Release order

Check can create a legacy release
user clicks link Legacy releases
user waits until h2 is visible Legacy releases
Check can reorder releases
user clicks link Release order
user waits until h2 is visible Release order
user checks page contains button Reorder releases

Check can create legacy releases
user checks page contains button Create legacy release

Check can create a Methodology for the owned Publication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ Validates release approver publication page is correct
user waits until page contains link Releases
user waits until page contains link Methodologies
user waits until page contains link Team access
user waits until page contains link Legacy releases # remove as part of EES-3794
user waits until page contains link Release order

user checks page does not contain link Details
user checks page does not contain link Contact

Check cannot create a legacy release
user clicks link Legacy releases
user waits until h2 is visible Legacy releases
Check cannot reorder releases
user clicks link Release order
user waits until h2 is visible Release order
user checks page does not contain button Reorder releases

Check cannot create legacy releases
user checks page does not contain button Create legacy release

Check cannot create a Methodology for a Publication if they don't have Publication Owner role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ Validates release contributor publication page is correct
user waits until page contains link Releases
user waits until page contains link Methodologies
user waits until page contains link Team access
user waits until page contains link Legacy releases # remove as part of EES-3794
user waits until page contains link Release order

user checks page does not contain link Details
user checks page does not contain link Contact

Check cannot create a legacy release
user clicks link Legacy releases
user waits until h2 is visible Legacy releases
Check cannot reorder releases
user clicks link Release order
user waits until h2 is visible Release order
user checks page does not contain button Reorder releases

Check cannot create legacy releases
user checks page does not contain button Create legacy release

Check cannot create a Methodology for a Publication if they don't have Publication Owner role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ Validates release viewer publication page is correct
user waits until page contains link Releases
user waits until page contains link Methodologies
user waits until page contains link Team access
user waits until page contains link Legacy releases # remove as part of EES-3794
user waits until page contains link Release order

user checks page does not contain link Details
user checks page does not contain link Contact

Check cannot create a legacy release
user clicks link Legacy releases
user waits until h2 is visible Legacy releases
Check cannot reorder releases
user clicks link Release order
user waits until h2 is visible Release order
user checks page does not contain button Reorder releases

Check cannot create legacy releases
user checks page does not contain button Create legacy release

Check cannot create a Methodology for a Publication if they don't have Publication Owner role
Expand Down
Loading
Loading