@reltio/components 1.4.883 → 1.4.887
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/DropDownSelector/DropDownSelector.d.ts +3 -1
- package/cjs/components/DropDownSelector/DropDownSelector.js +5 -3
- package/cjs/components/attributes/editMode/AttributesPager/SpecialRenderer.js +3 -3
- package/cjs/components/attributes/editMode/Roles/Roles.d.ts +6 -0
- package/cjs/components/attributes/editMode/Roles/Roles.js +64 -0
- package/cjs/components/attributes/editMode/Roles/styles.d.ts +1 -0
- package/cjs/components/attributes/editMode/Roles/styles.js +10 -0
- package/cjs/components/attributes/editMode/Tags/Tags.d.ts +7 -0
- package/cjs/components/attributes/editMode/Tags/Tags.js +62 -0
- package/cjs/components/attributes/editMode/Tags/index.d.ts +1 -0
- package/cjs/components/attributes/editMode/Tags/index.js +8 -0
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +1 -1
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.js +7 -6
- package/cjs/components/editors/TypeaheadEditor/styles.d.ts +1 -1
- package/cjs/components/editors/TypeaheadEditor/styles.js +15 -0
- package/cjs/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.js +6 -6
- package/cjs/components/workflow/components/AssigneeSelector/AssigneeSelector.d.ts +4 -2
- package/cjs/components/workflow/components/AssigneeSelector/AssigneeSelector.js +3 -2
- package/cjs/components/workflow/components/DueDateField/DueDateField.d.ts +2 -1
- package/cjs/components/workflow/components/DueDateField/DueDateField.js +6 -2
- package/cjs/components/workflow/components/PrioritySelector/PrioritySelector.d.ts +2 -1
- package/cjs/components/workflow/components/PrioritySelector/PrioritySelector.js +6 -2
- package/cjs/components/workflow/components/TaskActions/TaskActions.d.ts +4 -2
- package/cjs/components/workflow/components/TaskActions/TaskActions.js +7 -2
- package/cjs/components/workflow/components/WorkflowComments/WorkflowComments.d.ts +2 -1
- package/cjs/components/workflow/components/WorkflowComments/WorkflowComments.js +6 -2
- package/cjs/components/workflow/helpers/index.d.ts +3 -1
- package/cjs/components/workflow/helpers/index.js +3 -1
- package/cjs/components/workflow/hooks/useWorkflowActions.d.ts +1 -1
- package/cjs/components/workflow/hooks/useWorkflowActions.js +4 -3
- package/cjs/components/workflow/hooks/useWorkflowAssignee.d.ts +1 -1
- package/cjs/components/workflow/hooks/useWorkflowAssignee.js +3 -2
- package/cjs/components/workflow/hooks/useWorkflowComments.d.ts +1 -1
- package/cjs/components/workflow/hooks/useWorkflowComments.js +3 -2
- package/cjs/components/workflow/hooks/useWorkflowDueDate.d.ts +1 -1
- package/cjs/components/workflow/hooks/useWorkflowDueDate.js +3 -2
- package/cjs/components/workflow/hooks/useWorkflowPriority.d.ts +1 -1
- package/cjs/components/workflow/hooks/useWorkflowPriority.js +3 -2
- package/cjs/{hooks → components/workflow/hooks}/useWorkflowTasks.d.ts +7 -1
- package/cjs/{hooks → components/workflow/hooks}/useWorkflowTasks.js +28 -17
- package/cjs/components/workflow/index.d.ts +1 -0
- package/cjs/components/workflow/index.js +3 -1
- package/cjs/hooks/index.d.ts +0 -1
- package/cjs/hooks/index.js +1 -3
- package/esm/components/DropDownSelector/DropDownSelector.d.ts +3 -1
- package/esm/components/DropDownSelector/DropDownSelector.js +5 -3
- package/esm/components/attributes/editMode/AttributesPager/SpecialRenderer.js +2 -2
- package/esm/components/attributes/editMode/Roles/Roles.d.ts +6 -0
- package/esm/components/attributes/editMode/Roles/Roles.js +38 -0
- package/esm/components/attributes/editMode/Roles/styles.d.ts +1 -0
- package/esm/components/attributes/editMode/Roles/styles.js +7 -0
- package/esm/components/attributes/editMode/Tags/Tags.d.ts +7 -0
- package/esm/components/attributes/editMode/Tags/Tags.js +38 -0
- package/esm/components/attributes/editMode/Tags/index.d.ts +1 -0
- package/esm/components/attributes/editMode/Tags/index.js +1 -0
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +1 -1
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.js +7 -6
- package/esm/components/editors/TypeaheadEditor/styles.d.ts +1 -1
- package/esm/components/editors/TypeaheadEditor/styles.js +15 -0
- package/esm/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.js +6 -6
- package/esm/components/workflow/components/AssigneeSelector/AssigneeSelector.d.ts +4 -2
- package/esm/components/workflow/components/AssigneeSelector/AssigneeSelector.js +3 -2
- package/esm/components/workflow/components/DueDateField/DueDateField.d.ts +2 -1
- package/esm/components/workflow/components/DueDateField/DueDateField.js +6 -2
- package/esm/components/workflow/components/PrioritySelector/PrioritySelector.d.ts +2 -1
- package/esm/components/workflow/components/PrioritySelector/PrioritySelector.js +6 -2
- package/esm/components/workflow/components/TaskActions/TaskActions.d.ts +4 -2
- package/esm/components/workflow/components/TaskActions/TaskActions.js +7 -2
- package/esm/components/workflow/components/WorkflowComments/WorkflowComments.d.ts +2 -1
- package/esm/components/workflow/components/WorkflowComments/WorkflowComments.js +6 -2
- package/esm/components/workflow/helpers/index.d.ts +3 -1
- package/esm/components/workflow/helpers/index.js +2 -1
- package/esm/components/workflow/hooks/useWorkflowActions.d.ts +1 -1
- package/esm/components/workflow/hooks/useWorkflowActions.js +4 -3
- package/esm/components/workflow/hooks/useWorkflowAssignee.d.ts +1 -1
- package/esm/components/workflow/hooks/useWorkflowAssignee.js +3 -2
- package/esm/components/workflow/hooks/useWorkflowComments.d.ts +1 -1
- package/esm/components/workflow/hooks/useWorkflowComments.js +3 -2
- package/esm/components/workflow/hooks/useWorkflowDueDate.d.ts +1 -1
- package/esm/components/workflow/hooks/useWorkflowDueDate.js +3 -2
- package/esm/components/workflow/hooks/useWorkflowPriority.d.ts +1 -1
- package/esm/components/workflow/hooks/useWorkflowPriority.js +3 -2
- package/esm/{hooks → components/workflow/hooks}/useWorkflowTasks.d.ts +7 -1
- package/esm/{hooks → components/workflow/hooks}/useWorkflowTasks.js +28 -17
- package/esm/components/workflow/index.d.ts +1 -0
- package/esm/components/workflow/index.js +1 -0
- package/esm/hooks/index.d.ts +0 -1
- package/esm/hooks/index.js +0 -1
- package/package.json +3 -3
|
@@ -12,8 +12,9 @@ var hooks_1 = require("../../../hooks");
|
|
|
12
12
|
var WorkflowTasksContext_1 = require("../../../contexts/WorkflowTasksContext");
|
|
13
13
|
var errors_1 = require("../helpers/errors");
|
|
14
14
|
var useWorkflowCheckPermission_1 = require("./useWorkflowCheckPermission");
|
|
15
|
+
var helpers_1 = require("../helpers");
|
|
15
16
|
var useWorkflowComments = function (_a) {
|
|
16
|
-
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId;
|
|
17
|
+
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
17
18
|
var updateTaskState = (react_1.useContext(WorkflowTasksContext_1.WorkflowTasksContext) || {}).updateTaskState;
|
|
18
19
|
var workflowPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowPath);
|
|
19
20
|
var environment = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
@@ -22,7 +23,7 @@ var useWorkflowComments = function (_a) {
|
|
|
22
23
|
var _b = react_1.useState([]), comments = _b[0], setComments = _b[1];
|
|
23
24
|
var _c = react_1.useState(false), requestIsInProgress = _c[0], setRequestIsInProgress = _c[1];
|
|
24
25
|
var checkWorkflowPermission = useWorkflowCheckPermission_1.useWorkflowCheckPermission();
|
|
25
|
-
var canUpdateTask = checkWorkflowPermission('UPDATE_TASK');
|
|
26
|
+
var canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && helpers_1.isOpenTask(isOpen);
|
|
26
27
|
react_1.useEffect(function () {
|
|
27
28
|
setComments(processInstanceComments || []);
|
|
28
29
|
}, [processInstanceComments]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
-
export declare const useWorkflowDueDate: ({ dueDate, taskId }: Pick<WorkflowTaskData, 'dueDate' | 'taskId'>) => {
|
|
2
|
+
export declare const useWorkflowDueDate: ({ dueDate, taskId, isOpen }: Pick<WorkflowTaskData, 'dueDate' | 'taskId' | 'isOpen'>) => {
|
|
3
3
|
updateDueDate: (newValue: number) => void;
|
|
4
4
|
updateRequestIsInProgress: boolean;
|
|
5
5
|
readOnly: boolean;
|
|
@@ -12,8 +12,9 @@ var hooks_1 = require("../../../hooks");
|
|
|
12
12
|
var WorkflowTasksContext_1 = require("../../../contexts/WorkflowTasksContext");
|
|
13
13
|
var errors_1 = require("../helpers/errors");
|
|
14
14
|
var useWorkflowCheckPermission_1 = require("./useWorkflowCheckPermission");
|
|
15
|
+
var helpers_1 = require("../helpers");
|
|
15
16
|
var useWorkflowDueDate = function (_a) {
|
|
16
|
-
var dueDate = _a.dueDate, taskId = _a.taskId;
|
|
17
|
+
var dueDate = _a.dueDate, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
17
18
|
var updateTaskState = (react_1.useContext(WorkflowTasksContext_1.WorkflowTasksContext) || {}).updateTaskState;
|
|
18
19
|
var workflowPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowPath);
|
|
19
20
|
var environment = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
@@ -21,7 +22,7 @@ var useWorkflowDueDate = function (_a) {
|
|
|
21
22
|
var safePromise = hooks_1.useSafePromise();
|
|
22
23
|
var _b = react_1.useState(false), updateRequestIsInProgress = _b[0], setUpdateRequestIsInProgress = _b[1];
|
|
23
24
|
var checkWorkflowPermission = useWorkflowCheckPermission_1.useWorkflowCheckPermission();
|
|
24
|
-
var canUpdateTask = checkWorkflowPermission('UPDATE_TASK');
|
|
25
|
+
var canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && helpers_1.isOpenTask(isOpen);
|
|
25
26
|
var updateDueDate = react_1.useCallback(function (newValue) {
|
|
26
27
|
if (workflowPath && canUpdateTask && taskId && newValue && dueDate !== newValue) {
|
|
27
28
|
setUpdateRequestIsInProgress(true);
|
|
@@ -3,7 +3,7 @@ declare type PriorityOption = {
|
|
|
3
3
|
label: string;
|
|
4
4
|
value: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const useWorkflowPriority: ({ priority, taskId }: Pick<WorkflowTaskData, 'taskId' | 'priority'>) => {
|
|
6
|
+
export declare const useWorkflowPriority: ({ priority, taskId, isOpen }: Pick<WorkflowTaskData, 'taskId' | 'priority' | 'isOpen'>) => {
|
|
7
7
|
priorities: PriorityOption[];
|
|
8
8
|
updatePriority: (newValue: PriorityOption) => void;
|
|
9
9
|
updateRequestIsInProgress: boolean;
|
|
@@ -13,8 +13,9 @@ var hooks_1 = require("../../../hooks");
|
|
|
13
13
|
var WorkflowTasksContext_1 = require("../../../contexts/WorkflowTasksContext");
|
|
14
14
|
var errors_1 = require("../helpers/errors");
|
|
15
15
|
var useWorkflowCheckPermission_1 = require("./useWorkflowCheckPermission");
|
|
16
|
+
var helpers_1 = require("../helpers");
|
|
16
17
|
var useWorkflowPriority = function (_a) {
|
|
17
|
-
var priority = _a.priority, taskId = _a.taskId;
|
|
18
|
+
var priority = _a.priority, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
18
19
|
var updateTaskState = (react_1.useContext(WorkflowTasksContext_1.WorkflowTasksContext) || {}).updateTaskState;
|
|
19
20
|
var workflowPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowPath);
|
|
20
21
|
var environment = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
@@ -22,7 +23,7 @@ var useWorkflowPriority = function (_a) {
|
|
|
22
23
|
var safePromise = hooks_1.useSafePromise();
|
|
23
24
|
var _b = react_1.useState(false), updateRequestIsInProgress = _b[0], setUpdateRequestIsInProgress = _b[1];
|
|
24
25
|
var checkWorkflowPermission = useWorkflowCheckPermission_1.useWorkflowCheckPermission();
|
|
25
|
-
var canUpdateTask = checkWorkflowPermission('UPDATE_TASK');
|
|
26
|
+
var canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && helpers_1.isOpenTask(isOpen);
|
|
26
27
|
var updatePriority = react_1.useCallback(function (newValue) {
|
|
27
28
|
var newPriority = newValue.value;
|
|
28
29
|
if (workflowPath && canUpdateTask && taskId && priority !== newPriority) {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
-
|
|
2
|
+
declare type Config = {
|
|
3
|
+
processTypes?: string[];
|
|
4
|
+
assignee?: string;
|
|
5
|
+
showClosedTasks?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const useWorkflowTasks: (config?: Config) => {
|
|
3
8
|
tasks: WorkflowTaskData[];
|
|
4
9
|
total: number;
|
|
5
10
|
loading: boolean;
|
|
6
11
|
updateTaskState: (taskId: WorkflowTaskData['taskId'], payload: Partial<WorkflowTaskData>) => void;
|
|
7
12
|
loadWorkflowTasks: () => void;
|
|
8
13
|
};
|
|
14
|
+
export {};
|
|
@@ -17,11 +17,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.useWorkflowTasks = void 0;
|
|
18
18
|
var react_1 = require("react");
|
|
19
19
|
var react_redux_1 = require("react-redux");
|
|
20
|
+
var ramda_1 = require("ramda");
|
|
20
21
|
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
21
22
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
22
|
-
var useSafePromise_1 = require("
|
|
23
|
-
var useWorkflowCheckPermission_1 = require("
|
|
24
|
-
var useWorkflowTasks = function () {
|
|
23
|
+
var useSafePromise_1 = require("../../../hooks/useSafePromise");
|
|
24
|
+
var useWorkflowCheckPermission_1 = require("./useWorkflowCheckPermission");
|
|
25
|
+
var useWorkflowTasks = function (config) {
|
|
26
|
+
var _a = config || {}, processTypes = _a.processTypes, assignee = _a.assignee, showClosedTasks = _a.showClosedTasks;
|
|
25
27
|
var safePromise = useSafePromise_1.useSafePromise();
|
|
26
28
|
var workflowPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowPath);
|
|
27
29
|
var environment = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
@@ -31,21 +33,27 @@ var useWorkflowTasks = function () {
|
|
|
31
33
|
var checkWorkflowPermission = useWorkflowCheckPermission_1.useWorkflowCheckPermission();
|
|
32
34
|
var canViewTasks = checkWorkflowPermission('VIEW_TASKS');
|
|
33
35
|
var enabled = !!(workflowPath && environment) && canViewTasks;
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
36
|
+
var _b = react_1.useState(null), tasks = _b[0], setTasks = _b[1];
|
|
37
|
+
var _c = react_1.useState(0), total = _c[0], setTotal = _c[1];
|
|
38
|
+
var _d = react_1.useState(false), loading = _d[0], setLoading = _d[1];
|
|
37
39
|
var loadWorkflowTasks = react_1.useCallback(function () {
|
|
38
40
|
setLoading(true);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
var parsedProcessTypes = !Array.isArray(processTypes) || processTypes.includes('*') ? null : processTypes;
|
|
42
|
+
var requests = (parsedProcessTypes || [null]).map(function (processType) {
|
|
43
|
+
return mdm_sdk_1.getTasksForEntity({
|
|
44
|
+
entityUri: entityUri,
|
|
45
|
+
workflowPath: workflowPath,
|
|
46
|
+
environment: environment,
|
|
47
|
+
tenant: tenant,
|
|
48
|
+
filter: { assignee: assignee, processType: processType },
|
|
49
|
+
includeClosed: !!showClosedTasks
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
safePromise(Promise.all(requests))
|
|
53
|
+
.then(function (responses) {
|
|
54
|
+
var tasks = ramda_1.pipe(ramda_1.map(ramda_1.prop('data')), ramda_1.reject(ramda_1.isNil), ramda_1.flatten, ramda_1.uniqBy(ramda_1.prop('taskId')), ramda_1.filter(isRequestedTask(parsedProcessTypes, assignee)))(responses);
|
|
55
|
+
setTasks(tasks);
|
|
56
|
+
setTotal(tasks.length);
|
|
49
57
|
})
|
|
50
58
|
.catch(function (error) {
|
|
51
59
|
console.warn('Workflow error', error);
|
|
@@ -53,7 +61,7 @@ var useWorkflowTasks = function () {
|
|
|
53
61
|
.finally(function () {
|
|
54
62
|
setLoading(false);
|
|
55
63
|
});
|
|
56
|
-
}, [entityUri, environment, safePromise, tenant, workflowPath]);
|
|
64
|
+
}, [entityUri, environment, safePromise, tenant, workflowPath, assignee, showClosedTasks, processTypes]);
|
|
57
65
|
react_1.useEffect(function () {
|
|
58
66
|
if (entityUri && enabled && !mdm_sdk_1.isTempUri(entityUri)) {
|
|
59
67
|
loadWorkflowTasks();
|
|
@@ -70,3 +78,6 @@ var useWorkflowTasks = function () {
|
|
|
70
78
|
return { tasks: tasks, total: total, loading: loading, updateTaskState: updateTaskState, loadWorkflowTasks: loadWorkflowTasks };
|
|
71
79
|
};
|
|
72
80
|
exports.useWorkflowTasks = useWorkflowTasks;
|
|
81
|
+
var isRequestedTask = function (processTypes, assignee) { return function (task) {
|
|
82
|
+
return (!processTypes || processTypes.includes(task.processType)) && (!assignee || assignee === task.assignee);
|
|
83
|
+
}; };
|
|
@@ -4,3 +4,4 @@ export { default as WorkflowComments } from './components/WorkflowComments';
|
|
|
4
4
|
export { useWorkflowAssignee } from './hooks/useWorkflowAssignee';
|
|
5
5
|
export { useWorkflowComments } from './hooks/useWorkflowComments';
|
|
6
6
|
export { useWorkflowCheckPermission } from './hooks/useWorkflowCheckPermission';
|
|
7
|
+
export { useWorkflowTasks } from './hooks/useWorkflowTasks';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useWorkflowCheckPermission = exports.useWorkflowComments = exports.useWorkflowAssignee = exports.WorkflowComments = exports.AddWorkflowButton = exports.WorkflowTaskCard = void 0;
|
|
6
|
+
exports.useWorkflowTasks = exports.useWorkflowCheckPermission = exports.useWorkflowComments = exports.useWorkflowAssignee = exports.WorkflowComments = exports.AddWorkflowButton = exports.WorkflowTaskCard = void 0;
|
|
7
7
|
var WorkflowTaskCard_1 = require("./cards/WorkflowTaskCard");
|
|
8
8
|
Object.defineProperty(exports, "WorkflowTaskCard", { enumerable: true, get: function () { return WorkflowTaskCard_1.WorkflowTaskCard; } });
|
|
9
9
|
var AddWorkflowButton_1 = require("./components/AddWorkflowButton/AddWorkflowButton");
|
|
@@ -16,3 +16,5 @@ var useWorkflowComments_1 = require("./hooks/useWorkflowComments");
|
|
|
16
16
|
Object.defineProperty(exports, "useWorkflowComments", { enumerable: true, get: function () { return useWorkflowComments_1.useWorkflowComments; } });
|
|
17
17
|
var useWorkflowCheckPermission_1 = require("./hooks/useWorkflowCheckPermission");
|
|
18
18
|
Object.defineProperty(exports, "useWorkflowCheckPermission", { enumerable: true, get: function () { return useWorkflowCheckPermission_1.useWorkflowCheckPermission; } });
|
|
19
|
+
var useWorkflowTasks_1 = require("./hooks/useWorkflowTasks");
|
|
20
|
+
Object.defineProperty(exports, "useWorkflowTasks", { enumerable: true, get: function () { return useWorkflowTasks_1.useWorkflowTasks; } });
|
package/cjs/hooks/index.d.ts
CHANGED
|
@@ -11,4 +11,3 @@ export { useSavedState } from './useSavedState';
|
|
|
11
11
|
export { useUsers } from './useUsers';
|
|
12
12
|
export { useWhyDidYouUpdate } from './useWhyDidYouUpdate';
|
|
13
13
|
export { useConfigPermissions } from './useConfigPermissions';
|
|
14
|
-
export { useWorkflowTasks } from './useWorkflowTasks';
|
package/cjs/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useConfigPermissions = exports.useWhyDidYouUpdate = exports.useUsers = exports.useSavedState = exports.useSafePromise = exports.useRunOnceAfterValueInitialization = exports.useRelationsLoader = exports.useRelationTypeSelector = exports.usePrevious = exports.useDidUpdateEffect = exports.useCollaboration = exports.useAsyncMount = exports.useActions = void 0;
|
|
4
4
|
var useActions_1 = require("./useActions");
|
|
5
5
|
Object.defineProperty(exports, "useActions", { enumerable: true, get: function () { return useActions_1.useActions; } });
|
|
6
6
|
var useAsyncMount_1 = require("./useAsyncMount");
|
|
@@ -27,5 +27,3 @@ var useWhyDidYouUpdate_1 = require("./useWhyDidYouUpdate");
|
|
|
27
27
|
Object.defineProperty(exports, "useWhyDidYouUpdate", { enumerable: true, get: function () { return useWhyDidYouUpdate_1.useWhyDidYouUpdate; } });
|
|
28
28
|
var useConfigPermissions_1 = require("./useConfigPermissions");
|
|
29
29
|
Object.defineProperty(exports, "useConfigPermissions", { enumerable: true, get: function () { return useConfigPermissions_1.useConfigPermissions; } });
|
|
30
|
-
var useWorkflowTasks_1 = require("./useWorkflowTasks");
|
|
31
|
-
Object.defineProperty(exports, "useWorkflowTasks", { enumerable: true, get: function () { return useWorkflowTasks_1.useWorkflowTasks; } });
|
|
@@ -11,10 +11,11 @@ export namespace DropDownSelectorType {
|
|
|
11
11
|
const textFieldInputRef: PropTypes.Requireable<object>;
|
|
12
12
|
const TextFieldProps: PropTypes.Requireable<object>;
|
|
13
13
|
const height: PropTypes.Requireable<number>;
|
|
14
|
+
const classes: PropTypes.Requireable<object>;
|
|
14
15
|
}
|
|
15
16
|
export default DropDownSelector;
|
|
16
17
|
import PropTypes from "prop-types";
|
|
17
|
-
declare function DropDownSelector({ value, label, createLabel, getOptions, options, height, onChange, onCreate, onClear, components, textFieldInputRef, TextFieldProps, ...otherProps }: {
|
|
18
|
+
declare function DropDownSelector({ value, label, createLabel, getOptions, options, height, onChange, onCreate, onClear, components, textFieldInputRef, TextFieldProps, classes, ...otherProps }: {
|
|
18
19
|
[x: string]: any;
|
|
19
20
|
value: any;
|
|
20
21
|
label: any;
|
|
@@ -28,6 +29,7 @@ declare function DropDownSelector({ value, label, createLabel, getOptions, optio
|
|
|
28
29
|
components: any;
|
|
29
30
|
textFieldInputRef: any;
|
|
30
31
|
TextFieldProps: any;
|
|
32
|
+
classes: any;
|
|
31
33
|
}): JSX.Element;
|
|
32
34
|
declare namespace DropDownSelector {
|
|
33
35
|
export { DropDownSelectorType as propTypes };
|
|
@@ -35,7 +35,7 @@ import SingleValue from './components/SingleValue';
|
|
|
35
35
|
import { useStyles, customStyles, overloadMenuListStyle, withoutLabelInputStyle } from './styles';
|
|
36
36
|
var DropDownSelector = function (_a) {
|
|
37
37
|
var _b;
|
|
38
|
-
var value = _a.value, label = _a.label, createLabel = _a.createLabel, getOptions = _a.getOptions, options = _a.options, _c = _a.height, height = _c === void 0 ? 46 : _c, _d = _a.onChange, onChange = _d === void 0 ? identity : _d, onCreate = _a.onCreate, _e = _a.onClear, onClear = _e === void 0 ? identity : _e, components = _a.components, textFieldInputRef = _a.textFieldInputRef, TextFieldProps = _a.TextFieldProps, otherProps = __rest(_a, ["value", "label", "createLabel", "getOptions", "options", "height", "onChange", "onCreate", "onClear", "components", "textFieldInputRef", "TextFieldProps"]);
|
|
38
|
+
var value = _a.value, label = _a.label, createLabel = _a.createLabel, getOptions = _a.getOptions, options = _a.options, _c = _a.height, height = _c === void 0 ? 46 : _c, _d = _a.onChange, onChange = _d === void 0 ? identity : _d, onCreate = _a.onCreate, _e = _a.onClear, onClear = _e === void 0 ? identity : _e, components = _a.components, textFieldInputRef = _a.textFieldInputRef, TextFieldProps = _a.TextFieldProps, classes = _a.classes, otherProps = __rest(_a, ["value", "label", "createLabel", "getOptions", "options", "height", "onChange", "onCreate", "onClear", "components", "textFieldInputRef", "TextFieldProps", "classes"]);
|
|
39
39
|
var styles = useStyles({ height: height });
|
|
40
40
|
var underlineStyle = useInputStyles();
|
|
41
41
|
var _f = useState(false), open = _f[0], setOpen = _f[1];
|
|
@@ -53,7 +53,8 @@ var DropDownSelector = function (_a) {
|
|
|
53
53
|
var overloadStylesIfGroup = prop('Group', components) ? overloadMenuListStyle : {};
|
|
54
54
|
var overloadStylesIfNoLabel = isEmpty(label) ? withoutLabelInputStyle : {};
|
|
55
55
|
var mergedStyles = __assign(__assign(__assign({}, customStyles), overloadStylesIfGroup), overloadStylesIfNoLabel);
|
|
56
|
-
|
|
56
|
+
var mergedClasses = __assign(__assign({}, styles), classes);
|
|
57
|
+
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: mergedClasses, styles: mergedStyles, components: __assign(__assign({ DropdownIndicator: DropdownIndicator, LoadingIndicator: EmptyStub, SingleValue: SingleValue,
|
|
57
58
|
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
59
|
};
|
|
59
60
|
export var DropDownSelectorType = {
|
|
@@ -68,7 +69,8 @@ export var DropDownSelectorType = {
|
|
|
68
69
|
components: PropTypes.object,
|
|
69
70
|
textFieldInputRef: PropTypes.object,
|
|
70
71
|
TextFieldProps: PropTypes.object,
|
|
71
|
-
height: PropTypes.number
|
|
72
|
+
height: PropTypes.number,
|
|
73
|
+
classes: PropTypes.object
|
|
72
74
|
};
|
|
73
75
|
DropDownSelector.propTypes = DropDownSelectorType;
|
|
74
76
|
export default DropDownSelector;
|
|
@@ -27,8 +27,8 @@ import Title from '../../../Title/Title';
|
|
|
27
27
|
import Cardinality from './CardinalityMessage';
|
|
28
28
|
import ErrorMessage from '../../../ErrorWrapper/ErrorMessage';
|
|
29
29
|
import Attribute from '../AttributesFactory/Attribute';
|
|
30
|
-
import
|
|
31
|
-
import
|
|
30
|
+
import { Roles } from '../Roles/Roles';
|
|
31
|
+
import Tags from '../Tags';
|
|
32
32
|
import { useStyles } from './styles';
|
|
33
33
|
var SpecialRenderer = function (_a) {
|
|
34
34
|
var values = _a.values, attributeType = _a.attributeType, parentUri = _a.parentUri, mode = _a.mode, errorMessage = _a.errorMessage, otherProps = __rest(_a, ["values", "attributeType", "parentUri", "mode", "errorMessage"]);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { prop, propEq } from 'ramda';
|
|
3
|
+
import { useSelector, useDispatch } from 'react-redux';
|
|
4
|
+
import { EntityAttrTypes, getRolesForEntityType, getLastUriPart } from '@reltio/mdm-sdk';
|
|
5
|
+
import mdmModule, { profile } from '@reltio/mdm-module';
|
|
6
|
+
import SimpleDropDownSelector from '../../../SimpleDropDownSelector/SimpleDropDownSelector';
|
|
7
|
+
import { MultiValueChip } from '../../..';
|
|
8
|
+
import { useStyles } from './styles';
|
|
9
|
+
var components = { MultiValue: MultiValueChip };
|
|
10
|
+
export var Roles = function (_a) {
|
|
11
|
+
var values = _a.values;
|
|
12
|
+
var styles = useStyles();
|
|
13
|
+
var dispatch = useDispatch();
|
|
14
|
+
var metadata = useSelector(mdmModule.selectors.getMetadata);
|
|
15
|
+
var entity = useSelector(mdmModule.selectors.getEntity);
|
|
16
|
+
var entityUri = entity.uri;
|
|
17
|
+
var options = getRolesForEntityType(metadata, entity.type).map(function (role) { return ({
|
|
18
|
+
value: role.uri,
|
|
19
|
+
label: role.label
|
|
20
|
+
}); });
|
|
21
|
+
var formattedValues = values.map(function (value) {
|
|
22
|
+
var _a;
|
|
23
|
+
var label = (_a = options.find(propEq('value', value))) === null || _a === void 0 ? void 0 : _a.label;
|
|
24
|
+
return {
|
|
25
|
+
value: value,
|
|
26
|
+
label: label || getLastUriPart(value)
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
var handleChange = function (values) {
|
|
30
|
+
var roles = (values === null || values === void 0 ? void 0 : values.map(prop('value'))) || [];
|
|
31
|
+
dispatch(profile.actions.modifyAttribute({
|
|
32
|
+
value: roles,
|
|
33
|
+
attributeType: EntityAttrTypes.roles,
|
|
34
|
+
uri: entityUri
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
return (React.createElement(SimpleDropDownSelector, { label: '', height: 40, isMulti: true, options: options, value: formattedValues, onChange: handleChange, components: components, classes: styles }));
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"valueContainer">;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import mdmModule, { profile } from '@reltio/mdm-module';
|
|
4
|
+
import { getFacets, EntityAttrTypes, buildFilterQueryString } from '@reltio/mdm-sdk';
|
|
5
|
+
import TypeaheadEditor from '../../../editors/TypeaheadEditor/TypeaheadEditor';
|
|
6
|
+
var filtersWithSearch = function (searchQuery) { return [
|
|
7
|
+
{
|
|
8
|
+
filter: 'containsWordStartingWith',
|
|
9
|
+
fieldName: 'tags',
|
|
10
|
+
values: [searchQuery]
|
|
11
|
+
}
|
|
12
|
+
]; };
|
|
13
|
+
var getQuery = function (searchQuery) {
|
|
14
|
+
return searchQuery ? "?filter=" + buildFilterQueryString()(filtersWithSearch(searchQuery)) : '';
|
|
15
|
+
};
|
|
16
|
+
var body = [
|
|
17
|
+
{
|
|
18
|
+
fieldName: 'tags',
|
|
19
|
+
orderType: 'reversedCount'
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
var getSuggestions = function (searchQuery) {
|
|
23
|
+
return getFacets({ query: getQuery(searchQuery), body: body }).then(function (response) { return Object.keys(response.tags); });
|
|
24
|
+
};
|
|
25
|
+
var Tags = function (_a) {
|
|
26
|
+
var className = _a.className, values = _a.values;
|
|
27
|
+
var dispatch = useDispatch();
|
|
28
|
+
var entityUri = useSelector(mdmModule.selectors.getEntityUri);
|
|
29
|
+
var onChange = useCallback(function (tags) {
|
|
30
|
+
return dispatch(profile.actions.modifyAttribute({
|
|
31
|
+
value: tags,
|
|
32
|
+
attributeType: EntityAttrTypes.tags,
|
|
33
|
+
uri: entityUri
|
|
34
|
+
}));
|
|
35
|
+
}, [dispatch, entityUri]);
|
|
36
|
+
return (React.createElement(TypeaheadEditor, { fullWidth: true, multiple: true, variant: "filled", className: className, value: values, onChange: onChange, getSuggestions: getSuggestions }));
|
|
37
|
+
};
|
|
38
|
+
export default Tags;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Tags';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Tags';
|
|
@@ -26,6 +26,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
26
26
|
return to;
|
|
27
27
|
};
|
|
28
28
|
import Autosuggest from 'react-autosuggest';
|
|
29
|
+
import AutosizeInput from 'react-input-autosize';
|
|
29
30
|
import classnames from 'classnames';
|
|
30
31
|
import TextField from '@material-ui/core/TextField';
|
|
31
32
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
@@ -42,9 +43,9 @@ import ExpandedValueTooltip from '../../ExpandedValueTooltip/ExpandedValueToolti
|
|
|
42
43
|
import ValueChip from '../../ValueChip/ValueChip';
|
|
43
44
|
var FETCH_DEBOUNCE_INTERVAL = 300;
|
|
44
45
|
var TypeaheadEditor = function (_a) {
|
|
45
|
-
var value = _a.value, getSuggestions = _a.getSuggestions, onChange = _a.onChange, multiple = _a.multiple, fullWidth = _a.fullWidth,
|
|
46
|
-
var
|
|
47
|
-
var
|
|
46
|
+
var value = _a.value, getSuggestions = _a.getSuggestions, onChange = _a.onChange, multiple = _a.multiple, fullWidth = _a.fullWidth, _b = _a.InputProps, InputProps = _b === void 0 ? {} : _b, inputProps = __rest(_a, ["value", "getSuggestions", "onChange", "multiple", "fullWidth", "InputProps"]);
|
|
47
|
+
var _c = useState([]), suggestions = _c[0], setSuggestions = _c[1];
|
|
48
|
+
var _d = useState(false), isPlaceholderVisible = _d[0], setPlaceholderVisibility = _d[1];
|
|
48
49
|
var inputRef = useRef();
|
|
49
50
|
var styles = useStyles();
|
|
50
51
|
var isFocused = function () { var _a; return ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === document.activeElement; };
|
|
@@ -53,8 +54,8 @@ var TypeaheadEditor = function (_a) {
|
|
|
53
54
|
getSuggestions
|
|
54
55
|
]);
|
|
55
56
|
value = defaultTo(multiple ? [] : '', value);
|
|
56
|
-
var
|
|
57
|
-
var
|
|
57
|
+
var _e = useState(''), currentValue = _e[0], setCurrentValue = _e[1];
|
|
58
|
+
var _f = useState(false), hasHighlightedItem = _f[0], setHasHighlightedItem = _f[1];
|
|
58
59
|
var onInputChange = function (_a) {
|
|
59
60
|
var newValue = _a.newValue, method = _a.method;
|
|
60
61
|
switch (method) {
|
|
@@ -99,7 +100,7 @@ var TypeaheadEditor = function (_a) {
|
|
|
99
100
|
underline: classnames((_b = {}, _b[styles['input__underline']] = isEmptyValue(value), _b)),
|
|
100
101
|
input: classnames(styles['rawInput'], path(['classes', 'input'], InputProps))
|
|
101
102
|
};
|
|
102
|
-
return multiple ? (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value.map(function (item, index) { return (React.createElement(ValueChip, { key: item, label: item, onDelete: function () { return onChange(remove(index, 1, value)); } })); }), classes: __assign({ root: classnames(styles['multiple-input__input'], path(['classes', 'root'], InputProps)), adornedStart: styles['multiple-input__adornedStart'] }
|
|
103
|
+
return multiple ? (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value.map(function (item, index) { return (React.createElement(ValueChip, { key: item, label: item, onDelete: function () { return onChange(remove(index, 1, value)); } })); }), inputComponent: AutosizeInput, classes: __assign(__assign({ root: classnames(styles['multiple-input__input'], path(['classes', 'root'], InputProps)) }, commonClasses), { input: classnames(styles.autosizeInput, commonClasses.input), adornedStart: styles['multiple-input__adornedStart'] }) }), value: currentValue, onChange: onInputChange, classes: { root: styles['multiple-input__root'] } }))) : (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, value: value, onChange: pipe(tap(onInputChange), getValue, onChange), InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: classnames(styles['input__root'], path(['classes', 'root'], InputProps)) }, commonClasses) }) })));
|
|
103
104
|
}, renderSuggestionsContainer: function (_a) {
|
|
104
105
|
var children = _a.children, _b = _a.containerProps, ref = _b.ref, restContainerProps = __rest(_b, ["ref"]);
|
|
105
106
|
return (React.createElement(Popper, { anchorEl: inputRef.current, open: Boolean(children) || isPlaceholderVisible },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"typeahead__suggestions-placeholder" | "typeahead__suggestions-container--open" | "typeahead__suggestions-list" | "typeahead__suggestions-menuItem" | "input__root" | "rawInput" | "multiple-input__root" | "multiple-input__input" | "multiple-input__adornedStart" | "input__underline" | "typeahead__suggestions-container" | "menuItem--item">;
|
|
1
|
+
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"autosizeInput" | "typeahead__suggestions-placeholder" | "typeahead__suggestions-container--open" | "typeahead__suggestions-list" | "typeahead__suggestions-menuItem" | "input__root" | "rawInput" | "multiple-input__root" | "multiple-input__input" | "multiple-input__adornedStart" | "input__underline" | "typeahead__suggestions-container" | "menuItem--item">;
|
|
@@ -21,6 +21,21 @@ export var useStyles = makeStyles({
|
|
|
21
21
|
color: 'rgba(0,0,0,0.87)',
|
|
22
22
|
fontSize: '14px'
|
|
23
23
|
},
|
|
24
|
+
autosizeInput: {
|
|
25
|
+
width: 'auto',
|
|
26
|
+
paddingTop: '10px',
|
|
27
|
+
paddingBottom: '11px',
|
|
28
|
+
marginLeft: '5px',
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
'& input': {
|
|
31
|
+
background: '0px center',
|
|
32
|
+
border: 0,
|
|
33
|
+
fontSize: 'inherit',
|
|
34
|
+
outline: 0,
|
|
35
|
+
padding: 0,
|
|
36
|
+
color: 'inherit'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
24
39
|
rawInput: {
|
|
25
40
|
height: '19px'
|
|
26
41
|
},
|
|
@@ -18,7 +18,7 @@ import CollaborationIcon from '../../../../icons/CollaborationIcon';
|
|
|
18
18
|
var GenericWorkflowTaskCard = function (_a) {
|
|
19
19
|
var _b;
|
|
20
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;
|
|
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, isTaskOpen = task.isOpen;
|
|
22
22
|
var dcrId = getDCRId(objectURIs);
|
|
23
23
|
var color = useWorkflowColor({ processDefinitionDisplayName: processDefinitionDisplayName });
|
|
24
24
|
var styles = useStyles({ color: color });
|
|
@@ -61,16 +61,16 @@ var GenericWorkflowTaskCard = function (_a) {
|
|
|
61
61
|
canViewComments && (processInstanceComments === null || processInstanceComments === void 0 ? void 0 : processInstanceComments.length) > 0 && (React.createElement("div", { className: styles.commentsInfo },
|
|
62
62
|
React.createElement(CollaborationIcon, { className: styles.commentsIcon }),
|
|
63
63
|
React.createElement("div", { className: styles.infoValue }, processInstanceComments.length)))),
|
|
64
|
-
actions || (React.createElement(TaskActions, { taskId: taskId, possibleActions: possibleActions, assignee: assignee })))))),
|
|
64
|
+
actions || (React.createElement(TaskActions, { taskId: taskId, possibleActions: possibleActions, assignee: assignee, isTaskOpen: isTaskOpen })))))),
|
|
65
65
|
isExpanded && (React.createElement(LineDecorator, { plain: true },
|
|
66
66
|
React.createElement("div", { className: styles.controlsBox },
|
|
67
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 }))))),
|
|
68
|
+
React.createElement(DueDateField, { taskId: taskId, dueDate: dueDate, isTaskOpen: isTaskOpen }),
|
|
69
|
+
React.createElement(PrioritySelector, { taskId: taskId, priority: priority, className: styles.priority, isTaskOpen: isTaskOpen })),
|
|
70
|
+
React.createElement(AssigneeSelector, { taskId: taskId, assignee: assignee, isTaskOpen: isTaskOpen }))))),
|
|
71
71
|
isExpanded && (React.createElement(React.Fragment, null,
|
|
72
72
|
children,
|
|
73
73
|
canViewComments && (React.createElement("div", { className: styles.comments },
|
|
74
|
-
React.createElement(WorkflowComments, { taskId: taskId, processInstanceComments: processInstanceComments })))))));
|
|
74
|
+
React.createElement(WorkflowComments, { taskId: taskId, processInstanceComments: processInstanceComments, isTaskOpen: isTaskOpen })))))));
|
|
75
75
|
};
|
|
76
76
|
export default GenericWorkflowTaskCard;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
|
-
declare type Props = Pick<WorkflowTaskData, 'taskId' | 'assignee'
|
|
4
|
-
|
|
3
|
+
declare type Props = Pick<WorkflowTaskData, 'taskId' | 'assignee'> & {
|
|
4
|
+
isTaskOpen?: WorkflowTaskData['isOpen'];
|
|
5
|
+
};
|
|
6
|
+
declare const AssigneeSelector: ({ taskId, assignee, isTaskOpen }: Props) => JSX.Element;
|
|
5
7
|
export default AssigneeSelector;
|
|
@@ -3,10 +3,11 @@ import i18n from 'ui-i18n';
|
|
|
3
3
|
import DropDownSelector from '../../../DropDownSelector/DropDownSelector';
|
|
4
4
|
import { useWorkflowAssignee } from '../../hooks/useWorkflowAssignee';
|
|
5
5
|
var AssigneeSelector = function (_a) {
|
|
6
|
-
var taskId = _a.taskId, assignee = _a.assignee;
|
|
6
|
+
var taskId = _a.taskId, assignee = _a.assignee, isTaskOpen = _a.isTaskOpen;
|
|
7
7
|
var _b = useWorkflowAssignee({
|
|
8
8
|
taskId: taskId,
|
|
9
|
-
assignee: assignee
|
|
9
|
+
assignee: assignee,
|
|
10
|
+
isOpen: isTaskOpen
|
|
10
11
|
}), currentAssignee = _b.assignee, getAssignees = _b.getAssignees, updateAssignee = _b.updateAssignee, updateRequestIsInProgress = _b.updateRequestIsInProgress, readOnly = _b.readOnly;
|
|
11
12
|
var disabled = updateRequestIsInProgress || readOnly;
|
|
12
13
|
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 }));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
3
|
declare type Props = Pick<WorkflowTaskData, 'taskId' | 'dueDate'> & {
|
|
4
|
+
isTaskOpen?: WorkflowTaskData['isOpen'];
|
|
4
5
|
className?: string;
|
|
5
6
|
};
|
|
6
|
-
declare const DueDateField: ({ taskId, dueDate, className }: Props) => JSX.Element;
|
|
7
|
+
declare const DueDateField: ({ taskId, dueDate, isTaskOpen, className }: Props) => JSX.Element;
|
|
7
8
|
export default DueDateField;
|
|
@@ -6,9 +6,13 @@ import { useStyles } from './styles';
|
|
|
6
6
|
import { DateEditor } from '../../../editors';
|
|
7
7
|
import { useWorkflowDueDate } from '../../hooks/useWorkflowDueDate';
|
|
8
8
|
var DueDateField = function (_a) {
|
|
9
|
-
var taskId = _a.taskId, dueDate = _a.dueDate, className = _a.className;
|
|
9
|
+
var taskId = _a.taskId, dueDate = _a.dueDate, isTaskOpen = _a.isTaskOpen, className = _a.className;
|
|
10
10
|
var styles = useStyles();
|
|
11
|
-
var _b = useWorkflowDueDate({
|
|
11
|
+
var _b = useWorkflowDueDate({
|
|
12
|
+
dueDate: dueDate,
|
|
13
|
+
taskId: taskId,
|
|
14
|
+
isOpen: isTaskOpen
|
|
15
|
+
}), updateDueDate = _b.updateDueDate, updateRequestIsInProgress = _b.updateRequestIsInProgress, readOnly = _b.readOnly;
|
|
12
16
|
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
17
|
};
|
|
14
18
|
export default DueDateField;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
3
|
declare type Props = Pick<WorkflowTaskData, 'taskId' | 'priority'> & {
|
|
4
|
+
isTaskOpen?: WorkflowTaskData['isOpen'];
|
|
4
5
|
className?: string;
|
|
5
6
|
};
|
|
6
|
-
declare const PrioritySelector: ({ taskId, priority, className }: Props) => JSX.Element;
|
|
7
|
+
declare const PrioritySelector: ({ taskId, priority, isTaskOpen, className }: Props) => JSX.Element;
|
|
7
8
|
export default PrioritySelector;
|
|
@@ -4,8 +4,12 @@ import { propEq } from 'ramda';
|
|
|
4
4
|
import DropDownSelector from '../../../DropDownSelector/DropDownSelector';
|
|
5
5
|
import { useWorkflowPriority } from '../../hooks/useWorkflowPriority';
|
|
6
6
|
var PrioritySelector = function (_a) {
|
|
7
|
-
var taskId = _a.taskId, priority = _a.priority, className = _a.className;
|
|
8
|
-
var _b = useWorkflowPriority({
|
|
7
|
+
var taskId = _a.taskId, priority = _a.priority, isTaskOpen = _a.isTaskOpen, className = _a.className;
|
|
8
|
+
var _b = useWorkflowPriority({
|
|
9
|
+
taskId: taskId,
|
|
10
|
+
priority: priority,
|
|
11
|
+
isOpen: isTaskOpen
|
|
12
|
+
}), priorities = _b.priorities, updatePriority = _b.updatePriority, updateRequestIsInProgress = _b.updateRequestIsInProgress, readOnly = _b.readOnly;
|
|
9
13
|
var disabled = updateRequestIsInProgress || readOnly;
|
|
10
14
|
return (React.createElement(DropDownSelector, { className: className, isDisabled: disabled, options: priorities, onChange: updatePriority, hideSelectedOptions: false, label: i18n.text('Priority'), value: priorities.find(propEq('value', priority)), TextFieldProps: { disabled: disabled }, height: 40 }));
|
|
11
15
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
|
-
declare type Props = Pick<WorkflowTaskData, 'taskId' | 'possibleActions' | 'assignee'
|
|
4
|
-
|
|
3
|
+
declare type Props = Pick<WorkflowTaskData, 'taskId' | 'possibleActions' | 'assignee'> & {
|
|
4
|
+
isTaskOpen?: WorkflowTaskData['isOpen'];
|
|
5
|
+
};
|
|
6
|
+
declare const TaskActions: ({ taskId, possibleActions, assignee, isTaskOpen }: Props) => JSX.Element;
|
|
5
7
|
export default TaskActions;
|