@manuscripts/article-editor 1.10.10 → 1.10.11-LEAN-3301
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.
- package/dist/{types/components/metadata/SearchAuthorsSidebar.d.ts → cjs/components/UtilitiesEffects.js} +9 -10
- package/dist/cjs/components/UtilitiesEffects.js.map +1 -0
- package/dist/cjs/components/projects/ManuscriptPageContainer.js +4 -7
- package/dist/cjs/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/cjs/hooks/use-create-editor.js +11 -6
- package/dist/cjs/hooks/use-create-editor.js.map +1 -1
- package/dist/cjs/hooks/use-handle-snapshot.js +4 -1
- package/dist/cjs/hooks/use-handle-snapshot.js.map +1 -1
- package/dist/cjs/hooks/use-window-unload-effect.js +6 -2
- package/dist/cjs/hooks/use-window-unload-effect.js.map +1 -1
- package/dist/cjs/lib/deeper-equal.js +7 -3
- package/dist/cjs/lib/deeper-equal.js.map +1 -1
- package/dist/cjs/postgres-data/buildData.js +0 -4
- package/dist/cjs/postgres-data/buildData.js.map +1 -1
- package/dist/cjs/postgres-data/savingUtilities.js +29 -3
- package/dist/cjs/postgres-data/savingUtilities.js.map +1 -1
- package/dist/cjs/quarterback/QuarterbackStepsExchanger.js +14 -5
- package/dist/cjs/quarterback/QuarterbackStepsExchanger.js.map +1 -1
- package/dist/cjs/store/Store.js +1 -6
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/cjs/store/useStore.js +13 -12
- package/dist/cjs/store/useStore.js.map +1 -1
- package/dist/{types/components/metadata/AuthorsPage.d.ts → es/components/UtilitiesEffects.js} +7 -7
- package/dist/es/components/UtilitiesEffects.js.map +1 -0
- package/dist/es/components/projects/ManuscriptPageContainer.js +4 -7
- package/dist/es/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/es/hooks/use-create-editor.js +11 -6
- package/dist/es/hooks/use-create-editor.js.map +1 -1
- package/dist/es/hooks/use-handle-snapshot.js +4 -1
- package/dist/es/hooks/use-handle-snapshot.js.map +1 -1
- package/dist/es/hooks/use-window-unload-effect.js +6 -2
- package/dist/es/hooks/use-window-unload-effect.js.map +1 -1
- package/dist/es/lib/deeper-equal.js +7 -3
- package/dist/es/lib/deeper-equal.js.map +1 -1
- package/dist/es/postgres-data/buildData.js +0 -4
- package/dist/es/postgres-data/buildData.js.map +1 -1
- package/dist/es/postgres-data/savingUtilities.js +27 -2
- package/dist/es/postgres-data/savingUtilities.js.map +1 -1
- package/dist/es/quarterback/QuarterbackStepsExchanger.js +15 -6
- package/dist/es/quarterback/QuarterbackStepsExchanger.js.map +1 -1
- package/dist/es/store/Store.js +1 -6
- package/dist/es/store/Store.js.map +1 -1
- package/dist/es/store/useStore.js +13 -12
- package/dist/es/store/useStore.js.map +1 -1
- package/dist/types/components/{metadata/AuthorModalViews.d.ts → UtilitiesEffects.d.ts} +2 -3
- package/dist/types/hooks/use-window-unload-effect.d.ts +1 -1
- package/dist/types/postgres-data/savingUtilities.d.ts +2 -1
- package/dist/types/quarterback/QuarterbackStepsExchanger.d.ts +11 -2
- package/dist/types/store/Store.d.ts +2 -3
- package/dist/types/store/useStore.d.ts +3 -1
- package/package.json +3 -4
- package/dist/cjs/components/metadata/AddAuthorButton.js +0 -55
- package/dist/cjs/components/metadata/AddAuthorButton.js.map +0 -1
- package/dist/cjs/components/metadata/AddAuthorsModalContainer.js +0 -71
- package/dist/cjs/components/metadata/AddAuthorsModalContainer.js.map +0 -1
- package/dist/cjs/components/metadata/AddAuthorsSidebar.js +0 -67
- package/dist/cjs/components/metadata/AddAuthorsSidebar.js.map +0 -1
- package/dist/cjs/components/metadata/AuthorFormContainer.js +0 -24
- package/dist/cjs/components/metadata/AuthorFormContainer.js.map +0 -1
- package/dist/cjs/components/metadata/AuthorInvitationForm.js +0 -115
- package/dist/cjs/components/metadata/AuthorInvitationForm.js.map +0 -1
- package/dist/cjs/components/metadata/AuthorModalViews.js +0 -161
- package/dist/cjs/components/metadata/AuthorModalViews.js.map +0 -1
- package/dist/cjs/components/metadata/AuthorsModalContainer.js +0 -99
- package/dist/cjs/components/metadata/AuthorsModalContainer.js.map +0 -1
- package/dist/cjs/components/metadata/AuthorsModals.js +0 -37
- package/dist/cjs/components/metadata/AuthorsModals.js.map +0 -1
- package/dist/cjs/components/metadata/AuthorsPage.js +0 -100
- package/dist/cjs/components/metadata/AuthorsPage.js.map +0 -1
- package/dist/cjs/components/metadata/AuthorsSidebar.js +0 -34
- package/dist/cjs/components/metadata/AuthorsSidebar.js.map +0 -1
- package/dist/cjs/components/metadata/CreateAuthorPageContainer.js +0 -43
- package/dist/cjs/components/metadata/CreateAuthorPageContainer.js.map +0 -1
- package/dist/cjs/components/metadata/InviteAuthorButton.js +0 -62
- package/dist/cjs/components/metadata/InviteAuthorButton.js.map +0 -1
- package/dist/cjs/components/metadata/InviteAuthorPopperContainer.js +0 -62
- package/dist/cjs/components/metadata/InviteAuthorPopperContainer.js.map +0 -1
- package/dist/cjs/components/metadata/InviteAuthorsSidebar.js +0 -27
- package/dist/cjs/components/metadata/InviteAuthorsSidebar.js.map +0 -1
- package/dist/cjs/components/metadata/SearchAuthorsSidebar.js +0 -48
- package/dist/cjs/components/metadata/SearchAuthorsSidebar.js.map +0 -1
- package/dist/cjs/lib/authors.js +0 -124
- package/dist/cjs/lib/authors.js.map +0 -1
- package/dist/es/components/metadata/AddAuthorButton.js +0 -50
- package/dist/es/components/metadata/AddAuthorButton.js.map +0 -1
- package/dist/es/components/metadata/AddAuthorsModalContainer.js +0 -64
- package/dist/es/components/metadata/AddAuthorsModalContainer.js.map +0 -1
- package/dist/es/components/metadata/AddAuthorsSidebar.js +0 -62
- package/dist/es/components/metadata/AddAuthorsSidebar.js.map +0 -1
- package/dist/es/components/metadata/AuthorFormContainer.js +0 -17
- package/dist/es/components/metadata/AuthorFormContainer.js.map +0 -1
- package/dist/es/components/metadata/AuthorInvitationForm.js +0 -108
- package/dist/es/components/metadata/AuthorInvitationForm.js.map +0 -1
- package/dist/es/components/metadata/AuthorModalViews.js +0 -133
- package/dist/es/components/metadata/AuthorModalViews.js.map +0 -1
- package/dist/es/components/metadata/AuthorsModalContainer.js +0 -94
- package/dist/es/components/metadata/AuthorsModalContainer.js.map +0 -1
- package/dist/es/components/metadata/AuthorsModals.js +0 -29
- package/dist/es/components/metadata/AuthorsModals.js.map +0 -1
- package/dist/es/components/metadata/AuthorsPage.js +0 -92
- package/dist/es/components/metadata/AuthorsPage.js.map +0 -1
- package/dist/es/components/metadata/AuthorsSidebar.js +0 -29
- package/dist/es/components/metadata/AuthorsSidebar.js.map +0 -1
- package/dist/es/components/metadata/CreateAuthorPageContainer.js +0 -38
- package/dist/es/components/metadata/CreateAuthorPageContainer.js.map +0 -1
- package/dist/es/components/metadata/InviteAuthorButton.js +0 -57
- package/dist/es/components/metadata/InviteAuthorButton.js.map +0 -1
- package/dist/es/components/metadata/InviteAuthorPopperContainer.js +0 -57
- package/dist/es/components/metadata/InviteAuthorPopperContainer.js.map +0 -1
- package/dist/es/components/metadata/InviteAuthorsSidebar.js +0 -22
- package/dist/es/components/metadata/InviteAuthorsSidebar.js.map +0 -1
- package/dist/es/components/metadata/SearchAuthorsSidebar.js +0 -43
- package/dist/es/components/metadata/SearchAuthorsSidebar.js.map +0 -1
- package/dist/es/lib/authors.js +0 -112
- package/dist/es/lib/authors.js.map +0 -1
- package/dist/types/components/metadata/AddAuthorButton.d.ts +0 -29
- package/dist/types/components/metadata/AddAuthorsModalContainer.d.ts +0 -38
- package/dist/types/components/metadata/AddAuthorsSidebar.d.ts +0 -28
- package/dist/types/components/metadata/AuthorFormContainer.d.ts +0 -31
- package/dist/types/components/metadata/AuthorInvitationForm.d.ts +0 -36
- package/dist/types/components/metadata/AuthorsModalContainer.d.ts +0 -48
- package/dist/types/components/metadata/AuthorsModals.d.ts +0 -50
- package/dist/types/components/metadata/AuthorsSidebar.d.ts +0 -24
- package/dist/types/components/metadata/CreateAuthorPageContainer.d.ts +0 -25
- package/dist/types/components/metadata/InviteAuthorButton.d.ts +0 -33
- package/dist/types/components/metadata/InviteAuthorPopperContainer.d.ts +0 -31
- package/dist/types/components/metadata/InviteAuthorsSidebar.d.ts +0 -24
- package/dist/types/lib/authors.d.ts +0 -42
package/dist/cjs/lib/authors.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* 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.
|
|
4
|
-
*
|
|
5
|
-
* 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.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.reorderAuthors = exports.isJointFirstAuthor = exports.buildAuthorsAndAffiliations = exports.getMetaData = exports.buildAffiliationsMap = exports.buildAuthorAffiliations = exports.buildSortedAffiliationIDs = exports.buildAuthorPriority = exports.buildSortedContributors = void 0;
|
|
15
|
-
const json_schema_1 = require("@manuscripts/json-schema");
|
|
16
|
-
const transform_1 = require("@manuscripts/transform");
|
|
17
|
-
const sort_1 = require("./sort");
|
|
18
|
-
const buildSortedContributors = (contributors) => contributors.sort(sort_1.ascendingPriority);
|
|
19
|
-
exports.buildSortedContributors = buildSortedContributors;
|
|
20
|
-
const buildAuthorPriority = (authors) => {
|
|
21
|
-
if (!authors.length) {
|
|
22
|
-
return 0;
|
|
23
|
-
}
|
|
24
|
-
const priorities = authors.map((author) => Number(author.priority));
|
|
25
|
-
return Math.max(...priorities) + 1;
|
|
26
|
-
};
|
|
27
|
-
exports.buildAuthorPriority = buildAuthorPriority;
|
|
28
|
-
const buildSortedAffiliationIDs = (sortedAuthors) => {
|
|
29
|
-
const ids = new Set();
|
|
30
|
-
for (const author of sortedAuthors) {
|
|
31
|
-
if (author.affiliations) {
|
|
32
|
-
author.affiliations.forEach((id) => {
|
|
33
|
-
ids.add(id);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return [...ids];
|
|
38
|
-
};
|
|
39
|
-
exports.buildSortedAffiliationIDs = buildSortedAffiliationIDs;
|
|
40
|
-
const buildAuthorAffiliations = (authors, affiliations, sortedAffiliationIDs) => {
|
|
41
|
-
const items = new Map();
|
|
42
|
-
const sortedAffs = Array.from(affiliations.values());
|
|
43
|
-
for (const author of authors) {
|
|
44
|
-
items.set(author._id, (author.affiliations || []).map((id) => {
|
|
45
|
-
return {
|
|
46
|
-
ordinal: sortedAffiliationIDs.indexOf(id) + 1,
|
|
47
|
-
data: sortedAffs.find((af) => af._id.startsWith(id)),
|
|
48
|
-
};
|
|
49
|
-
}));
|
|
50
|
-
}
|
|
51
|
-
return items;
|
|
52
|
-
};
|
|
53
|
-
exports.buildAuthorAffiliations = buildAuthorAffiliations;
|
|
54
|
-
function createInvalidAffillation(id) {
|
|
55
|
-
return {
|
|
56
|
-
priority: 0,
|
|
57
|
-
manuscriptID: '',
|
|
58
|
-
containerID: '',
|
|
59
|
-
_id: id,
|
|
60
|
-
objectType: 'MPAffiliation',
|
|
61
|
-
createdAt: 0,
|
|
62
|
-
updatedAt: 0,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const buildAffiliationsMap = (affiliationIDs, affiliations) => new Map(affiliationIDs.map((id) => {
|
|
66
|
-
let associatedItem = affiliations.find((affiliation) => affiliation._id.startsWith(id));
|
|
67
|
-
// this provides loose id referencing for cases when affiliation is rejected in track changes and doesn't exist anymore in the modelMap
|
|
68
|
-
associatedItem = associatedItem || createInvalidAffillation(id);
|
|
69
|
-
return [id, associatedItem];
|
|
70
|
-
}));
|
|
71
|
-
exports.buildAffiliationsMap = buildAffiliationsMap;
|
|
72
|
-
const isContributor = (0, transform_1.hasObjectType)(json_schema_1.ObjectTypes.Contributor);
|
|
73
|
-
const isAffiliation = (0, transform_1.hasObjectType)(json_schema_1.ObjectTypes.Affiliation);
|
|
74
|
-
const getMetaData = (modelMap) => {
|
|
75
|
-
const affiliationAndContributors = [];
|
|
76
|
-
const contributorRoles = [];
|
|
77
|
-
if (modelMap) {
|
|
78
|
-
for (const model of modelMap.values()) {
|
|
79
|
-
if (model.objectType === json_schema_1.ObjectTypes.Affiliation ||
|
|
80
|
-
model.objectType === json_schema_1.ObjectTypes.Contributor) {
|
|
81
|
-
affiliationAndContributors.push(model); // or Contributor
|
|
82
|
-
}
|
|
83
|
-
if (model.objectType === json_schema_1.ObjectTypes.ContributorRole) {
|
|
84
|
-
contributorRoles.push(model);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
authorsAndAffiliations: (0, exports.buildAuthorsAndAffiliations)(affiliationAndContributors),
|
|
89
|
-
contributorRoles: contributorRoles,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
exports.getMetaData = getMetaData;
|
|
94
|
-
const buildAuthorsAndAffiliations = (data) => {
|
|
95
|
-
const authors = data.filter(isContributor);
|
|
96
|
-
const affiliations = data.filter(isAffiliation);
|
|
97
|
-
// sorted authors
|
|
98
|
-
const sortedAuthors = authors.sort(sort_1.ascendingPriority);
|
|
99
|
-
// array of unique affiliations IDs based on the order give by authors
|
|
100
|
-
const sortedAffiliationIDs = (0, exports.buildSortedAffiliationIDs)(sortedAuthors);
|
|
101
|
-
const affiliationsMap = (0, exports.buildAffiliationsMap)(sortedAffiliationIDs, affiliations);
|
|
102
|
-
const authorAffiliations = (0, exports.buildAuthorAffiliations)(sortedAuthors, affiliationsMap, sortedAffiliationIDs);
|
|
103
|
-
return {
|
|
104
|
-
affiliations: affiliationsMap,
|
|
105
|
-
authors: sortedAuthors,
|
|
106
|
-
authorAffiliations,
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
exports.buildAuthorsAndAffiliations = buildAuthorsAndAffiliations;
|
|
110
|
-
const isJointFirstAuthor = (authors, index) => {
|
|
111
|
-
const author = index === 0 ? authors[index] : authors[index - 1];
|
|
112
|
-
return Boolean(author.isJointContributor);
|
|
113
|
-
};
|
|
114
|
-
exports.isJointFirstAuthor = isJointFirstAuthor;
|
|
115
|
-
const reorderAuthors = (authors, oldIndex, newIndex) => {
|
|
116
|
-
const clonedAuthors = authors.slice(0);
|
|
117
|
-
const order = authors.map((_, i) => (i === oldIndex ? newIndex : i));
|
|
118
|
-
clonedAuthors.sort((a, b) => {
|
|
119
|
-
return order[authors.indexOf(a)] - order[authors.indexOf(b)];
|
|
120
|
-
});
|
|
121
|
-
return clonedAuthors;
|
|
122
|
-
};
|
|
123
|
-
exports.reorderAuthors = reorderAuthors;
|
|
124
|
-
//# sourceMappingURL=authors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authors.js","sourceRoot":"","sources":["../../../src/lib/authors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,0DAMiC;AACjC,sDAAsD;AAEtD,iCAA0C;AAenC,MAAM,uBAAuB,GAAG,CAAC,YAA2B,EAAE,EAAE,CACrE,YAAY,CAAC,IAAI,CAAC,wBAAiB,CAAC,CAAA;AADzB,QAAA,uBAAuB,2BACE;AAE/B,MAAM,mBAAmB,GAAG,CAAC,OAAsB,EAAE,EAAE;IAC5D,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACnB,OAAO,CAAC,CAAA;KACT;IAED,MAAM,UAAU,G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AAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAEhE,OAAO,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAC3C,CAAC,CAAA;AAJY,QAAA,kBAAkB,sBAI9B;AAEM,MAAM,cAAc,GAAG,CAC5B,OAAsB,EACtB,QAAgB,EAChB,QAAgB,EAChB,EAAE;IACF,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACtC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACpE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAA;IACF,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAXY,QAAA,cAAc,kBAW1B"}
|
|
@@ -1,50 +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 { AddIconInverted, IconButton } from '@manuscripts/style-guide';
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import styled from 'styled-components';
|
|
16
|
-
import { buildAuthorPriority } from '../../lib/authors';
|
|
17
|
-
import { theme } from '../../theme/theme';
|
|
18
|
-
const AddIconButton = styled(IconButton).attrs({ defaultColor: true }) `
|
|
19
|
-
width: unset;
|
|
20
|
-
height: unset;
|
|
21
|
-
`;
|
|
22
|
-
class AddAuthorButton extends React.Component {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.state = {
|
|
26
|
-
isSelected: false,
|
|
27
|
-
};
|
|
28
|
-
this.handleSelected = () => {
|
|
29
|
-
const { person, authors, createAuthor } = this.props;
|
|
30
|
-
this.setState({ isSelected: true });
|
|
31
|
-
createAuthor(buildAuthorPriority(authors), person);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
componentDidMount() {
|
|
35
|
-
this.setState({
|
|
36
|
-
isSelected: this.props.isSelected || false,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
render() {
|
|
40
|
-
const { isSelected } = this.state;
|
|
41
|
-
if (isSelected) {
|
|
42
|
-
return (React.createElement(AddIconButton, null,
|
|
43
|
-
React.createElement(AddedIcon, null)));
|
|
44
|
-
}
|
|
45
|
-
return (React.createElement(AddIconButton, { onClick: this.handleSelected },
|
|
46
|
-
React.createElement(AddIconInverted, { color: theme.colors.brand.medium })));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export default AddAuthorButton;
|
|
50
|
-
//# sourceMappingURL=AddAuthorButton.js.map
|
|
@@ -1 +0,0 @@
|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;SACF;QAED,OAAO,CACL,oBAAC,aAAa,IAAC,OAAO,EAAE,IAAI,CAAC,cAAc;YACzC,oBAAC,eAAe,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAI,CACvC,CACjB,CAAA;IACH,CAAC;CAQF;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -1,64 +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 { AddAuthorsModal } from './AuthorsModals';
|
|
14
|
-
export class AddAuthorsModalContainer extends React.Component {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.state = {
|
|
18
|
-
isCreateAuthorOpen: false,
|
|
19
|
-
searchText: '',
|
|
20
|
-
searchResults: [],
|
|
21
|
-
};
|
|
22
|
-
this.handleCreateAuthor = () => {
|
|
23
|
-
if (this.state.isCreateAuthorOpen) {
|
|
24
|
-
this.setState({
|
|
25
|
-
searchText: '',
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
this.setState({
|
|
29
|
-
isCreateAuthorOpen: !this.state.isCreateAuthorOpen,
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
this.handleSearchChange = (event) => {
|
|
33
|
-
this.setState({ searchText: event.currentTarget.value });
|
|
34
|
-
this.search(event.currentTarget.value);
|
|
35
|
-
};
|
|
36
|
-
this.search = (searchText) => {
|
|
37
|
-
const { nonAuthors } = this.props;
|
|
38
|
-
if (!nonAuthors || !searchText) {
|
|
39
|
-
return this.setState({ searchResults: [] });
|
|
40
|
-
}
|
|
41
|
-
searchText = searchText.toLowerCase();
|
|
42
|
-
const searchResults = nonAuthors.filter((person) => {
|
|
43
|
-
if (searchText.includes('@')) {
|
|
44
|
-
return person.email && person.email.toLowerCase().includes(searchText);
|
|
45
|
-
}
|
|
46
|
-
const personName = [
|
|
47
|
-
person.bibliographicName.given,
|
|
48
|
-
person.bibliographicName.family,
|
|
49
|
-
]
|
|
50
|
-
.filter((part) => part)
|
|
51
|
-
.join(' ')
|
|
52
|
-
.toLowerCase();
|
|
53
|
-
return personName && personName.includes(searchText);
|
|
54
|
-
});
|
|
55
|
-
this.setState({ searchResults });
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
render() {
|
|
59
|
-
const { isCreateAuthorOpen, searchResults, searchText } = this.state;
|
|
60
|
-
const { numberOfAddedAuthors, createAuthor, addedAuthors, authors, handleAddingDoneCancel, nonAuthors, } = this.props;
|
|
61
|
-
return (React.createElement(AddAuthorsModal, { authors: authors, nonAuthors: nonAuthors, addedAuthors: addedAuthors, numberOfAddedAuthors: numberOfAddedAuthors, isCreateAuthorOpen: isCreateAuthorOpen, searchResults: searchResults, searchText: searchText, createAuthor: createAuthor, handleAddingDoneCancel: handleAddingDoneCancel, handleSearchChange: this.handleSearchChange, handleCreateAuthor: this.handleCreateAuthor }));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=AddAuthorsModalContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|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|
|
@@ -1,62 +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 { Avatar } from '@manuscripts/style-guide';
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import styled from 'styled-components';
|
|
15
|
-
import { ModalSidebar, SidebarContent, SidebarHeader, SidebarPersonContainer, SidebarSearch, } from '../Sidebar';
|
|
16
|
-
import AddAuthorButton from './AddAuthorButton';
|
|
17
|
-
import CreateAuthorPageContainer from './CreateAuthorPageContainer';
|
|
18
|
-
import SearchAuthorsSidebar from './SearchAuthorsSidebar';
|
|
19
|
-
const PersonInitial = styled.span `
|
|
20
|
-
margin-right: ${(props) => props.theme.grid.unit}px;
|
|
21
|
-
font-weight: ${(props) => props.theme.font.weight.light};
|
|
22
|
-
`;
|
|
23
|
-
const PersonName = styled.div `
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
color: ${(props) => props.theme.colors.text.primary};
|
|
26
|
-
font-size: ${(props) => props.theme.font.size.xlarge};
|
|
27
|
-
font-weight: ${(props) => props.theme.font.weight.medium};
|
|
28
|
-
max-width: 138px;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
text-overflow: ellipsis;
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
width: 100%;
|
|
33
|
-
`;
|
|
34
|
-
const PersonData = styled.div `
|
|
35
|
-
margin-left: ${(props) => props.theme.grid.unit * 2}px;
|
|
36
|
-
`;
|
|
37
|
-
const UserDataContainer = styled.div `
|
|
38
|
-
align-items: center;
|
|
39
|
-
display: flex;
|
|
40
|
-
flex: 1;
|
|
41
|
-
margin-right: 16px;
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
`;
|
|
44
|
-
const SearchContainer = styled.div `
|
|
45
|
-
margin-bottom: ${(props) => props.theme.grid.unit * 2}px;
|
|
46
|
-
`;
|
|
47
|
-
const AddAuthorsSidebar = ({ nonAuthors, numberOfAddedAuthors, searchText, addedAuthors, handleDoneCancel, createAuthor, handleSearchChange, searchResults, authors, isCreateAuthorOpen, handleCreateAuthor, }) => {
|
|
48
|
-
return (React.createElement(ModalSidebar, { "data-cy": 'add-author-sidebar' },
|
|
49
|
-
React.createElement(SidebarHeader, { action: handleDoneCancel, isCancel: !numberOfAddedAuthors, title: 'Add Author' }),
|
|
50
|
-
React.createElement(SearchContainer, null,
|
|
51
|
-
React.createElement(SidebarSearch, { autoFocus: true, handleSearchChange: handleSearchChange, maxLength: 100, placeholder: 'Search name/email', value: searchText })),
|
|
52
|
-
searchText === '' ? (React.createElement(SidebarContent, { "data-cy": "non-authors-list" }, nonAuthors.map((person) => (React.createElement(SidebarPersonContainer, { key: person._id },
|
|
53
|
-
React.createElement(UserDataContainer, null,
|
|
54
|
-
React.createElement(Avatar, { src: person.avatar, size: 45 }),
|
|
55
|
-
React.createElement(PersonData, null,
|
|
56
|
-
React.createElement(PersonName, null,
|
|
57
|
-
React.createElement(PersonInitial, null, person.bibliographicName.given),
|
|
58
|
-
person.bibliographicName.family))),
|
|
59
|
-
React.createElement(AddAuthorButton, { person: person, isSelected: addedAuthors.includes(person.userID), createAuthor: createAuthor, authors: authors })))))) : isCreateAuthorOpen ? (React.createElement(CreateAuthorPageContainer, { "data-cy": "create-author-dialog", authors: authors, createAuthor: createAuthor, isOpen: isCreateAuthorOpen, handleCancel: handleCreateAuthor, searchText: searchText })) : (React.createElement(SearchAuthorsSidebar, { "data-cy": "search-authors-sidebar", addedAuthors: addedAuthors, createAuthor: createAuthor, searchResults: searchResults, authors: authors }))));
|
|
60
|
-
};
|
|
61
|
-
export default AddAuthorsSidebar;
|
|
62
|
-
//# sourceMappingURL=AddAuthorsSidebar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AddAuthorsSidebar.js","sourceRoot":"","sources":["../../../../src/components/metadata/AddAuthorsSidebar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEjD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,aAAa,GACd,MAAM,YAAY,CAAA;AACnB,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,yBAAyB,MAAM,6BAA6B,CAAA;AACnE,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AAEzD,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAA;kBACf,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;iBACjC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;CACxD,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;WAElB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;eACtC,CAAC,KAAK,EAAE,EAAE,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AAE,MAAM,CAAC,GAAG;YACrC,oBAAC,iBAAiB;gBAChB,oBAAC,MAAM,IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,GAAI;gBACxC,oBAAC,UAAU;oBACT,oBAAC,UAAU;wBACT,oBAAC,aAAa,QACX,MAAM,CAAC,iBAAiB,CAAC,KAAK,CACjB;wBACf,MAAM,CAAC,iBAAiB,CAAC,MAAM,CACrB,CACF,CACK;YACpB,oBAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAChD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,GAChB,CACqB,CAC1B,CAAC,CACa,CAClB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CACvB,oBAAC,yBAAyB,eAChB,sBAAsB,EAC9B,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,kBAAkB,EAC1B,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,UAAU,GACtB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,oBAAoB,eACX,wBAAwB,EAChC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,GAChB,CACH,CACY,CAChB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1,17 +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 { AffiliationsEditor, AuthorForm, } from '@manuscripts/style-guide';
|
|
13
|
-
import React from 'react';
|
|
14
|
-
export const AuthorFormContainer = ({ author, affiliations, authorAffiliations, handleSave, addAuthorAffiliation, removeAuthorAffiliation, updateAffiliation, removeAuthor, isRemoveAuthorOpen, handleRemoveAuthor, contributorRoles, createContributorRole, }) => (React.createElement(React.Fragment, null,
|
|
15
|
-
React.createElement(AuthorForm, { author: author, handleSave: handleSave, isRemoveAuthorOpen: isRemoveAuthorOpen, removeAuthor: removeAuthor, handleRemoveAuthor: handleRemoveAuthor, contributorRoles: contributorRoles, createContributorRole: createContributorRole }),
|
|
16
|
-
React.createElement(AffiliationsEditor, { affiliations: affiliations, authorAffiliations: authorAffiliations, addAuthorAffiliation: addAuthorAffiliation, removeAuthorAffiliation: removeAuthorAffiliation, updateAffiliation: updateAffiliation })));
|
|
17
|
-
//# sourceMappingURL=AuthorFormContainer.js.map
|
|
@@ -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,uB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AA+C,EACzD,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,MAAM,EAC3C,QAAQ,EAAE,CAAC,WAAW,aAGV,CACf,CACK;gBAEP,MAAM,CAAC,IAAI,IAAI,oBAAC,SAAS,QAAE,MAAM,CAAC,IAAI,CAAa,CAC9B;YAExB,oBAAC,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,E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