@manuscripts/style-guide 1.1.4 → 1.1.5-LEAN-2192

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 (49) hide show
  1. package/dist/cjs/components/EditorHeader/EditorHeader.js +2 -2
  2. package/dist/cjs/components/EditorHeader/ProceedView.js +5 -5
  3. package/dist/cjs/components/FileManager/FileManager.js +8 -20
  4. package/dist/cjs/components/FileManager/FileSectionItem/DragLayer.js +1 -1
  5. package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +1 -3
  6. package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +4 -6
  7. package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +3 -16
  8. package/dist/cjs/components/FileManager/FileSectionState.js +5 -14
  9. package/dist/cjs/components/FileManager/FilesSection.js +7 -20
  10. package/dist/cjs/components/FileManager/InlineFilesSection.js +1 -1
  11. package/dist/cjs/components/FileManager/util.js +1 -323
  12. package/dist/cjs/index.js +1 -3
  13. package/dist/cjs/lib/capabilities.js +0 -1
  14. package/dist/es/components/EditorHeader/EditorHeader.js +2 -2
  15. package/dist/es/components/EditorHeader/ProceedView.js +5 -5
  16. package/dist/es/components/FileManager/FileManager.js +9 -21
  17. package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
  18. package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +1 -3
  19. package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +4 -6
  20. package/dist/es/components/FileManager/FileSectionItem/ItemActions.js +4 -17
  21. package/dist/es/components/FileManager/FileSectionState.js +5 -14
  22. package/dist/es/components/FileManager/FilesSection.js +9 -22
  23. package/dist/es/components/FileManager/InlineFilesSection.js +1 -1
  24. package/dist/es/components/FileManager/util.js +0 -318
  25. package/dist/es/index.js +0 -1
  26. package/dist/es/lib/capabilities.js +0 -1
  27. package/dist/types/components/EditorHeader/EditorHeader.d.ts +1 -1
  28. package/dist/types/components/EditorHeader/ProceedView.d.ts +1 -1
  29. package/dist/types/components/FileManager/FileManager.d.ts +2 -4
  30. package/dist/types/components/FileManager/FileSectionItem/FileInfo.d.ts +0 -5
  31. package/dist/types/components/FileManager/FileSectionItem/FileSectionItem.d.ts +1 -3
  32. package/dist/types/components/FileManager/FileSectionItem/ItemActions.d.ts +0 -2
  33. package/dist/types/components/FileManager/FileSectionState.d.ts +2 -5
  34. package/dist/types/components/FileManager/util.d.ts +0 -30
  35. package/dist/types/index.d.ts +0 -1
  36. package/dist/types/lib/capabilities.d.ts +0 -1
  37. package/package.json +1 -1
  38. package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +0 -131
  39. package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +0 -54
  40. package/dist/cjs/components/FileManager/SelectDesignationActions.js +0 -74
  41. package/dist/cjs/components/FileManager/SelectDialogDesignation.js +0 -33
  42. package/dist/es/components/FileManager/FileSectionItem/DesignationActions.js +0 -101
  43. package/dist/es/components/FileManager/FileSectionItem/DesignationActionsList.js +0 -47
  44. package/dist/es/components/FileManager/SelectDesignationActions.js +0 -44
  45. package/dist/es/components/FileManager/SelectDialogDesignation.js +0 -26
  46. package/dist/types/components/FileManager/FileSectionItem/DesignationActions.d.ts +0 -14
  47. package/dist/types/components/FileManager/FileSectionItem/DesignationActionsList.d.ts +0 -13
  48. package/dist/types/components/FileManager/SelectDesignationActions.d.ts +0 -12
  49. package/dist/types/components/FileManager/SelectDialogDesignation.d.ts +0 -11
@@ -1,131 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.DesignationActions = void 0;
30
- const react_1 = __importStar(require("react"));
31
- const react_tooltip_1 = __importDefault(require("react-tooltip"));
32
- const styled_components_1 = __importDefault(require("styled-components"));
33
- const BottomArrowIcon_1 = __importDefault(require("../../icons/BottomArrowIcon"));
34
- const ConfirmationPopUp_1 = require("../ConfirmationPopUp");
35
- const TooltipDiv_1 = require("../TooltipDiv");
36
- const util_1 = require("../util");
37
- const DesignationActionsList_1 = require("./DesignationActionsList");
38
- const DesignationActions = ({ designation, attachmentId, fileExtension, handleChangeDesignation, fileName, can, dispatch, }) => {
39
- const [isActionsShown, setIsActionsShown] = (0, react_1.useState)(false);
40
- const [confirmationPopUpData, setConfirmationPopUpData] = (0, react_1.useState)({
41
- isConfirmationPopUpOpen: false,
42
- confirmationPopUpMessage: '',
43
- confirmationPopUpHeader: '',
44
- selectedDesignation: '',
45
- });
46
- const toggleActionsList = () => {
47
- setIsActionsShown((prevState) => {
48
- return !prevState;
49
- });
50
- };
51
- const hideActionsList = () => {
52
- setIsActionsShown(false);
53
- };
54
- if (designation !== undefined && fileExtension) {
55
- const designationActionsList = (0, util_1.getDesignationActionsList)(designation, fileExtension);
56
- if (!designationActionsList.length) {
57
- return null;
58
- }
59
- const handleOpenConfirmationPopup = (popupHeader, popupMessage, designation) => {
60
- setConfirmationPopUpData({
61
- confirmationPopUpMessage: popupMessage,
62
- confirmationPopUpHeader: popupHeader,
63
- isConfirmationPopUpOpen: true,
64
- selectedDesignation: designation,
65
- });
66
- };
67
- const handleMoveAction = () => {
68
- handleChangeDesignation &&
69
- handleChangeDesignation(attachmentId, confirmationPopUpData.selectedDesignation, fileName);
70
- handleCloseAction();
71
- };
72
- const handleCloseAction = () => {
73
- setConfirmationPopUpData({
74
- confirmationPopUpMessage: '',
75
- confirmationPopUpHeader: '',
76
- selectedDesignation: '',
77
- isConfirmationPopUpOpen: false,
78
- });
79
- };
80
- return (react_1.default.createElement(react_1.default.Fragment, null,
81
- react_1.default.createElement(SecondaryActionsContainer, { onClick: toggleActionsList, onBlur: hideActionsList },
82
- !(can === null || can === void 0 ? void 0 : can.changeDesignation) && (react_1.default.createElement(TooltipContainer, null,
83
- react_1.default.createElement(react_tooltip_1.default, { id: "file-designation", place: "bottom", offset: { bottom: -8 }, effect: "solid", className: "tooltip" },
84
- react_1.default.createElement("div", null, "You don\u2019t have permissions to adjust this selection")))),
85
- react_1.default.createElement(SecondaryActionsText, { "data-for": "file-designation", "data-tip": true }, util_1.designationWithReadableNamesMap.get(designation)),
86
- react_1.default.createElement(BottomArrowIcon_1.default, null),
87
- isActionsShown && (can === null || can === void 0 ? void 0 : can.changeDesignation) && (react_1.default.createElement(ActionsListContainer, null,
88
- react_1.default.createElement(DesignationActionsList_1.DesignationActionsList, { handleChangeDesignation: handleChangeDesignation, designationActionsList: designationActionsList, fileName: fileName, designation: designation, attachmentId: attachmentId, dispatch: dispatch, handleOpenConfirmationPopup: handleOpenConfirmationPopup })))),
89
- confirmationPopUpData.isConfirmationPopUpOpen && (react_1.default.createElement(ConfirmationPopUp_1.ConfirmationPopUp, { popupHeader: confirmationPopUpData.confirmationPopUpHeader !== undefined
90
- ? confirmationPopUpData.confirmationPopUpHeader
91
- : '', popUpMessage: confirmationPopUpData.confirmationPopUpMessage !== undefined
92
- ? confirmationPopUpData.confirmationPopUpMessage
93
- : '', isOpen: confirmationPopUpData.isConfirmationPopUpOpen, handleClose: () => handleCloseAction(), handleMove: () => handleMoveAction() }))));
94
- }
95
- else {
96
- return null;
97
- }
98
- };
99
- exports.DesignationActions = DesignationActions;
100
- const SecondaryActionsContainer = styled_components_1.default.button `
101
- display: flex;
102
- align-items: center;
103
- background: transparent;
104
- border: none;
105
- padding: 0;
106
- font-family: ${(props) => props.theme.font.family.Lato};
107
- font-weight: normal;
108
- font-size: 14px;
109
- line-height: 20px;
110
- color: ${(props) => props.theme.colors.text.secondary};
111
- cursor: pointer;
112
-
113
- &:focus {
114
- outline: none;
115
- }
116
- `;
117
- const SecondaryActionsText = styled_components_1.default.div `
118
- margin-right: 8px;
119
- `;
120
- const ActionsListContainer = styled_components_1.default.div `
121
- position: absolute;
122
- top: 40px;
123
- z-index: 999;
124
- `;
125
- const TooltipContainer = (0, styled_components_1.default)(TooltipDiv_1.TooltipDiv) `
126
- .tooltip {
127
- white-space: normal;
128
- width: 144px;
129
- height: 32px;
130
- }
131
- `;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DesignationActionsList = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const FileSectionState_1 = require("../FileSectionState");
9
- const ItemsAction_1 = require("../ItemsAction");
10
- const util_1 = require("../util");
11
- const DesignationActionsList = ({ handleChangeDesignation, designationActionsList, fileName, designation, attachmentId, dispatch, handleOpenConfirmationPopup, }) => {
12
- const handleChangeOtherFilesTabDesignation = (designation, isMoveInOtherFileSection, confirmationPopupHeader, confirmationPopupMessage, successMoveMessage) => {
13
- if (isMoveInOtherFileSection) {
14
- if (dispatch) {
15
- dispatch(FileSectionState_1.actions.MOVE_FILE(attachmentId, (0, util_1.getDesignationName)(designation), fileName, successMoveMessage));
16
- handleOpenConfirmationPopup(confirmationPopupHeader, confirmationPopupMessage, (0, util_1.getDesignationName)(designation));
17
- }
18
- }
19
- else {
20
- handleChangeDesignation &&
21
- handleChangeDesignation(attachmentId, (0, util_1.getDesignationName)(designation), fileName);
22
- }
23
- };
24
- const isSupplementaryActionIncluded = designationActionsList.indexOf(util_1.Designation.Supplementary) !== -1;
25
- const otherFilesActionsList = designationActionsList
26
- .filter((value) => value !== util_1.Designation.Supplementary)
27
- .map((value) => {
28
- return (react_1.default.createElement(ItemsAction_1.ActionsItem, { key: value, onClick: () => {
29
- let isMoveToOtherFileSection = true;
30
- if (designation !== undefined) {
31
- isMoveToOtherFileSection =
32
- util_1.designationWithFileSectionsMap.get(designation) !==
33
- util_1.FileSectionType.OtherFile;
34
- }
35
- handleChangeOtherFilesTabDesignation(value, isMoveToOtherFileSection, 'Are you sure you want to move this file to "Other"?', 'The file will be removed from the "Supplementary" and added to "Other".', 'Supplementary file successfully moved to other files');
36
- } }, util_1.designationWithReadableNamesMap.get(value)));
37
- });
38
- return (react_1.default.createElement(ItemsAction_1.ActionsBox, null,
39
- otherFilesActionsList.length > 0 && (react_1.default.createElement(react_1.default.Fragment, null,
40
- react_1.default.createElement(ItemsAction_1.ActionsLabel, null, "Other Files"),
41
- otherFilesActionsList)),
42
- isSupplementaryActionIncluded && (react_1.default.createElement(react_1.default.Fragment, null,
43
- react_1.default.createElement(ItemsAction_1.ActionsSeparator, null),
44
- react_1.default.createElement(ItemsAction_1.ActionsItem, { onClick: () => {
45
- let isMoveToOtherFileSection = true;
46
- if (designation !== undefined) {
47
- isMoveToOtherFileSection =
48
- util_1.designationWithFileSectionsMap.get(designation) !==
49
- util_1.FileSectionType.Supplements;
50
- }
51
- handleChangeOtherFilesTabDesignation(util_1.Designation.Supplementary, isMoveToOtherFileSection, 'Are you sure you want to move this file to "Supplementary"?', 'The file will be removed from the "Other" and added to "Supplementary".', 'File successfully moved to Supplementary files');
52
- } }, util_1.designationWithReadableNamesMap.get(util_1.Designation.Supplementary))))));
53
- };
54
- exports.DesignationActionsList = DesignationActionsList;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.SelectDesignationActions = void 0;
30
- const react_1 = __importStar(require("react"));
31
- const creatable_1 = __importDefault(require("react-select/creatable"));
32
- const styled_components_1 = __importDefault(require("styled-components"));
33
- const BottomArrowIcon_1 = __importDefault(require("../icons/BottomArrowIcon"));
34
- const FileManager_1 = require("./FileManager");
35
- const FileSectionState_1 = require("./FileSectionState");
36
- const util_1 = require("./util");
37
- const DropdownIndicator = () => (react_1.default.createElement(SelectDesignationContainer, null,
38
- react_1.default.createElement(BottomArrowIcon_1.default, null)));
39
- const reactSelectComponents = {
40
- IndicatorsContainer: DropdownIndicator,
41
- };
42
- const SelectDesignationActions = ({ fileExtension, fileSection, dispatch }) => {
43
- const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
44
- const handleInputChange = (selectedDesignation) => {
45
- if (selectedDesignation) {
46
- if (selectedDesignation && 'value' in selectedDesignation) {
47
- dispatch(FileSectionState_1.actions.SELECT_DESIGNATION(selectedDesignation.value));
48
- }
49
- }
50
- };
51
- if (fileExtension) {
52
- const designationActionsList = (0, util_1.getUploadFileDesignationList)(fileExtension, fileSection, can);
53
- return (react_1.default.createElement(creatable_1.default, { closeMenuOnSelect: true, options: designationActionsList, onChange: handleInputChange, placeholder: "Select Designation", components: reactSelectComponents }));
54
- }
55
- else {
56
- return null;
57
- }
58
- };
59
- exports.SelectDesignationActions = SelectDesignationActions;
60
- const SelectDesignationContainer = styled_components_1.default.div `
61
- padding-right: 12px;
62
- display: flex;
63
- flex-direction: column;
64
- justify-content: space-around;
65
-
66
- circle,
67
- use {
68
- fill: ${(props) => props.theme.colors.brand.default};
69
- }
70
-
71
- path {
72
- mask: none;
73
- }
74
- `;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SelectDialogDesignation = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- const Dialog_1 = require("../Dialog");
10
- const SelectDesignationActions_1 = require("./SelectDesignationActions");
11
- const SelectDialogDesignation = ({ isOpen, fileExtension, fileSection, handleCancel, uploadFileHandler, dispatch, }) => {
12
- return (react_1.default.createElement(DesignationDialog, { isOpen: isOpen, category: Dialog_1.Category.confirmation, header: "Choose designation", message: "Please choose the designation for the file", actions: {
13
- primary: {
14
- action: uploadFileHandler,
15
- title: 'Choose',
16
- },
17
- secondary: {
18
- action: handleCancel,
19
- title: 'Cancel',
20
- },
21
- } },
22
- react_1.default.createElement(SelectDesignationActions_1.SelectDesignationActions, { fileExtension: fileExtension, fileSection: fileSection, dispatch: dispatch })));
23
- };
24
- exports.SelectDialogDesignation = SelectDialogDesignation;
25
- const DesignationDialog = (0, styled_components_1.default)(Dialog_1.Dialog) `
26
- & ${Dialog_1.ModalBody} {
27
- overflow: visible;
28
- }
29
-
30
- & ${Dialog_1.MessageContainer} {
31
- overflow: visible;
32
- }
33
- `;
@@ -1,101 +0,0 @@
1
- import React, { useState } from 'react';
2
- import ReactTooltip from 'react-tooltip';
3
- import styled from 'styled-components';
4
- import BottomArrowIcon from '../../icons/BottomArrowIcon';
5
- import { ConfirmationPopUp } from '../ConfirmationPopUp';
6
- import { TooltipDiv } from '../TooltipDiv';
7
- import { designationWithReadableNamesMap, getDesignationActionsList, } from '../util';
8
- import { DesignationActionsList } from './DesignationActionsList';
9
- export const DesignationActions = ({ designation, attachmentId, fileExtension, handleChangeDesignation, fileName, can, dispatch, }) => {
10
- const [isActionsShown, setIsActionsShown] = useState(false);
11
- const [confirmationPopUpData, setConfirmationPopUpData] = useState({
12
- isConfirmationPopUpOpen: false,
13
- confirmationPopUpMessage: '',
14
- confirmationPopUpHeader: '',
15
- selectedDesignation: '',
16
- });
17
- const toggleActionsList = () => {
18
- setIsActionsShown((prevState) => {
19
- return !prevState;
20
- });
21
- };
22
- const hideActionsList = () => {
23
- setIsActionsShown(false);
24
- };
25
- if (designation !== undefined && fileExtension) {
26
- const designationActionsList = getDesignationActionsList(designation, fileExtension);
27
- if (!designationActionsList.length) {
28
- return null;
29
- }
30
- const handleOpenConfirmationPopup = (popupHeader, popupMessage, designation) => {
31
- setConfirmationPopUpData({
32
- confirmationPopUpMessage: popupMessage,
33
- confirmationPopUpHeader: popupHeader,
34
- isConfirmationPopUpOpen: true,
35
- selectedDesignation: designation,
36
- });
37
- };
38
- const handleMoveAction = () => {
39
- handleChangeDesignation &&
40
- handleChangeDesignation(attachmentId, confirmationPopUpData.selectedDesignation, fileName);
41
- handleCloseAction();
42
- };
43
- const handleCloseAction = () => {
44
- setConfirmationPopUpData({
45
- confirmationPopUpMessage: '',
46
- confirmationPopUpHeader: '',
47
- selectedDesignation: '',
48
- isConfirmationPopUpOpen: false,
49
- });
50
- };
51
- return (React.createElement(React.Fragment, null,
52
- React.createElement(SecondaryActionsContainer, { onClick: toggleActionsList, onBlur: hideActionsList },
53
- !(can === null || can === void 0 ? void 0 : can.changeDesignation) && (React.createElement(TooltipContainer, null,
54
- React.createElement(ReactTooltip, { id: "file-designation", place: "bottom", offset: { bottom: -8 }, effect: "solid", className: "tooltip" },
55
- React.createElement("div", null, "You don\u2019t have permissions to adjust this selection")))),
56
- React.createElement(SecondaryActionsText, { "data-for": "file-designation", "data-tip": true }, designationWithReadableNamesMap.get(designation)),
57
- React.createElement(BottomArrowIcon, null),
58
- isActionsShown && (can === null || can === void 0 ? void 0 : can.changeDesignation) && (React.createElement(ActionsListContainer, null,
59
- React.createElement(DesignationActionsList, { handleChangeDesignation: handleChangeDesignation, designationActionsList: designationActionsList, fileName: fileName, designation: designation, attachmentId: attachmentId, dispatch: dispatch, handleOpenConfirmationPopup: handleOpenConfirmationPopup })))),
60
- confirmationPopUpData.isConfirmationPopUpOpen && (React.createElement(ConfirmationPopUp, { popupHeader: confirmationPopUpData.confirmationPopUpHeader !== undefined
61
- ? confirmationPopUpData.confirmationPopUpHeader
62
- : '', popUpMessage: confirmationPopUpData.confirmationPopUpMessage !== undefined
63
- ? confirmationPopUpData.confirmationPopUpMessage
64
- : '', isOpen: confirmationPopUpData.isConfirmationPopUpOpen, handleClose: () => handleCloseAction(), handleMove: () => handleMoveAction() }))));
65
- }
66
- else {
67
- return null;
68
- }
69
- };
70
- const SecondaryActionsContainer = styled.button `
71
- display: flex;
72
- align-items: center;
73
- background: transparent;
74
- border: none;
75
- padding: 0;
76
- font-family: ${(props) => props.theme.font.family.Lato};
77
- font-weight: normal;
78
- font-size: 14px;
79
- line-height: 20px;
80
- color: ${(props) => props.theme.colors.text.secondary};
81
- cursor: pointer;
82
-
83
- &:focus {
84
- outline: none;
85
- }
86
- `;
87
- const SecondaryActionsText = styled.div `
88
- margin-right: 8px;
89
- `;
90
- const ActionsListContainer = styled.div `
91
- position: absolute;
92
- top: 40px;
93
- z-index: 999;
94
- `;
95
- const TooltipContainer = styled(TooltipDiv) `
96
- .tooltip {
97
- white-space: normal;
98
- width: 144px;
99
- height: 32px;
100
- }
101
- `;
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { actions } from '../FileSectionState';
3
- import { ActionsBox, ActionsItem, ActionsLabel, ActionsSeparator, } from '../ItemsAction';
4
- import { Designation, designationWithFileSectionsMap, designationWithReadableNamesMap, FileSectionType, getDesignationName, } from '../util';
5
- export const DesignationActionsList = ({ handleChangeDesignation, designationActionsList, fileName, designation, attachmentId, dispatch, handleOpenConfirmationPopup, }) => {
6
- const handleChangeOtherFilesTabDesignation = (designation, isMoveInOtherFileSection, confirmationPopupHeader, confirmationPopupMessage, successMoveMessage) => {
7
- if (isMoveInOtherFileSection) {
8
- if (dispatch) {
9
- dispatch(actions.MOVE_FILE(attachmentId, getDesignationName(designation), fileName, successMoveMessage));
10
- handleOpenConfirmationPopup(confirmationPopupHeader, confirmationPopupMessage, getDesignationName(designation));
11
- }
12
- }
13
- else {
14
- handleChangeDesignation &&
15
- handleChangeDesignation(attachmentId, getDesignationName(designation), fileName);
16
- }
17
- };
18
- const isSupplementaryActionIncluded = designationActionsList.indexOf(Designation.Supplementary) !== -1;
19
- const otherFilesActionsList = designationActionsList
20
- .filter((value) => value !== Designation.Supplementary)
21
- .map((value) => {
22
- return (React.createElement(ActionsItem, { key: value, onClick: () => {
23
- let isMoveToOtherFileSection = true;
24
- if (designation !== undefined) {
25
- isMoveToOtherFileSection =
26
- designationWithFileSectionsMap.get(designation) !==
27
- FileSectionType.OtherFile;
28
- }
29
- handleChangeOtherFilesTabDesignation(value, isMoveToOtherFileSection, 'Are you sure you want to move this file to "Other"?', 'The file will be removed from the "Supplementary" and added to "Other".', 'Supplementary file successfully moved to other files');
30
- } }, designationWithReadableNamesMap.get(value)));
31
- });
32
- return (React.createElement(ActionsBox, null,
33
- otherFilesActionsList.length > 0 && (React.createElement(React.Fragment, null,
34
- React.createElement(ActionsLabel, null, "Other Files"),
35
- otherFilesActionsList)),
36
- isSupplementaryActionIncluded && (React.createElement(React.Fragment, null,
37
- React.createElement(ActionsSeparator, null),
38
- React.createElement(ActionsItem, { onClick: () => {
39
- let isMoveToOtherFileSection = true;
40
- if (designation !== undefined) {
41
- isMoveToOtherFileSection =
42
- designationWithFileSectionsMap.get(designation) !==
43
- FileSectionType.Supplements;
44
- }
45
- handleChangeOtherFilesTabDesignation(Designation.Supplementary, isMoveToOtherFileSection, 'Are you sure you want to move this file to "Supplementary"?', 'The file will be removed from the "Other" and added to "Supplementary".', 'File successfully moved to Supplementary files');
46
- } }, designationWithReadableNamesMap.get(Designation.Supplementary))))));
47
- };
@@ -1,44 +0,0 @@
1
- import React, { useContext } from 'react';
2
- import CreatableSelect from 'react-select/creatable';
3
- import styled from 'styled-components';
4
- import BottomArrowIcon from '../icons/BottomArrowIcon';
5
- import { PermissionsContext } from './FileManager';
6
- import { actions } from './FileSectionState';
7
- import { getUploadFileDesignationList, } from './util';
8
- const DropdownIndicator = () => (React.createElement(SelectDesignationContainer, null,
9
- React.createElement(BottomArrowIcon, null)));
10
- const reactSelectComponents = {
11
- IndicatorsContainer: DropdownIndicator,
12
- };
13
- export const SelectDesignationActions = ({ fileExtension, fileSection, dispatch }) => {
14
- const can = useContext(PermissionsContext);
15
- const handleInputChange = (selectedDesignation) => {
16
- if (selectedDesignation) {
17
- if (selectedDesignation && 'value' in selectedDesignation) {
18
- dispatch(actions.SELECT_DESIGNATION(selectedDesignation.value));
19
- }
20
- }
21
- };
22
- if (fileExtension) {
23
- const designationActionsList = getUploadFileDesignationList(fileExtension, fileSection, can);
24
- return (React.createElement(CreatableSelect, { closeMenuOnSelect: true, options: designationActionsList, onChange: handleInputChange, placeholder: "Select Designation", components: reactSelectComponents }));
25
- }
26
- else {
27
- return null;
28
- }
29
- };
30
- const SelectDesignationContainer = styled.div `
31
- padding-right: 12px;
32
- display: flex;
33
- flex-direction: column;
34
- justify-content: space-around;
35
-
36
- circle,
37
- use {
38
- fill: ${(props) => props.theme.colors.brand.default};
39
- }
40
-
41
- path {
42
- mask: none;
43
- }
44
- `;
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
- import { Category, Dialog, MessageContainer, ModalBody } from '../Dialog';
4
- import { SelectDesignationActions } from './SelectDesignationActions';
5
- export const SelectDialogDesignation = ({ isOpen, fileExtension, fileSection, handleCancel, uploadFileHandler, dispatch, }) => {
6
- return (React.createElement(DesignationDialog, { isOpen: isOpen, category: Category.confirmation, header: "Choose designation", message: "Please choose the designation for the file", actions: {
7
- primary: {
8
- action: uploadFileHandler,
9
- title: 'Choose',
10
- },
11
- secondary: {
12
- action: handleCancel,
13
- title: 'Cancel',
14
- },
15
- } },
16
- React.createElement(SelectDesignationActions, { fileExtension: fileExtension, fileSection: fileSection, dispatch: dispatch })));
17
- };
18
- const DesignationDialog = styled(Dialog) `
19
- & ${ModalBody} {
20
- overflow: visible;
21
- }
22
-
23
- & ${MessageContainer} {
24
- overflow: visible;
25
- }
26
- `;
@@ -1,14 +0,0 @@
1
- import React, { Dispatch } from 'react';
2
- import { Capabilities } from '../../../lib/capabilities';
3
- import { ChangeDesignation } from '../FileManager';
4
- import { Action } from '../FileSectionState';
5
- import { Designation } from '../util';
6
- export declare const DesignationActions: React.FC<{
7
- designation?: Designation;
8
- attachmentId: string;
9
- fileExtension?: string;
10
- handleChangeDesignation?: ChangeDesignation;
11
- fileName: string;
12
- can: Capabilities | null;
13
- dispatch?: Dispatch<Action>;
14
- }>;
@@ -1,13 +0,0 @@
1
- import React, { Dispatch } from 'react';
2
- import { ChangeDesignation } from '../FileManager';
3
- import { Action } from '../FileSectionState';
4
- import { Designation } from '../util';
5
- export declare const DesignationActionsList: React.FC<{
6
- handleChangeDesignation?: ChangeDesignation;
7
- designationActionsList: Array<Designation>;
8
- fileName: string;
9
- designation?: Designation;
10
- attachmentId: string;
11
- dispatch?: Dispatch<Action>;
12
- handleOpenConfirmationPopup: (popupHeader: string, popupMessage: string, designation: string) => void;
13
- }>;
@@ -1,12 +0,0 @@
1
- import React, { Dispatch } from 'react';
2
- import { Action } from './FileSectionState';
3
- import { Designation, FileSectionType } from './util';
4
- export interface DesignationOption {
5
- value: number;
6
- label: string;
7
- }
8
- export declare const SelectDesignationActions: React.FC<{
9
- fileExtension: string;
10
- fileSection: FileSectionType | Designation[];
11
- dispatch: Dispatch<Action>;
12
- }>;
@@ -1,11 +0,0 @@
1
- import React, { Dispatch } from 'react';
2
- import { Action } from './FileSectionState';
3
- import { Designation, FileSectionType } from './util';
4
- export declare const SelectDialogDesignation: React.FC<{
5
- isOpen: boolean;
6
- fileExtension: string;
7
- fileSection: FileSectionType | Designation[];
8
- handleCancel: () => void;
9
- uploadFileHandler: () => void;
10
- dispatch: Dispatch<Action>;
11
- }>;