|
5 | 5 | // Invenio-RDM-Records is free software; you can redistribute it and/or modify it
|
6 | 6 | // under the terms of the MIT License; see LICENSE file for more details.
|
7 | 7 |
|
| 8 | +import { IdentifiersField } from "@js/invenio_rdm_records/src/deposit/fields"; |
| 9 | +import { i18next } from "@translations/invenio_rdm_records/i18next"; |
8 | 10 | import React, { Component } from "react";
|
9 |
| - |
| 11 | +import { getInputFromDOM } from "@js/invenio_rdm_records"; |
10 | 12 | import { FieldLabel, Input } from "react-invenio-forms";
|
11 | 13 | import { Divider, Grid } from "semantic-ui-react";
|
12 | 14 |
|
13 | 15 | import PropTypes from "prop-types";
|
14 | 16 |
|
15 | 17 | export class Meeting extends Component {
|
| 18 | + constructor(props) { |
| 19 | + super(props); |
| 20 | + this.config = getInputFromDOM("deposits-config"); |
| 21 | + this.vocabularies = this.config.vocabularies; |
| 22 | + } |
| 23 | + |
16 | 24 | render() {
|
17 | 25 | const {
|
18 | 26 | fieldPath, // injected by the custom field loader via the `field` config property
|
19 | 27 | title,
|
20 | 28 | acronym,
|
21 | 29 | dates,
|
22 | 30 | place,
|
23 |
| - url, |
| 31 | + // identifiers, |
24 | 32 | session,
|
25 | 33 | session_part: sessionPart,
|
26 | 34 | icon,
|
@@ -75,15 +83,14 @@ export class Meeting extends Component {
|
75 | 83 | <label className="helptext mb-0">{dates.description}</label>
|
76 | 84 | )}
|
77 | 85 | </Grid.Column>
|
78 |
| - <Grid.Column width="12"> |
79 |
| - <Input |
80 |
| - fieldPath={`${fieldPath}.url`} |
81 |
| - label={url.label} |
82 |
| - placeholder={url.placeholder} |
| 86 | + <Grid.Column width="16"> |
| 87 | + <IdentifiersField |
| 88 | + fieldPath={`${fieldPath}.identifiers`} |
| 89 | + label={i18next.t("Meeting identifiers")} |
| 90 | + labelIcon="barcode" |
| 91 | + schemeOptions={this.vocabularies.identifiers.scheme} |
| 92 | + showEmptyValue |
83 | 93 | />
|
84 |
| - {url.description && ( |
85 |
| - <label className="helptext mb-0">{url.description}</label> |
86 |
| - )} |
87 | 94 | </Grid.Column>
|
88 | 95 | <Grid.Column width="6">
|
89 | 96 | <Input
|
@@ -117,7 +124,7 @@ Meeting.propTypes = {
|
117 | 124 | acronym: PropTypes.object.isRequired,
|
118 | 125 | session_part: PropTypes.object.isRequired,
|
119 | 126 | session: PropTypes.object.isRequired,
|
120 |
| - url: PropTypes.object.isRequired, |
| 127 | + // identifiers: PropTypes.object.isRequired, |
121 | 128 | dates: PropTypes.object.isRequired,
|
122 | 129 | place: PropTypes.object.isRequired,
|
123 | 130 | icon: PropTypes.string,
|
|
0 commit comments