@topconsultnpm/sdkui-react 6.19.0-dev1.63 → 6.19.0-dev1.65

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.
@@ -20,6 +20,7 @@ import TMSaveForm from '../../forms/TMSaveForm';
20
20
  import TMDcmtForm from '../documents/TMDcmtForm';
21
21
  import styled from 'styled-components';
22
22
  import { TMColors } from '../../../utils/theme';
23
+ import { renderContextBlock } from './TMTasksUtilsView';
23
24
  const ResponseCommentWrapper = styled.div `
24
25
  position: relative;
25
26
  width: 100%;
@@ -319,7 +320,27 @@ const TMTaskForm = (props) => {
319
320
  && !areDifferentIDs(formData?.toID, SDK_Globals.tmSession?.SessionDescr?.userID))
320
321
  && _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: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.PersonalTaskAssignmentMessage })] }) }), (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
321
322
  && areDifferentIDs(formData?.toID, SDK_Globals.tmSession?.SessionDescr?.userID))
322
- && _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: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedToUserMessage.replaceParams(users.find(user => user.id === formData?.toID)?.name ?? '-') })] }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.workingGroup && taskContext.workingGroup.id) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.WG, taskContext.workingGroup.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.WG) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.WG, taskContext.workingGroup.name) })] }) }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.dossier && taskContext.dossier.id) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.CF, taskContext.dossier.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.CF) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.CF, taskContext.dossier.name) })] }) }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.document && taskContext.document.tid && taskContext.document.did && taskContext.document.name) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.DT, taskContext.document.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.DT) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.DT, taskContext.document.name) })] }) }) }), (formMode === FormModes.Create && isContextualCreate && taskContext && taskContext.workItem && taskContext.workItem.tid && taskContext.workItem.did && taskContext.workItem.name) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', display: 'flex', alignItems: 'center', color: "#000", marginTop: 10 }, children: _jsxs(TMTooltip, { content: getOriginLabel(PdGs.DT, taskContext.workItem.name), children: [_jsx("span", { children: getPdgsIconMap().get(PdGs.DT) }), "\u00A0", _jsx("span", { children: getOriginLabel(PdGs.DT, taskContext.workItem.name) })] }) }) }), formMode === FormModes.Update && formData?.pdG && formData?.iD1Name && (_jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => (_jsx("div", { style: {
323
+ && _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: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedToUserMessage.replaceParams(users.find(user => user.id === formData?.toID)?.name ?? '-') })] }) }), renderContextBlock({
324
+ condition: formMode === FormModes.Create && isContextualCreate && !!taskContext?.workingGroup?.id,
325
+ pdg: PdGs.WG,
326
+ label: getOriginLabel(PdGs.WG, taskContext?.workingGroup?.name),
327
+ isMobile: isMobile
328
+ }), renderContextBlock({
329
+ condition: formMode === FormModes.Create && isContextualCreate && !!taskContext?.dossier?.id,
330
+ pdg: PdGs.CF,
331
+ label: getOriginLabel(PdGs.CF, taskContext?.dossier?.name),
332
+ isMobile: isMobile
333
+ }), renderContextBlock({
334
+ condition: formMode === FormModes.Create && isContextualCreate && !!taskContext?.document?.tid && !!taskContext?.document?.did,
335
+ pdg: PdGs.DT,
336
+ label: getOriginLabel(PdGs.DT, taskContext?.document?.name),
337
+ isMobile: isMobile
338
+ }), renderContextBlock({
339
+ condition: formMode === FormModes.Create && isContextualCreate && !!taskContext?.workItem?.tid && !!taskContext?.workItem?.did,
340
+ pdg: PdGs.DT,
341
+ label: getOriginLabel(PdGs.DT, taskContext?.workItem?.name),
342
+ isMobile: isMobile
343
+ }), formMode === FormModes.Update && formData?.pdG && formData?.iD1Name && (_jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => (_jsx("div", { style: {
323
344
  display: 'flex',
324
345
  flexDirection: 'row',
325
346
  width: '100%',
@@ -329,17 +350,13 @@ const TMTaskForm = (props) => {
329
350
  display: 'flex',
330
351
  alignItems: 'center',
331
352
  marginTop: 12
332
- }, children: _jsx(TMTooltip, { content: formData.pdG !== PdGs.None
333
- ? gotoPDGExtendedLabel(true, formData.pdG, formData.iD1Name)
334
- : '', children: _jsxs("span", { onClick: () => formData.pdG !== PdGs.None
335
- ? gotoPDGExtendedLabelClickCallback()
336
- : null, style: {
353
+ }, children: _jsx(TMTooltip, { content: formData.pdG !== PdGs.None ? gotoPDGExtendedLabel(true, formData.pdG, formData.iD1Name) : '', children: _jsxs("span", { onClick: () => formData.pdG !== PdGs.None ? gotoPDGExtendedLabelClickCallback() : null, style: {
337
354
  display: 'inline-flex',
338
355
  alignItems: 'center',
339
356
  padding: '6px 10px',
340
357
  borderRadius: 8,
341
358
  backgroundColor: formData.pdG !== PdGs.None ? '#f5f5f7' : 'transparent',
342
- color: formData.pdG !== PdGs.None ? '#1a0dab' : '#444',
359
+ color: formData.pdG !== PdGs.None ? '#2559A5' : '#444',
343
360
  cursor: formData.pdG !== PdGs.None ? 'pointer' : 'default',
344
361
  fontWeight: 600,
345
362
  transition: 'all 0.25s ease',
@@ -29,4 +29,11 @@ export declare const treeFilterDataSource: (allTasks: Array<TaskDescriptor>) =>
29
29
  expanded?: boolean;
30
30
  tooltipContent?: ReactNode;
31
31
  }>;
32
+ type RenderContextBlockParams = {
33
+ condition: boolean;
34
+ pdg: PdGs;
35
+ label: string | undefined;
36
+ isMobile: boolean;
37
+ };
38
+ export declare const renderContextBlock: ({ condition, pdg, label, isMobile }: RenderContextBlockParams) => JSX.Element | null;
32
39
  export {};
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useState } from "react";
3
3
  import { PdGs, Priorities, SDK_Globals, Task_States } from '@topconsultnpm/sdk-ts';
4
4
  import { Extended_Task_States, FilterCategoryId, filterTreeTask, gotoPDGExtendedLabel, prioritiesResourceData, taskIsExpiringSoon } from "./TMTasksUtils";
5
- import { getPdgsIconMap, SDKUI_Localizator } from "../../../helper";
5
+ import { getPdgsIconMap, SDKUI_Localizator, TMConditionalWrapper } from "../../../helper";
6
6
  import { FormModes } from "../../../ts";
7
7
  import TMTooltip from "../../base/TMTooltip";
8
8
  const taskStateIconClassMap = () => {
@@ -105,3 +105,14 @@ export const treeFilterDataSource = (allTasks) => {
105
105
  { id: FilterCategoryId.High, label: SDKUI_Localizator.High + " (" + highLength + ")", value: Priorities.High, categoryId: FilterCategoryId.AllPriorities },
106
106
  ];
107
107
  };
108
+ export const renderContextBlock = ({ condition, pdg, label, isMobile }) => {
109
+ if (!condition || !label)
110
+ return null;
111
+ return (_jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: (children) => (_jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children })), children: _jsx("div", { style: {
112
+ width: isMobile ? '100%' : '50%',
113
+ display: 'flex',
114
+ alignItems: 'center',
115
+ color: "#2559A5",
116
+ marginTop: 10
117
+ }, children: _jsxs(TMTooltip, { content: label, children: [_jsx("span", { children: getPdgsIconMap().get(pdg) }), "\u00A0", _jsx("span", { children: label })] }) }) }));
118
+ };
@@ -531,7 +531,7 @@ const TMTasksView = (props) => {
531
531
  _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) => {
532
532
  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 }) }))] });
533
533
  }, render: () => activeTabIndex === AssignedTab.All ?
534
- _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, '700px', '700px', '95%'), title: SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, 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: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
534
+ _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, '700px', '700px', '95%'), title: isContextualCreate ? SDKUI_Localizator.ContextualTask : SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, 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: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
535
535
  position: 'absolute',
536
536
  bottom: hasFilters ? '90px' : '18px',
537
537
  right: '20px',
@@ -556,6 +556,6 @@ const TMTasksView = (props) => {
556
556
  e.currentTarget.style.backgroundColor = "#C2388B";
557
557
  e.currentTarget.style.transform = 'scale(1)';
558
558
  e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)';
559
- }, onClick: () => openTaskFormCallback(FormModes.Create), children: _jsx(TMTooltip, { content: SDKUI_Localizator.Create, children: _jsx("i", { className: "dx-icon-add", style: { fontSize: '25px' } }) }) })] });
559
+ }, onClick: () => openTaskFormCallback(FormModes.Create, undefined, taskContext !== undefined), children: _jsx(TMTooltip, { content: SDKUI_Localizator.Create, children: _jsx("i", { className: "dx-icon-add", style: { fontSize: '25px' } }) }) })] });
560
560
  };
561
561
  export default TMTasksView;
@@ -241,5 +241,8 @@ export const BlogPostTitle = (props) => {
241
241
  fontWeight: "bold",
242
242
  color: isSelected ? "#fff" : !isSys ? TMColors.primary : "#ff0000",
243
243
  ...getCompactEllipsisStyle(layoutMode),
244
- }, children: highlightText(blogPost.ownerName, searchText, isSelected) })), subtitle.length > 0 && (_jsx("div", { style: { ...getCompactEllipsisStyle(layoutMode) }, children: highlightText(subtitle, searchText, isSelected) }))] })] });
244
+ }, children: highlightText(blogPost.ownerName, searchText, isSelected) })), subtitle.length > 0 && (_jsx("div", { style: {
245
+ color: isSelected ? "#fff" : !isSys ? TMColors.primary : "#ff0000",
246
+ ...getCompactEllipsisStyle(layoutMode)
247
+ }, children: highlightText(subtitle, searchText, isSelected) }))] })] });
245
248
  };
@@ -104,6 +104,7 @@ export declare class SDKUI_Localizator {
104
104
  static get ConfirmPassword(): "Bestätige das Passwort" | "Confirm password" | "Confirmar Contraseña" | "Confirmez le mot de passe" | "Confirme sua senha" | "Conferma password";
105
105
  static get ConfirmOnCancel(): "Wenn wir fortfahren, gehen die vorgenommenen Änderungen verloren. Fortfahren?" | "All modifications will be lost. Continue?" | "Si sigue adelante, se perderán las modificaciones aportadas. ¿Seguir?" | "Continuant, les changements seront perdus. Continuer?" | "Continuando as alterações feitas serão perdidas. Continuar?" | "Proseguendo le modifiche apportate andranno perse. Proseguire?";
106
106
  static get ConfirmSelectedDocumentsMessage(): string;
107
+ static get ContextualTask(): "Kontextbezogene Aufgabe" | "Contextual Task" | "Tarea contextual" | "Tâche contextuelle" | "Tarefa contextual" | "Attività contestuale";
107
108
  static get Continue(): string;
108
109
  static get ContinueOperation(): "Fortfahren?" | "Continue ?" | "¿Continuar?" | "Continuer?" | "Continuar?" | "Continuare?";
109
110
  static get CopiedSuccessfully(): "In die Zwischenablage kopieren" | "Copied in clipboard successfully" | "Copiado en el portapapeles con éxito" | "Copié dans le presse-papiers avec succès" | "CCopiado na área de transferência com sucesso" | "Copiato negli appunti con successo";
@@ -1001,6 +1001,16 @@ export class SDKUI_Localizator {
1001
1001
  return "{{0}} documento/i selezionato/i. Confermare l'operazione?";
1002
1002
  }
1003
1003
  }
1004
+ static get ContextualTask() {
1005
+ switch (this._cultureID) {
1006
+ case CultureIDs.De_DE: return "Kontextbezogene Aufgabe";
1007
+ case CultureIDs.En_US: return "Contextual Task";
1008
+ case CultureIDs.Es_ES: return "Tarea contextual";
1009
+ case CultureIDs.Fr_FR: return "Tâche contextuelle";
1010
+ case CultureIDs.Pt_PT: return "Tarefa contextual";
1011
+ default: return "Attività contestuale";
1012
+ }
1013
+ }
1004
1014
  static get Continue() {
1005
1015
  switch (this._cultureID) {
1006
1016
  case CultureIDs.De_DE: return "Fortfahren";
@@ -43,6 +43,7 @@ export const setSDK_GlobalsInfoAsync = async (tms) => {
43
43
  tmSessionNew.SessionDescr = tms?.SessionDescr;
44
44
  }
45
45
  SDK_Globals.tmSession = tmSessionNew;
46
+ SDK_Globals.tmSession.AutoRefresh = true;
46
47
  if (SDK_Globals.license == undefined) {
47
48
  try {
48
49
  SDK_Globals.license = await tmSessionNew.NewLicenseEngine().RetrieveAsync();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.19.0-dev1.63",
3
+ "version": "6.19.0-dev1.65",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",