Skip to content

Commit c039834

Browse files
committed
Merge and resolve conflict in recently-used.ts
2 parents 559d02f + 62acde2 commit c039834

File tree

34 files changed

+810
-390
lines changed

34 files changed

+810
-390
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const bestPracticesRules = {
118118
'no-param-reassign': ERROR,
119119
'no-proto': ERROR,
120120
'no-return-assign': ERROR,
121-
'no-return-await': ERROR,
121+
'no-return-await': TRANSITION_IGNORE,
122122
'no-script-url': ERROR,
123123
'no-self-compare': ERROR,
124124
'no-sequences': ERROR,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- stable
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
update_release_draft:
13+
permissions:
14+
# write permission is required to create a github release
15+
contents: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: release-drafter/release-drafter@v6
19+
with:
20+
disable-autolabeler: true
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const bestPracticesRules = {
9494
'no-param-reassign': ERROR,
9595
'no-proto': ERROR,
9696
'no-return-assign': ERROR,
97-
'no-return-await': ERROR,
97+
'no-return-await': TRANSITION_IGNORE,
9898
'no-script-url': ERROR,
9999
'no-self-compare': ERROR,
100100
'no-sequences': ERROR,

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"isomorphic-dompurify": "^2.24.0",
6060
"jsesc": "^3.0.2",
6161
"lobes4": "4.0.1",
62-
"lodash": "^4.17.21",
62+
"lodash": "^4.17.23",
6363
"log": "^6.0.0",
6464
"log-node": "^8.0.3",
6565
"mocha-chai-jest-snapshot": "^1.1.4",
@@ -91,7 +91,7 @@
9191
"superagent": "^10.2.1",
9292
"swagger-jsdoc": "^6.2.8",
9393
"swagger-ui-express": "^4.6.0",
94-
"validator": "^13.15.20"
94+
"validator": "^13.15.22"
9595
},
9696
"devDependencies": {
9797
"@babel/cli": "^7.28.3",
@@ -144,7 +144,7 @@
144144
"sass-loader": "^13.2.0",
145145
"sinon": "^19.0.2",
146146
"typescript": "^4.0.5",
147-
"webpack": "^5.94.0",
147+
"webpack": "^5.104.1",
148148
"webpack-bundle-analyzer": "^4.3.0",
149149
"webpack-cli": "^4.10.0",
150150
"webpack-dev-middleware": "^7.4.2",
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
*/
2020

2121
import * as bootstrap from 'react-bootstrap';
22-
23-
import PropTypes from 'prop-types';
2422
import React from 'react';
2523

2624

2725
const {Col, Container, Row} = bootstrap;
2826

29-
function Footer(props) {
30-
const {repositoryUrl, siteRevision} = props;
31-
27+
type FooterProps = {
28+
repositoryUrl: string;
29+
siteRevision: string;
30+
};
31+
function Footer({repositoryUrl, siteRevision}: Props) {
3232
return (
3333
<footer className="footer">
3434
<Container fluid>
@@ -89,10 +89,4 @@ function Footer(props) {
8989
);
9090
}
9191

92-
Footer.displayName = 'Footer';
93-
Footer.propTypes = {
94-
repositoryUrl: PropTypes.string.isRequired,
95-
siteRevision: PropTypes.string.isRequired
96-
};
97-
9892
export default Footer;

src/client/components/forms/deletion.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ class EntityDeletionForm extends React.Component {
6868
.then(() => {
6969
window.location.href = this.entityUrl;
7070
})
71-
.catch((res) => {
72-
const {error} = res.body;
73-
71+
.catch((err) => {
72+
const {error: erroMessage} = err?.response?.body;
73+
const statusText = err?.message ?? `Error ${err?.status}`;
7474
this.setState({
75-
error,
75+
error: `${statusText}: ${erroMessage}`,
7676
waiting: false
7777
});
7878
});

src/client/components/forms/type-editor/identifier-type.tsx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function IdentifierTypeEditor({identifierTypeData, parentTypes}: IdentifierTypeE
3232
// State for the ParentType modal
3333
const [showModal, setShowModal] = useState<boolean>(false);
3434
const [selectedParentType, setSelectedParentType] = useState<number | null>(identifierTypeData.parentId);
35-
const [childOrder, setChildOrder] = useState<number>(formData.childOrder);
3635

3736
const [filteredParentTypes, setFilteredParentTypes] = useState<IdentifierTypeDataT[]>(parentTypes);
3837
useEffect(() => {
@@ -55,7 +54,6 @@ function IdentifierTypeEditor({identifierTypeData, parentTypes}: IdentifierTypeE
5554
// Callback function for closing the modal, the state of the modal should alse be reset
5655
const handleModalClose = useCallback(() => {
5756
setSelectedParentType(null);
58-
setChildOrder(0);
5957
setShowModal(false);
6058
}, []);
6159

@@ -69,18 +67,12 @@ function IdentifierTypeEditor({identifierTypeData, parentTypes}: IdentifierTypeE
6967
}
7068
}, [selectedParentType]);
7169

72-
// Function to handle child order input in ParentType modal
73-
const handleChildOrderChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {
74-
setChildOrder(event.target.valueAsNumber || 0);
75-
}, [formData, childOrder]);
76-
7770
// Function to handle parent removal
7871
const handleRemoveParent = useCallback(() => {
7972
setFormData((prevFormData) => ({
8073
...prevFormData,
8174
childOrder: 0, parentId: null
8275
}));
83-
setChildOrder(0);
8476
setSelectedParentType(null);
8577
}, [formData]);
8678

@@ -93,11 +85,11 @@ function IdentifierTypeEditor({identifierTypeData, parentTypes}: IdentifierTypeE
9385
if (selectedParentType !== null) {
9486
setFormData((prevFormData) => ({
9587
...prevFormData,
96-
childOrder, parentId: selectedParentType
88+
parentId: selectedParentType
9789
}));
9890
setShowModal(false);
9991
}
100-
}, [formData, childOrder, selectedParentType]);
92+
}, [formData, selectedParentType]);
10193

10294
const handleInputChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {
10395
const {name, value} = event.target;
@@ -179,7 +171,7 @@ function IdentifierTypeEditor({identifierTypeData, parentTypes}: IdentifierTypeE
179171

180172
try {
181173
await request.post(submissionURL).send(formData);
182-
window.location.href = '/identifier-types';
174+
window.location.href = document.referrer;
183175
}
184176
catch (err) {
185177
const errorMessage = err.response.body.error;
@@ -346,6 +338,22 @@ function IdentifierTypeEditor({identifierTypeData, parentTypes}: IdentifierTypeE
346338
</Form.Group>
347339
</Col>
348340
</Row>
341+
<Row>
342+
<Col lg={lgCol}>
343+
<Form.Group >
344+
<Form.Label>Child Order</Form.Label>
345+
<Form.Control
346+
required
347+
defaultValue={0}
348+
min={0}
349+
name="childOrder"
350+
type="number"
351+
value={formData.childOrder}
352+
onChange={handleInputChange}
353+
/>
354+
</Form.Group>
355+
</Col>
356+
</Row>
349357

350358
<Row>
351359
<Col lg={lgCol}>
@@ -397,17 +405,6 @@ function IdentifierTypeEditor({identifierTypeData, parentTypes}: IdentifierTypeE
397405
onChange={handleParentTypeChange}
398406
/>
399407
</Form.Group>
400-
<Form.Group >
401-
<Form.Label>Child Order</Form.Label>
402-
<Form.Control
403-
required
404-
min={0}
405-
name="childOrder"
406-
type="number"
407-
value={childOrder}
408-
onChange={handleChildOrderChange}
409-
/>
410-
</Form.Group>
411408
</Modal.Body>
412409
<Modal.Footer>
413410
<Button variant="secondary" onClick={handleModalClose}>

src/client/components/forms/type-editor/relationship-type.tsx

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function RelationshipTypeEditor({relationshipTypeData, parentTypes, attributeTyp
3232
// State for the ParentType modal
3333
const [showModal, setShowModal] = useState<boolean>(false);
3434
const [selectedParentType, setSelectedParentType] = useState<number | null>(formData.parentId);
35-
const [childOrder, setChildOrder] = useState<number>(formData.childOrder);
3635

3736
const [isFormEdited, setIsFormEdited] = useState(false);
3837

@@ -96,7 +95,6 @@ function RelationshipTypeEditor({relationshipTypeData, parentTypes, attributeTyp
9695
// Callback function for closing the modal, the state of the modal should alse be reset
9796
const handleModalClose = useCallback(() => {
9897
setSelectedParentType(null);
99-
setChildOrder(0);
10098
setShowModal(false);
10199
}, []);
102100

@@ -110,19 +108,12 @@ function RelationshipTypeEditor({relationshipTypeData, parentTypes, attributeTyp
110108
}
111109
}, [selectedParentType]);
112110

113-
// Function to handle child order input in ParentType modal
114-
const handleChildOrderChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {
115-
const value = parseInt(event.target.value, 10);
116-
setChildOrder(isNaN(value) ? 0 : value);
117-
}, [formData, childOrder]);
118-
119111
// Function to handle parent removal
120112
const handleRemoveParent = useCallback(() => {
121113
setFormData((prevFormData) => ({
122114
...prevFormData,
123115
childOrder: 0, parentId: null
124116
}));
125-
setChildOrder(0);
126117
setSelectedParentType(null);
127118
}, [formData]);
128119

@@ -135,11 +126,11 @@ function RelationshipTypeEditor({relationshipTypeData, parentTypes, attributeTyp
135126
if (selectedParentType !== null) {
136127
setFormData((prevFormData) => ({
137128
...prevFormData,
138-
childOrder, parentId: selectedParentType
129+
parentId: selectedParentType
139130
}));
140131
setShowModal(false);
141132
}
142-
}, [formData, childOrder, selectedParentType]);
133+
}, [formData, selectedParentType]);
143134

144135
const handleInputChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {
145136
const {name, value} = event.target;
@@ -233,7 +224,7 @@ function RelationshipTypeEditor({relationshipTypeData, parentTypes, attributeTyp
233224
try {
234225
await request.post(submissionURL)
235226
.send({oldAttributeTypes: relationshipTypeData.attributeTypes, ...formData});
236-
window.location.href = '/relationship-types';
227+
window.location.href = document.referrer;
237228
}
238229
catch (err) {
239230
throw new Error(err);
@@ -405,6 +396,22 @@ function RelationshipTypeEditor({relationshipTypeData, parentTypes, attributeTyp
405396
</Col>
406397
</Row>
407398

399+
<Row>
400+
<Col lg={lgCol}>
401+
<Form.Group >
402+
<Form.Label>Child Order</Form.Label>
403+
<Form.Control
404+
required
405+
defaultValue={0}
406+
min={0}
407+
name="childOrder"
408+
type="number"
409+
value={formData.childOrder}
410+
onChange={handleInputChange}
411+
/>
412+
</Form.Group>
413+
</Col>
414+
</Row>
408415
<Row>
409416
<Col lg={lgCol}>
410417
<Form.Group>
@@ -480,17 +487,6 @@ function RelationshipTypeEditor({relationshipTypeData, parentTypes, attributeTyp
480487
onChange={handleParentTypeChange}
481488
/>
482489
</Form.Group>
483-
<Form.Group >
484-
<Form.Label>Child Order</Form.Label>
485-
<Form.Control
486-
required
487-
min={0}
488-
name="childOrder"
489-
type="number"
490-
value={childOrder}
491-
onChange={handleChildOrderChange}
492-
/>
493-
</Form.Group>
494490
</Modal.Body>
495491
<Modal.Footer>
496492
<Button variant="secondary" onClick={handleModalClose}>

src/client/components/pages/entities/edition.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import * as bootstrap from 'react-bootstrap';
2020
import * as entityHelper from '../../../helpers/entity';
2121
import AuthorCreditDisplay from '../../author-credit-display';
22+
import EditionCover from '../parts/edition-cover';
2223
import EntityAnnotation from './annotation';
2324
import EntityFooter from './footer';
24-
import EntityImage from './image';
2525
import EntityLinks from './links';
2626
import EntityRelatedCollections from './related-collections';
2727
import EntityTitle from './title';
@@ -155,14 +155,15 @@ function EditionDisplayPage({entity, identifierTypes, user, wikipediaExtract}) {
155155
return (
156156
<div>
157157
<Row className="entity-display-background">
158-
<Col className="entity-display-image-box text-center" lg={2}>
159-
<EntityImage
158+
<Col className="entity-display-image-box text-center" lg={3}>
159+
<EditionCover
160160
backupIcon={ENTITY_TYPE_ICONS.Edition}
161161
deleted={entity.deleted}
162-
imageUrl={entity.imageUrl}
162+
editionName={entity.defaultAlias?.name || entity.name}
163+
identifiers={entity.identifierSet?.identifiers}
163164
/>
164165
</Col>
165-
<Col lg={10}>
166+
<Col lg={9}>
166167
<EntityTitle entity={entity}/>
167168
{authorCreditSection}
168169
<hr/>

0 commit comments

Comments
 (0)