Skip to content

Commit 4f780b5

Browse files
authored
Merge pull request #209 from istex/feat/172-author-affiliation
Feat(authors): display affiliation and move to main content
2 parents 3f7c1ac + 2f64ecf commit 4f780b5

37 files changed

Lines changed: 1125 additions & 1134 deletions

docs/supported-tags.md

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,76 @@ This document lists all TEI tags supported by the istex-view viewer.
99
- **Bibref**: Bibliographic references sidebar section
1010
- **Authors**: Authors sidebar section
1111
- **Source**: Source sidebar section
12-
- **\***: Supported in all applicable sections
12+
- **Keywords**: Keywords sidebar section
13+
- **Figure**: Inside figure elements
14+
- **FloatingText**: Inside floating text elements
1315

1416
## All Supported Tags
1517

1618
| Tag | Description | Sections | Component |
1719
| --- | ----------- | -------- | --------- |
18-
| `addName` | Additional name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/SidePanel/authors/PersNamePart.tsx) |
19-
| `affiliation` | Author affiliation | Authors | Nothing |
20-
| `author` | Author element | Bibref | NoOp |
20+
| `addName` | Additional name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/authors/tags/PersNamePart.tsx) |
21+
| `address` | Physical address | Authors | [Address.tsx](../packages/react-tei/src/authors/tags/Address.tsx) |
22+
| `addrLine` | Address line | Authors | NoOp |
23+
| `affiliation` | Author affiliation | Authors | [Affiliation.tsx](../packages/react-tei/src/authors/tags/Affiliation.tsx) |
24+
| `author` | Author element | Authors, Bibref | [Author.tsx](../packages/react-tei/src/authors/tags/Author.tsx) / NoOp |
2125
| `bibl` | Bibliographic reference | Body, Bibref | [Bibl.tsx](../packages/react-tei/src/SidePanel/bibliographicReferences/Bibl.tsx) |
22-
| `biblScope` | Bibliographic scope (volume, pages, etc.) | Body, Bibref | NoOp |
26+
| `biblScope` | Bibliographic scope (volume, pages, etc.) | Body, Bibref, Source | NoOp |
2327
| `biblStruct` | Structured bibliographic reference | Bibref | [BiblStruct.tsx](../packages/react-tei/src/SidePanel/bibliographicReferences/BiblStruct.tsx) |
24-
| `body` | Document body container | Body | NoOp |
25-
| `date` | Date element | Body, Footnotes, Bibref | [DateTag.tsx](../packages/react-tei/src/tags/DateTag.tsx) |
28+
| `bloc` | Address block | Authors | NoOp |
29+
| `body` | Document body container | Body, FloatingText | NoOp |
30+
| `city` | City name | Authors | NoOp |
31+
| `country` | Country name | Authors | NoOp |
32+
| `date` | Date element | Body, Footnotes, Bibref, Source | [DateTag.tsx](../packages/react-tei/src/tags/DateTag.tsx) |
33+
| `district` | District name | Authors | NoOp |
2634
| `div` | Division/section | Body | [Div.tsx](../packages/react-tei/src/tags/Div.tsx) |
2735
| `email` | Email address | Authors | Nothing |
2836
| `emph` | Emphasized text | Body, Footnotes, Bibref | [Emph.tsx](../packages/react-tei/src/tags/Emph.tsx) |
37+
| `figDesc` | Figure description | Figure | [FigDesc.tsx](../packages/react-tei/src/tags/figure/FigDesc.tsx) |
2938
| `figure` | Figure with graphics or tables | Body | [Figure.tsx](../packages/react-tei/src/tags/Figure.tsx) |
3039
| `floatingText` | Floating text element | Body | [FloatingText.tsx](../packages/react-tei/src/tags/floatingText/FloatingText.tsx) |
31-
| `forename` | First name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/SidePanel/authors/PersNamePart.tsx) |
40+
| `forename` | First name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/authors/tags/PersNamePart.tsx) / NoOp |
3241
| `formula` | Mathematical formula with notation or rendering | Body, Footnotes, Bibref | [Formula.tsx](../packages/react-tei/src/tags/Formula.tsx) |
33-
| `genName` | Generational name (Jr., Sr., etc.) | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/SidePanel/authors/PersNamePart.tsx) |
42+
| `genName` | Generational name (Jr., Sr., etc.) | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/authors/tags/PersNamePart.tsx) / NoOp |
3443
| `graphic` | Graphic element (used in formulas) | Body, Footnotes, Bibref | [Graphic.tsx](../packages/react-tei/src/tags/Graphic.tsx) |
35-
| `head` | Heading element | Body | [Head.tsx](../packages/react-tei/src/tags/Head.tsx) |
36-
| `hi` | Highlighted text (various renditions) | Body, Footnotes, Bibref | [Hi.tsx](../packages/react-tei/src/tags/Hi.tsx) |
37-
| `highlight` | Enrichment highlight | Body | [Highlight.tsx](../packages/react-tei/src/tags/Highlight.tsx) |
38-
| `highlightedText` | Text highlighted by enrichment | Body | NoOp |
39-
| `idno` | Identifier number | Source | [SourceIdno.tsx](../packages/react-tei/src/SidePanel/source/SourceIdno.tsx) |
44+
| `head` | Heading element | Body, Figure, FloatingText, Keywords | [Head.tsx](../packages/react-tei/src/tags/Head.tsx) / [FloatingTextHead.tsx](../packages/react-tei/src/tags/floatingText/FloatingTextHead.tsx) / Nothing |
45+
| `hi` | Highlighted text (various renditions) | Body, Footnotes, Bibref, Figure, Keywords | [Hi.tsx](../packages/react-tei/src/tags/Hi.tsx) |
46+
| `highlight` | Enrichment highlight | Body, Figure | [Highlight.tsx](../packages/react-tei/src/tags/Highlight.tsx) |
47+
| `highlightedText` | Text highlighted by enrichment | Body, Figure | NoOp |
48+
| `idno` | Identifier number | Authors, Source | [SourceIdno.tsx](../packages/react-tei/src/SidePanel/source/tags/SourceIdno.tsx) / Nothing |
49+
| `imprint` | Imprint information | Source | [SourceImprint.tsx](../packages/react-tei/src/SidePanel/source/tags/SourceImprint.tsx) |
50+
| `item` | List item | Body, Keywords | NoOp |
51+
| `keywords` | Keywords section | Keywords | [Keywords.tsx](../packages/react-tei/src/SidePanel/keywords/Keywords.tsx) |
4052
| `l` | Line (in verse) | Footnotes | [L.tsx](../packages/react-tei/src/tags/L.tsx) |
53+
| `label` | Label element | Figure | [Head.tsx](../packages/react-tei/src/tags/figure/Head.tsx) |
4154
| `lg` | Line group (verse stanza) | Footnotes | [Lg.tsx](../packages/react-tei/src/tags/Lg.tsx) |
42-
| `list` | List element (ordered/unordered) | Body | [List.tsx](../packages/react-tei/src/tags/list/List.tsx) |
55+
| `list` | List element (ordered/unordered) | Body, Keywords | [List.tsx](../packages/react-tei/src/tags/list/List.tsx) / NoOp |
4356
| `math` | MathML root element | Body, Footnotes, Bibref | [MathMLTag.tsx](../packages/react-tei/src/tags/formula/mathml/MathMLTag.tsx) |
4457
| MathML tags | All MathML tags (203 total) | Body, Footnotes, Bibref | [MathMLTag.tsx](../packages/react-tei/src/tags/formula/mathml/MathMLTag.tsx) |
45-
| `name` | Generic name element | Authors, Bibref | [Name.tsx](../packages/react-tei/src/SidePanel/authors/Name.tsx) |
46-
| `nameLink` | Name linking particle (de, von, etc.) | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/SidePanel/authors/PersNamePart.tsx) |
47-
| `note` | Note/footnote element | Footnotes, Bibref | [Note.tsx](../packages/react-tei/src/SidePanel/footNotes/Note.tsx) |
48-
| `orgName` | Organization name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/SidePanel/authors/PersNamePart.tsx) |
58+
| `name` | Generic name element | Authors, Bibref | [Name.tsx](../packages/react-tei/src/authors/tags/Name.tsx) / NoOp |
59+
| `nameLink` | Name linking particle (de, von, etc.) | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/authors/tags/PersNamePart.tsx) / NoOp |
60+
| `note` | Note/footnote element | Footnotes, Bibref | [Note.tsx](../packages/react-tei/src/SidePanel/footNotes/Note.tsx) / NoOp |
61+
| `orgName` | Organization name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/authors/tags/PersNamePart.tsx) / NoOp |
4962
| `p` | Paragraph | Body, Footnotes | [P.tsx](../packages/react-tei/src/tags/P.tsx) |
50-
| `persName` | Personal name | Authors, Bibref | [PersName.tsx](../packages/react-tei/src/SidePanel/authors/PersName.tsx) |
63+
| `persName` | Personal name | Authors, Bibref | [PersName.tsx](../packages/react-tei/src/SidePanel/bibliographicReferences/PersName.tsx) / NoOp |
64+
| `postBox` | Post office box | Authors | NoOp |
65+
| `postCode` | Postal code | Authors | NoOp |
5166
| `pubPlace` | Publication place | Bibref | NoOp |
52-
| `publisher` | Publisher | Bibref | NoOp |
67+
| `publisher` | Publisher | Bibref, Source | NoOp |
5368
| `quote` | Quoted text block | Body, Footnotes, Bibref | [Quote.tsx](../packages/react-tei/src/tags/Quote.tsx) |
5469
| `ref` | Reference (footnote, bibliographic, URL, table) | Body, Footnotes, Bibref | [Ref.tsx](../packages/react-tei/src/tags/Ref.tsx) |
55-
| `roleName` | Role name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/SidePanel/authors/PersNamePart.tsx) |
70+
| `region` | Region name | Authors | NoOp |
71+
| `roleName` | Role name | Authors, Bibref | Nothing / NoOp |
5672
| `s` | Sentence | Body | NoOp |
5773
| `sc` | Small capitals | Body | NoOp |
5874
| `series` | Series information | Bibref | NoOp |
59-
| `surname` | Last name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/SidePanel/authors/PersNamePart.tsx) |
75+
| `settlement` | Settlement name | Authors | NoOp |
76+
| `state` | State name | Authors | NoOp |
77+
| `street` | Street name | Authors | NoOp |
78+
| `surname` | Last name | Authors, Bibref | [PersNamePart.tsx](../packages/react-tei/src/authors/tags/PersNamePart.tsx) / NoOp |
6079
| `table` | Table element | Body | [Table.tsx](../packages/react-tei/src/tags/Table.tsx) |
61-
| `title` | Title element | Body, Bibref | [Title.tsx](../packages/react-tei/src/tags/Title.tsx) |
80+
| `term` | Keyword term | Keywords | [Term.tsx](../packages/react-tei/src/SidePanel/keywords/Term.tsx) |
81+
| `title` | Title element | Body, Bibref | [Title.tsx](../packages/react-tei/src/tags/Title.tsx) / NoOp |
6282

6383
See [mathMLTagNames.ts](../packages/react-tei/src/tags/formula/mathml/mathMLTagNames.ts) for the complete list of 203 supported MathML tags.
6484

packages/e2e/src/authors.spec.ts

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import { expect, test } from "@playwright/test";
2+
import { launchViewer, uploadFile } from "./support/upload";
3+
4+
test("authors section", async ({ page }) => {
5+
await page.goto("/");
6+
7+
await uploadFile(page, "document.tei");
8+
await launchViewer(page);
9+
10+
const authorButton = page.getByRole("button", { name: "Auteurs" });
11+
await expect(authorButton).toHaveAttribute("aria-expanded", "false");
12+
await authorButton.click();
13+
await expect(authorButton).toHaveAttribute("aria-expanded", "true");
14+
15+
await expect(
16+
page.getByLabel("Auteur", {
17+
exact: true,
18+
}),
19+
).toHaveCount(6);
20+
await expect(page.getByText("Victor Hugo")).toBeVisible();
21+
await expect(page.getByText("Jean Paul II")).toBeVisible();
22+
await expect(page.getByText("Jean De La Fontaine")).toBeVisible();
23+
await expect(page.getByText("Marie Curie")).toBeVisible();
24+
await expect(page.getByText("Dead Poets Society")).toBeVisible();
25+
await expect(page.getByText("et al.")).toBeVisible();
26+
await expect(
27+
page
28+
.getByLabel("Auteur", {
29+
exact: true,
30+
})
31+
.nth(0),
32+
).toHaveText("Victor Hugo");
33+
await expect(
34+
page
35+
.getByLabel("Auteur", {
36+
exact: true,
37+
})
38+
.nth(0)
39+
.getByText("Victor"),
40+
).toBeVisible();
41+
await expect(
42+
page
43+
.getByLabel("Auteur", {
44+
exact: true,
45+
})
46+
.nth(1),
47+
).toHaveText("Jean Paul II");
48+
await expect(
49+
page
50+
.getByLabel("Auteur", {
51+
exact: true,
52+
})
53+
.nth(2),
54+
).toHaveText("Jean De La Fontaine");
55+
await expect(
56+
page
57+
.getByLabel("Auteur", {
58+
exact: true,
59+
})
60+
.nth(3),
61+
).toHaveText("Marie Curie");
62+
await expect(
63+
page
64+
.getByLabel("Auteur", {
65+
exact: true,
66+
})
67+
.nth(4),
68+
).toHaveText("Dead Poets Society");
69+
70+
await expect(
71+
page
72+
.getByLabel("Auteur", {
73+
exact: true,
74+
})
75+
.getByText("Victor"),
76+
).toHaveAttribute("aria-description", "Prénom");
77+
await expect(
78+
page
79+
.getByLabel("Auteur", {
80+
exact: true,
81+
})
82+
.getByText("Hugo"),
83+
).toHaveAttribute("aria-description", "Nom");
84+
await expect(
85+
page
86+
.getByLabel("Auteur", {
87+
exact: true,
88+
})
89+
.getByText("II"),
90+
).toHaveAttribute("aria-description", "Génération");
91+
await expect(
92+
page
93+
.getByLabel("Auteur", {
94+
exact: true,
95+
})
96+
.getByText("De", {
97+
exact: true,
98+
}),
99+
).toHaveAttribute("aria-description", "Particule");
100+
await expect(
101+
page
102+
.getByLabel("Auteur", {
103+
exact: true,
104+
})
105+
.getByText("Dead Poets Society"),
106+
).toHaveAttribute("aria-description", "Organisation");
107+
108+
await page.getByRole("button", { name: "Auteurs" }).click();
109+
await expect(page.getByRole("button", { name: "Auteurs" })).toHaveAttribute(
110+
"aria-expanded",
111+
"false",
112+
);
113+
});

packages/e2e/src/sidePanel.spec.ts

Lines changed: 0 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,6 @@
11
import { expect, test } from "@playwright/test";
22
import { launchViewer, uploadFile } from "./support/upload";
33

4-
test("document sidePanel authors section", async ({ page }) => {
5-
await page.goto("/");
6-
7-
await uploadFile(page, "document.tei");
8-
await launchViewer(page);
9-
10-
await expect(
11-
page.getByRole("button", { name: "Fermer le panneau latéral" }),
12-
).toBeVisible();
13-
14-
await expect(
15-
page.getByRole("button", { name: "Auteurs (5)" }),
16-
).toHaveAttribute("aria-expanded", "true");
17-
18-
await expect(
19-
page.getByLabel("Auteur", {
20-
exact: true,
21-
}),
22-
).toHaveCount(5);
23-
await expect(page.getByText("Mr Victor Hugo")).toBeVisible();
24-
await expect(page.getByText("Jean Paul II")).toBeVisible();
25-
await expect(page.getByText("Jean De La Fontaine")).toBeVisible();
26-
await expect(page.getByText("Dr Marie Curie PhD")).toBeVisible();
27-
await expect(page.getByText("Dead Poets Society")).toBeVisible();
28-
await expect(
29-
page
30-
.getByLabel("Auteur", {
31-
exact: true,
32-
})
33-
.nth(0),
34-
).toHaveText("Mr Victor Hugo");
35-
await expect(
36-
page
37-
.getByLabel("Auteur", {
38-
exact: true,
39-
})
40-
.nth(0)
41-
.getByText("Victor"),
42-
).toBeVisible();
43-
await expect(
44-
page
45-
.getByLabel("Auteur", {
46-
exact: true,
47-
})
48-
.nth(1),
49-
).toHaveText("Jean Paul II");
50-
await expect(
51-
page
52-
.getByLabel("Auteur", {
53-
exact: true,
54-
})
55-
.nth(2),
56-
).toHaveText("Jean De La Fontaine");
57-
await expect(
58-
page
59-
.getByLabel("Auteur", {
60-
exact: true,
61-
})
62-
.nth(3),
63-
).toHaveText("Dr Marie Curie PhD");
64-
await expect(
65-
page
66-
.getByLabel("Auteur", {
67-
exact: true,
68-
})
69-
.nth(4),
70-
).toHaveText("Dead Poets Society");
71-
72-
await expect(
73-
page
74-
.getByLabel("Auteur", {
75-
exact: true,
76-
})
77-
.getByText("Victor"),
78-
).toHaveAttribute("aria-description", "Prénom");
79-
await expect(
80-
page
81-
.getByLabel("Auteur", {
82-
exact: true,
83-
})
84-
.getByText("Hugo"),
85-
).toHaveAttribute("aria-description", "Nom");
86-
await expect(
87-
page
88-
.getByLabel("Auteur", {
89-
exact: true,
90-
})
91-
.getByText("Mr"),
92-
).toHaveAttribute("aria-description", "Civilité");
93-
await expect(
94-
page
95-
.getByLabel("Auteur", {
96-
exact: true,
97-
})
98-
.getByText("Dr"),
99-
).toHaveAttribute("aria-description", "Civilité");
100-
await expect(
101-
page
102-
.getByLabel("Auteur", {
103-
exact: true,
104-
})
105-
.getByText("PhD"),
106-
).toHaveAttribute("aria-description", "Diplôme");
107-
await expect(
108-
page
109-
.getByLabel("Auteur", {
110-
exact: true,
111-
})
112-
.getByText("II"),
113-
).toHaveAttribute("aria-description", "Génération");
114-
await expect(
115-
page
116-
.getByLabel("Auteur", {
117-
exact: true,
118-
})
119-
.getByText("De", {
120-
exact: true,
121-
}),
122-
).toHaveAttribute("aria-description", "Particule");
123-
await expect(
124-
page
125-
.getByLabel("Auteur", {
126-
exact: true,
127-
})
128-
.getByText("Dead Poets Society"),
129-
).toHaveAttribute("aria-description", "Organisation");
130-
131-
await page.getByRole("button", { name: "Auteurs" }).click();
132-
await expect(page.getByRole("button", { name: "Auteurs" })).toHaveAttribute(
133-
"aria-expanded",
134-
"false",
135-
);
136-
137-
await expect(
138-
page.getByRole("button", { name: "Fermer le panneau latéral" }),
139-
).toBeVisible();
140-
141-
await page.getByLabel("Fermer le panneau latéral").click();
142-
expect(
143-
page.getByRole("button", { name: "Ouvrir le panneau latéral" }),
144-
).toBeVisible();
145-
});
146-
1474
test("document sidePanel keywords section", async ({ page }) => {
1485
await page.goto("/");
1496

packages/e2e/testdata/bibliographicReferences.tei

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,18 @@
5757
<profileDesc>
5858
<textClass>
5959
<keywords>
60-
<term>TEI</term>
61-
<term>XML</term>
62-
<term>Sample Document</term>
60+
<term>Legolas</term>
61+
<term>Aragorn</term>
62+
<term>Gimli</term>
63+
<term>Gandalf the Gray</term>
64+
<term>Frodo</term>
65+
<term>Sam</term>
66+
<term>Merry</term>
67+
<term>Pippin</term>
68+
<term>Boromir</term>
69+
<term>Faramir</term>
70+
<term>Elrond</term>
71+
<term>Arwen</term>
6372
</keywords>
6473
<keywords>
6574
<list>

packages/e2e/testdata/document.tei

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<orgName>Dead Poets Society</orgName>
5151
</persName>
5252
</author>
53+
<author role="et-al">et al.</author>
5354
</analytic>
5455
</biblStruct>
5556
</sourceDesc>

0 commit comments

Comments
 (0)