Skip to content

Commit

Permalink
Add a link to remove an author
Browse files Browse the repository at this point in the history
Refs #388
  • Loading branch information
thewilkybarkid committed Oct 20, 2022
1 parent 9237939 commit 23e1f57
Show file tree
Hide file tree
Showing 27 changed files with 78 additions and 51 deletions.
13 changes: 13 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,21 @@ html-editor {
padding-inline-start: 0;

& > * {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
align-items: baseline;
column-gap: var(--space-s-m);
border-block-end: var(--width-divider-narrow) solid var(--color-divider);
padding-block: var(--space-3xs-2xs);

& > :not(a) {
flex-grow: 1;
}

@media (min-width: 40em) {
flex-wrap: nowrap;
}
}

& + * {
Expand Down
4 changes: 2 additions & 2 deletions integration/posting-a-prereview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ test.extend(canAddAuthors)('can add other authors to the PREreview', async ({ fe
await expect(page.locator('h1')).toHaveText('You have added 3 other authors')
await expect(page).toHaveScreenshot()

await page.goto('/preprints/doi-10.1101-2022.01.13.476201/write-a-prereview/remove-author/1')
await page.click('role=link[name="Remove Otto Lidenbrock"]')

await expect(page.locator('h1')).toHaveText('Are you sure you want to remove Otto Lidenbrock?')
await expect(page).toHaveScreenshot()
Expand Down Expand Up @@ -1411,7 +1411,7 @@ test.extend(canAddAuthors)(
await page.click('text="Save and continue"')
await page.fill('role=textbox[name="Name"]', 'Jean-Baptiste Botul')
await page.click('text="Save and continue"')
await page.goto('/preprints/doi-10.1101-2022.01.13.476201/write-a-prereview/remove-author/0')
await page.click('role=link[name="Remove Jean-Baptiste Botul"]')

await page.click('text="Save and continue"')

Expand Down
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
16 changes: 15 additions & 1 deletion src/write-review/write-review-add-authors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
writeReviewAddAuthorsMatch,
writeReviewAuthorsMatch,
writeReviewMatch,
writeReviewRemoveAuthorMatch,
} from '../routes'
import { NonEmptyString } from '../string'
import { User, getUserFromSession } from '../user'
Expand Down Expand Up @@ -152,7 +153,20 @@ function addAuthorsForm(preprint: Preprint, authors: ReadonlyArray<{ name: NonEm
<h1>You have added ${authors.length} other author${authors.length !== 1 ? 's' : ''}</h1>
<ol class="summary-list">
${authors.map(({ name }) => html` <li>${name}</li>`)}
${authors.map(
({ name }, index) => html`
<li>
<span>${name}</span>
<a
href="${format(writeReviewRemoveAuthorMatch.formatter, {
doi: preprint.doi,
index,
})}"
>Remove<span class="visually-hidden"> ${name}</span></a
>
</li>
`,
)}
</ol>
<div ${rawHtml(E.isLeft(form.anotherAuthor) ? 'class="error"' : '')}>
Expand Down

0 comments on commit 23e1f57

Please sign in to comment.