@manuscripts/article-editor 1.10.11-LEAN-3301 → 1.10.11

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/metadata/AddAuthorButton.js +55 -0
  2. package/dist/cjs/components/metadata/AddAuthorButton.js.map +1 -0
  3. package/dist/cjs/components/metadata/AddAuthorsModalContainer.js +71 -0
  4. package/dist/cjs/components/metadata/AddAuthorsModalContainer.js.map +1 -0
  5. package/dist/cjs/components/metadata/AddAuthorsSidebar.js +67 -0
  6. package/dist/cjs/components/metadata/AddAuthorsSidebar.js.map +1 -0
  7. package/dist/cjs/components/metadata/AuthorFormContainer.js +24 -0
  8. package/dist/cjs/components/metadata/AuthorFormContainer.js.map +1 -0
  9. package/dist/cjs/components/metadata/AuthorInvitationForm.js +115 -0
  10. package/dist/cjs/components/metadata/AuthorInvitationForm.js.map +1 -0
  11. package/dist/cjs/components/metadata/AuthorModalViews.js +161 -0
  12. package/dist/cjs/components/metadata/AuthorModalViews.js.map +1 -0
  13. package/dist/cjs/components/metadata/AuthorsModalContainer.js +99 -0
  14. package/dist/cjs/components/metadata/AuthorsModalContainer.js.map +1 -0
  15. package/dist/cjs/components/metadata/AuthorsModals.js +37 -0
  16. package/dist/cjs/components/metadata/AuthorsModals.js.map +1 -0
  17. package/dist/cjs/components/metadata/AuthorsPage.js +100 -0
  18. package/dist/cjs/components/metadata/AuthorsPage.js.map +1 -0
  19. package/dist/cjs/components/metadata/AuthorsSidebar.js +34 -0
  20. package/dist/cjs/components/metadata/AuthorsSidebar.js.map +1 -0
  21. package/dist/cjs/components/metadata/CreateAuthorPageContainer.js +43 -0
  22. package/dist/cjs/components/metadata/CreateAuthorPageContainer.js.map +1 -0
  23. package/dist/cjs/components/metadata/InviteAuthorButton.js +62 -0
  24. package/dist/cjs/components/metadata/InviteAuthorButton.js.map +1 -0
  25. package/dist/cjs/components/metadata/InviteAuthorPopperContainer.js +62 -0
  26. package/dist/cjs/components/metadata/InviteAuthorPopperContainer.js.map +1 -0
  27. package/dist/cjs/components/metadata/InviteAuthorsSidebar.js +27 -0
  28. package/dist/cjs/components/metadata/InviteAuthorsSidebar.js.map +1 -0
  29. package/dist/cjs/components/metadata/SearchAuthorsSidebar.js +48 -0
  30. package/dist/cjs/components/metadata/SearchAuthorsSidebar.js.map +1 -0
  31. package/dist/cjs/components/projects/ManuscriptPageContainer.js +2 -0
  32. package/dist/cjs/components/projects/ManuscriptPageContainer.js.map +1 -1
  33. package/dist/cjs/hooks/use-create-editor.js +2 -0
  34. package/dist/cjs/hooks/use-create-editor.js.map +1 -1
  35. package/dist/cjs/lib/authors.js +124 -0
  36. package/dist/cjs/lib/authors.js.map +1 -0
  37. package/dist/cjs/postgres-data/buildData.js +4 -0
  38. package/dist/cjs/postgres-data/buildData.js.map +1 -1
  39. package/dist/cjs/store/Store.js.map +1 -1
  40. package/dist/es/components/metadata/AddAuthorButton.js +50 -0
  41. package/dist/es/components/metadata/AddAuthorButton.js.map +1 -0
  42. package/dist/es/components/metadata/AddAuthorsModalContainer.js +64 -0
  43. package/dist/es/components/metadata/AddAuthorsModalContainer.js.map +1 -0
  44. package/dist/es/components/metadata/AddAuthorsSidebar.js +62 -0
  45. package/dist/es/components/metadata/AddAuthorsSidebar.js.map +1 -0
  46. package/dist/es/components/metadata/AuthorFormContainer.js +17 -0
  47. package/dist/es/components/metadata/AuthorFormContainer.js.map +1 -0
  48. package/dist/es/components/metadata/AuthorInvitationForm.js +108 -0
  49. package/dist/es/components/metadata/AuthorInvitationForm.js.map +1 -0
  50. package/dist/es/components/metadata/AuthorModalViews.js +133 -0
  51. package/dist/es/components/metadata/AuthorModalViews.js.map +1 -0
  52. package/dist/es/components/metadata/AuthorsModalContainer.js +94 -0
  53. package/dist/es/components/metadata/AuthorsModalContainer.js.map +1 -0
  54. package/dist/es/components/metadata/AuthorsModals.js +29 -0
  55. package/dist/es/components/metadata/AuthorsModals.js.map +1 -0
  56. package/dist/es/components/metadata/AuthorsPage.js +92 -0
  57. package/dist/es/components/metadata/AuthorsPage.js.map +1 -0
  58. package/dist/es/components/metadata/AuthorsSidebar.js +29 -0
  59. package/dist/es/components/metadata/AuthorsSidebar.js.map +1 -0
  60. package/dist/es/components/metadata/CreateAuthorPageContainer.js +38 -0
  61. package/dist/es/components/metadata/CreateAuthorPageContainer.js.map +1 -0
  62. package/dist/es/components/metadata/InviteAuthorButton.js +57 -0
  63. package/dist/es/components/metadata/InviteAuthorButton.js.map +1 -0
  64. package/dist/es/components/metadata/InviteAuthorPopperContainer.js +57 -0
  65. package/dist/es/components/metadata/InviteAuthorPopperContainer.js.map +1 -0
  66. package/dist/es/components/metadata/InviteAuthorsSidebar.js +22 -0
  67. package/dist/es/components/metadata/InviteAuthorsSidebar.js.map +1 -0
  68. package/dist/es/components/metadata/SearchAuthorsSidebar.js +43 -0
  69. package/dist/es/components/metadata/SearchAuthorsSidebar.js.map +1 -0
  70. package/dist/es/components/projects/ManuscriptPageContainer.js +2 -0
  71. package/dist/es/components/projects/ManuscriptPageContainer.js.map +1 -1
  72. package/dist/es/hooks/use-create-editor.js +2 -0
  73. package/dist/es/hooks/use-create-editor.js.map +1 -1
  74. package/dist/es/lib/authors.js +112 -0
  75. package/dist/es/lib/authors.js.map +1 -0
  76. package/dist/es/postgres-data/buildData.js +4 -0
  77. package/dist/es/postgres-data/buildData.js.map +1 -1
  78. package/dist/es/store/Store.js.map +1 -1
  79. package/dist/types/components/metadata/AddAuthorButton.d.ts +29 -0
  80. package/dist/types/components/metadata/AddAuthorsModalContainer.d.ts +38 -0
  81. package/dist/types/components/metadata/AddAuthorsSidebar.d.ts +28 -0
  82. package/dist/types/components/metadata/AuthorFormContainer.d.ts +31 -0
  83. package/dist/types/components/metadata/AuthorInvitationForm.d.ts +36 -0
  84. package/dist/types/components/metadata/AuthorModalViews.d.ts +14 -0
  85. package/dist/types/components/metadata/AuthorsModalContainer.d.ts +48 -0
  86. package/dist/types/components/metadata/AuthorsModals.d.ts +50 -0
  87. package/dist/types/components/metadata/AuthorsPage.d.ts +18 -0
  88. package/dist/types/components/metadata/AuthorsSidebar.d.ts +24 -0
  89. package/dist/types/components/metadata/CreateAuthorPageContainer.d.ts +25 -0
  90. package/dist/types/components/metadata/InviteAuthorButton.d.ts +33 -0
  91. package/dist/types/components/metadata/InviteAuthorPopperContainer.d.ts +31 -0
  92. package/dist/types/components/metadata/InviteAuthorsSidebar.d.ts +24 -0
  93. package/dist/types/components/metadata/SearchAuthorsSidebar.d.ts +21 -0
  94. package/dist/types/lib/authors.d.ts +42 -0
  95. package/dist/types/store/Store.d.ts +3 -1
  96. package/package.json +4 -3
@@ -0,0 +1,55 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ const AddedIcon_1 = __importDefault(require("@manuscripts/assets/react/AddedIcon"));
18
+ const style_guide_1 = require("@manuscripts/style-guide");
19
+ const react_1 = __importDefault(require("react"));
20
+ const styled_components_1 = __importDefault(require("styled-components"));
21
+ const authors_1 = require("../../lib/authors");
22
+ const theme_1 = require("../../theme/theme");
23
+ const AddIconButton = (0, styled_components_1.default)(style_guide_1.IconButton).attrs({ defaultColor: true }) `
24
+ width: unset;
25
+ height: unset;
26
+ `;
27
+ class AddAuthorButton extends react_1.default.Component {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.state = {
31
+ isSelected: false,
32
+ };
33
+ this.handleSelected = () => {
34
+ const { person, authors, createAuthor } = this.props;
35
+ this.setState({ isSelected: true });
36
+ createAuthor((0, authors_1.buildAuthorPriority)(authors), person);
37
+ };
38
+ }
39
+ componentDidMount() {
40
+ this.setState({
41
+ isSelected: this.props.isSelected || false,
42
+ });
43
+ }
44
+ render() {
45
+ const { isSelected } = this.state;
46
+ if (isSelected) {
47
+ return (react_1.default.createElement(AddIconButton, null,
48
+ react_1.default.createElement(AddedIcon_1.default, null)));
49
+ }
50
+ return (react_1.default.createElement(AddIconButton, { onClick: this.handleSelected },
51
+ react_1.default.createElement(style_guide_1.AddIconInverted, { color: theme_1.theme.colors.brand.medium })));
52
+ }
53
+ }
54
+ exports.default = AddAuthorButton;
55
+ //# sourceMappingURL=AddAuthorButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddAuthorButton.js","sourceRoot":"","sources":["../../../../src/components/metadata/AddAuthorButton.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAEH,oFAA2D;AAE3D,0DAAsE;AACtE,kDAAyB;AACzB,0EAAsC;AAEtC,+CAAuD;AACvD,6CAAyC;AAEzC,MAAM,aAAa,GAAG,IAAA,2BAAM,EAAC,wBAAU,CAAC,CAAC,KAAK,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAA;;;CAGrE,CAAA;AAkBD,MAAM,eAAgB,SAAQ,eAAK,CAAC,SAAuB;IAA3D;;QACS,UAAK,GAAU;YACpB,UAAU,EAAE,KAAK;SAClB,CAAA;QAyBO,mBAAc,GAAG,GAAG,EAAE;YAC5B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;YACpD,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;YAEnC,YAAY,CAAC,IAAA,6BAAmB,EAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAA;QACpD,CAAC,CAAA;IACH,CAAC;IA7BQ,iBAAiB;QACtB,IAAI,CAAC,QAAQ,CAAC;YACZ,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK;SAC3C,CAAC,CAAA;IACJ,CAAC;IAEM,MAAM;QACX,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QACjC,IAAI,UAAU,EAAE;YACd,OAAO,CACL,8BAAC,aAAa;gBACZ,8BAAC,mBAAS,OAAG,CACC,CACjB,CAAA;SACF;QAED,OAAO,CACL,8BAAC,aAAa,IAAC,OAAO,EAAE,IAAI,CAAC,cAAc;YACzC,8BAAC,6BAAe,IAAC,KAAK,EAAE,aAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAI,CACvC,CACjB,CAAA;IACH,CAAC;CAQF;AAED,kBAAe,eAAe,CAAA"}
@@ -0,0 +1,71 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.AddAuthorsModalContainer = void 0;
18
+ const react_1 = __importDefault(require("react"));
19
+ const AuthorsModals_1 = require("./AuthorsModals");
20
+ class AddAuthorsModalContainer extends react_1.default.Component {
21
+ constructor() {
22
+ super(...arguments);
23
+ this.state = {
24
+ isCreateAuthorOpen: false,
25
+ searchText: '',
26
+ searchResults: [],
27
+ };
28
+ this.handleCreateAuthor = () => {
29
+ if (this.state.isCreateAuthorOpen) {
30
+ this.setState({
31
+ searchText: '',
32
+ });
33
+ }
34
+ this.setState({
35
+ isCreateAuthorOpen: !this.state.isCreateAuthorOpen,
36
+ });
37
+ };
38
+ this.handleSearchChange = (event) => {
39
+ this.setState({ searchText: event.currentTarget.value });
40
+ this.search(event.currentTarget.value);
41
+ };
42
+ this.search = (searchText) => {
43
+ const { nonAuthors } = this.props;
44
+ if (!nonAuthors || !searchText) {
45
+ return this.setState({ searchResults: [] });
46
+ }
47
+ searchText = searchText.toLowerCase();
48
+ const searchResults = nonAuthors.filter((person) => {
49
+ if (searchText.includes('@')) {
50
+ return person.email && person.email.toLowerCase().includes(searchText);
51
+ }
52
+ const personName = [
53
+ person.bibliographicName.given,
54
+ person.bibliographicName.family,
55
+ ]
56
+ .filter((part) => part)
57
+ .join(' ')
58
+ .toLowerCase();
59
+ return personName && personName.includes(searchText);
60
+ });
61
+ this.setState({ searchResults });
62
+ };
63
+ }
64
+ render() {
65
+ const { isCreateAuthorOpen, searchResults, searchText } = this.state;
66
+ const { numberOfAddedAuthors, createAuthor, addedAuthors, authors, handleAddingDoneCancel, nonAuthors, } = this.props;
67
+ return (react_1.default.createElement(AuthorsModals_1.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 }));
68
+ }
69
+ }
70
+ exports.AddAuthorsModalContainer = AddAuthorsModalContainer;
71
+ //# sourceMappingURL=AddAuthorsModalContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddAuthorsModalContainer.js","sourceRoot":"","sources":["../../../../src/components/metadata/AddAuthorsModalContainer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAGH,kDAAyB;AAEzB,mDAAiD;AAsBjD,MAAa,wBAAyB,SAAQ,eAAK,CAAC,SAAuB;IAA3E;;QACS,UAAK,GAAG;YACb,kBAAkB,EAAE,KAAK;YACzB,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,EAAE;SAClB,CAAA;QA+BO,uBAAkB,GAAG,GAAG,EAAE;YAChC,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE;gBACjC,IAAI,CAAC,QAAQ,CAAC;oBACZ,UAAU,EAAE,EAAE;iBACf,CAAC,CAAA;aACH;YACD,IAAI,CAAC,QAAQ,CAAC;gBACZ,kBAAkB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB;aACnD,CAAC,CAAA;QACJ,CAAC,CAAA;QAEO,uBAAkB,GAAG,CAAC,KAAwC,EAAE,EAAE;YACxE,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,CAAA;YAExD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACxC,CAAC,CAAA;QAEO,WAAM,GAAG,CAAC,UAAkB,EAAE,EAAE;YACtC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,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kB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,sBAAsB,EAAE,sBAAsB,EAC9C,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,GAC3C,CACH,CAAA;IACH,CAAC;CA8CF;AAhFD,4DAgFC"}
@@ -0,0 +1,67 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ const style_guide_1 = require("@manuscripts/style-guide");
18
+ const react_1 = __importDefault(require("react"));
19
+ const styled_components_1 = __importDefault(require("styled-components"));
20
+ const Sidebar_1 = require("../Sidebar");
21
+ const AddAuthorButton_1 = __importDefault(require("./AddAuthorButton"));
22
+ const CreateAuthorPageContainer_1 = __importDefault(require("./CreateAuthorPageContainer"));
23
+ const SearchAuthorsSidebar_1 = __importDefault(require("./SearchAuthorsSidebar"));
24
+ const PersonInitial = styled_components_1.default.span `
25
+ margin-right: ${(props) => props.theme.grid.unit}px;
26
+ font-weight: ${(props) => props.theme.font.weight.light};
27
+ `;
28
+ const PersonName = styled_components_1.default.div `
29
+ box-sizing: border-box;
30
+ color: ${(props) => props.theme.colors.text.primary};
31
+ font-size: ${(props) => props.theme.font.size.xlarge};
32
+ font-weight: ${(props) => props.theme.font.weight.medium};
33
+ max-width: 138px;
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ white-space: nowrap;
37
+ width: 100%;
38
+ `;
39
+ const PersonData = styled_components_1.default.div `
40
+ margin-left: ${(props) => props.theme.grid.unit * 2}px;
41
+ `;
42
+ const UserDataContainer = styled_components_1.default.div `
43
+ align-items: center;
44
+ display: flex;
45
+ flex: 1;
46
+ margin-right: 16px;
47
+ overflow: hidden;
48
+ `;
49
+ const SearchContainer = styled_components_1.default.div `
50
+ margin-bottom: ${(props) => props.theme.grid.unit * 2}px;
51
+ `;
52
+ const AddAuthorsSidebar = ({ nonAuthors, numberOfAddedAuthors, searchText, addedAuthors, handleDoneCancel, createAuthor, handleSearchChange, searchResults, authors, isCreateAuthorOpen, handleCreateAuthor, }) => {
53
+ return (react_1.default.createElement(Sidebar_1.ModalSidebar, { "data-cy": 'add-author-sidebar' },
54
+ react_1.default.createElement(Sidebar_1.SidebarHeader, { action: handleDoneCancel, isCancel: !numberOfAddedAuthors, title: 'Add Author' }),
55
+ react_1.default.createElement(SearchContainer, null,
56
+ react_1.default.createElement(Sidebar_1.SidebarSearch, { autoFocus: true, handleSearchChange: handleSearchChange, maxLength: 100, placeholder: 'Search name/email', value: searchText })),
57
+ searchText === '' ? (react_1.default.createElement(Sidebar_1.SidebarContent, { "data-cy": "non-authors-list" }, nonAuthors.map((person) => (react_1.default.createElement(Sidebar_1.SidebarPersonContainer, { key: person._id },
58
+ react_1.default.createElement(UserDataContainer, null,
59
+ react_1.default.createElement(style_guide_1.Avatar, { src: person.avatar, size: 45 }),
60
+ react_1.default.createElement(PersonData, null,
61
+ react_1.default.createElement(PersonName, null,
62
+ react_1.default.createElement(PersonInitial, null, person.bibliographicName.given),
63
+ person.bibliographicName.family))),
64
+ react_1.default.createElement(AddAuthorButton_1.default, { person: person, isSelected: addedAuthors.includes(person.userID), createAuthor: createAuthor, authors: authors })))))) : isCreateAuthorOpen ? (react_1.default.createElement(CreateAuthorPageContainer_1.default, { "data-cy": "create-author-dialog", authors: authors, createAuthor: createAuthor, isOpen: isCreateAuthorOpen, handleCancel: handleCreateAuthor, searchText: searchText })) : (react_1.default.createElement(SearchAuthorsSidebar_1.default, { "data-cy": "search-authors-sidebar", addedAuthors: addedAuthors, createAuthor: createAuthor, searchResults: searchResults, authors: authors }))));
65
+ };
66
+ exports.default = AddAuthorsSidebar;
67
+ //# sourceMappingURL=AddAuthorsSidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddAuthorsSidebar.js","sourceRoot":"","sources":["../../../../src/components/metadata/AddAuthorsSidebar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAGH,0DAAiD;AAEjD,kDAAyB;AACzB,0EAAsC;AAEtC,wCAMmB;AACnB,wEAA+C;AAC/C,4FAAmE;AACnE,kFAAyD;AAEzD,MAAM,aAAa,GAAG,2BAAM,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,2BAAM,CAAC,GAAG,CAAA;;WAElB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;eACtC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;iBACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC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M,EAAE,IAAI,EAAE,EAAE,GAAI;gBACxC,8BAAC,UAAU;oBACT,8BAAC,UAAU;wBACT,8BAAC,aAAa,QACX,MAAM,CAAC,iBAAiB,CAAC,KAAK,CACjB;wBACf,MAAM,CAAC,iBAAiB,CAAC,MAAM,CACrB,CACF,CACK;YACpB,8BAAC,yBAAe,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,8BAAC,mCAAyB,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,8BAAC,8BAAoB,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,kBAAe,iBAAiB,CAAA"}
@@ -0,0 +1,24 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.AuthorFormContainer = void 0;
18
+ const style_guide_1 = require("@manuscripts/style-guide");
19
+ const react_1 = __importDefault(require("react"));
20
+ const AuthorFormContainer = ({ author, affiliations, authorAffiliations, handleSave, addAuthorAffiliation, removeAuthorAffiliation, updateAffiliation, removeAuthor, isRemoveAuthorOpen, handleRemoveAuthor, contributorRoles, createContributorRole, }) => (react_1.default.createElement(react_1.default.Fragment, null,
21
+ react_1.default.createElement(style_guide_1.AuthorForm, { author: author, handleSave: handleSave, isRemoveAuthorOpen: isRemoveAuthorOpen, removeAuthor: removeAuthor, handleRemoveAuthor: handleRemoveAuthor, contributorRoles: contributorRoles, createContributorRole: createContributorRole }),
22
+ react_1.default.createElement(style_guide_1.AffiliationsEditor, { affiliations: affiliations, authorAffiliations: authorAffiliations, addAuthorAffiliation: addAuthorAffiliation, removeAuthorAffiliation: removeAuthorAffiliation, updateAffiliation: updateAffiliation })));
23
+ exports.AuthorFormContainer = AuthorFormContainer;
24
+ //# sourceMappingURL=AuthorFormContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorFormContainer.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorFormContainer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAOH,0DAKiC;AACjC,kDAAyB;AAmBlB,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,8BAAC,eAAK,CAAC,QAAQ;IACb,8BAAC,wBAAU,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,8BAAC,gCAAkB,IACjB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,EAC1C,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,GACpC,CACa,CAClB,CAAA;AAhCY,QAAA,mBAAmB,uBAgC/B"}
@@ -0,0 +1,115 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.InvitationForm = void 0;
18
+ const style_guide_1 = require("@manuscripts/style-guide");
19
+ const formik_1 = require("formik");
20
+ const http_status_codes_1 = require("http-status-codes");
21
+ const react_1 = __importDefault(require("react"));
22
+ const styled_components_1 = __importDefault(require("styled-components"));
23
+ const roles_1 = require("../../lib/roles");
24
+ const RadioButton_1 = require("../RadioButton");
25
+ const SendInvitationButton = (0, styled_components_1.default)(style_guide_1.PrimaryButton) `
26
+ width: 100%;
27
+ `;
28
+ const RadioButtonsContainer = styled_components_1.default.div `
29
+ padding-top: ${(props) => props.theme.grid.unit * 6}px;
30
+ padding-bottom: ${(props) => props.theme.grid.unit * 6}px;
31
+ `;
32
+ const AlertMessageContainer = styled_components_1.default.div `
33
+ margin-bottom: ${(props) => props.theme.grid.unit * 2}px;
34
+ `;
35
+ const errorResponseMessage = (status) => {
36
+ switch (status) {
37
+ case http_status_codes_1.StatusCodes.BAD_REQUEST:
38
+ return 'You are already a collaborator on this project.';
39
+ case http_status_codes_1.StatusCodes.CONFLICT:
40
+ return 'The invited user is already a collaborator on this project.';
41
+ default:
42
+ return 'Sending invitation failed.';
43
+ }
44
+ };
45
+ class InvitationForm extends react_1.default.Component {
46
+ constructor() {
47
+ super(...arguments);
48
+ this.state = {
49
+ invitationSent: false,
50
+ };
51
+ this.initialValues = {
52
+ email: '',
53
+ name: '',
54
+ role: 'Writer',
55
+ };
56
+ this.dismissSuccessAlert = () => {
57
+ this.setState({
58
+ invitationSent: false,
59
+ });
60
+ };
61
+ }
62
+ render() {
63
+ const { allowSubmit, handleSubmit, invitationValues, tokenActions } = this.props;
64
+ const { invitationSent } = this.state;
65
+ return (react_1.default.createElement(formik_1.Formik, { onSubmit: async (values, actions) => {
66
+ try {
67
+ await handleSubmit(values);
68
+ this.setState({ invitationSent: true });
69
+ }
70
+ catch (error) {
71
+ const errors = {};
72
+ errors.submit = error.response
73
+ ? errorResponseMessage(error.response.status)
74
+ : 'There was an error submitting the form.';
75
+ if (error.response &&
76
+ error.response.status === http_status_codes_1.StatusCodes.UNAUTHORIZED) {
77
+ tokenActions.delete();
78
+ }
79
+ else {
80
+ actions.setErrors(errors);
81
+ }
82
+ }
83
+ finally {
84
+ actions.setSubmitting(false);
85
+ }
86
+ }, initialValues: invitationValues || this.initialValues, isInitialValid: true, validateOnChange: false, validateOnBlur: false }, ({ errors, isSubmitting, values, resetForm, }) => (react_1.default.createElement(formik_1.Form, { noValidate: true },
87
+ errors.submit && (react_1.default.createElement(style_guide_1.AlertMessage, { type: style_guide_1.AlertMessageType.error, hideCloseButton: true },
88
+ errors.submit,
89
+ ' ')),
90
+ !allowSubmit && (react_1.default.createElement(AlertMessageContainer, null,
91
+ react_1.default.createElement(style_guide_1.AlertMessage, { type: style_guide_1.AlertMessageType.info, hideCloseButton: true }, "Only project owners can invite others to the project."))),
92
+ invitationSent && (react_1.default.createElement(AlertMessageContainer, null,
93
+ react_1.default.createElement(style_guide_1.AlertMessage, { type: style_guide_1.AlertMessageType.success, hideCloseButton: true, dismissButton: {
94
+ text: 'OK',
95
+ action: () => {
96
+ this.dismissSuccessAlert();
97
+ resetForm();
98
+ },
99
+ } }, "Invitation was sent."))),
100
+ react_1.default.createElement(style_guide_1.TextFieldGroupContainer, { errors: {
101
+ name: errors.name,
102
+ email: errors.email,
103
+ } },
104
+ react_1.default.createElement(formik_1.Field, { name: 'name' }, ({ field }) => (react_1.default.createElement(style_guide_1.TextField, { ...field, onFocus: this.dismissSuccessAlert, type: 'text', placeholder: 'name', required: true, error: errors.name, disabled: !allowSubmit }))),
105
+ react_1.default.createElement(formik_1.Field, { name: 'email' }, ({ field }) => (react_1.default.createElement(style_guide_1.TextField, { ...field, onFocus: this.dismissSuccessAlert, type: 'email', placeholder: 'email', required: true, error: errors.email, disabled: !allowSubmit })))),
106
+ react_1.default.createElement(RadioButtonsContainer, null,
107
+ react_1.default.createElement(formik_1.Field, { name: 'role' }, ({ field }) => (react_1.default.createElement(RadioButton_1.RadioButton, { _id: 'owner', ...field, onFocus: this.dismissSuccessAlert, value: 'Owner', required: true, textHint: 'Can modify and delete project, invite and remove collaborators', checked: values.role === roles_1.ProjectRole.owner, disabled: !allowSubmit }, "Owner"))),
108
+ react_1.default.createElement(formik_1.Field, { name: 'role' }, ({ field }) => (react_1.default.createElement(RadioButton_1.RadioButton, { _id: 'writer', ...field, onFocus: this.dismissSuccessAlert, value: 'Writer', required: true, textHint: 'Can modify project contents', checked: values.role === roles_1.ProjectRole.writer, disabled: !allowSubmit }, "Writer"))),
109
+ react_1.default.createElement(formik_1.Field, { name: 'role' }, ({ field }) => (react_1.default.createElement(RadioButton_1.RadioButton, { _id: 'viewer', ...field, onFocus: this.dismissSuccessAlert, value: 'Viewer', required: true, textHint: 'Can only review projects without modifying it', checked: values.role === roles_1.ProjectRole.viewer, disabled: !allowSubmit }, "Viewer"))),
110
+ errors.role && react_1.default.createElement(style_guide_1.FormError, null, errors.role)),
111
+ react_1.default.createElement(SendInvitationButton, { type: "submit", disabled: isSubmitting || !allowSubmit }, "Send Invitation")))));
112
+ }
113
+ }
114
+ exports.InvitationForm = InvitationForm;
115
+ //# sourceMappingURL=AuthorInvitationForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorInvitationForm.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorInvitationForm.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,0DAOiC;AACjC,mCAOe;AACf,yDAA+C;AAC/C,kDAAyB;AACzB,0EAAsC;AAEtC,2CAA6C;AAE7C,gDAA4C;AAE5C,MAAM,oBAAoB,GAAG,IAAA,2BAAM,EAAC,2BAAa,CAAC,CAAA;;CAEjD,CAAA;AAED,MAAM,qBAAqB,GAAG,2BAAM,CAAC,GAAG,CAAA;iBACvB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;oBACjC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;CACvD,CAAA;AAED,MAAM,qBAAq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CAAC,EAAE,KAAK,EAAc,EAAE,EAAE,CAAC,CAC1B,8BAAC,yBAAW,IACV,GAAG,EAAE,QAAQ,KACT,KAAK,EACT,OAAO,EAAE,IAAI,CAAC,mBAAmB,EACjC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,6BAA6B,EACvC,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,mBAAW,CAAC,MAAM,EAC3C,QAAQ,EAAE,CAAC,WAAW,aAGV,CACf,CACK;gBAER,8BAAC,cAAK,IAAC,IAAI,EAAE,MAAM,IAChB,CAAC,EAAE,KAAK,EAAc,EAAE,EAAE,CAAC,CAC1B,8BAAC,yBAAW,IACV,GAAG,EAAE,QAAQ,KACT,KAAK,EACT,OAAO,EAAE,IAAI,CAAC,mBAAmB,EACjC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,+CAA+C,EACzD,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,mBAAW,CAAC,MAAM,EAC3C,QAAQ,EAAE,CAAC,WAAW,aAGV,CACf,CACK;gBAEP,MAAM,CAAC,IAAI,IAAI,8BAAC,uBAAS,QAAE,MAAM,CAAC,IAAI,CAAa,CAC9B;YAExB,8BAAC,oBAAoB,IACnB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,IAAI,CAAC,WAAW,sBAGjB,CAClB,CACR,CACM,CACV,CAAA;IACH,CAAC;CAOF;AArMD,wCAqMC"}
@@ -0,0 +1,161 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ const style_guide_1 = require("@manuscripts/style-guide");
41
+ const transform_1 = require("@manuscripts/transform");
42
+ const react_1 = __importStar(require("react"));
43
+ const authors_1 = require("../../lib/authors");
44
+ const store_1 = require("../../store");
45
+ const AddAuthorsModalContainer_1 = require("./AddAuthorsModalContainer");
46
+ const AuthorsModalContainer_1 = __importDefault(require("./AuthorsModalContainer"));
47
+ const AuthorModalViews = () => {
48
+ const [store, dispatch] = (0, store_1.useStore)((store) => store);
49
+ const [state, setState] = (0, react_1.useState)({
50
+ expanded: true,
51
+ selectedAuthor: null,
52
+ addingAuthors: false,
53
+ nonAuthors: [],
54
+ numberOfAddedAuthors: 0,
55
+ addedAuthors: [],
56
+ });
57
+ const { saveTrackModel, collaboratorsProfiles, user, deleteTrackModel, trackModelMap, authorsPopupOn, } = store;
58
+ const stopEditing = () => {
59
+ setState((state) => ({
60
+ ...state,
61
+ selectedAuthor: null,
62
+ addingAuthors: false,
63
+ isInvite: false,
64
+ }));
65
+ dispatch({ authorsPopupOn: false });
66
+ };
67
+ const createAuthor = async (priority, person, name) => {
68
+ if (name) {
69
+ const [given, ...family] = name.split(' ');
70
+ const bibName = (0, transform_1.buildBibliographicName)({
71
+ given,
72
+ family: family.join(' '),
73
+ });
74
+ const author = (0, transform_1.buildContributor)(bibName, 'author', priority);
75
+ await saveTrackModel(author);
76
+ setState((state) => ({
77
+ ...state,
78
+ numberOfAddedAuthors: state.numberOfAddedAuthors + 1,
79
+ }));
80
+ }
81
+ if (person) {
82
+ const author = (0, transform_1.buildContributor)(person.bibliographicName, 'author', priority, person.userID);
83
+ const createdAuthor = await saveTrackModel(author);
84
+ setState((state) => ({
85
+ ...state,
86
+ addedAuthors: state.addedAuthors.concat(author.userID),
87
+ numberOfAddedAuthors: state.numberOfAddedAuthors + 1,
88
+ }));
89
+ selectAuthor(createdAuthor);
90
+ }
91
+ };
92
+ const startEditing = (0, react_1.useCallback)(() => {
93
+ dispatch({ authorsPopupOn: true });
94
+ }, [dispatch]);
95
+ const selectAuthor = (0, react_1.useCallback)((author) => {
96
+ // TODO: make this switch without deselecting
97
+ setState((state) => ({
98
+ ...state,
99
+ selectedAuthor: typeof author === 'string' ? author : author._id,
100
+ }));
101
+ }, []);
102
+ (0, react_1.useEffect)(() => {
103
+ dispatch({ startEditing, selectAuthor });
104
+ }, [dispatch, startEditing, selectAuthor]);
105
+ const deselectAuthor = () => {
106
+ setState((state) => ({ ...state, selectedAuthor: null }));
107
+ };
108
+ const removeAuthor = async (author) => {
109
+ await deleteTrackModel(author._id);
110
+ deselectAuthor();
111
+ if (state.addedAuthors.includes(author.userID)) {
112
+ const index = state.addedAuthors.indexOf(author.userID);
113
+ state.addedAuthors.splice(index, 1);
114
+ }
115
+ };
116
+ const handleAddingDoneCancel = () => setState((state) => ({
117
+ ...state,
118
+ numberOfAddedAuthors: 0,
119
+ addingAuthors: false,
120
+ }));
121
+ const handleDrop = (authors, oldIndex, newIndex) => {
122
+ const reorderedAuthors = (0, authors_1.reorderAuthors)(authors, oldIndex, newIndex);
123
+ Promise.all(reorderedAuthors.map((author, i) => {
124
+ author.priority = i;
125
+ return saveTrackModel(author);
126
+ }))
127
+ .then(() => {
128
+ setState((state) => ({ ...state, authorListError: '' }));
129
+ })
130
+ .catch(() => {
131
+ setState((state) => ({
132
+ ...state,
133
+ authorListError: 'There was an error saving authors',
134
+ }));
135
+ });
136
+ };
137
+ const metaData = (0, react_1.useMemo)(() => {
138
+ const data = (0, authors_1.getMetaData)(trackModelMap);
139
+ return data;
140
+ }, [trackModelMap]);
141
+ (0, react_1.useEffect)(() => {
142
+ dispatch({
143
+ trackedAuthorsAndAffiliations: metaData?.authorsAndAffiliations,
144
+ });
145
+ }, [metaData, dispatch]);
146
+ const authorsAndAffiliations = metaData?.authorsAndAffiliations;
147
+ const contributorRoles = metaData?.contributorRoles || [];
148
+ if (!collaboratorsProfiles ||
149
+ !user ||
150
+ !authorsAndAffiliations ||
151
+ !contributorRoles) {
152
+ return null;
153
+ }
154
+ return (react_1.default.createElement(style_guide_1.StyledModal, { isOpen: !!authorsPopupOn, onRequestClose: stopEditing, shouldCloseOnOverlayClick: true },
155
+ react_1.default.createElement(style_guide_1.ModalContainer, null,
156
+ react_1.default.createElement(style_guide_1.ModalHeader, null,
157
+ react_1.default.createElement(style_guide_1.CloseButton, { onClick: stopEditing, "data-cy": 'modal-close-button' })),
158
+ state.addingAuthors ? (react_1.default.createElement(AddAuthorsModalContainer_1.AddAuthorsModalContainer, { ...state, handleAddingDoneCancel: handleAddingDoneCancel, createAuthor: createAuthor, authors: authorsAndAffiliations.authors })) : (react_1.default.createElement(AuthorsModalContainer_1.default, { ...state, createAuthor: createAuthor, selectAuthor: selectAuthor, removeAuthor: removeAuthor, saveTrackModel: saveTrackModel, handleDrop: handleDrop, authors: authorsAndAffiliations.authors, authorAffiliations: authorsAndAffiliations.authorAffiliations, affiliations: authorsAndAffiliations.affiliations, contributorRoles: contributorRoles })))));
159
+ };
160
+ exports.default = AuthorModalViews;
161
+ //# sourceMappingURL=AuthorModalViews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorModalViews.js","sourceRoot":"","sources":["../../../../src/components/metadata/AuthorModalViews.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,0DAKiC;AACjC,sDAG+B;AAC/B,+CAAwE;AAExE,+CAA+D;AAC/D,uCAAsC;AACtC,yEAAqE;AACrE,oFAA2D;AAY3D,MAAM,gBAAgB,GAAa,GAAG,EAAE;IACtC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;IAEpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAQ;QACxC,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,EAAE;QACd,oBAAoB,EAAE,CAAC;QACvB,YAAY,EAAE,EAAE;KACjB,CAAC,CAAA;IAEF,MAAM,EACJ,cAAc,EACd,qBAAqB,EACrB,IAAI,EACJ,gBAAgB,EAChB,aAAa,EACb,cAAc,GACf,GAAG,KAAK,CAAA;IAET,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,QAAQ,CAAC,CAAC,K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