Skip to content

Commit

Permalink
other(editor): Moved the identifier & aliases editin to be part of th…
Browse files Browse the repository at this point in the history
…e man editing flow
  • Loading branch information
Tarunmeena0901 committed Dec 18, 2023
1 parent 9328218 commit 5582729
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 41 deletions.
36 changes: 16 additions & 20 deletions src/client/entity-editor/alias-editor/alias-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

import {Button, Modal, OverlayTrigger, Tooltip} from 'react-bootstrap';
import {hideAliasEditor, removeEmptyAliases} from './actions';
import { Button, Modal, OverlayTrigger, Tooltip } from 'react-bootstrap';

Check warning on line 19 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L19

'Modal' is defined but never used (@typescript-eslint/no-unused-vars)

Check failure on line 19 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L19

There should be no space after '{' (object-curly-spacing)

Check failure on line 19 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L19

There should be no space before '}' (object-curly-spacing)
import { hideAliasEditor, removeEmptyAliases } from './actions';

Check warning on line 20 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L20

'hideAliasEditor' is defined but never used (@typescript-eslint/no-unused-vars)

Check failure on line 20 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L20

There should be no space after '{' (object-curly-spacing)

Check failure on line 20 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L20

There should be no space before '}' (object-curly-spacing)
import AliasModalBody from './alias-modal-body';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

Check failure on line 22 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L22

There should be no space after '{' (object-curly-spacing)

Check failure on line 22 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L22

There should be no space before '}' (object-curly-spacing)
import PropTypes from 'prop-types';
import React from 'react';
import {connect} from 'react-redux';
import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons';
import { connect } from 'react-redux';

Check failure on line 25 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L25

There should be no space after '{' (object-curly-spacing)

Check failure on line 25 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L25

There should be no space before '}' (object-curly-spacing)
import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons';

Check failure on line 26 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L26

There should be no space after '{' (object-curly-spacing)

Check failure on line 26 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L26

There should be no space before '}' (object-curly-spacing)


/**
Expand All @@ -37,15 +37,13 @@ import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons';
* @param {Array} props.languageOptions - The list of possible languages for an
* alias.
* @param {Function} props.onClose - A function to be called when the button to
* close the editor is clicked.
* @param {boolean} props.show - Whether or not the editor modal should be
* visible.
* add the alias is clicked.
* @returns {ReactElement} React element containing the rendered AliasEditor.
*/
const AliasEditor = ({
languageOptions,
onClose,
// show
onClose,

Check failure on line 45 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L45

Unexpected trailing comma (comma-dangle)

}) => {
const helpText = `Variant names for an entity such as alternate spelling, different script, stylistic representation, acronyms, etc.
Refer to the help page for more details and examples.`;
Expand All @@ -65,16 +63,16 @@ const AliasEditor = ({
return (
<div>
<div>
<div style={{display:'flex'}}>
<h2 style={{marginRight:"5px"}}>Add a Alias</h2>
<div style={{marginTop:"15px"}}>
<div style={{ display: 'flex' }}>

Check failure on line 66 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L66

There should be no space after '{' (object-curly-spacing)

Check failure on line 66 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L66

There should be no space before '}' (object-curly-spacing)
<h2 style={{ marginRight: "5px" }}>Add a Alias</h2>

Check failure on line 67 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L67

There should be no space after '{' (object-curly-spacing)

Check failure on line 67 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L67

Strings must use singlequote (quotes)

Check failure on line 67 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L67

There should be no space before '}' (object-curly-spacing)
<div style={{ marginTop: "15px" }}>

Check failure on line 68 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L68

There should be no space after '{' (object-curly-spacing)

Check failure on line 68 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L68

Strings must use singlequote (quotes)

Check failure on line 68 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L68

There should be no space before '}' (object-curly-spacing)
{helpIconElement}
</div>
</div>
</div>
</div>

<div>
<AliasModalBody languageOptions={languageOptions}/>
<AliasModalBody languageOptions={languageOptions} />

Check failure on line 75 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L75

A space is forbidden before closing bracket (react/jsx-tag-spacing)
</div>

<div>
Expand All @@ -87,16 +85,14 @@ AliasEditor.displayName = 'AliasEditor';
AliasEditor.propTypes = {
languageOptions: PropTypes.array.isRequired,
onClose: PropTypes.func.isRequired,

Check failure on line 87 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L87

Unexpected trailing comma (comma-dangle)
//show: PropTypes.bool

};
// AliasEditor.defaultProps = {
// show: false
// };


function mapDispatchToProps(dispatch) {
return {
onClose: () => {

Check failure on line 94 in src/client/entity-editor/alias-editor/alias-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/alias-editor/alias-editor.js#L94

Block must not be padded by blank lines (padded-blocks)
//dispatch(hideAliasEditor());

dispatch(removeEmptyAliases());
}
};
Expand Down
36 changes: 15 additions & 21 deletions src/client/entity-editor/identifier-editor/identifier-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

import {Button, Modal, OverlayTrigger, Tooltip} from 'react-bootstrap';
import {hideIdentifierEditor, removeEmptyIdentifiers} from './actions';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { Button, Modal, OverlayTrigger, Tooltip } from 'react-bootstrap';

Check warning on line 19 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L19

'Modal' is defined but never used (@typescript-eslint/no-unused-vars)

Check failure on line 19 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L19

There should be no space after '{' (object-curly-spacing)

Check failure on line 19 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L19

There should be no space before '}' (object-curly-spacing)
import { hideIdentifierEditor, removeEmptyIdentifiers } from './actions';

Check warning on line 20 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L20

'hideIdentifierEditor' is defined but never used (@typescript-eslint/no-unused-vars)

Check failure on line 20 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L20

There should be no space after '{' (object-curly-spacing)

Check failure on line 20 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L20

There should be no space before '}' (object-curly-spacing)
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

Check failure on line 21 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L21

There should be no space after '{' (object-curly-spacing)

Check failure on line 21 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L21

There should be no space before '}' (object-curly-spacing)
import IdentifierModalBody from './identifier-modal-body';
import PropTypes from 'prop-types';
import React from 'react';
import {connect} from 'react-redux';
import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons';
import { connect } from 'react-redux';

Check failure on line 25 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L25

There should be no space after '{' (object-curly-spacing)

Check failure on line 25 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L25

There should be no space before '}' (object-curly-spacing)
import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons';

Check failure on line 26 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L26

There should be no space after '{' (object-curly-spacing)

Check failure on line 26 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L26

There should be no space before '}' (object-curly-spacing)


/**
Expand All @@ -39,16 +39,13 @@ import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons';
* @param {Function} props.onAddIdentifier - A function to be called when the
* button to add an identifier is clicked.
* @param {Function} props.onClose - A function to be called when the button to
* close the editor is clicked.
* @param {boolean} props.show - Whether or not the editor modal should be
* visible.
* Add the new identifier is clicked.
* @returns {ReactElement} React element containing the rendered
* IdentifierEditor.
*/
const IdentifierEditor = ({
identifierTypes,
onClose,
// show
onClose,

Check failure on line 48 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L48

Unexpected trailing comma (comma-dangle)
}) => {
const helpText = `identity of the entity in other databases and services, such as ISBN, barcode, MusicBrainz ID, WikiData ID, OpenLibrary ID, etc.
You can enter either the identifier only (Q2517049) or a full link (https://www.wikidata.org/wiki/Q2517049).`;
Expand All @@ -69,39 +66,36 @@ const IdentifierEditor = ({
return (
<div>
<div>
<div style={{display:'flex'}}>
<h2 style={{marginRight:"5px"}}>Add a Identifier</h2>
<div style={{marginTop:"15px"}}>
<div style={{ display: 'flex' }}>

Check failure on line 69 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L69

There should be no space after '{' (object-curly-spacing)

Check failure on line 69 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L69

There should be no space before '}' (object-curly-spacing)
<h2 style={{ marginRight: "5px" }}>Add a Identifier</h2>

Check failure on line 70 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L70

There should be no space after '{' (object-curly-spacing)

Check failure on line 70 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L70

Strings must use singlequote (quotes)

Check failure on line 70 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L70

There should be no space before '}' (object-curly-spacing)
<div style={{ marginTop: "15px" }}>

Check failure on line 71 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L71

There should be no space after '{' (object-curly-spacing)

Check failure on line 71 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L71

Strings must use singlequote (quotes)

Check failure on line 71 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L71

There should be no space before '}' (object-curly-spacing)
{helpIconElement}
</div>
</div>
</div>

<div>
<IdentifierModalBody identifierTypes={identifierTypes}/>
<IdentifierModalBody identifierTypes={identifierTypes} />

Check failure on line 78 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L78

A space is forbidden before closing bracket (react/jsx-tag-spacing)
</div>
<div>
<Button variant="primary" onClick={onClose}>Done</Button>
<Button variant="primary" onClick={onClose}>Done</Button>
</div>


</div>
);
};
IdentifierEditor.displayName = 'IdentifierEditor';
IdentifierEditor.propTypes = {
identifierTypes: PropTypes.array.isRequired,
onClose: PropTypes.func.isRequired,

Check failure on line 91 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L91

Unexpected trailing comma (comma-dangle)
//show: PropTypes.bool
};
// IdentifierEditor.defaultProps = {
// show: false
// };


function mapDispatchToProps(dispatch) {
return {
onClose: () => {

Check failure on line 97 in src/client/entity-editor/identifier-editor/identifier-editor.js

View workflow job for this annotation

GitHub Actions / ESLint

src/client/entity-editor/identifier-editor/identifier-editor.js#L97

Block must not be padded by blank lines (padded-blocks)
//dispatch(hideIdentifierEditor());

dispatch(removeEmptyIdentifiers());
}
};
Expand Down

0 comments on commit 5582729

Please sign in to comment.