@manuscripts/article-editor 1.10.13 → 1.10.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/cjs/components/projects/ManuscriptPageContainer.js +0 -2
  2. package/dist/cjs/components/projects/ManuscriptPageContainer.js.map +1 -1
  3. package/dist/cjs/hooks/use-create-editor.js +0 -2
  4. package/dist/cjs/hooks/use-create-editor.js.map +1 -1
  5. package/dist/cjs/postgres-data/buildData.js +0 -4
  6. package/dist/cjs/postgres-data/buildData.js.map +1 -1
  7. package/dist/cjs/store/Store.js.map +1 -1
  8. package/dist/es/components/projects/ManuscriptPageContainer.js +0 -2
  9. package/dist/es/components/projects/ManuscriptPageContainer.js.map +1 -1
  10. package/dist/es/hooks/use-create-editor.js +0 -2
  11. package/dist/es/hooks/use-create-editor.js.map +1 -1
  12. package/dist/es/postgres-data/buildData.js +0 -4
  13. package/dist/es/postgres-data/buildData.js.map +1 -1
  14. package/dist/es/store/Store.js.map +1 -1
  15. package/dist/types/store/Store.d.ts +1 -3
  16. package/package.json +3 -4
  17. package/dist/cjs/components/metadata/AddAuthorButton.js +0 -55
  18. package/dist/cjs/components/metadata/AddAuthorButton.js.map +0 -1
  19. package/dist/cjs/components/metadata/AddAuthorsModalContainer.js +0 -71
  20. package/dist/cjs/components/metadata/AddAuthorsModalContainer.js.map +0 -1
  21. package/dist/cjs/components/metadata/AddAuthorsSidebar.js +0 -67
  22. package/dist/cjs/components/metadata/AddAuthorsSidebar.js.map +0 -1
  23. package/dist/cjs/components/metadata/AuthorFormContainer.js +0 -24
  24. package/dist/cjs/components/metadata/AuthorFormContainer.js.map +0 -1
  25. package/dist/cjs/components/metadata/AuthorInvitationForm.js +0 -115
  26. package/dist/cjs/components/metadata/AuthorInvitationForm.js.map +0 -1
  27. package/dist/cjs/components/metadata/AuthorModalViews.js +0 -161
  28. package/dist/cjs/components/metadata/AuthorModalViews.js.map +0 -1
  29. package/dist/cjs/components/metadata/AuthorsModalContainer.js +0 -99
  30. package/dist/cjs/components/metadata/AuthorsModalContainer.js.map +0 -1
  31. package/dist/cjs/components/metadata/AuthorsModals.js +0 -37
  32. package/dist/cjs/components/metadata/AuthorsModals.js.map +0 -1
  33. package/dist/cjs/components/metadata/AuthorsPage.js +0 -100
  34. package/dist/cjs/components/metadata/AuthorsPage.js.map +0 -1
  35. package/dist/cjs/components/metadata/AuthorsSidebar.js +0 -34
  36. package/dist/cjs/components/metadata/AuthorsSidebar.js.map +0 -1
  37. package/dist/cjs/components/metadata/CreateAuthorPageContainer.js +0 -43
  38. package/dist/cjs/components/metadata/CreateAuthorPageContainer.js.map +0 -1
  39. package/dist/cjs/components/metadata/InviteAuthorButton.js +0 -62
  40. package/dist/cjs/components/metadata/InviteAuthorButton.js.map +0 -1
  41. package/dist/cjs/components/metadata/InviteAuthorPopperContainer.js +0 -62
  42. package/dist/cjs/components/metadata/InviteAuthorPopperContainer.js.map +0 -1
  43. package/dist/cjs/components/metadata/InviteAuthorsSidebar.js +0 -27
  44. package/dist/cjs/components/metadata/InviteAuthorsSidebar.js.map +0 -1
  45. package/dist/cjs/components/metadata/SearchAuthorsSidebar.js +0 -48
  46. package/dist/cjs/components/metadata/SearchAuthorsSidebar.js.map +0 -1
  47. package/dist/cjs/lib/authors.js +0 -124
  48. package/dist/cjs/lib/authors.js.map +0 -1
  49. package/dist/es/components/metadata/AddAuthorButton.js +0 -50
  50. package/dist/es/components/metadata/AddAuthorButton.js.map +0 -1
  51. package/dist/es/components/metadata/AddAuthorsModalContainer.js +0 -64
  52. package/dist/es/components/metadata/AddAuthorsModalContainer.js.map +0 -1
  53. package/dist/es/components/metadata/AddAuthorsSidebar.js +0 -62
  54. package/dist/es/components/metadata/AddAuthorsSidebar.js.map +0 -1
  55. package/dist/es/components/metadata/AuthorFormContainer.js +0 -17
  56. package/dist/es/components/metadata/AuthorFormContainer.js.map +0 -1
  57. package/dist/es/components/metadata/AuthorInvitationForm.js +0 -108
  58. package/dist/es/components/metadata/AuthorInvitationForm.js.map +0 -1
  59. package/dist/es/components/metadata/AuthorModalViews.js +0 -133
  60. package/dist/es/components/metadata/AuthorModalViews.js.map +0 -1
  61. package/dist/es/components/metadata/AuthorsModalContainer.js +0 -94
  62. package/dist/es/components/metadata/AuthorsModalContainer.js.map +0 -1
  63. package/dist/es/components/metadata/AuthorsModals.js +0 -29
  64. package/dist/es/components/metadata/AuthorsModals.js.map +0 -1
  65. package/dist/es/components/metadata/AuthorsPage.js +0 -92
  66. package/dist/es/components/metadata/AuthorsPage.js.map +0 -1
  67. package/dist/es/components/metadata/AuthorsSidebar.js +0 -29
  68. package/dist/es/components/metadata/AuthorsSidebar.js.map +0 -1
  69. package/dist/es/components/metadata/CreateAuthorPageContainer.js +0 -38
  70. package/dist/es/components/metadata/CreateAuthorPageContainer.js.map +0 -1
  71. package/dist/es/components/metadata/InviteAuthorButton.js +0 -57
  72. package/dist/es/components/metadata/InviteAuthorButton.js.map +0 -1
  73. package/dist/es/components/metadata/InviteAuthorPopperContainer.js +0 -57
  74. package/dist/es/components/metadata/InviteAuthorPopperContainer.js.map +0 -1
  75. package/dist/es/components/metadata/InviteAuthorsSidebar.js +0 -22
  76. package/dist/es/components/metadata/InviteAuthorsSidebar.js.map +0 -1
  77. package/dist/es/components/metadata/SearchAuthorsSidebar.js +0 -43
  78. package/dist/es/components/metadata/SearchAuthorsSidebar.js.map +0 -1
  79. package/dist/es/lib/authors.js +0 -112
  80. package/dist/es/lib/authors.js.map +0 -1
  81. package/dist/types/components/metadata/AddAuthorButton.d.ts +0 -29
  82. package/dist/types/components/metadata/AddAuthorsModalContainer.d.ts +0 -38
  83. package/dist/types/components/metadata/AddAuthorsSidebar.d.ts +0 -28
  84. package/dist/types/components/metadata/AuthorFormContainer.d.ts +0 -31
  85. package/dist/types/components/metadata/AuthorInvitationForm.d.ts +0 -36
  86. package/dist/types/components/metadata/AuthorModalViews.d.ts +0 -14
  87. package/dist/types/components/metadata/AuthorsModalContainer.d.ts +0 -48
  88. package/dist/types/components/metadata/AuthorsModals.d.ts +0 -50
  89. package/dist/types/components/metadata/AuthorsPage.d.ts +0 -18
  90. package/dist/types/components/metadata/AuthorsSidebar.d.ts +0 -24
  91. package/dist/types/components/metadata/CreateAuthorPageContainer.d.ts +0 -25
  92. package/dist/types/components/metadata/InviteAuthorButton.d.ts +0 -33
  93. package/dist/types/components/metadata/InviteAuthorPopperContainer.d.ts +0 -31
  94. package/dist/types/components/metadata/InviteAuthorsSidebar.d.ts +0 -24
  95. package/dist/types/components/metadata/SearchAuthorsSidebar.d.ts +0 -21
  96. package/dist/types/lib/authors.d.ts +0 -42
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthorFormContainer.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorFormContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EACL,kBAAkB,EAElB,UAAU,GAEX,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AAmBzB,MAAM,CAAC,MAAM,mBAAmB,GAAyC,CAAC,EACxE,MAAM,EACN,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GACtB,EAAE,EAAE,CAAC,CACJ,oBAAC,KAAK,CAAC,QAAQ;IACb,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,qBAAqB,GAC5C;IACF,oBAAC,kBAAkB,IACjB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,EAC1C,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,GACpC,CACa,CAClB,CAAA"}
@@ -1,108 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { AlertMessage, AlertMessageType, FormError, PrimaryButton, TextField, TextFieldGroupContainer, } from '@manuscripts/style-guide';
13
- import { Field, Form, Formik, } from 'formik';
14
- import { StatusCodes } from 'http-status-codes';
15
- import React from 'react';
16
- import styled from 'styled-components';
17
- import { ProjectRole } from '../../lib/roles';
18
- import { RadioButton } from '../RadioButton';
19
- const SendInvitationButton = styled(PrimaryButton) `
20
- width: 100%;
21
- `;
22
- const RadioButtonsContainer = styled.div `
23
- padding-top: ${(props) => props.theme.grid.unit * 6}px;
24
- padding-bottom: ${(props) => props.theme.grid.unit * 6}px;
25
- `;
26
- const AlertMessageContainer = styled.div `
27
- margin-bottom: ${(props) => props.theme.grid.unit * 2}px;
28
- `;
29
- const errorResponseMessage = (status) => {
30
- switch (status) {
31
- case StatusCodes.BAD_REQUEST:
32
- return 'You are already a collaborator on this project.';
33
- case StatusCodes.CONFLICT:
34
- return 'The invited user is already a collaborator on this project.';
35
- default:
36
- return 'Sending invitation failed.';
37
- }
38
- };
39
- export class InvitationForm extends React.Component {
40
- constructor() {
41
- super(...arguments);
42
- this.state = {
43
- invitationSent: false,
44
- };
45
- this.initialValues = {
46
- email: '',
47
- name: '',
48
- role: 'Writer',
49
- };
50
- this.dismissSuccessAlert = () => {
51
- this.setState({
52
- invitationSent: false,
53
- });
54
- };
55
- }
56
- render() {
57
- const { allowSubmit, handleSubmit, invitationValues, tokenActions } = this.props;
58
- const { invitationSent } = this.state;
59
- return (React.createElement(Formik, { onSubmit: async (values, actions) => {
60
- try {
61
- await handleSubmit(values);
62
- this.setState({ invitationSent: true });
63
- }
64
- catch (error) {
65
- const errors = {};
66
- errors.submit = error.response
67
- ? errorResponseMessage(error.response.status)
68
- : 'There was an error submitting the form.';
69
- if (error.response &&
70
- error.response.status === StatusCodes.UNAUTHORIZED) {
71
- tokenActions.delete();
72
- }
73
- else {
74
- actions.setErrors(errors);
75
- }
76
- }
77
- finally {
78
- actions.setSubmitting(false);
79
- }
80
- }, initialValues: invitationValues || this.initialValues, isInitialValid: true, validateOnChange: false, validateOnBlur: false }, ({ errors, isSubmitting, values, resetForm, }) => (React.createElement(Form, { noValidate: true },
81
- errors.submit && (React.createElement(AlertMessage, { type: AlertMessageType.error, hideCloseButton: true },
82
- errors.submit,
83
- ' ')),
84
- !allowSubmit && (React.createElement(AlertMessageContainer, null,
85
- React.createElement(AlertMessage, { type: AlertMessageType.info, hideCloseButton: true }, "Only project owners can invite others to the project."))),
86
- invitationSent && (React.createElement(AlertMessageContainer, null,
87
- React.createElement(AlertMessage, { type: AlertMessageType.success, hideCloseButton: true, dismissButton: {
88
- text: 'OK',
89
- action: () => {
90
- this.dismissSuccessAlert();
91
- resetForm();
92
- },
93
- } }, "Invitation was sent."))),
94
- React.createElement(TextFieldGroupContainer, { errors: {
95
- name: errors.name,
96
- email: errors.email,
97
- } },
98
- React.createElement(Field, { name: 'name' }, ({ field }) => (React.createElement(TextField, { ...field, onFocus: this.dismissSuccessAlert, type: 'text', placeholder: 'name', required: true, error: errors.name, disabled: !allowSubmit }))),
99
- React.createElement(Field, { name: 'email' }, ({ field }) => (React.createElement(TextField, { ...field, onFocus: this.dismissSuccessAlert, type: 'email', placeholder: 'email', required: true, error: errors.email, disabled: !allowSubmit })))),
100
- React.createElement(RadioButtonsContainer, null,
101
- React.createElement(Field, { name: 'role' }, ({ field }) => (React.createElement(RadioButton, { _id: 'owner', ...field, onFocus: this.dismissSuccessAlert, value: 'Owner', required: true, textHint: 'Can modify and delete project, invite and remove collaborators', checked: values.role === ProjectRole.owner, disabled: !allowSubmit }, "Owner"))),
102
- React.createElement(Field, { name: 'role' }, ({ field }) => (React.createElement(RadioButton, { _id: 'writer', ...field, onFocus: this.dismissSuccessAlert, value: 'Writer', required: true, textHint: 'Can modify project contents', checked: values.role === ProjectRole.writer, disabled: !allowSubmit }, "Writer"))),
103
- React.createElement(Field, { name: 'role' }, ({ field }) => (React.createElement(RadioButton, { _id: 'viewer', ...field, onFocus: this.dismissSuccessAlert, value: 'Viewer', required: true, textHint: 'Can only review projects without modifying it', checked: values.role === ProjectRole.viewer, disabled: !allowSubmit }, "Viewer"))),
104
- errors.role && React.createElement(FormError, null, errors.role)),
105
- React.createElement(SendInvitationButton, { type: "submit", disabled: isSubmitting || !allowSubmit }, "Send Invitation")))));
106
- }
107
- }
108
- //# sourceMappingURL=AuthorInvitationForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthorInvitationForm.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorInvitationForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,SAAS,EACT,uBAAuB,GACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,KAAK,EAEL,IAAI,EACJ,MAAM,GAGP,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,M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AAC,oBAAoB,IACnB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,IAAI,CAAC,WAAW,sBAGjB,CAClB,CACR,CACM,CACV,CAAA;IACH,CAAC;CAOF"}
@@ -1,133 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { CloseButton, ModalContainer, ModalHeader, StyledModal, } from '@manuscripts/style-guide';
13
- import { buildBibliographicName, buildContributor, } from '@manuscripts/transform';
14
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
15
- import { getMetaData, reorderAuthors } from '../../lib/authors';
16
- import { useStore } from '../../store';
17
- import { AddAuthorsModalContainer } from './AddAuthorsModalContainer';
18
- import AuthorsModalContainer from './AuthorsModalContainer';
19
- const AuthorModalViews = () => {
20
- const [store, dispatch] = useStore((store) => store);
21
- const [state, setState] = useState({
22
- expanded: true,
23
- selectedAuthor: null,
24
- addingAuthors: false,
25
- nonAuthors: [],
26
- numberOfAddedAuthors: 0,
27
- addedAuthors: [],
28
- });
29
- const { saveTrackModel, collaboratorsProfiles, user, deleteTrackModel, trackModelMap, authorsPopupOn, } = store;
30
- const stopEditing = () => {
31
- setState((state) => ({
32
- ...state,
33
- selectedAuthor: null,
34
- addingAuthors: false,
35
- isInvite: false,
36
- }));
37
- dispatch({ authorsPopupOn: false });
38
- };
39
- const createAuthor = async (priority, person, name) => {
40
- if (name) {
41
- const [given, ...family] = name.split(' ');
42
- const bibName = buildBibliographicName({
43
- given,
44
- family: family.join(' '),
45
- });
46
- const author = buildContributor(bibName, 'author', priority);
47
- await saveTrackModel(author);
48
- setState((state) => ({
49
- ...state,
50
- numberOfAddedAuthors: state.numberOfAddedAuthors + 1,
51
- }));
52
- }
53
- if (person) {
54
- const author = buildContributor(person.bibliographicName, 'author', priority, person.userID);
55
- const createdAuthor = await saveTrackModel(author);
56
- setState((state) => ({
57
- ...state,
58
- addedAuthors: state.addedAuthors.concat(author.userID),
59
- numberOfAddedAuthors: state.numberOfAddedAuthors + 1,
60
- }));
61
- selectAuthor(createdAuthor);
62
- }
63
- };
64
- const startEditing = useCallback(() => {
65
- dispatch({ authorsPopupOn: true });
66
- }, [dispatch]);
67
- const selectAuthor = useCallback((author) => {
68
- // TODO: make this switch without deselecting
69
- setState((state) => ({
70
- ...state,
71
- selectedAuthor: typeof author === 'string' ? author : author._id,
72
- }));
73
- }, []);
74
- useEffect(() => {
75
- dispatch({ startEditing, selectAuthor });
76
- }, [dispatch, startEditing, selectAuthor]);
77
- const deselectAuthor = () => {
78
- setState((state) => ({ ...state, selectedAuthor: null }));
79
- };
80
- const removeAuthor = async (author) => {
81
- await deleteTrackModel(author._id);
82
- deselectAuthor();
83
- if (state.addedAuthors.includes(author.userID)) {
84
- const index = state.addedAuthors.indexOf(author.userID);
85
- state.addedAuthors.splice(index, 1);
86
- }
87
- };
88
- const handleAddingDoneCancel = () => setState((state) => ({
89
- ...state,
90
- numberOfAddedAuthors: 0,
91
- addingAuthors: false,
92
- }));
93
- const handleDrop = (authors, oldIndex, newIndex) => {
94
- const reorderedAuthors = reorderAuthors(authors, oldIndex, newIndex);
95
- Promise.all(reorderedAuthors.map((author, i) => {
96
- author.priority = i;
97
- return saveTrackModel(author);
98
- }))
99
- .then(() => {
100
- setState((state) => ({ ...state, authorListError: '' }));
101
- })
102
- .catch(() => {
103
- setState((state) => ({
104
- ...state,
105
- authorListError: 'There was an error saving authors',
106
- }));
107
- });
108
- };
109
- const metaData = useMemo(() => {
110
- const data = getMetaData(trackModelMap);
111
- return data;
112
- }, [trackModelMap]);
113
- useEffect(() => {
114
- dispatch({
115
- trackedAuthorsAndAffiliations: metaData?.authorsAndAffiliations,
116
- });
117
- }, [metaData, dispatch]);
118
- const authorsAndAffiliations = metaData?.authorsAndAffiliations;
119
- const contributorRoles = metaData?.contributorRoles || [];
120
- if (!collaboratorsProfiles ||
121
- !user ||
122
- !authorsAndAffiliations ||
123
- !contributorRoles) {
124
- return null;
125
- }
126
- return (React.createElement(StyledModal, { isOpen: !!authorsPopupOn, onRequestClose: stopEditing, shouldCloseOnOverlayClick: true },
127
- React.createElement(ModalContainer, null,
128
- React.createElement(ModalHeader, null,
129
- React.createElement(CloseButton, { onClick: stopEditing, "data-cy": 'modal-close-button' })),
130
- state.addingAuthors ? (React.createElement(AddAuthorsModalContainer, { ...state, handleAddingDoneCancel: handleAddingDoneCancel, createAuthor: createAuthor, authors: authorsAndAffiliations.authors })) : (React.createElement(AuthorsModalContainer, { ...state, createAuthor: createAuthor, selectAuthor: selectAuthor, removeAuthor: removeAuthor, saveTrackModel: saveTrackModel, handleDrop: handleDrop, authors: authorsAndAffiliations.authors, authorAffiliations: authorsAndAffiliations.authorAffiliations, affiliations: authorsAndAffiliations.affiliations, contributorRoles: contributorRoles })))));
131
- };
132
- export default AuthorModalViews;
133
- //# sourceMappingURL=AuthorModalViews.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthorModalViews.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorModalViews.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,WAAW,EACX,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,sBAAsB,EACtB,gBAAgB,G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AAC,WAAW,IACV,MAAM,EAAE,CAAC,CAAC,cAAc,EACxB,cAAc,EAAE,WAAW,EAC3B,yBAAyB,EAAE,IAAI;QAE/B,oBAAC,cAAc;YACb,oBAAC,WAAW;gBACV,oBAAC,WAAW,IAAC,OAAO,EAAE,WAAW,aAAW,oBAAoB,GAAI,CACxD;YACb,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CACrB,oBAAC,wBAAwB,OACnB,KAAK,EACT,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,sBAAsB,CAAC,OAAO,GACvC,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,qBAAqB,OAChB,KAAK,EACT,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,sBAAsB,CAAC,OAAO,EACvC,kBAAkB,EAAE,sBAAsB,CAAC,kBAAkB,EAC7D,YAAY,EAAE,sBAAsB,CAAC,YAAY,EACjD,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CACc,CACL,CACf,CAAA;AACH,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -1,94 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { ObjectTypes, } from '@manuscripts/json-schema';
13
- import { buildAffiliation, buildBibliographicName, buildContributor, buildContributorRole, } from '@manuscripts/transform';
14
- import React from 'react';
15
- import { stripTracked } from '../track-changes/utils';
16
- import { AuthorsModal } from './AuthorsModals';
17
- class AuthorsModalContainer extends React.Component {
18
- constructor() {
19
- super(...arguments);
20
- this.state = {
21
- isRemoveAuthorOpen: false,
22
- };
23
- this.createContributorRole = async (name) => {
24
- const contributorRole = buildContributorRole(name);
25
- return this.props.saveTrackModel(contributorRole);
26
- };
27
- this.handleRemoveAuthor = () => this.setState({ isRemoveAuthorOpen: !this.state.isRemoveAuthorOpen });
28
- this.removeAuthor = async (author) => {
29
- await this.props.removeAuthor(author);
30
- this.handleRemoveAuthor();
31
- };
32
- this.handleSaveAuthor = async (values) => {
33
- await this.props.saveTrackModel({
34
- objectType: ObjectTypes.Contributor,
35
- ...values,
36
- });
37
- };
38
- this.addAuthorAffiliation = async (affiliation) => {
39
- const selectedAuthor = this.getSelectedAuthor();
40
- if (!selectedAuthor) {
41
- return;
42
- }
43
- let affiliationObj;
44
- this.props.affiliations.forEach((aff) => {
45
- if (affiliation.startsWith(aff._id)) {
46
- affiliationObj = aff;
47
- }
48
- });
49
- if (!affiliationObj) {
50
- affiliationObj = await this.props.saveTrackModel(buildAffiliation(affiliation));
51
- }
52
- const author = {
53
- ...selectedAuthor,
54
- affiliations: (selectedAuthor.affiliations || []).concat(affiliationObj._id),
55
- };
56
- await this.props.saveTrackModel(author);
57
- };
58
- this.removeAuthorAffiliation = async (affiliation) => {
59
- const selectedAuthor = this.getSelectedAuthor();
60
- if (!selectedAuthor) {
61
- return;
62
- }
63
- const nextAuthor = {
64
- ...selectedAuthor,
65
- affiliations: (selectedAuthor.affiliations || []).filter((aff) => aff !== affiliation._id),
66
- };
67
- console.log(nextAuthor);
68
- await this.props.saveTrackModel(nextAuthor);
69
- };
70
- this.updateAffiliation = async (affiliation) => {
71
- await this.props.saveTrackModel(affiliation);
72
- };
73
- this.getSelectedAuthor = () => {
74
- const sel = this.props.authors.find((author) => stripTracked(author._id) ===
75
- stripTracked(this.props.selectedAuthor || '')) || null;
76
- return sel;
77
- };
78
- this.handleDrop = (oldIndex, newIndex) => {
79
- this.props.handleDrop(this.props.authors, oldIndex, newIndex);
80
- };
81
- this.createEmptyAuthor = async () => {
82
- const authorInfo = buildContributor(buildBibliographicName({ given: '', family: '' }), 'author', this.props.authors.length + 1);
83
- const author = await this.props.saveTrackModel(authorInfo);
84
- this.props.selectAuthor(author);
85
- };
86
- }
87
- render() {
88
- const { isRemoveAuthorOpen } = this.state;
89
- const { authors, authorAffiliations, affiliations, selectAuthor, contributorRoles, } = this.props;
90
- return (React.createElement(AuthorsModal, { "data-cy": "authors-editing-modal", authors: authors, authorAffiliations: authorAffiliations, affiliations: affiliations, selectedAuthor: this.getSelectedAuthor(), isRemoveAuthorOpen: isRemoveAuthorOpen, addAuthorAffiliation: this.addAuthorAffiliation, removeAuthorAffiliation: this.removeAuthorAffiliation, updateAffiliation: this.updateAffiliation, handleDrop: this.handleDrop, handleSaveAuthor: this.handleSaveAuthor, openAddAuthors: this.createEmptyAuthor, selectAuthor: selectAuthor, removeAuthor: this.removeAuthor, handleRemoveAuthor: this.handleRemoveAuthor, contributorRoles: contributorRoles, createContributorRole: this.createContributorRole }));
91
- }
92
- }
93
- export default AuthorsModalContainer;
94
- //# sourceMappingURL=AuthorsModalContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthorsModalContainer.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorsModalContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAKL,WAAW,GAEZ,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAEL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,wBAAwB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E,IAAI,CAAC,uBAAuB,EACrD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,cAAc,EAAE,IAAI,CAAC,iBAAiB,EACtC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,GACjD,CACH,CAAA;IACH,CAAC;CA0GF;AAED,eAAe,qBAAqB,CAAA"}
@@ -1,29 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import React from 'react';
13
- import styled from 'styled-components';
14
- import { ModalBody, StyledModalMain } from '../Sidebar';
15
- import AddAuthorsSidebar from './AddAuthorsSidebar';
16
- import { AuthorFormContainer } from './AuthorFormContainer';
17
- import { AddAuthorsPage, AuthorDetailsPage } from './AuthorsPage';
18
- import AuthorsSidebar from './AuthorsSidebar';
19
- export const ScrollableModalMain = styled(StyledModalMain) `
20
- overflow-y: auto;
21
- `;
22
- export const AuthorsModal = ({ authors, authorAffiliations, affiliations, removeAuthor, selectAuthor, selectedAuthor, openAddAuthors, handleSaveAuthor, addAuthorAffiliation, removeAuthorAffiliation, updateAffiliation, handleDrop, isRemoveAuthorOpen, handleRemoveAuthor, contributorRoles, createContributorRole, }) => (React.createElement(ModalBody, null,
23
- React.createElement(AuthorsSidebar, { authors: authors, authorAffiliations: authorAffiliations, selectAuthor: selectAuthor, selectedAuthor: selectedAuthor, openAddAuthors: openAddAuthors, handleDrop: handleDrop }),
24
- React.createElement(ScrollableModalMain, null, selectedAuthor ? (React.createElement(AuthorFormContainer, { author: selectedAuthor, affiliations: affiliations, authorAffiliations: authorAffiliations.get(selectedAuthor._id), handleSave: handleSaveAuthor, addAuthorAffiliation: addAuthorAffiliation, removeAuthorAffiliation: removeAuthorAffiliation, updateAffiliation: updateAffiliation, isRemoveAuthorOpen: isRemoveAuthorOpen, handleRemoveAuthor: handleRemoveAuthor, removeAuthor: removeAuthor, contributorRoles: contributorRoles, createContributorRole: createContributorRole })) : (React.createElement(AuthorDetailsPage, null)))));
25
- export const AddAuthorsModal = ({ nonAuthors, authors, addedAuthors, numberOfAddedAuthors, searchResults, searchText, createAuthor, handleAddingDoneCancel, handleSearchChange, isCreateAuthorOpen, handleCreateAuthor, }) => (React.createElement(ModalBody, null,
26
- React.createElement(AddAuthorsSidebar, { authors: authors, nonAuthors: nonAuthors, numberOfAddedAuthors: numberOfAddedAuthors, searchText: searchText, addedAuthors: addedAuthors, handleDoneCancel: handleAddingDoneCancel, createAuthor: createAuthor, handleSearchChange: handleSearchChange, searchResults: searchResults, isCreateAuthorOpen: isCreateAuthorOpen, handleCreateAuthor: handleCreateAuthor }),
27
- React.createElement(StyledModalMain, null,
28
- React.createElement(AddAuthorsPage, { addedAuthorsCount: numberOfAddedAuthors }))));
29
- //# sourceMappingURL=AuthorsModals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthorsModals.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorsModals.tsx"],"names":[],"mappings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AAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,iBAAiB,OAAG,CACtB,CACmB,CACZ,CACb,CAAA;AAqBD,MAAM,CAAC,MAAM,eAAe,GAA6C,CAAC,EACxE,UAAU,EACV,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,EAAE,EAAE,CAAC,CACJ,oBAAC,SAAS;IACR,oBAAC,iBAAiB,IAChB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,sBAAsB,EACxC,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,GACtC;IACF,oBAAC,eAAe;QACd,oBAAC,cAAc,IAAC,iBAAiB,EAAE,oBAAoB,GAAI,CAC3C,CACR,CACb,CAAA"}
@@ -1,92 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import AddedIcon from '@manuscripts/assets/react/AddedIcon';
13
- import AuthorPlaceholder from '@manuscripts/assets/react/AuthorPlaceholder';
14
- import ContributorDetails from '@manuscripts/assets/react/ContributorDetailsPlaceholder';
15
- import React from 'react';
16
- import styled from 'styled-components';
17
- const AddAuthorsMessage = () => (React.createElement("span", null, "Add authors to your author list from your collaborators, or invite new ones"));
18
- const SelectAuthorMessage = () => (React.createElement("span", null, "Select an author from the list to display their details here."));
19
- const AddedAuthorsMessage = ({ addedCount }) => React.createElement("span", null, "Authors added");
20
- const OuterContainer = styled.div `
21
- display: flex;
22
- flex-direction: column;
23
- align-items: center;
24
- justify-content: center;
25
- height: 100%;
26
- overflow-y: auto;
27
- `;
28
- const InnerContainer = styled.div `
29
- text-align: center;
30
- max-width: 480px;
31
- font-size: ${(props) => props.theme.font.size.xlarge};
32
- line-height: ${(props) => props.theme.font.lineHeight.large};
33
- `;
34
- const Placeholder = styled.div `
35
- display: flex;
36
- justify-content: center;
37
- margin-bottom: ${(props) => props.theme.grid.unit * 5}px;
38
- `;
39
- const Action = styled.div `
40
- display: flex;
41
- align-items: center;
42
- justify-content: center;
43
- font-size: ${(props) => props.theme.font.size.xlarge};
44
- font-weight: ${(props) => props.theme.font.weight.medium};
45
- letter-spacing: -0.5px;
46
- `;
47
- const Message = styled.div `
48
- max-width: 400px;
49
- font-size: ${(props) => props.theme.font.size.xlarge};
50
- margin-top: ${(props) => props.theme.grid.unit * 6}px;
51
- font-weight: ${(props) => props.theme.font.weight.light};
52
- color: ${(props) => props.theme.colors.text.secondary};
53
-
54
- @media (max-width: 850px) {
55
- margin-right: ${(props) => props.theme.grid.unit * 5}px;
56
- margin-left: ${(props) => props.theme.grid.unit * 5}px;
57
- max-width: 350px;
58
- }
59
- `;
60
- const AddedMessage = styled(Message) `
61
- margin-top: 2px;
62
- `;
63
- const IconContainer = styled.div `
64
- display: flex;
65
- align-self: center;
66
- padding-right: 5px;
67
- `;
68
- const MessageContainer = styled.div `
69
- display: flex;
70
- justify-content: center;
71
- `;
72
- export const AddAuthorsPage = ({ addedAuthorsCount, }) => (React.createElement(OuterContainer, null,
73
- React.createElement(InnerContainer, null,
74
- React.createElement(Placeholder, null,
75
- React.createElement(AuthorPlaceholder, null)),
76
- addedAuthorsCount ? (React.createElement(MessageContainer, { "data-cy": 'add-author-message' },
77
- React.createElement(IconContainer, null,
78
- React.createElement(AddedIcon, null)),
79
- React.createElement(AddedMessage, null,
80
- React.createElement(AddedAuthorsMessage, { addedCount: addedAuthorsCount })))) : (React.createElement(React.Fragment, null,
81
- React.createElement(Action, null, "Add Author"),
82
- React.createElement(Message, null,
83
- React.createElement(AddAuthorsMessage, null)))))));
84
- export const AuthorDetailsPage = () => (React.createElement(OuterContainer, { "data-cy": 'author-details' },
85
- React.createElement(InnerContainer, null,
86
- React.createElement(Placeholder, null,
87
- React.createElement(ContributorDetails, null)),
88
- React.createElement(React.Fragment, null,
89
- React.createElement(Action, null, "Author Details"),
90
- React.createElement(Message, null,
91
- React.createElement(SelectAuthorMessage, null))))));
92
- //# sourceMappingURL=AuthorsPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthorsPage.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorsPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,SAAS,MAAM,qCAAqC,CAAA;AAC3D,OAAO,iBAAiB,MAAM,6CAA6C,CAAA;AAC3E,OAAO,kBAAkB,MAAM,yDAAyD,CAAA;AACxF,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CAC9B,gHAEO,CACR,CAAA;AACD,MAAM,mB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AAmB,OAAG,CACf,CACK,CACF,CACF,CAClB,CAAA"}
@@ -1,29 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { AuthorsDND } from '@manuscripts/style-guide';
13
- import React from 'react';
14
- import styled from 'styled-components';
15
- import { AddButton } from '../AddButton';
16
- import { ModalSidebar, SidebarContent, SidebarHeader } from '../Sidebar';
17
- const SidebarAction = styled.div `
18
- display: flex;
19
- align-items: center;
20
- margin-bottom: ${(props) => props.theme.grid.unit * 4}px;
21
- `;
22
- const AuthorsSidebar = ({ openAddAuthors, authors, selectAuthor, handleDrop, selectedAuthor, }) => (React.createElement(ModalSidebar, { "data-cy": 'authors-sidebar' },
23
- React.createElement(SidebarHeader, { title: 'Authors' }),
24
- React.createElement(SidebarContent, null,
25
- React.createElement(SidebarAction, null,
26
- React.createElement(AddButton, { action: openAddAuthors, size: 'medium', title: 'New Author' })),
27
- React.createElement(AuthorsDND, { authors: authors, selectAuthor: selectAuthor, selectedAuthor: selectedAuthor, handleDrop: handleDrop }))));
28
- export default AuthorsSidebar;
29
- //# sourceMappingURL=AuthorsSidebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthorsSidebar.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorsSidebar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAqB,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAExE,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;mBAGb,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;CACtD,CAAA;AAWD,MAAM,cAAc,GAAmC,CAAC,EACtD,cAAc,EACd,OAAO,EACP,YAAY,EACZ,UAAU,EACV,cAAc,GACf,EAAE,EAAE,CAAC,CACJ,oBAAC,YAAY,eAAU,iBAAiB;IACtC,oBAAC,aAAa,IAAC,KAAK,EAAE,SAAS,GAAI;IAEnC,oBAAC,cAAc;QACb,oBAAC,aAAa;YACZ,oBAAC,SAAS,IACR,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,YAAY,GACnB,CACY;QAChB,oBAAC,UAAU,IACT,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,GACtB,CACa,CACJ,CAChB,CAAA;AAED,eAAe,cAAc,CAAA"}
@@ -1,38 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { Category, Dialog } from '@manuscripts/style-guide';
13
- import React from 'react';
14
- import { buildAuthorPriority } from '../../lib/authors';
15
- class CreateAuthorPageContainer extends React.Component {
16
- constructor() {
17
- super(...arguments);
18
- this.handleCreate = () => {
19
- this.props.createAuthor(buildAuthorPriority(this.props.authors), null, this.props.searchText);
20
- this.props.handleCancel();
21
- };
22
- }
23
- render() {
24
- const actions = {
25
- primary: {
26
- action: this.handleCreate,
27
- title: 'Create',
28
- },
29
- secondary: {
30
- action: this.props.handleCancel,
31
- title: 'Cancel',
32
- },
33
- };
34
- return (React.createElement(Dialog, { isOpen: this.props.isOpen, actions: actions, category: Category.confirmation, header: 'Create author', message: `Author already exist are you sure you want to create author with the same name?` }));
35
- }
36
- }
37
- export default CreateAuthorPageContainer;
38
- //# sourceMappingURL=CreateAuthorPageContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateAuthorPageContainer.js","sourceRoot":"","sources":["../../../../src/components/metadata/CreateAuthorPageContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAevD,MAAM,yBAA0B,SAAQ,KAAK,CAAC,SAAgB;IAA9D;;QAsBU,iBAAY,GAAG,GAAG,EAAE;YAC1B,IAAI,CAAC,KAAK,CAAC,YAAY,CACrB,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EACvC,IAAI,EACJ,IAAI,CAAC,KAAK,CAAC,UAAU,CACtB,CAAA;YACD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAA;QAC3B,CAAC,CAAA;IACH,CAAC;IA7BQ,MAAM;QACX,MAAM,OAAO,GAAG;YACd,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,YAAY;gBACzB,KAAK,EAAE,QAAQ;aAChB;YACD,SAAS,EAAE;gBACT,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY;gBAC/B,KAAK,EAAE,QAAQ;aAChB;SACF,CAAA;QACD,OAAO,CACL,oBAAC,MAAM,IACL,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,CAAC,YAAY,EAC/B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,iFAAiF,GAC1F,CACH,CAAA;IACH,CAAC;CASF;AAED,eAAe,yBAAyB,CAAA"}