@topconsultnpm/sdkui-react 6.19.0-dev1.55 → 6.19.0-dev1.56
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/lib/components/base/TMCustomButton.d.ts +11 -0
- package/lib/components/base/TMCustomButton.js +63 -0
- package/lib/components/features/archive/TMArchive.d.ts +8 -0
- package/lib/components/features/archive/TMArchive.js +3 -3
- package/lib/components/features/documents/TMDcmtBlog.d.ts +8 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.d.ts +8 -1
- package/lib/components/features/documents/TMDcmtForm.js +52 -21
- package/lib/components/features/documents/TMDcmtTasks.d.ts +12 -0
- package/lib/components/features/documents/TMDcmtTasks.js +24 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +8 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +5 -5
- package/lib/components/features/search/TMSearch.d.ts +8 -1
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +8 -1
- package/lib/components/features/search/TMSearchResult.js +14 -11
- package/lib/components/features/search/TMSearchResultsMenuItems.js +1 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +8 -4
- package/lib/components/features/tasks/TMTaskForm.js +4 -4
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +3 -3
- package/lib/components/features/tasks/TMTasksPanelContent.js +8 -18
- package/lib/components/features/tasks/TMTasksUtils.d.ts +3 -2
- package/lib/components/features/tasks/TMTasksUtils.js +36 -4
- package/lib/components/features/tasks/TMTasksView.d.ts +5 -3
- package/lib/components/features/tasks/TMTasksView.js +5 -6
- package/lib/components/grids/TMBlogAttachments.js +2 -2
- package/lib/components/grids/TMBlogsPost.d.ts +8 -5
- package/lib/components/grids/TMBlogsPost.js +2 -2
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/helper/TMImageLibrary.d.ts +3 -2
- package/lib/helper/TMImageLibrary.js +230 -230
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +18 -0
- package/package.json +1 -1
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TaskDescriptor, UserDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { TaskDescriptor, UserDescriptor, HomeBlogPost } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, FormModes, TaskContext } from '../../../ts';
|
|
4
4
|
export interface TMTaskFormProps {
|
|
5
|
+
allTasks: Array<TaskDescriptor>;
|
|
6
|
+
getAllTasks: () => Promise<void>;
|
|
7
|
+
deleteTaskByIdsCallback: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
8
|
+
addTaskCallback: (task: TaskDescriptor) => Promise<void>;
|
|
9
|
+
editTaskCallback: (task: TaskDescriptor) => Promise<void>;
|
|
10
|
+
handleNavigateToWGs: (value: HomeBlogPost | number) => Promise<void>;
|
|
11
|
+
handleNavigateToDossiers: (value: HomeBlogPost | number) => Promise<void>;
|
|
5
12
|
id: number;
|
|
6
13
|
title: string;
|
|
7
14
|
isModal: boolean;
|
|
@@ -13,11 +20,8 @@ export interface TMTaskFormProps {
|
|
|
13
20
|
handleFocusedRowKeyChange?: (row: TaskDescriptor | undefined) => void;
|
|
14
21
|
onStatusChanged?: () => void;
|
|
15
22
|
onSaved?: (newTask: TaskDescriptor) => void;
|
|
16
|
-
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
17
23
|
onClose?: () => void;
|
|
18
24
|
onCancel?: () => void;
|
|
19
|
-
handleNavigateToWGs?: (workGroupId: number) => void;
|
|
20
|
-
handleNavigateToDossiers?: (dossierId: number) => void;
|
|
21
25
|
taskContext?: TaskContext;
|
|
22
26
|
startDate?: Date;
|
|
23
27
|
endDate?: Date;
|
|
@@ -23,7 +23,7 @@ const TMTaskForm = (props) => {
|
|
|
23
23
|
const { refreshWorkflowApprove } = useWorkflowApprove();
|
|
24
24
|
const validator = async (taskDescriptor) => { return await taskValidatorAsync(taskDescriptor); };
|
|
25
25
|
// Destructure the props object to extract individual properties
|
|
26
|
-
const { id, title, isModal, formMode, visualizedTasks, editTaskCallback, currentTask, setCurrentTask, selectedRowKeys, handleFocusedRowKeyChange, onStatusChanged, onSaved, onClose, onCancel,
|
|
26
|
+
const { id, title, isModal, formMode, visualizedTasks, editTaskCallback, currentTask, setCurrentTask, selectedRowKeys, handleFocusedRowKeyChange, onStatusChanged, onSaved, onClose, onCancel, taskContext, startDate, endDate, showBackButton = true, hasNavigation = true, width = "100%", height = "100%", usersList, onOpenS4TViewerRequest, s4TViewerDialogComponent, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
27
27
|
const sfo = new SaveFormOptions();
|
|
28
28
|
sfo.objClass = ObjectClasses.Task;
|
|
29
29
|
const customizeFormData = (task) => {
|
|
@@ -106,7 +106,7 @@ const TMTaskForm = (props) => {
|
|
|
106
106
|
const newTaskDescriptor = new TaskDescriptor();
|
|
107
107
|
Object.assign(newTaskDescriptor, formDataOrig);
|
|
108
108
|
newTaskDescriptor.isNew = 0;
|
|
109
|
-
editTaskCallback
|
|
109
|
+
editTaskCallback(newTaskDescriptor);
|
|
110
110
|
}
|
|
111
111
|
else if (formDataOrig && formMode === FormModes.Create && taskContext?.dossier && currentTask) {
|
|
112
112
|
setFieldsReadOnly({
|
|
@@ -263,7 +263,7 @@ const TMTaskForm = (props) => {
|
|
|
263
263
|
onClose?.();
|
|
264
264
|
};
|
|
265
265
|
const onTaskCompleted = async (task) => {
|
|
266
|
-
await editTaskCallback
|
|
266
|
+
await editTaskCallback(task);
|
|
267
267
|
onClose?.();
|
|
268
268
|
};
|
|
269
269
|
return (_jsx("div", { style: { width: "100%", height: "100%", overflow: "auto" }, ref: containerRef, children: _jsx(TMSaveForm, { width: width, height: height, id: id, title: title, isModal: isModal, formMode: formMode, onSaveAsync: saveDataAsync, onClose: onCloseCallback, onUndo: onUndoCallback, exception: exception, isModified: calcIsModified(formData, formDataOrig), validationItems: validationItems, showBackButton: showBackButton, hasNavigation: (hasNavigation && formMode !== FormModes.Create), canNext: canNext(), onNext: onNextCallback, canPrev: canPrev(), onPrev: onPrevCallback, showToolbar: !(showDcmtForm && formData?.iD1 && formData?.iD2), children: _jsxs(_Fragment, { children: [_jsx(ScrollView, { direction: "vertical", useNative: true, height: "calc(100% - 35px)", children: _jsx("div", { style: { marginRight: "5px" }, children: _jsxs(TMLayoutContainer, { direction: 'vertical', gap: 2, children: [(formMode === FormModes.Update && areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#E29000" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedMessage.replaceParams(formDataOrig?.fromName ?? '') })] }) }), taskContext?.workItem === undefined && (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
|
|
@@ -286,6 +286,6 @@ const TMTaskForm = (props) => {
|
|
|
286
286
|
} }) })
|
|
287
287
|
: formMode === FormModes.Update && _jsxs(_Fragment, { children: [areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID) && _jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.AssignedBy, value: formData?.fromName ?? '', readOnly: true }) }), areDifferentIDs(formDataOrig?.toID, SDK_Globals.tmSession?.SessionDescr?.userID) && _jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.AssignedTo, value: formData?.toName ?? '', readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs(_Fragment, { children: [_jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMDropDown, { label: SDKUI_Localizator.Status, value: formData?.state, dataSource: getStatusLocalizatorValues(), isModifiedWhen: formData?.state !== formDataOrig?.state, onValueChanged: onStatusValueChange, readOnly: fieldsReadOnly.status }) }), _jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: !fieldsReadOnly.priority ? _jsx(TMDropDown, { label: SDKUI_Localizator.Priority, value: formData?.priority, dataSource: getPriorityLocalizatorValues(), isModifiedWhen: formData?.priority !== formDataOrig?.priority, onValueChanged: onPriorityValueChange })
|
|
288
288
|
: _jsx(TMTextBox, { label: SDKUI_Localizator.Priority, value: getPriorityLocalizatorValue(formData?.priority ?? Priorities.Low), readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs(_Fragment, { children: [_jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "start-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.StartDate, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.startTime, isModifiedWhen: formData?.startTime !== formDataOrig?.startTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate), onContentReady: handleStartTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, startTime: value }); }, showClearButton: true }) : _jsx(TMTextBox, { label: SDKUI_Localizator.StartDate, value: formData?.startTime ? formatDate(formData?.startTime) : '', readOnly: true }) }), _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "end-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Expiration, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.endTime, isModifiedWhen: formData?.endTime !== formDataOrig?.endTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate || o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onContentReady: handleEndTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, endTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.endDate }) : _jsx(TMTextBox, { label: SDKUI_Localizator.Expiration, value: formData?.endTime ? formatDate(formData?.endTime) : '', readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsx(TMDateBox, { id: "alert-time", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Reminder, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.remTime ?? undefined, isModifiedWhen: formData?.remTime !== formDataOrig?.remTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onValueChange: (value) => { setFormData({ ...formData ?? {}, remTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.remTime }) }) })] }) }) }), (showDcmtForm && formData?.iD1 && formData?.iD2) &&
|
|
289
|
-
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, taskMoreInfo: formData, onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent })] }) }) }));
|
|
289
|
+
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, taskMoreInfo: formData, onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }) }) }));
|
|
290
290
|
};
|
|
291
291
|
export default TMTaskForm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { TaskDescriptor, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
import { HomeBlogPost, TaskDescriptor, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { DcmtInfo, TaskContext } from "../../../ts";
|
|
4
4
|
interface TMTasksPanelContentProps {
|
|
5
5
|
id: string;
|
|
@@ -8,8 +8,8 @@ interface TMTasksPanelContentProps {
|
|
|
8
8
|
deleteTaskByIdsCallback: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
9
9
|
addTaskCallback: (task: TaskDescriptor) => Promise<void>;
|
|
10
10
|
editTaskCallback: (task: TaskDescriptor) => Promise<void>;
|
|
11
|
-
handleNavigateToWGs: (
|
|
12
|
-
handleNavigateToDossiers: (
|
|
11
|
+
handleNavigateToWGs: (value: HomeBlogPost | number) => Promise<void>;
|
|
12
|
+
handleNavigateToDossiers: (value: HomeBlogPost | number) => Promise<void>;
|
|
13
13
|
taskContext?: TaskContext;
|
|
14
14
|
usersList?: Array<UserDescriptor>;
|
|
15
15
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, onRefreshSearchAsync?: (() => Promise<void>)) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect } from "react";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { AssignedTab, FilterCategoryId, filterTreeTask, getTaskAssignedToMe, TaskView } from "./TMTasksUtils";
|
|
4
|
+
import { applyContextFilters, AssignedTab, FilterCategoryId, filterTreeTask, getTaskAssignedToMe, TaskView } from "./TMTasksUtils";
|
|
5
5
|
import { getTaskAssignedByMe } from "../tasks/TMTasksUtils";
|
|
6
6
|
import TMTasksView from "./TMTasksView";
|
|
7
7
|
import TMTasksHeader from "./TMTasksHeader";
|
|
@@ -26,20 +26,15 @@ const TMTasksPanelContent = (props) => {
|
|
|
26
26
|
const [showContextualWG, setShowContextualWG] = useState(true);
|
|
27
27
|
// showContextualDossier is a state variable that determines whether the contextual dossier filter is visible
|
|
28
28
|
const [showContextualDossier, setShowContextualDossier] = useState(true);
|
|
29
|
+
// showContextualDocument is a state variable that determines whether the contextual document filter is visible
|
|
30
|
+
const [showContextualDocument, setShowContextualDocument] = useState(true);
|
|
29
31
|
// showId is a state variable that determines whether an ID-related component or feature should be displayed
|
|
30
32
|
const [showId, setShowId] = useState(false);
|
|
31
33
|
// showSearch is a state variable that controls the visibility of a search-related component or feature
|
|
32
34
|
const [showSearch, setShowSearch] = useState(true);
|
|
33
35
|
const contextualTasks = React.useMemo(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
tasks = tasks.filter(task => task.iD1 === taskContext.workingGroup.id);
|
|
37
|
-
}
|
|
38
|
-
if (showContextualDossier && taskContext && taskContext.dossier && taskContext.dossier.id) {
|
|
39
|
-
tasks = tasks.filter(task => task.iD1 === taskContext.dossier.id);
|
|
40
|
-
}
|
|
41
|
-
return tasks;
|
|
42
|
-
}, [allTasks, showContextualWG, showContextualDossier, taskContext]);
|
|
36
|
+
return applyContextFilters(allTasks, showContextualWG, showContextualDossier, showContextualDocument, taskContext);
|
|
37
|
+
}, [allTasks, showContextualWG, showContextualDossier, showContextualDocument, taskContext]);
|
|
43
38
|
useEffect(() => {
|
|
44
39
|
const getFilteredTasks = (tab) => {
|
|
45
40
|
let tasks = allTasks;
|
|
@@ -53,22 +48,17 @@ const TMTasksPanelContent = (props) => {
|
|
|
53
48
|
default:
|
|
54
49
|
break;
|
|
55
50
|
}
|
|
56
|
-
|
|
57
|
-
tasks = tasks.filter(task => task.iD1 === taskContext.workingGroup?.id);
|
|
58
|
-
}
|
|
59
|
-
if (showContextualDossier && taskContext && taskContext.dossier && taskContext.dossier.id) {
|
|
60
|
-
tasks = tasks.filter(task => task.iD1 === taskContext.dossier?.id);
|
|
61
|
-
}
|
|
51
|
+
tasks = applyContextFilters(allTasks, showContextualWG, showContextualDossier, showContextualDocument, taskContext);
|
|
62
52
|
return filterTreeTask(tasks, appliedGlobalFilters);
|
|
63
53
|
};
|
|
64
54
|
setAssignedToMeCount(getFilteredTasks(AssignedTab.AssignedToMe).length);
|
|
65
55
|
setAssignedByMeCount(getFilteredTasks(AssignedTab.AssignedByMe).length);
|
|
66
56
|
setAllTasksFilteredCount(getFilteredTasks(AssignedTab.All).length);
|
|
67
57
|
setVisualizedTasks(getFilteredTasks(activeTabIndex));
|
|
68
|
-
}, [allTasks, appliedGlobalFilters, activeTabIndex, showContextualWG, showContextualDossier, taskContext]);
|
|
58
|
+
}, [allTasks, appliedGlobalFilters, activeTabIndex, showContextualWG, showContextualDossier, showContextualDocument, taskContext]);
|
|
69
59
|
const updateActiveComponent = useCallback((newComponent) => {
|
|
70
60
|
setActiveComponent(newComponent);
|
|
71
61
|
}, []);
|
|
72
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMTasksHeader, { height: "55px", activeComponent: activeComponent, updateActiveComponent: updateActiveComponent, allTasks: contextualTasks, appliedGlobalFilters: appliedGlobalFilters, setAppliedGlobalFilters: setAppliedGlobalFilters }), _jsx("div", { style: { width: "100%", height: "calc(100% - 55px)" }, children: _jsx(TMTasksView, { id: id, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, currentTask: currentTask, setCurrentTask: setCurrentTask, visualizedTasks: visualizedTasks, activeComponent: activeComponent, activeTabIndex: activeTabIndex, setActiveTabIndex: setActiveTabIndex, assignedToMeCount: assignedToMeCount, assignedByMeCount: assignedByMeCount, allTasksFilteredCount: allTasksFilteredCount, showId: showId, setShowId: setShowId, showSearch: showSearch, setShowSearch: setShowSearch, showContextualWG: showContextualWG, setShowContextualWG: setShowContextualWG, showContextualDossier: showContextualDossier, setShowContextualDossier: setShowContextualDossier, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, taskContext: taskContext, usersList: usersList, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent }) })] });
|
|
62
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMTasksHeader, { height: "55px", activeComponent: activeComponent, updateActiveComponent: updateActiveComponent, allTasks: contextualTasks, appliedGlobalFilters: appliedGlobalFilters, setAppliedGlobalFilters: setAppliedGlobalFilters }), _jsx("div", { style: { width: "100%", height: "calc(100% - 55px)" }, children: _jsx(TMTasksView, { id: id, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, currentTask: currentTask, setCurrentTask: setCurrentTask, visualizedTasks: visualizedTasks, activeComponent: activeComponent, activeTabIndex: activeTabIndex, setActiveTabIndex: setActiveTabIndex, assignedToMeCount: assignedToMeCount, assignedByMeCount: assignedByMeCount, allTasksFilteredCount: allTasksFilteredCount, showId: showId, setShowId: setShowId, showSearch: showSearch, setShowSearch: setShowSearch, showContextualWG: showContextualWG, setShowContextualWG: setShowContextualWG, showContextualDossier: showContextualDossier, setShowContextualDossier: setShowContextualDossier, showContextualDocument: showContextualDocument, setShowContextualDocument: setShowContextualDocument, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, taskContext: taskContext, usersList: usersList, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent }) })] });
|
|
73
63
|
};
|
|
74
64
|
export default TMTasksPanelContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Appointment } from 'devextreme/ui/scheduler';
|
|
2
2
|
import { ContextMenuTypes } from 'devextreme-react/cjs/context-menu';
|
|
3
3
|
import { TaskDescriptor, Task_States, PdGs, Priorities, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import { FormModes } from '../../../ts';
|
|
4
|
+
import { FormModes, TaskContext } from '../../../ts';
|
|
5
5
|
import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
|
6
6
|
export declare const TEXT_SELECTED_COLOR = "#ff5e1a";
|
|
7
7
|
export declare const BG_COLOR_INACTIVE_WIDGET = "#fff";
|
|
@@ -98,7 +98,7 @@ export declare const gotoPDGExtendedLabel: (gotoVisible: boolean, pdg: PdGs, iD1
|
|
|
98
98
|
export declare const convertToSchedulerAppointments: (tasks: Array<TaskDescriptor>) => Array<Appointment>;
|
|
99
99
|
export declare const formatDate: (date: Date) => string;
|
|
100
100
|
export declare const areDifferentIDs: (fromID: number | undefined, userID: number | undefined) => boolean;
|
|
101
|
-
export declare const createTasksMenuItems: (taskDescriptor: TaskDescriptor | undefined, showId: boolean, setShowId: React.Dispatch<React.SetStateAction<boolean>>, showSearch: boolean, setShowSearch: React.Dispatch<React.SetStateAction<boolean>>, openTaskForm: (formMode: FormModes, task?: TaskDescriptor) => void, editTaskCallback: (rowId: number | undefined) => void, duplicateTaskCallback: (rowId: number | undefined) => void, onDeleteCallback: (rowIds: Array<number>) => void, markAsStatus: (rowIds: Array<number>, status: Task_States) => void, getAllTasks: () => Promise<void>, fromWG: boolean, showContextualWG: boolean, setShowContextualWG: React.Dispatch<React.SetStateAction<boolean>>, fromDossier: boolean, showContextualDossier: boolean, setShowContextualDossier: React.Dispatch<React.SetStateAction<boolean>>, showGoToToday: boolean, handleGoToToday?: () => void, fromDatagrid?: boolean) => Array<TMDataGridContextMenuItem>;
|
|
101
|
+
export declare const createTasksMenuItems: (taskDescriptor: TaskDescriptor | undefined, showId: boolean, setShowId: React.Dispatch<React.SetStateAction<boolean>>, showSearch: boolean, setShowSearch: React.Dispatch<React.SetStateAction<boolean>>, openTaskForm: (formMode: FormModes, task?: TaskDescriptor) => void, editTaskCallback: (rowId: number | undefined) => void, duplicateTaskCallback: (rowId: number | undefined) => void, onDeleteCallback: (rowIds: Array<number>) => void, markAsStatus: (rowIds: Array<number>, status: Task_States) => void, getAllTasks: () => Promise<void>, fromWG: boolean, showContextualWG: boolean, setShowContextualWG: React.Dispatch<React.SetStateAction<boolean>>, fromDossier: boolean, showContextualDossier: boolean, setShowContextualDossier: React.Dispatch<React.SetStateAction<boolean>>, fromDocument: boolean, showContextualDocument: boolean, setShowContextualDocument: React.Dispatch<React.SetStateAction<boolean>>, showGoToToday: boolean, handleGoToToday?: () => void, fromDatagrid?: boolean) => Array<TMDataGridContextMenuItem>;
|
|
102
102
|
export declare const checkIfNew: (fromId: number | undefined, isNew: number | undefined) => boolean;
|
|
103
103
|
export declare const getNewTaskCount: (tasks: Array<TaskDescriptor>) => number;
|
|
104
104
|
export declare const isTaskAssignedToAnotherUser: (task: TaskDescriptor) => boolean;
|
|
@@ -128,3 +128,4 @@ export declare enum FilterCategoryId {
|
|
|
128
128
|
High = 2.3
|
|
129
129
|
}
|
|
130
130
|
export declare const filterTreeTask: (tasks: Array<TaskDescriptor>, filtersApplied: Array<FilterCategoryId>) => Array<TaskDescriptor>;
|
|
131
|
+
export declare const applyContextFilters: (allTasks: Array<TaskDescriptor>, showContextualWG: boolean, showContextualDossier: boolean, showContextualDocument: boolean, taskContext: TaskContext | undefined) => TaskDescriptor[];
|
|
@@ -381,11 +381,12 @@ export const areDifferentIDs = (fromID, userID) => {
|
|
|
381
381
|
}
|
|
382
382
|
return false;
|
|
383
383
|
};
|
|
384
|
-
export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSearch, setShowSearch, openTaskForm, editTaskCallback, duplicateTaskCallback, onDeleteCallback, markAsStatus, getAllTasks, fromWG, showContextualWG, setShowContextualWG, fromDossier, showContextualDossier, setShowContextualDossier, showGoToToday, handleGoToToday, fromDatagrid = true) => {
|
|
384
|
+
export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSearch, setShowSearch, openTaskForm, editTaskCallback, duplicateTaskCallback, onDeleteCallback, markAsStatus, getAllTasks, fromWG, showContextualWG, setShowContextualWG, fromDossier, showContextualDossier, setShowContextualDossier, fromDocument, showContextualDocument, setShowContextualDocument, showGoToToday, handleGoToToday, fromDatagrid = true) => {
|
|
385
385
|
const isTaskDescriptorDefined = taskDescriptor !== undefined;
|
|
386
386
|
const isTaskFromAnotherUser = isTaskDescriptorDefined && areDifferentIDs(taskDescriptor.fromID, SDK_Globals.tmSession?.SessionDescr?.userID);
|
|
387
387
|
const menuItems = [
|
|
388
388
|
{
|
|
389
|
+
id: 'createContextualTask',
|
|
389
390
|
text: SDKUI_Localizator.CreateContextualTask,
|
|
390
391
|
icon: 'plus',
|
|
391
392
|
onClick: () => { openTaskForm(FormModes.Create); },
|
|
@@ -447,9 +448,18 @@ export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSear
|
|
|
447
448
|
icon: 'filter',
|
|
448
449
|
onClick: () => { setShowContextualDossier(prev => !prev); },
|
|
449
450
|
disabled: false,
|
|
450
|
-
beginGroup: !fromWG,
|
|
451
|
+
beginGroup: !fromWG && !fromDocument,
|
|
451
452
|
visible: fromDossier
|
|
452
453
|
},
|
|
454
|
+
{
|
|
455
|
+
id: 'documentContextFilter',
|
|
456
|
+
text: showContextualDocument ? SDKUI_Localizator.RemoveContextualFilter : SDKUI_Localizator.ApplyContextualFilter,
|
|
457
|
+
icon: 'filter',
|
|
458
|
+
onClick: () => { setShowContextualDocument(prev => !prev); },
|
|
459
|
+
disabled: false,
|
|
460
|
+
beginGroup: !fromDossier && !fromWG,
|
|
461
|
+
visible: fromDocument
|
|
462
|
+
},
|
|
453
463
|
{
|
|
454
464
|
icon: "event",
|
|
455
465
|
onClick: () => { if (handleGoToToday) {
|
|
@@ -482,8 +492,8 @@ export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSear
|
|
|
482
492
|
// Apply filters
|
|
483
493
|
let filteredMenuItems = [...menuItems];
|
|
484
494
|
// Show "CreateContextualTask" only if we are in a WG or Dossier context
|
|
485
|
-
if (fromWG === false && fromDossier === false) {
|
|
486
|
-
filteredMenuItems = filteredMenuItems.filter(item => item.id !== '
|
|
495
|
+
if (fromWG === false && fromDossier === false && fromDocument === false) {
|
|
496
|
+
filteredMenuItems = filteredMenuItems.filter(item => item.id !== 'createContextualTask');
|
|
487
497
|
}
|
|
488
498
|
// Remove WG contextual filter menu if not in WG context
|
|
489
499
|
if (fromWG === false) {
|
|
@@ -497,6 +507,12 @@ export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSear
|
|
|
497
507
|
item.visible !== true ||
|
|
498
508
|
item.visible === undefined);
|
|
499
509
|
}
|
|
510
|
+
// Remove Document contextual filter menu if not in Document context
|
|
511
|
+
if (fromDocument === false) {
|
|
512
|
+
filteredMenuItems = filteredMenuItems.filter(item => item.id !== 'documentContextFilter' ||
|
|
513
|
+
item.visible !== true ||
|
|
514
|
+
item.visible === undefined);
|
|
515
|
+
}
|
|
500
516
|
if (showGoToToday === false) {
|
|
501
517
|
filteredMenuItems = filteredMenuItems.filter(item => item.text !== SDKUI_Localizator.GoToToday);
|
|
502
518
|
}
|
|
@@ -600,3 +616,19 @@ export const filterTreeTask = (tasks, filtersApplied) => {
|
|
|
600
616
|
});
|
|
601
617
|
return filteredTasks;
|
|
602
618
|
};
|
|
619
|
+
export const applyContextFilters = (allTasks, showContextualWG, showContextualDossier, showContextualDocument, taskContext) => {
|
|
620
|
+
if (taskContext === undefined)
|
|
621
|
+
return allTasks;
|
|
622
|
+
let filtered = allTasks;
|
|
623
|
+
if (showContextualWG && taskContext.workingGroup?.id) {
|
|
624
|
+
filtered = filtered.filter(t => t.iD1?.toString() === taskContext.workingGroup?.id.toString());
|
|
625
|
+
}
|
|
626
|
+
if (showContextualDossier && taskContext.dossier?.id) {
|
|
627
|
+
filtered = filtered.filter(t => t.iD1?.toString() === taskContext.dossier?.id.toString());
|
|
628
|
+
}
|
|
629
|
+
if (showContextualDocument && taskContext.document?.tid && taskContext?.document?.did) {
|
|
630
|
+
filtered = filtered.filter(t => t.iD1?.toString() === taskContext.document?.tid.toString() &&
|
|
631
|
+
t.iD2?.toString() === taskContext.document?.did.toString());
|
|
632
|
+
}
|
|
633
|
+
return filtered;
|
|
634
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AssignedTab, TaskViewType } from "./TMTasksUtils";
|
|
3
|
-
import { TaskDescriptor, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { HomeBlogPost, TaskDescriptor, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { DcmtInfo, TaskContext } from "../../../ts";
|
|
5
5
|
interface TMTasksViewProps {
|
|
6
6
|
id: string;
|
|
@@ -9,6 +9,8 @@ interface TMTasksViewProps {
|
|
|
9
9
|
deleteTaskByIdsCallback: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
10
10
|
addTaskCallback: (task: TaskDescriptor) => Promise<void>;
|
|
11
11
|
editTaskCallback: (task: TaskDescriptor) => Promise<void>;
|
|
12
|
+
handleNavigateToWGs: (value: HomeBlogPost | number) => Promise<void>;
|
|
13
|
+
handleNavigateToDossiers: (value: HomeBlogPost | number) => Promise<void>;
|
|
12
14
|
visualizedTasks: Array<TaskDescriptor>;
|
|
13
15
|
activeComponent: TaskViewType;
|
|
14
16
|
activeTabIndex: AssignedTab;
|
|
@@ -26,8 +28,8 @@ interface TMTasksViewProps {
|
|
|
26
28
|
setShowContextualWG: React.Dispatch<React.SetStateAction<boolean>>;
|
|
27
29
|
showContextualDossier: boolean;
|
|
28
30
|
setShowContextualDossier: React.Dispatch<React.SetStateAction<boolean>>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
showContextualDocument: boolean;
|
|
32
|
+
setShowContextualDocument: React.Dispatch<React.SetStateAction<boolean>>;
|
|
31
33
|
taskContext?: TaskContext;
|
|
32
34
|
usersList?: Array<UserDescriptor>;
|
|
33
35
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, onRefreshSearchAsync?: (() => Promise<void>)) => void;
|
|
@@ -19,7 +19,7 @@ import TMTasksAgenda from "./TMTasksAgenda";
|
|
|
19
19
|
import TMTaskForm from "./TMTaskForm";
|
|
20
20
|
let abortController = new AbortController();
|
|
21
21
|
const TMTasksView = (props) => {
|
|
22
|
-
const { id, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, visualizedTasks, activeComponent, activeTabIndex, setActiveTabIndex, currentTask, setCurrentTask, assignedToMeCount, assignedByMeCount, allTasksFilteredCount, showId, setShowId, showSearch, setShowSearch, showContextualWG, setShowContextualWG, showContextualDossier, setShowContextualDossier, handleNavigateToWGs, handleNavigateToDossiers, taskContext, usersList, onOpenS4TViewerRequest, s4TViewerDialogComponent } = props;
|
|
22
|
+
const { id, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, visualizedTasks, activeComponent, activeTabIndex, setActiveTabIndex, currentTask, setCurrentTask, assignedToMeCount, assignedByMeCount, allTasksFilteredCount, showId, setShowId, showSearch, setShowSearch, showContextualWG, setShowContextualWG, showContextualDossier, setShowContextualDossier, showContextualDocument, setShowContextualDocument, handleNavigateToWGs, handleNavigateToDossiers, taskContext, usersList, onOpenS4TViewerRequest, s4TViewerDialogComponent } = props;
|
|
23
23
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
24
24
|
const deviceType = useDeviceType();
|
|
25
25
|
// State to manage show comment form selected file
|
|
@@ -83,7 +83,7 @@ const TMTasksView = (props) => {
|
|
|
83
83
|
editTaskAgendaCallback(focusedRowKey); }, () => { if (focusedRowKey)
|
|
84
84
|
onDuplicateAgendaCallback(focusedRowKey); }, () => { if (focusedRowKey)
|
|
85
85
|
onDeleteCallback([focusedRowKey]); }, (rowIds, status) => { if (focusedRowKey)
|
|
86
|
-
markAsStatus([focusedRowKey], status); }, getAllTasks, taskContext?.workingGroup?.id !== undefined, showContextualWG, setShowContextualWG, taskContext?.dossier?.id !== undefined, showContextualDossier, setShowContextualDossier, true, () => { setCurrentCalendarDate(new Date()); setCurrentAgendaDate(new Date()); }, false),
|
|
86
|
+
markAsStatus([focusedRowKey], status); }, getAllTasks, taskContext?.workingGroup?.id !== undefined, showContextualWG, setShowContextualWG, taskContext?.dossier?.id !== undefined, showContextualDossier, setShowContextualDossier, taskContext?.document?.tid !== undefined && taskContext?.document?.did !== undefined, showContextualDocument, setShowContextualDocument, true, () => { setCurrentCalendarDate(new Date()); setCurrentAgendaDate(new Date()); }, false),
|
|
87
87
|
];
|
|
88
88
|
}, [visualizedTasks, focusedRowKey, showId, showSearch, showContextualWG, showContextualDossier, taskContext]);
|
|
89
89
|
const [menuItems, setMenuItems] = useState(agendaCalendarItems());
|
|
@@ -287,6 +287,7 @@ const TMTasksView = (props) => {
|
|
|
287
287
|
else {
|
|
288
288
|
await editTaskCallback(task);
|
|
289
289
|
}
|
|
290
|
+
setShowTaskForm(false);
|
|
290
291
|
};
|
|
291
292
|
const handleNavigateToDossiersWrapper = useCallback((dossierId) => {
|
|
292
293
|
setShowTaskForm(false);
|
|
@@ -300,10 +301,8 @@ const TMTasksView = (props) => {
|
|
|
300
301
|
if (e === undefined)
|
|
301
302
|
return;
|
|
302
303
|
if (e.target === 'content') {
|
|
303
|
-
console.log("taskContext:", taskContext);
|
|
304
|
-
console.log("showContextualWG:", showContextualWG);
|
|
305
304
|
e.items = e.items || [];
|
|
306
|
-
e.items = createTasksMenuItems(e.row?.data, showId, setShowId, showSearch, setShowSearch, () => { openTaskFormCallback(FormModes.Create); }, () => { openTaskFormCallback(FormModes.Update, e.row?.data); }, () => { openTaskFormCallback(FormModes.Duplicate, e.row?.data); }, onDeleteCallback, markAsStatus, getAllTasks, taskContext?.workingGroup?.id !== undefined, showContextualWG, setShowContextualWG, taskContext?.dossier?.id !== undefined, showContextualDossier, setShowContextualDossier, false);
|
|
305
|
+
e.items = createTasksMenuItems(e.row?.data, showId, setShowId, showSearch, setShowSearch, () => { openTaskFormCallback(FormModes.Create); }, () => { openTaskFormCallback(FormModes.Update, e.row?.data); }, () => { openTaskFormCallback(FormModes.Duplicate, e.row?.data); }, onDeleteCallback, markAsStatus, getAllTasks, taskContext?.workingGroup?.id !== undefined, showContextualWG, setShowContextualWG, taskContext?.dossier?.id !== undefined, showContextualDossier, setShowContextualDossier, taskContext?.document?.tid !== undefined && taskContext?.document?.did !== undefined, showContextualDocument, setShowContextualDocument, false);
|
|
307
306
|
}
|
|
308
307
|
};
|
|
309
308
|
const RenderCustomHeader = ({ data }) => { return _jsx("p", { style: { color: TEXT_NOT_SELECTED_COLOR }, children: data.column.caption }); };
|
|
@@ -525,7 +524,7 @@ const TMTasksView = (props) => {
|
|
|
525
524
|
_jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, false, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, false, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, false, true)] }) : '' }), _jsx(Item, { title: SDKUI_Localizator.AllFemale, icon: "fields", tabRender: (params) => {
|
|
526
525
|
return _jsxs(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.All, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AllFemale, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (allTasksFilteredCount > 0) ? `(${allTasksFilteredCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
|
|
527
526
|
}, render: () => activeTabIndex === AssignedTab.All ?
|
|
528
|
-
_jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '670px', '80%', '95%'), title: SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback,
|
|
527
|
+
_jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '670px', '80%', '95%'), title: SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), _jsx("button", { style: {
|
|
529
528
|
position: 'absolute',
|
|
530
529
|
bottom: hasFilters ? '90px' : '18px',
|
|
531
530
|
right: '20px',
|
|
@@ -22,7 +22,7 @@ const TMBlogAttachments = (props) => {
|
|
|
22
22
|
const fileName = `${removeFileExtension(name)}_${archiveID}_${blogPostAttachment.tid}_${blogPostAttachment.did}.${fileExt}`;
|
|
23
23
|
openDcmtForm({ TID: blogPostAttachment.tid, DID: blogPostAttachment.did, fileName });
|
|
24
24
|
};
|
|
25
|
-
return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment) => {
|
|
25
|
+
return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment, index) => {
|
|
26
26
|
const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
|
|
27
27
|
return _jsx("div", { onDoubleClick: (e) => onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => handleMouseLeave(e), style: {
|
|
28
28
|
display: 'inline-flex',
|
|
@@ -37,7 +37,7 @@ const TMBlogAttachments = (props) => {
|
|
|
37
37
|
color: isSelected ? "#ffffff" : "#000000",
|
|
38
38
|
}, children: _jsxs("div", { style: { alignItems: 'center', display: 'flex' }, children: [(!archivedDocumentsExist && !draftExist) ?
|
|
39
39
|
_jsx(IconAttachment, { style: { marginRight: "5px" } }) :
|
|
40
|
-
_jsx("div", { style: { marginRight: "10px" }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _jsx("span", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }, children: nameElement })] }) }, blogPostAttachment.did);
|
|
40
|
+
_jsx("div", { style: { marginRight: "10px" }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _jsx("span", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }, children: nameElement })] }) }, blogPostAttachment.did + "_" + index);
|
|
41
41
|
}) });
|
|
42
42
|
};
|
|
43
43
|
export default TMBlogAttachments;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { BlogPost, HomeBlogPost } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
import { BlogPost, HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { DcmtInfo } from "../../ts";
|
|
4
4
|
import { FileItem } from "../base/TMFileManagerUtils";
|
|
5
5
|
import { TMBlogsPostHeader, TMBlogContextDescriptor } from "./TMBlogsPostUtils";
|
|
@@ -68,16 +68,19 @@ interface TMBlogsPostProps {
|
|
|
68
68
|
setShowId?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
69
69
|
/** Refresh Home Page News Callback */
|
|
70
70
|
refreshHomePageNews?: () => Promise<void>;
|
|
71
|
-
/** Optional callback to handle navigation to working groups */
|
|
72
|
-
handleNavigateToWGs?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
73
|
-
/** Optional callback to handle navigation to dossiers */
|
|
74
|
-
handleNavigateToDossiers?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
75
71
|
/** Optional callback to mark blog as read */
|
|
76
72
|
markBlogAsRead?: (blog: BlogPost | undefined) => Promise<void>;
|
|
77
73
|
/** Optional blog post to be externally selected */
|
|
78
74
|
externalBlogPost?: BlogPost;
|
|
79
75
|
/** Optional function to reset the external blog post */
|
|
80
76
|
resetExternalBlogPost?: () => void;
|
|
77
|
+
allTasks?: Array<TaskDescriptor>;
|
|
78
|
+
getAllTasks?: () => Promise<void>;
|
|
79
|
+
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
80
|
+
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
81
|
+
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
82
|
+
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
83
|
+
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
81
84
|
}
|
|
82
85
|
declare const TMBlogsPost: (props: TMBlogsPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
83
86
|
export default TMBlogsPost;
|
|
@@ -30,7 +30,7 @@ const TMBlogsPost = (props) => {
|
|
|
30
30
|
isRestoreEnabled: false,
|
|
31
31
|
isRefreshEnabled: false,
|
|
32
32
|
isCreateContextualTask: false,
|
|
33
|
-
}, showFloatingCommentButton = false, showCommentFormCallback, showTaskFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews,
|
|
33
|
+
}, showFloatingCommentButton = false, showCommentFormCallback, showTaskFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, } = props;
|
|
34
34
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
|
35
35
|
const bottomRef = useRef(null);
|
|
36
36
|
const containerRef = useRef(null);
|
|
@@ -598,7 +598,7 @@ const TMBlogsPost = (props) => {
|
|
|
598
598
|
boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
|
|
599
599
|
cursor: 'pointer',
|
|
600
600
|
}, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { contextMenuParams: contextMenuParams, attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, context: context, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
|
|
601
|
-
}), _jsx("div", { ref: bottomRef }), anchorEl && _jsx("div", { style: { position: 'fixed', zIndex: 9999 }, children: _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu }) })] }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%" }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
601
|
+
}), _jsx("div", { ref: bottomRef }), anchorEl && _jsx("div", { style: { position: 'fixed', zIndex: 9999 }, children: _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu }) })] }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
602
602
|
position: 'absolute',
|
|
603
603
|
bottom: '18px',
|
|
604
604
|
right: '20px',
|
|
@@ -61,6 +61,7 @@ export declare class SDKUI_Localizator {
|
|
|
61
61
|
static get AuthMode_WindowsViaTopMedia(): "Windows-Authentifizierung über TopMedia" | "Windows authentication via TopMedia" | "Autenticación de Windows a través de TopMedia" | "Authentification Windows via TopMedia" | "Autenticação Windows via TopMedia" | "Autenticazione Windows tramite TopMedia";
|
|
62
62
|
static get AutoAdjust(): "Automatische Anpassung" | "Auto Adjust" | "Ajuste automático" | "Ajustement automatique" | "Regolazione automatica";
|
|
63
63
|
static get Author(): string;
|
|
64
|
+
static get CustomButtons(): string;
|
|
64
65
|
static get Back(): "Zurück" | "Back" | "Atrás" | "Dos" | "Voltar" | "Indietro";
|
|
65
66
|
static get BatchUpdate(): "Mehrfachbearbeitung" | "Multiple modification" | "Modificación múltiple" | "Modifie multiple" | "Editar múltipla" | "Modifica multipla";
|
|
66
67
|
static get BlogCase(): "Anschlagbrett" | "Blog board" | "Tablón" | "Tableau d'affichage" | "Bakeca" | "Bacheca";
|
|
@@ -559,6 +559,16 @@ export class SDKUI_Localizator {
|
|
|
559
559
|
default: return "Autore";
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
+
static get CustomButtons() {
|
|
563
|
+
switch (this._cultureID) {
|
|
564
|
+
case CultureIDs.De_DE: return "Benutzerdefinierte Schaltflächen";
|
|
565
|
+
case CultureIDs.En_US: return "Custom buttons";
|
|
566
|
+
case CultureIDs.Es_ES: return "Botones personalizados";
|
|
567
|
+
case CultureIDs.Fr_FR: return "Boutons personnalisés";
|
|
568
|
+
case CultureIDs.Pt_PT: return "Botões personalizados";
|
|
569
|
+
default: return "Bottoni personalizzati";
|
|
570
|
+
}
|
|
571
|
+
}
|
|
562
572
|
static get Back() {
|
|
563
573
|
switch (this._cultureID) {
|
|
564
574
|
case CultureIDs.De_DE: return "Zurück";
|