@reltio/components 1.4.878 → 1.4.879

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 (92) hide show
  1. package/components/CollaborationItem/Comment/styles.d.ts +1 -1
  2. package/components/DropDownSelector/DropDownSelector.d.ts +16 -15
  3. package/components/DropDownSelector/DropDownSelector.js +2 -1
  4. package/components/DropDownSelector/styles.d.ts +1 -1
  5. package/components/ImageDetailsView/ImageDetailsViewSidebar/styles.d.ts +1 -1
  6. package/components/ImageGalleryDialog/styles.d.ts +1 -1
  7. package/components/MatchRulesBlock/MatchRulesTooltip/styles.d.ts +1 -1
  8. package/components/PotentialMatchReviewCard/styles.d.ts +1 -1
  9. package/components/SidePanel/styles.js +1 -1
  10. package/components/UploadImageDialog/styles.d.ts +1 -1
  11. package/components/attributes/PivotingAttributes/styles.d.ts +1 -1
  12. package/components/editors/DateEditor/DateEditor.d.ts +4 -2
  13. package/components/editors/DateEditor/DateEditor.js +6 -9
  14. package/components/index.d.ts +1 -0
  15. package/components/index.js +1 -0
  16. package/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.d.ts +7 -0
  17. package/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +28 -0
  18. package/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.d.ts +10 -0
  19. package/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.js +76 -0
  20. package/components/workflow/cards/GenericWorkflowTaskCard/styles.d.ts +3 -0
  21. package/components/workflow/cards/GenericWorkflowTaskCard/styles.js +110 -0
  22. package/components/workflow/cards/WorkflowTaskCard.d.ts +3 -0
  23. package/components/workflow/cards/WorkflowTaskCard.js +5 -0
  24. package/components/workflow/cards/WorkflowTaskCardsFactory.d.ts +9 -0
  25. package/components/workflow/cards/WorkflowTaskCardsFactory.js +27 -0
  26. package/components/workflow/components/AssigneeSelector/AssigneeSelector.d.ts +5 -0
  27. package/components/workflow/components/AssigneeSelector/AssigneeSelector.js +14 -0
  28. package/components/workflow/components/DueDateField/DueDateField.d.ts +7 -0
  29. package/components/workflow/components/DueDateField/DueDateField.js +14 -0
  30. package/components/workflow/components/DueDateField/styles.d.ts +1 -0
  31. package/components/workflow/components/DueDateField/styles.js +13 -0
  32. package/components/workflow/components/LineDecorator/LineDecorator.d.ts +11 -0
  33. package/components/workflow/components/LineDecorator/LineDecorator.js +14 -0
  34. package/components/workflow/components/LineDecorator/styles.d.ts +1 -0
  35. package/components/workflow/components/LineDecorator/styles.js +59 -0
  36. package/components/workflow/components/PrioritySelector/PrioritySelector.d.ts +7 -0
  37. package/components/workflow/components/PrioritySelector/PrioritySelector.js +12 -0
  38. package/components/workflow/components/TaskActions/TaskActions.d.ts +5 -0
  39. package/components/workflow/components/TaskActions/TaskActions.js +15 -0
  40. package/components/workflow/components/WorkflowComments/CollapsedComments.d.ts +16 -0
  41. package/components/workflow/components/WorkflowComments/CollapsedComments.js +34 -0
  42. package/components/workflow/components/WorkflowComments/Comment.d.ts +20 -0
  43. package/components/workflow/components/WorkflowComments/Comment.js +29 -0
  44. package/components/workflow/components/WorkflowComments/ExpandedComments.d.ts +14 -0
  45. package/components/workflow/components/WorkflowComments/ExpandedComments.js +20 -0
  46. package/components/workflow/components/WorkflowComments/WorkflowComments.d.ts +16 -0
  47. package/components/workflow/components/WorkflowComments/WorkflowComments.js +42 -0
  48. package/components/workflow/components/WorkflowComments/index.d.ts +1 -0
  49. package/components/workflow/components/WorkflowComments/index.js +1 -0
  50. package/components/workflow/components/WorkflowComments/styles.d.ts +4 -0
  51. package/components/workflow/components/WorkflowComments/styles.js +105 -0
  52. package/components/workflow/helpers/errors.d.ts +2 -0
  53. package/components/workflow/helpers/errors.js +14 -0
  54. package/components/workflow/helpers/index.d.ts +3 -0
  55. package/components/workflow/helpers/index.js +10 -0
  56. package/components/workflow/hooks/useWorkflowActions.d.ts +10 -0
  57. package/components/workflow/hooks/useWorkflowActions.js +57 -0
  58. package/components/workflow/hooks/useWorkflowAssignee.d.ts +13 -0
  59. package/components/workflow/hooks/useWorkflowAssignee.js +83 -0
  60. package/components/workflow/hooks/useWorkflowCheckPermission.d.ts +1 -0
  61. package/components/workflow/hooks/useWorkflowCheckPermission.js +84 -0
  62. package/components/workflow/hooks/useWorkflowColor.d.ts +3 -0
  63. package/components/workflow/hooks/useWorkflowColor.js +31 -0
  64. package/components/workflow/hooks/useWorkflowComments.d.ts +7 -0
  65. package/components/workflow/hooks/useWorkflowComments.js +50 -0
  66. package/components/workflow/hooks/useWorkflowDueDate.d.ts +6 -0
  67. package/components/workflow/hooks/useWorkflowDueDate.js +39 -0
  68. package/components/workflow/hooks/useWorkflowPriority.d.ts +12 -0
  69. package/components/workflow/hooks/useWorkflowPriority.js +59 -0
  70. package/components/workflow/index.d.ts +5 -0
  71. package/components/workflow/index.js +5 -0
  72. package/contexts/WorkflowTasksContext/index.d.ts +9 -0
  73. package/contexts/WorkflowTasksContext/index.js +3 -0
  74. package/contexts/index.d.ts +15 -14
  75. package/contexts/index.js +1 -0
  76. package/hooks/index.d.ts +1 -0
  77. package/hooks/index.js +1 -0
  78. package/hooks/useWorkflowTasks.d.ts +8 -0
  79. package/hooks/useWorkflowTasks.js +65 -0
  80. package/icons/CollaborationIcon.d.ts +3 -0
  81. package/icons/CollaborationIcon.js +22 -0
  82. package/icons/DcrTaskIcon.d.ts +3 -0
  83. package/icons/DcrTaskIcon.js +19 -0
  84. package/icons/DefaultTaskIcon.d.ts +3 -0
  85. package/icons/DefaultTaskIcon.js +19 -0
  86. package/icons/DeleteRequestTaskIcon.d.ts +3 -0
  87. package/icons/DeleteRequestTaskIcon.js +19 -0
  88. package/icons/PmTaskIcon.d.ts +3 -0
  89. package/icons/PmTaskIcon.js +19 -0
  90. package/icons/index.d.ts +11 -2
  91. package/icons/index.js +11 -2
  92. package/package.json +3 -3
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"message" | "button" | "body" | "header" | "avatar" | "username" | "createdAt" | "commentTarget" | "dropdownMenu" | "buttons">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "message" | "button" | "header" | "avatar" | "username" | "createdAt" | "commentTarget" | "dropdownMenu" | "buttons">;
@@ -1,4 +1,19 @@
1
+ export namespace DropDownSelectorType {
2
+ const value: PropTypes.Requireable<object>;
3
+ const label: PropTypes.Validator<string>;
4
+ const getOptions: PropTypes.Requireable<(...args: any[]) => any>;
5
+ const options: PropTypes.Requireable<any[]>;
6
+ const onChange: PropTypes.Requireable<(...args: any[]) => any>;
7
+ const onCreate: PropTypes.Requireable<(...args: any[]) => any>;
8
+ const onClear: PropTypes.Requireable<(...args: any[]) => any>;
9
+ const createLabel: PropTypes.Requireable<string>;
10
+ const components: PropTypes.Requireable<object>;
11
+ const textFieldInputRef: PropTypes.Requireable<object>;
12
+ const TextFieldProps: PropTypes.Requireable<object>;
13
+ const height: PropTypes.Requireable<number>;
14
+ }
1
15
  export default DropDownSelector;
16
+ import PropTypes from "prop-types";
2
17
  declare function DropDownSelector({ value, label, createLabel, getOptions, options, height, onChange, onCreate, onClear, components, textFieldInputRef, TextFieldProps, ...otherProps }: {
3
18
  [x: string]: any;
4
19
  value: any;
@@ -15,19 +30,5 @@ declare function DropDownSelector({ value, label, createLabel, getOptions, optio
15
30
  TextFieldProps: any;
16
31
  }): JSX.Element;
17
32
  declare namespace DropDownSelector {
18
- namespace propTypes {
19
- const value: PropTypes.Requireable<object>;
20
- const label: PropTypes.Validator<string>;
21
- const getOptions: PropTypes.Requireable<(...args: any[]) => any>;
22
- const options: PropTypes.Requireable<any[]>;
23
- const onChange: PropTypes.Requireable<(...args: any[]) => any>;
24
- const onCreate: PropTypes.Requireable<(...args: any[]) => any>;
25
- const onClear: PropTypes.Requireable<(...args: any[]) => any>;
26
- const createLabel: PropTypes.Requireable<string>;
27
- const components: PropTypes.Requireable<object>;
28
- const textFieldInputRef: PropTypes.Requireable<object>;
29
- const TextFieldProps: PropTypes.Requireable<object>;
30
- const height: PropTypes.Requireable<number>;
31
- }
33
+ export { DropDownSelectorType as propTypes };
32
34
  }
33
- import PropTypes from "prop-types";
@@ -56,7 +56,7 @@ var DropDownSelector = function (_a) {
56
56
  return (React.createElement(SelectComponent, __assign({ placeholder: "", defaultOptions: true }, otherProps, { value: defaultTo(null, value), loadOptions: getOptions, options: options, cacheOptions: true, onChange: onChange, onCreate: handleCreate, onClear: onClear, createLabel: createLabel, classes: styles, styles: mergedStyles, components: __assign(__assign({ DropdownIndicator: DropdownIndicator, LoadingIndicator: EmptyStub, SingleValue: SingleValue,
57
57
  Menu: Menu }, showIndicatorSeparator), components), menuPlacement: "auto", TextFieldProps: __assign(__assign({}, TextFieldProps), { label: label, variant: 'filled', margin: 'dense', classes: __assign(__assign({}, prop('classes', TextFieldProps)), { root: classnames(styles.formControl, path(['classes', 'root'], TextFieldProps)) }), inputProps: __assign({}, prop('inputProps', TextFieldProps)), InputProps: __assign(__assign({}, prop('InputProps', TextFieldProps)), { classes: __assign(__assign({}, path(['InputProps', 'classes'], TextFieldProps)), { root: classnames(styles.filledInputRoot, path(['InputProps', 'classes', 'root'], TextFieldProps)), underline: classnames((_b = {}, _b[underlineStyle.filledInputUnderline] = isEmptyValue(value), _b), path(['InputProps', 'classes', 'underline'], TextFieldProps)), focused: classnames('focused', path(['InputProps', 'classes', 'focused'], TextFieldProps)) }) }), InputLabelProps: __assign(__assign({}, prop('InputLabelProps', TextFieldProps)), { classes: __assign(__assign({}, path(['InputLabelProps', 'classes'], TextFieldProps)), { root: classnames(styles.inputLabel, path(['InputLabelProps', 'classes', 'root'], TextFieldProps)), shrink: classnames('shrink', path(['InputLabelProps', 'classes', 'shrink'], TextFieldProps)) }), shrink: !isEmptyValue(value) ? true : undefined }), ref: textFieldInputRef || inputRef }), inputRef: textFieldInputRef || inputRef, menuIsOpen: open, onMenuOpen: function () { return setOpen(true); }, onMenuClose: function () { return setOpen(false); } })));
58
58
  };
59
- DropDownSelector.propTypes = {
59
+ export var DropDownSelectorType = {
60
60
  value: PropTypes.object,
61
61
  label: PropTypes.string.isRequired,
62
62
  getOptions: PropTypes.func,
@@ -70,4 +70,5 @@ DropDownSelector.propTypes = {
70
70
  TextFieldProps: PropTypes.object,
71
71
  height: PropTypes.number
72
72
  };
73
+ DropDownSelector.propTypes = DropDownSelectorType;
73
74
  export default DropDownSelector;
@@ -1,4 +1,4 @@
1
- export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"control" | "valueContainer" | "dropdownIndicator" | "formControl" | "filledInputUnderline" | "filledInputRoot" | "inputLabel">;
1
+ export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"control" | "valueContainer" | "dropdownIndicator" | "formControl" | "inputLabel" | "filledInputUnderline" | "filledInputRoot">;
2
2
  export namespace customStyles {
3
3
  function menu(baseStyles: any): any;
4
4
  function menuList(baseStyles: any): any;
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"checkbox" | "body" | "header" | "root" | "headerTitle" | "bodyWrapper" | "formControlLabel" | "checkboxLabel">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "checkbox" | "header" | "root" | "headerTitle" | "bodyWrapper" | "formControlLabel" | "checkboxLabel">;
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "toolbar" | "backdrop" | "paper" | "closeIcon" | "appBar" | "closeButton" | "headerLeft" | "headerCenter" | "headerRight" | "modeSwitcher">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "toolbar" | "paper" | "backdrop" | "closeIcon" | "appBar" | "closeButton" | "headerLeft" | "headerCenter" | "headerRight" | "modeSwitcher">;
@@ -1,2 +1,2 @@
1
- declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "body" | "container">;
1
+ declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "title" | "container">;
2
2
  export default styles;
@@ -1 +1 @@
1
- export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"flex" | "caption" | "title" | "expanded" | "icon" | "header" | "date" | "info" | "infoBlock" | "flag" | "pmReviewCard" | "mainInfo">;
1
+ export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"flex" | "caption" | "title" | "expanded" | "icon" | "header" | "date" | "info" | "infoBlock" | "flag" | "mainInfo" | "pmReviewCard">;
@@ -5,7 +5,7 @@ export var useStyles = makeStyles(function (theme) { return ({
5
5
  flexDirection: 'column',
6
6
  backgroundColor: theme.palette.background.paper,
7
7
  boxShadow: '0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)',
8
- marginLeft: '1px',
8
+ marginLeft: '3px',
9
9
  transition: theme.transitions.create(['width'], {
10
10
  duration: theme.transitions.duration.enteringScreen
11
11
  })
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "body" | "root" | "divider" | "dialogPaper" | "targetBox">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "title" | "root" | "divider" | "dialogPaper" | "targetBox">;
@@ -1,2 +1,2 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "entityTypeLabel" | "title" | "icon" | "body" | "footer" | "header" | "entityLabel" | "container" | "divider" | "headerCount" | "profileIcon" | "entityContainer">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "body" | "entityTypeLabel" | "title" | "icon" | "footer" | "header" | "entityLabel" | "container" | "divider" | "headerCount" | "profileIcon" | "entityContainer">;
2
2
  export declare const usePivotingTooltipStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"tooltip" | "arrow">;
@@ -1,11 +1,12 @@
1
1
  export default DateEditor;
2
- declare function DateEditor({ value, label, variant, onChange, InputProps, ...otherProps }: {
2
+ declare function DateEditor({ value, label, variant, onChange, InputProps, InputLabelProps, ...otherProps }: {
3
3
  [x: string]: any;
4
4
  value?: any;
5
5
  label: any;
6
6
  variant?: string;
7
7
  onChange: any;
8
- InputProps: any;
8
+ InputProps?: {};
9
+ InputLabelProps?: {};
9
10
  }): JSX.Element;
10
11
  declare namespace DateEditor {
11
12
  namespace propTypes {
@@ -13,6 +14,7 @@ declare namespace DateEditor {
13
14
  export const label: PropTypes.Requireable<string>;
14
15
  export { InputVariant as variant };
15
16
  export const InputProps: PropTypes.Requireable<object>;
17
+ export const InputLabelProps: PropTypes.Requireable<object>;
16
18
  export const onChange: PropTypes.Validator<(...args: any[]) => any>;
17
19
  }
18
20
  }
@@ -33,10 +33,11 @@ import CalendarIcon from '../../../icons/Calendar';
33
33
  import { useStyles } from './styles';
34
34
  var format = moment.localeData().longDateFormat('L');
35
35
  var DateEditor = function (_a) {
36
- var _b;
37
- var _c = _a.value, value = _c === void 0 ? null : _c, label = _a.label, _d = _a.variant, variant = _d === void 0 ? 'filled' : _d, onChange = _a.onChange, InputProps = _a.InputProps, otherProps = __rest(_a, ["value", "label", "variant", "onChange", "InputProps"]);
36
+ var _b, _c;
37
+ var _d;
38
+ var _e = _a.value, value = _e === void 0 ? null : _e, label = _a.label, _f = _a.variant, variant = _f === void 0 ? 'filled' : _f, onChange = _a.onChange, _g = _a.InputProps, InputProps = _g === void 0 ? {} : _g, _h = _a.InputLabelProps, InputLabelProps = _h === void 0 ? {} : _h, otherProps = __rest(_a, ["value", "label", "variant", "onChange", "InputProps", "InputLabelProps"]);
38
39
  var styles = useStyles();
39
- var _e = useState(false), isCalendarOpen = _e[0], setIsCalendarOpen = _e[1];
40
+ var _j = useState(false), isCalendarOpen = _j[0], setIsCalendarOpen = _j[1];
40
41
  return (React.createElement(KeyboardDatePicker, __assign({ format: format, variant: "inline", invalidDateMessage: i18n.text('Invalid Date Format'), maxDateMessage: i18n.text('Date should not be after maximal date'), minDateMessage: i18n.text('Date should not be before minimal date'), inputVariant: variant, autoOk: true, InputAdornmentProps: { position: 'end', classes: { positionEnd: styles.adornmentPositionEnd } }, KeyboardButtonProps: {
41
42
  classes: { root: styles.iconButtonRoot },
42
43
  onKeyPress: invoker(0, 'stopPropagation')
@@ -53,18 +54,14 @@ var DateEditor = function (_a) {
53
54
  vertical: 'top',
54
55
  horizontal: 'left'
55
56
  }
56
- }, InputLabelProps: {
57
- classes: {
58
- root: isCalendarOpen ? styles.inputLabel : undefined
59
- },
60
- shrink: !isNil(label)
61
- } }, otherProps)));
57
+ }, InputLabelProps: __assign({ classes: __assign({ root: classnames((_c = {}, _c[styles.inputLabel] = isCalendarOpen, _c), (_d = InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.classes) === null || _d === void 0 ? void 0 : _d.root) }, InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.classes), shrink: !isNil(label) }, InputLabelProps) }, otherProps)));
62
58
  };
63
59
  DateEditor.propTypes = {
64
60
  value: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),
65
61
  label: PropTypes.string,
66
62
  variant: InputVariant,
67
63
  InputProps: PropTypes.object,
64
+ InputLabelProps: PropTypes.object,
68
65
  onChange: PropTypes.func.isRequired
69
66
  };
70
67
  export default DateEditor;
@@ -119,3 +119,4 @@ export { ReltioMap } from './ReltioMap';
119
119
  export { default as ErrorMessage } from './ErrorWrapper/ErrorMessage';
120
120
  export * from './history';
121
121
  export { default as OvIcon } from './attributes/OvIcon';
122
+ export * from './workflow';
@@ -118,3 +118,4 @@ export { ReltioMap } from './ReltioMap';
118
118
  export { default as ErrorMessage } from './ErrorWrapper/ErrorMessage';
119
119
  export * from './history';
120
120
  export { default as OvIcon } from './attributes/OvIcon';
121
+ export * from './workflow';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { WorkflowTaskData } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ task: WorkflowTaskData;
5
+ };
6
+ declare const DataChangeRequestTaskCard: ({ task }: Props) => JSX.Element;
7
+ export default DataChangeRequestTaskCard;
@@ -0,0 +1,28 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { getDataChangeRequest } from '@reltio/mdm-sdk';
3
+ import GenericWorkflowTaskCard from '../GenericWorkflowTaskCard/GenericWorkflowTaskCard';
4
+ import LineDecorator from '../../components/LineDecorator/LineDecorator';
5
+ import { getDCRUri } from '../../helpers';
6
+ import DcrTaskIcon from '../../../../icons/DcrTaskIcon';
7
+ //eslint-disable-next-line
8
+ var AttributesChanges = function (_a) {
9
+ var objectsInfo = _a.objectsInfo, changes = _a.changes;
10
+ return (React.createElement("span", null,
11
+ "AttributesChanges",
12
+ React.createElement("br", null),
13
+ "AttributesChanges",
14
+ React.createElement("br", null),
15
+ "AttributesChanges"));
16
+ };
17
+ var DataChangeRequestTaskCard = function (_a) {
18
+ var task = _a.task;
19
+ var objectURIs = task.objectURIs;
20
+ var dcrUri = getDCRUri(objectURIs);
21
+ var _b = useState(null), dcr = _b[0], setDcr = _b[1];
22
+ useEffect(function () {
23
+ getDataChangeRequest(dcrUri).then(setDcr);
24
+ }, [dcrUri]);
25
+ return (React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DcrTaskIcon }, dcr && (React.createElement(LineDecorator, { last: true },
26
+ React.createElement(AttributesChanges, { changes: dcr.changes, objectsInfo: dcr.objectsInfo })))));
27
+ };
28
+ export default DataChangeRequestTaskCard;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { WorkflowTaskData } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ task: WorkflowTaskData;
5
+ children?: React.ReactNode;
6
+ actions?: React.ReactNode;
7
+ Icon?: React.ElementType;
8
+ };
9
+ declare const GenericWorkflowTaskCard: ({ task, children, actions, Icon }: Props) => JSX.Element;
10
+ export default GenericWorkflowTaskCard;
@@ -0,0 +1,76 @@
1
+ import React, { useState } from 'react';
2
+ import classnames from 'classnames';
3
+ import FlagIcon from '@material-ui/icons/Flag';
4
+ import i18n from 'ui-i18n';
5
+ import Tooltip from '@material-ui/core/Tooltip';
6
+ import { useStyles } from './styles';
7
+ import CollapseButton from '../../../CollapseButton/CollapseButton';
8
+ import AssigneeSelector from '../../components/AssigneeSelector/AssigneeSelector';
9
+ import DueDateField from '../../components/DueDateField/DueDateField';
10
+ import PrioritySelector from '../../components/PrioritySelector/PrioritySelector';
11
+ import WorkflowComments from '../../components/WorkflowComments';
12
+ import { getDCRId } from '../../helpers';
13
+ import TaskActions from '../../components/TaskActions/TaskActions';
14
+ import LineDecorator from '../../components/LineDecorator/LineDecorator';
15
+ import { useWorkflowColor } from '../../hooks/useWorkflowColor';
16
+ import { useWorkflowCheckPermission } from '../../hooks/useWorkflowCheckPermission';
17
+ import CollaborationIcon from '../../../../icons/CollaborationIcon';
18
+ var GenericWorkflowTaskCard = function (_a) {
19
+ var _b;
20
+ var task = _a.task, children = _a.children, actions = _a.actions, Icon = _a.Icon;
21
+ var taskId = task.taskId, dueDate = task.dueDate, priority = task.priority, assignee = task.assignee, createdBy = task.createdBy, createTime = task.createTime, step = task.displayName, processDefinitionDisplayName = task.processDefinitionDisplayName, objectURIs = task.objectURIs, processInstanceComments = task.processInstanceComments, possibleActions = task.possibleActions;
22
+ var dcrId = getDCRId(objectURIs);
23
+ var color = useWorkflowColor({ processDefinitionDisplayName: processDefinitionDisplayName });
24
+ var styles = useStyles({ color: color });
25
+ var _c = useState(false), isExpanded = _c[0], setExpanded = _c[1];
26
+ var checkWorkflowPermission = useWorkflowCheckPermission();
27
+ var canViewComments = checkWorkflowPermission('VIEW_PROCESS_INSTANCE_COMMENTS');
28
+ return (React.createElement("div", { className: styles.card },
29
+ React.createElement("div", { className: classnames((_b = {}, _b[styles.withBackground] = isExpanded, _b)) },
30
+ React.createElement("div", { className: styles.lineWrapper },
31
+ React.createElement("div", { className: styles.line }),
32
+ Icon && React.createElement(Icon, { className: styles.icon }),
33
+ React.createElement(LineDecorator, { plain: true, first: true, transparent: !isExpanded },
34
+ React.createElement("div", { className: styles.mainInfo },
35
+ React.createElement("div", { className: styles.title },
36
+ React.createElement("div", { className: classnames(styles.caption, styles.flex) }, processDefinitionDisplayName),
37
+ React.createElement(FlagIcon, { className: styles.flag }),
38
+ React.createElement(Tooltip, { title: i18n.text('Due date') },
39
+ React.createElement("span", { className: styles.date }, i18n.date(dueDate, 'L'))),
40
+ React.createElement(CollapseButton, { isOpen: isExpanded, size: "L", onClick: function () {
41
+ setExpanded(!isExpanded);
42
+ } })),
43
+ React.createElement("div", { className: styles.infoBlock },
44
+ React.createElement("div", { className: styles.flex },
45
+ dcrId && (React.createElement("div", { className: styles.info },
46
+ i18n.text('DCR ID'),
47
+ ': ',
48
+ React.createElement("span", { className: styles.infoValue }, dcrId))),
49
+ React.createElement("div", { className: styles.info },
50
+ i18n.text('Created by'),
51
+ ': ',
52
+ React.createElement("span", { className: styles.infoValue }, createdBy),
53
+ " ",
54
+ i18n.text('on'),
55
+ ' ',
56
+ React.createElement("span", { className: styles.infoValue }, i18n.date(createTime, 'L'))),
57
+ React.createElement("div", { className: styles.info },
58
+ i18n.text('Step'),
59
+ ': ',
60
+ React.createElement("span", { className: styles.infoValue }, step)),
61
+ canViewComments && (processInstanceComments === null || processInstanceComments === void 0 ? void 0 : processInstanceComments.length) > 0 && (React.createElement("div", { className: styles.commentsInfo },
62
+ React.createElement(CollaborationIcon, { className: styles.commentsIcon }),
63
+ React.createElement("div", { className: styles.infoValue }, processInstanceComments.length)))),
64
+ actions || (React.createElement(TaskActions, { taskId: taskId, possibleActions: possibleActions, assignee: assignee })))))),
65
+ isExpanded && (React.createElement(LineDecorator, { plain: true },
66
+ React.createElement("div", { className: styles.controlsBox },
67
+ React.createElement("div", { className: styles.controlsInRow },
68
+ React.createElement(DueDateField, { taskId: taskId, dueDate: dueDate }),
69
+ React.createElement(PrioritySelector, { taskId: taskId, priority: priority, className: styles.priority })),
70
+ React.createElement(AssigneeSelector, { taskId: taskId, assignee: assignee }))))),
71
+ isExpanded && (React.createElement(React.Fragment, null,
72
+ children,
73
+ canViewComments && (React.createElement("div", { className: styles.comments },
74
+ React.createElement(WorkflowComments, { taskId: taskId, processInstanceComments: processInstanceComments })))))));
75
+ };
76
+ export default GenericWorkflowTaskCard;
@@ -0,0 +1,3 @@
1
+ export declare const useStyles: (props: {
2
+ color: string;
3
+ }) => import("@material-ui/core/styles/withStyles").ClassNameMap<"priority" | "flex" | "caption" | "title" | "icon" | "header" | "line" | "date" | "comments" | "info" | "card" | "withBackground" | "lineWrapper" | "commentsInfo" | "commentsIcon" | "infoValue" | "infoBlock" | "flag" | "mainInfo" | "controlsBox" | "controlsInRow">;
@@ -0,0 +1,110 @@
1
+ import { makeStyles } from '@material-ui/core/styles';
2
+ export var useStyles = makeStyles(function (theme) { return ({
3
+ card: {
4
+ borderBottom: '1px solid rgba(0,0,0,0.06)'
5
+ },
6
+ withBackground: {
7
+ backgroundColor: 'rgba(0, 0, 0, 0.03)'
8
+ },
9
+ lineWrapper: {
10
+ position: 'relative'
11
+ },
12
+ icon: {
13
+ position: 'absolute',
14
+ top: '8px',
15
+ left: '16px',
16
+ width: '32px',
17
+ height: '32px',
18
+ zIndex: 1
19
+ },
20
+ line: function (_a) {
21
+ var color = _a.color;
22
+ return ({
23
+ borderLeft: "3px solid " + color,
24
+ position: 'absolute',
25
+ left: 0,
26
+ top: 0,
27
+ bottom: 0
28
+ });
29
+ },
30
+ info: {
31
+ fontSize: '13px',
32
+ color: theme.palette.text.secondary,
33
+ wordWrap: 'break-word',
34
+ lineHeight: '15px'
35
+ },
36
+ commentsInfo: {
37
+ display: 'flex',
38
+ alignItems: 'center',
39
+ marginBottom: '-4px',
40
+ marginTop: '7px'
41
+ },
42
+ commentsIcon: {
43
+ width: '11px',
44
+ height: '11px',
45
+ marginLeft: '2px',
46
+ marginRight: '6px',
47
+ marginTop: '-2px'
48
+ },
49
+ infoValue: {
50
+ color: theme.palette.text.primary
51
+ },
52
+ infoBlock: {
53
+ display: 'flex',
54
+ flexDirection: 'row',
55
+ marginBottom: '5px'
56
+ },
57
+ header: {
58
+ display: 'flex',
59
+ flexDirection: 'row',
60
+ paddingBottom: '12px'
61
+ },
62
+ flex: {
63
+ flex: 1
64
+ },
65
+ caption: {
66
+ fontSize: '16px',
67
+ color: theme.palette.text.primary
68
+ },
69
+ title: {
70
+ display: 'flex',
71
+ flexDirection: 'row',
72
+ alignItems: 'center',
73
+ marginBottom: '-4px'
74
+ },
75
+ flag: {
76
+ height: '13px',
77
+ width: '13px',
78
+ marginTop: '-2px',
79
+ stroke: '#000000',
80
+ fill: 'none',
81
+ margin: '2px 5px 0 5px'
82
+ },
83
+ date: {
84
+ fontSize: '13px',
85
+ color: theme.palette.text.primary
86
+ },
87
+ mainInfo: {
88
+ display: 'flex',
89
+ flexDirection: 'column',
90
+ flex: 1
91
+ },
92
+ controlsBox: {
93
+ marginRight: '16px',
94
+ marginBottom: '12px',
95
+ marginTop: '13px'
96
+ },
97
+ controlsInRow: {
98
+ display: 'flex',
99
+ flexDirection: 'row',
100
+ alignItems: 'center',
101
+ justifyContent: 'space-between',
102
+ marginBottom: '20px'
103
+ },
104
+ priority: {
105
+ width: '162px'
106
+ },
107
+ comments: {
108
+ marginLeft: '11px'
109
+ }
110
+ }); });
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { FactoryProps } from './WorkflowTaskCardsFactory';
3
+ export declare const WorkflowTaskCard: ({ task }: FactoryProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ import WorkflowTaskCardsFactory from './WorkflowTaskCardsFactory';
2
+ export var WorkflowTaskCard = function (_a) {
3
+ var task = _a.task;
4
+ return WorkflowTaskCardsFactory.build({ task: task });
5
+ };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { WorkflowTaskData } from '@reltio/mdm-sdk';
3
+ export declare type FactoryProps = {
4
+ task: WorkflowTaskData;
5
+ };
6
+ declare class WorkflowTaskCardsFactory {
7
+ static build: ({ task }: FactoryProps) => JSX.Element;
8
+ }
9
+ export default WorkflowTaskCardsFactory;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { PredefinedWorkflowProcessType } from '@reltio/mdm-sdk';
3
+ import GenericWorkflowTaskCard from './GenericWorkflowTaskCard/GenericWorkflowTaskCard';
4
+ import DataChangeRequestTaskCard from './DataChangeRequestTaskCard/DataChangeRequestTaskCard';
5
+ import DefaultTaskIcon from '../../../icons/DefaultTaskIcon';
6
+ import DeleteRequestTaskIcon from '../../../icons/DeleteRequestTaskIcon';
7
+ import PmTaskIcon from '../../../icons/PmTaskIcon';
8
+ var WorkflowTaskCardsFactory = /** @class */ (function () {
9
+ function WorkflowTaskCardsFactory() {
10
+ }
11
+ WorkflowTaskCardsFactory.build = function (_a) {
12
+ var task = _a.task;
13
+ var processType = task.processType;
14
+ switch (processType) {
15
+ case PredefinedWorkflowProcessType.dataChangeRequestReview:
16
+ return React.createElement(DataChangeRequestTaskCard, { task: task });
17
+ case PredefinedWorkflowProcessType.potentialMatchReview:
18
+ return React.createElement(GenericWorkflowTaskCard, { task: task, Icon: PmTaskIcon });
19
+ case PredefinedWorkflowProcessType.recommendForDelete:
20
+ return React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DeleteRequestTaskIcon });
21
+ default:
22
+ return React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DefaultTaskIcon });
23
+ }
24
+ };
25
+ return WorkflowTaskCardsFactory;
26
+ }());
27
+ export default WorkflowTaskCardsFactory;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { WorkflowTaskData } from '@reltio/mdm-sdk';
3
+ declare type Props = Pick<WorkflowTaskData, 'taskId' | 'assignee'>;
4
+ declare const AssigneeSelector: ({ taskId, assignee }: Props) => JSX.Element;
5
+ export default AssigneeSelector;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import i18n from 'ui-i18n';
3
+ import DropDownSelector from '../../../DropDownSelector/DropDownSelector';
4
+ import { useWorkflowAssignee } from '../../hooks/useWorkflowAssignee';
5
+ var AssigneeSelector = function (_a) {
6
+ var taskId = _a.taskId, assignee = _a.assignee;
7
+ var _b = useWorkflowAssignee({
8
+ taskId: taskId,
9
+ assignee: assignee
10
+ }), currentAssignee = _b.assignee, getAssignees = _b.getAssignees, updateAssignee = _b.updateAssignee, updateRequestIsInProgress = _b.updateRequestIsInProgress, readOnly = _b.readOnly;
11
+ var disabled = updateRequestIsInProgress || readOnly;
12
+ return (React.createElement(DropDownSelector, { isDisabled: disabled, getOptions: getAssignees, onChange: updateAssignee, hideSelectedOptions: false, label: i18n.text('Assigned to'), value: currentAssignee, defaultOptions: true, TextFieldProps: { disabled: disabled }, height: 40 }));
13
+ };
14
+ export default AssigneeSelector;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { WorkflowTaskData } from '@reltio/mdm-sdk';
3
+ declare type Props = Pick<WorkflowTaskData, 'taskId' | 'dueDate'> & {
4
+ className?: string;
5
+ };
6
+ declare const DueDateField: ({ taskId, dueDate, className }: Props) => JSX.Element;
7
+ export default DueDateField;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import i18n from 'ui-i18n';
3
+ import classnames from 'classnames';
4
+ import { pipe } from 'ramda';
5
+ import { useStyles } from './styles';
6
+ import { DateEditor } from '../../../editors';
7
+ import { useWorkflowDueDate } from '../../hooks/useWorkflowDueDate';
8
+ var DueDateField = function (_a) {
9
+ var taskId = _a.taskId, dueDate = _a.dueDate, className = _a.className;
10
+ var styles = useStyles();
11
+ var _b = useWorkflowDueDate({ dueDate: dueDate, taskId: taskId }), updateDueDate = _b.updateDueDate, updateRequestIsInProgress = _b.updateRequestIsInProgress, readOnly = _b.readOnly;
12
+ return (React.createElement(DateEditor, { className: classnames(styles.dueDate, className), disabled: updateRequestIsInProgress || readOnly, value: dueDate, label: i18n.text('Due date'), onChange: pipe(function (date) { return date && date.getTime(); }, updateDueDate), margin: "dense", InputProps: { className: styles.dueDateInput }, InputLabelProps: { classes: { root: styles.inputLabel } } }));
13
+ };
14
+ export default DueDateField;
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"dueDate" | "dueDateInput" | "inputLabel">;
@@ -0,0 +1,13 @@
1
+ import { makeStyles } from '@material-ui/core/styles';
2
+ export var useStyles = makeStyles({
3
+ dueDate: {
4
+ marginTop: 0,
5
+ marginBottom: 0
6
+ },
7
+ dueDateInput: {
8
+ height: '40px'
9
+ },
10
+ inputLabel: {
11
+ fontSize: '14px'
12
+ }
13
+ });
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ declare type Props = {
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ plain?: boolean;
6
+ first?: boolean;
7
+ last?: boolean;
8
+ transparent?: boolean;
9
+ };
10
+ declare const LineDecorator: ({ className, children, plain, first, last, transparent }: Props) => JSX.Element;
11
+ export default LineDecorator;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import { useStyles } from './styles';
4
+ var LineDecorator = function (_a) {
5
+ var _b, _c, _d;
6
+ var className = _a.className, children = _a.children, plain = _a.plain, first = _a.first, last = _a.last, transparent = _a.transparent;
7
+ var styles = useStyles();
8
+ return (React.createElement("div", { className: classnames(className, styles.decorator) },
9
+ React.createElement("div", { className: classnames(styles.lineBlock, (_b = {}, _b[styles.withLinePadding] = first, _b)) }, !transparent && (React.createElement(React.Fragment, null,
10
+ React.createElement("div", { className: styles.noLine }),
11
+ React.createElement("div", { className: classnames(styles.line, (_c = {}, _c[styles.plain] = plain, _c), (_d = {}, _d[styles.last] = last, _d)) })))),
12
+ React.createElement("div", { className: styles.content }, children)));
13
+ };
14
+ export default LineDecorator;
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "last" | "line" | "decorator" | "plain" | "lineBlock" | "withLinePadding" | "noLine">;