@topconsultnpm/sdkui-react-beta 6.13.16 → 6.13.18
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/assets/Designer-bianco.svg +20 -20
- package/lib/assets/Orchestrator-bianco.svg +71 -71
- package/lib/assets/Surfer-bianco.svg +18 -18
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/six.png +0 -0
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/base/TMSpinner.js +2 -2
- package/lib/components/choosers/TMDistinctValues.js +3 -17
- package/lib/components/editors/TMMetadataValues.d.ts +1 -0
- package/lib/components/editors/TMMetadataValues.js +49 -38
- package/lib/components/features/documents/TMDcmtForm.js +12 -14
- package/lib/components/features/search/TMSavedQuerySelector.js +4 -6
- package/lib/components/features/search/TMSearch.js +31 -33
- package/lib/components/features/search/TMSearchQueryEditor.js +17 -18
- package/lib/components/features/search/TMSearchResult.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +9 -11
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/sidebar/TMHeader.js +8 -10
- package/package.json +1 -1
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
3
3
|
import { LayoutModes, MetadataDataDomains, AccessLevels, MetadataDataTypes, SDK_Globals, DcmtTypeListCacheService, DataColumnTypes } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import styled from 'styled-components';
|
5
|
-
import {
|
6
|
-
import TMButton from '../base/TMButton';
|
5
|
+
import { SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
|
7
6
|
import TMDataGrid from '../base/TMDataGrid';
|
8
7
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
9
8
|
import TMSpinner from '../base/TMSpinner';
|
@@ -17,16 +16,9 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
17
16
|
const [dataSource, setDataSource] = useState([]);
|
18
17
|
const [isAppendMode, setIsAppendMode] = useState(false);
|
19
18
|
const [md, setMd] = useState();
|
20
|
-
const [hasLoadedBefore, setHasLoadedBefore] = useState(false);
|
21
|
-
const [showPrompt, setShowPrompt] = useState(false);
|
22
19
|
const [currentValue, setCurrentValue] = useState('');
|
23
20
|
useEffect(() => {
|
24
|
-
|
25
|
-
getDistictValuesAsync().then(() => setHasLoadedBefore(true));
|
26
|
-
}
|
27
|
-
else {
|
28
|
-
getDcmtTypeAsync().then(() => setShowPrompt(true));
|
29
|
-
}
|
21
|
+
getDistictValuesAsync();
|
30
22
|
}, [mid]);
|
31
23
|
useEffect(() => {
|
32
24
|
setIsAppendMode(false);
|
@@ -68,7 +60,6 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
68
60
|
setMd(dtd?.metadata?.find(o => o.id === mid));
|
69
61
|
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDistinctValuesAsync(tid, mid, 10000);
|
70
62
|
setDataSource(convertDataTableToObject(result?.dtdResult));
|
71
|
-
setShowPrompt(false);
|
72
63
|
}
|
73
64
|
catch (e) {
|
74
65
|
let err = e;
|
@@ -94,9 +85,6 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
94
85
|
TMSpinner.hide();
|
95
86
|
}
|
96
87
|
};
|
97
|
-
const handleLoadData = () => {
|
98
|
-
getDistictValuesAsync();
|
99
|
-
};
|
100
88
|
const onFocusedRowChanged = useCallback((e) => {
|
101
89
|
setFocusedItem(e.row?.data);
|
102
90
|
}, []);
|
@@ -143,9 +131,7 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
143
131
|
return md.dataDomain === undefined || md.dataDomain === MetadataDataDomains.None;
|
144
132
|
};
|
145
133
|
const renderContent = () => {
|
146
|
-
return (
|
147
|
-
? _jsxs(StyledPanelContainer, { children: [_jsx(IconDataList, { fontSize: 96 }), _jsxs("p", { children: ["Caricare i valori distinti di ", _jsx("strong", { children: `"${md?.nameLoc}" ` }), "? "] }), _jsx(TMButton, { caption: SDKUI_Localizator.Yes, onClick: handleLoadData, showTooltip: false })] })
|
148
|
-
: _jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary })] }) }));
|
134
|
+
return (_jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary })] }));
|
149
135
|
};
|
150
136
|
return (_jsx(_Fragment, { children: isModal
|
151
137
|
? _jsx(TMModal, { title: SDKUI_Localizator.DistinctValues + (md?.nameLoc ? ` (${md?.nameLoc})` : ''), height: '600px', width: '500px', resizable: true, onClose: onClosePanelCallback, children: renderContent() })
|
@@ -24,6 +24,7 @@ interface ITMMetadataValuesProps extends DeviceContextProps {
|
|
24
24
|
metadataValuesOrig?: MetadataValueDescriptorEx[];
|
25
25
|
customMenuItems?: any[];
|
26
26
|
isExpertMode?: boolean;
|
27
|
+
isReadOnly?: boolean;
|
27
28
|
showCheckBoxes?: ShowCheckBoxesMode;
|
28
29
|
showNullValueCheckBoxes?: boolean;
|
29
30
|
validationItems: ValidationItem[];
|
@@ -23,7 +23,7 @@ export var AdvancedMenuButtons;
|
|
23
23
|
AdvancedMenuButtons[AdvancedMenuButtons["FormulaEditor"] = 2] = "FormulaEditor";
|
24
24
|
AdvancedMenuButtons[AdvancedMenuButtons["DistinctValues"] = 3] = "DistinctValues";
|
25
25
|
})(AdvancedMenuButtons || (AdvancedMenuButtons = {}));
|
26
|
-
const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerms = true, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, customMenuItems = [], showNullValueCheckBoxes, isOpenDistinctValues = false, openChooserBySingleClick, selectedMID, onFocusedItemChanged, layoutMode = LayoutModes.Update, metadataValues = [], metadataValuesOrig = [], TID, onValueChanged, onAdvancedMenuClick, validationItems }) => {
|
26
|
+
const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerms = true, isReadOnly = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, customMenuItems = [], showNullValueCheckBoxes, isOpenDistinctValues = false, openChooserBySingleClick, selectedMID, onFocusedItemChanged, layoutMode = LayoutModes.Update, metadataValues = [], metadataValuesOrig = [], TID, onValueChanged, onAdvancedMenuClick, validationItems }) => {
|
27
27
|
const [dynDataListsToBeRefreshed, setDynDataListsToBeRefreshed] = useState([]);
|
28
28
|
const [currentDTD, setCurrentDTD] = useState();
|
29
29
|
const [isEditableList, addOrRemoveEditableList] = useMetadataEditableList();
|
@@ -151,47 +151,58 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
151
151
|
let md = mvd.md;
|
152
152
|
if (!md)
|
153
153
|
return [];
|
154
|
-
// let isEditable = isEditableList(mvd.mid);
|
155
154
|
let isDisabledOper = checkPerms && (md.dataDomain === MetadataDataDomains.Computed || md?.perm?.canUpdate !== AccessLevels.Yes);
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
155
|
+
const menu = [
|
156
|
+
// Only add MakeEditable/Restore and FormulaEditor if isExpertMode is true
|
157
|
+
...(isExpertMode ? [
|
158
|
+
{
|
159
|
+
text: mvd.isEditable ? SDKUI_Localizator.Restore : SDKUI_Localizator.MakeEditable,
|
160
|
+
icon: mvd.isEditable ? _jsx(IconUndo, {}) : _jsx(IconPencil, {}),
|
161
|
+
disabled: isDisabledOper,
|
162
|
+
onClick: () => {
|
163
|
+
onAdvancedMenuClick?.({ tid: mvd.tid, mid: mvd.mid, button: AdvancedMenuButtons.MakeEditable });
|
164
|
+
onValueChanged?.(metadataValues.map((item) => {
|
165
|
+
if (item.tid == mvd.tid && item.mid === mvd.mid) {
|
166
|
+
// If DateTime and value is a formula, clear value but keep formulaValue
|
167
|
+
if (item.md?.dataType === MetadataDataTypes.DateTime && FormulaHelper.isFormula(item.value)) {
|
168
|
+
return {
|
169
|
+
...item,
|
170
|
+
isEditable: !item.isEditable,
|
171
|
+
formulaValue: item.value,
|
172
|
+
value: null
|
173
|
+
};
|
174
|
+
}
|
175
|
+
// If restoring and formulaValue exists, restore it
|
176
|
+
if (item.md?.dataType === MetadataDataTypes.DateTime && !item.isEditable && item.formulaValue) {
|
177
|
+
return {
|
178
|
+
...item,
|
179
|
+
isEditable: !item.isEditable,
|
180
|
+
value: item.formulaValue,
|
181
|
+
formulaValue: undefined
|
182
|
+
};
|
183
|
+
}
|
184
|
+
return { ...item, isEditable: !item.isEditable };
|
183
185
|
}
|
184
|
-
return
|
185
|
-
}
|
186
|
-
|
187
|
-
|
186
|
+
return item;
|
187
|
+
}));
|
188
|
+
}
|
189
|
+
},
|
190
|
+
{
|
191
|
+
text: SDKUI_Localizator.FormulaEditorTitle,
|
192
|
+
icon: _jsx(IconFunction, {}),
|
193
|
+
disabled: isDisabledOper,
|
194
|
+
onClick: () => onAdvancedMenuClick?.({ tid: mvd.tid, mid: mvd.mid, button: AdvancedMenuButtons.FormulaEditor })
|
188
195
|
}
|
196
|
+
] : []),
|
197
|
+
// Always add DistinctValues
|
198
|
+
{
|
199
|
+
text: SDKUI_Localizator.DistinctValues,
|
200
|
+
icon: _jsx(IconDataList, {}),
|
201
|
+
onClick: () => onAdvancedMenuClick?.({ tid: mvd.tid, mid: mvd.mid, button: AdvancedMenuButtons.DistinctValues })
|
189
202
|
},
|
190
|
-
|
191
|
-
|
203
|
+
// Always add customMenuItems if present
|
204
|
+
...customMenuItems
|
192
205
|
];
|
193
|
-
if (customMenuItems.length > 0)
|
194
|
-
menu.push(...customMenuItems);
|
195
206
|
return menu;
|
196
207
|
};
|
197
208
|
return (_jsx(StyledMetadataValuesContainer, { children: metadataValues.map((item) => (_jsxs(StyledRow, { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '6px' : '0', gap: '8px' }, onClick: () => { handleMetadataValueSelection(item); }, onFocus: () => { handleMetadataValueSelection(item); }, children: [showCheckBoxes !== ShowCheckBoxesMode.Never &&
|
@@ -247,7 +258,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
247
258
|
mvd.isSelected = !stringIsNullOrEmpty(mvd.value);
|
248
259
|
}
|
249
260
|
onValueChanged?.(newValues);
|
250
|
-
} }) }),
|
261
|
+
} }) }), !isReadOnly && _jsx("div", { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '12px' : '18px' }, onClick: () => { handleMetadataValueSelection(item); }, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', color: TMColors.button_icon, borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), disabled: item.isLexProt === 1, items: getAdvancedMenuItems(item) }) })] }, item.mid))) }));
|
251
262
|
};
|
252
263
|
export default TMMetadataValues;
|
253
264
|
//#region Styled Components
|
@@ -9,7 +9,7 @@ import { DownloadTypes, FormModes } from '../../../ts';
|
|
9
9
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
10
10
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
11
11
|
import { handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
12
|
-
import { genUniqueId, IconShow, SDKUI_Localizator, IconBoard, IconDcmtTypeSys,
|
12
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconRoundFileUpload } from '../../../helper';
|
13
13
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
14
14
|
import { TMColors } from '../../../utils/theme';
|
15
15
|
import { StyledFormButtonsContainer, StyledModalContainer, StyledToolbarCardContainer } from '../../base/Styled';
|
@@ -73,7 +73,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
73
73
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
74
74
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
75
75
|
const deviceType = useDeviceType();
|
76
|
-
const isOpenMiddlePanel = () => isOpenSysMetadata || isOpenBoard || isOpenTags ||
|
76
|
+
const isOpenMiddlePanel = () => isOpenSysMetadata || isOpenBoard || isOpenTags || isOpenFormulaEditor;
|
77
77
|
const retrieveMetadataAsync = async () => {
|
78
78
|
try {
|
79
79
|
await DcmtTypeListCacheService.GetAsync(TID).then(async (dtd) => {
|
@@ -147,19 +147,18 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
147
147
|
{ icon: fileManagerIcon, id: 'Preview', visibleName: (layoutMode === LayoutModes.Ark && fileIsNotValid) ? SDKUI_Localizator.RequiredField : layoutMode === LayoutModes.Ark ? SDKUI_Localizator.UploadFile : 'Anteprima', isActive: isOpenPreview, onClick: () => { setIsOpenPreview(!isOpenPreview); }, disabled: layoutMode === LayoutModes.Ark && fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata },
|
148
148
|
{ icon: _jsx(IconBoard, {}), id: 'Board', visibleName: 'Bacheca', disabled: layoutMode !== LayoutModes.Update, beginGroup: true, isActive: isOpenBoard, visible: layoutMode !== LayoutModes.Ark, onClick: () => { closeMiddlePanel(); setIsOpenBoard(!isOpenBoard); } },
|
149
149
|
{ icon: _jsx(IconDcmtTypeSys, {}), id: 'SystemMetadata', visibleName: 'Metadati di sistema', disabled: layoutMode !== LayoutModes.Update, isActive: isOpenSysMetadata, visible: layoutMode !== LayoutModes.Ark, onClick: () => { closeMiddlePanel(); setIsOpenSysMetadata(!isOpenSysMetadata); } },
|
150
|
-
{ icon: _jsx(IconDataList, {}), id: 'DistinctValues', disabled: !focusedMetadataValue, visibleName: 'Valori distiniti', isActive: isOpenDistinctValues, onClick: () => { closeMiddlePanel(); setIsOpenDistinctValues(!isOpenDistinctValues); } },
|
151
150
|
{ icon: _jsx(IconDetailDcmts, { fontSize: 20, transform: 'scale(-1, 1)' }), id: 'Master', beginGroup: true, visible: layoutMode !== LayoutModes.Ark && allowRelations && currentTIDHasMasterRelations, visibleName: SDKUI_Localizator.DcmtsMaster, disabled: layoutMode !== LayoutModes.Update || !DID, isActive: isOpenMaster, onClick: () => { setIsOpenMaster(!isOpenMaster); } },
|
152
151
|
{ icon: _jsx(IconDetailDcmts, { fontSize: 20 }), id: 'Details', visibleName: SDKUI_Localizator.DcmtsDetail, disabled: layoutMode !== LayoutModes.Update || !DID, isActive: isOpenDetails, visible: layoutMode !== LayoutModes.Ark && allowRelations && currentTIDHasDetailRelations, onClick: () => { setIsOpenDetails(!isOpenDetails); } },
|
153
152
|
];
|
154
153
|
return customRightSidebarItems.length === 0
|
155
154
|
? fixedItems
|
156
155
|
: [...fixedItems.filter(item => item.id !== 'DistinctValues'), ...customRightSidebarItems, ...fixedItems.filter(item => item.id === 'DistinctValues')];
|
157
|
-
}, [customRightSidebarItems, layoutMode,
|
156
|
+
}, [customRightSidebarItems, layoutMode, isOpenPreview, focusedMetadataValue, fromDTD?.archiveConstraint]);
|
158
157
|
const closeMiddlePanel = () => {
|
159
158
|
setIsOpenBoard(false);
|
160
159
|
setIsOpenSysMetadata(false);
|
161
160
|
setIsOpenTags(false);
|
162
|
-
setIsOpenDistinctValues(false);
|
161
|
+
// setIsOpenDistinctValues(false);
|
163
162
|
setIsOpenFormulaEditor(false);
|
164
163
|
};
|
165
164
|
const titleText = () => {
|
@@ -169,8 +168,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
169
168
|
return 'Metadati di sistema';
|
170
169
|
if (isOpenBoard)
|
171
170
|
return 'Bacheca';
|
172
|
-
if (isOpenDistinctValues)
|
173
|
-
return `${SDKUI_Localizator.DistinctValues} (${focusedMetadataValue?.md?.nameLoc})`;
|
171
|
+
// if (isOpenDistinctValues) return `${SDKUI_Localizator.DistinctValues} (${focusedMetadataValue?.md?.nameLoc})`;
|
174
172
|
if (isOpenFormulaEditor)
|
175
173
|
return `${SDKUI_Localizator.FormulaEditorTitle} (${focusedMetadataValue?.md?.nameLoc})`;
|
176
174
|
return '';
|
@@ -471,12 +469,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
471
469
|
_jsx(TMLayoutItem, { children: _jsxs(TMSplitterLayout, { separatorSize: 5, direction: 'horizontal', showSeparator: deviceType !== DeviceType.MOBILE && (isOpenPreview && isOpenMiddlePanel()), start: getSecondarySplitterStartLayout(), min: ['0', '0'], separatorColor: 'transparent', children: [isOpenMiddlePanel()
|
472
470
|
? _jsx(TMLayoutItem, { children: _jsx(TMToolbarCard, { padding: '0', showHeader: !(isOpenDetails && layoutMode === LayoutModes.Update), color: TMColors.primaryColor, backgroundColor: `${TMColors.primaryColor}25`, title: titleText(), toolbar: middlePanelToolbar, onClose: () => { closeMiddlePanel(); }, children: _jsx(StyledToolbarCardContainer, { children: _jsx(StyledSectionContainer, { children: _jsxs(StyledSidebarItemsContentContainer, { children: [isOpenBoard && layoutMode === LayoutModes.Update &&
|
473
471
|
_jsx(TMDcmtBlog, { tid: TID, did: DID }), isOpenSysMetadata && layoutMode === LayoutModes.Update &&
|
474
|
-
_jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }),
|
475
|
-
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
476
|
-
if (!e)
|
477
|
-
return;
|
478
|
-
setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
|
479
|
-
} }), isOpenFormulaEditor &&
|
472
|
+
_jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), isOpenFormulaEditor &&
|
480
473
|
_jsx(TMFormulaEditor, { isModal: false, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setIsOpenFormulaEditor(false), onApplied: (newFormula) => {
|
481
474
|
setFormData((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
482
475
|
setFocusedMetadataValue(prevState => ({
|
@@ -490,7 +483,12 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
490
483
|
? _jsxs(TMLayoutItem, { children: [layoutMode === LayoutModes.Update ?
|
491
484
|
_jsx(TMDcmtPreview, { onClose: () => { setIsOpenPreview(false); onClosePreview?.(); }, dcmtData: currentDcmt, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev }) :
|
492
485
|
_jsx(TMFileUploader, { onFileUpload: (file) => setDcmtFile(file), onClose: () => setIsOpenPreview(false), isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType }), " "] })
|
493
|
-
: _jsx(_Fragment, {})] }) }) : _jsx(_Fragment, {})] }),
|
486
|
+
: _jsx(_Fragment, {})] }) }) : _jsx(_Fragment, {})] }), isOpenDistinctValues &&
|
487
|
+
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
488
|
+
if (!e)
|
489
|
+
return;
|
490
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
|
491
|
+
} }), isOpenDetails &&
|
494
492
|
_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenDetails(false) }) }), isOpenMaster &&
|
495
493
|
_jsxs(StyledModalContainer, { style: { backgroundColor: 'white' }, children: [_jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
496
494
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem }) }, `${index}-${dcmt.DID}`));
|
@@ -16,7 +16,7 @@ const StyledSqdItem = styled.div `
|
|
16
16
|
flex-direction: column;
|
17
17
|
align-items: stretch;
|
18
18
|
min-width: 0;
|
19
|
-
padding: 10px;
|
19
|
+
padding: 10px 10px 0px 10px;
|
20
20
|
position: relative;
|
21
21
|
white-space: nowrap;
|
22
22
|
text-overflow: ellipsis;
|
@@ -123,9 +123,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
123
123
|
width: '100%',
|
124
124
|
padding: '5px',
|
125
125
|
gap: '3px',
|
126
|
-
|
127
|
-
overflow: 'hidden',
|
128
|
-
textOverflow: 'ellipsis'
|
126
|
+
overflow: 'auto'
|
129
127
|
}, children: dataSource.slice(0, showAllRoot || searchText.length > 0 ? dataSource.length : initialSQDsMaxItems).filter(o => searchText.length <= 0 || (searchText.length > 0 && o.name?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || o.description?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())).map((sqd, index) => (_jsxs(StyledSqdItem, { id: `sqd-item-${sqd.id}`, onClick: () => {
|
130
128
|
setSelectedItem(sqd);
|
131
129
|
onItemClick?.(sqd);
|
@@ -145,14 +143,14 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
145
143
|
overflow: 'hidden',
|
146
144
|
textOverflow: 'ellipsis',
|
147
145
|
color: TMColors.primaryColor,
|
148
|
-
paddingRight: '
|
146
|
+
paddingRight: '15px'
|
149
147
|
}, children: sqd.name }), manageDefault && sqd.isDefault == 1 && _jsx(IconStar, { fontSize: 16, color: 'rgb(248, 215, 117)' })] }), selectedItem?.id == sqd.id &&
|
150
148
|
_jsx("div", { style: {
|
151
149
|
width: '24px',
|
152
150
|
height: '24px',
|
153
151
|
borderRadius: '24px',
|
154
152
|
position: 'absolute',
|
155
|
-
top: '
|
153
|
+
top: '4px',
|
156
154
|
right: '0px',
|
157
155
|
display: 'flex',
|
158
156
|
alignItems: 'center',
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useCallback, useEffect,
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
3
3
|
import { SavedQueryCacheService, DcmtTypeListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import TMSavedQuerySelector from './TMSavedQuerySelector';
|
5
5
|
import TMTreeSelector from './TMTreeSelector';
|
@@ -140,38 +140,36 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
140
140
|
}
|
141
141
|
]
|
142
142
|
]);
|
143
|
-
const toolbar =
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
};
|
174
|
-
}, [deviceType]);
|
143
|
+
const toolbar = {
|
144
|
+
items: [
|
145
|
+
{
|
146
|
+
id: 'toolbar-item-treeSelector',
|
147
|
+
icon: _jsx(IconTree, {}),
|
148
|
+
tooltipName: 'treeSelector',
|
149
|
+
panelManagerMatrixRowId: 'treeSelector',
|
150
|
+
},
|
151
|
+
{
|
152
|
+
id: 'toolbar-item-recentsManager',
|
153
|
+
icon: _jsx(IconProgressReady, {}),
|
154
|
+
tooltipName: 'recentsManager',
|
155
|
+
panelManagerMatrixRowId: 'recentsManager',
|
156
|
+
},
|
157
|
+
{
|
158
|
+
id: 'toolbar-item-searchQueryPanel',
|
159
|
+
icon: _jsx(IconProgressReady, {}),
|
160
|
+
tooltipName: 'searchQueryPanel',
|
161
|
+
panelManagerMatrixRowId: 'searchQueryPanel',
|
162
|
+
visible: deviceType === DeviceType.MOBILE
|
163
|
+
},
|
164
|
+
{
|
165
|
+
id: 'toolbar-item-savedQuery',
|
166
|
+
icon: _jsx(IconSavedQuery, {}),
|
167
|
+
tooltipName: 'savedQuery',
|
168
|
+
panelManagerMatrixRowId: 'savedQuery',
|
169
|
+
// alternativePanelManagerMatrixRowId: ['distinctValues']
|
170
|
+
}
|
171
|
+
]
|
172
|
+
};
|
175
173
|
useEffect(() => {
|
176
174
|
setMruTIDs(SDKUI_Globals.userSettings.searchSettings.mruTIDs);
|
177
175
|
loadDataSQDsAsync(false);
|
@@ -135,27 +135,26 @@ const TMSearchQueryEditor = ({ qd, fromDTD, dcmtTypesList = [], isOpenDistinctVa
|
|
135
135
|
let md = dtd.metadata?.find(o => o.id == mid);
|
136
136
|
if (!md)
|
137
137
|
return [];
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
138
|
+
const menu = [
|
139
|
+
// Only add MakeEditable/Restore if isExpertMode is true
|
140
|
+
...(isExpertMode ? [{
|
141
|
+
text: isEditable ? SDKUI_Localizator.Restore : SDKUI_Localizator.MakeEditable,
|
142
|
+
icon: isEditable ? _jsx(IconUndo, {}) : _jsx(IconPencil, {}),
|
143
|
+
onClick: () => {
|
144
|
+
addOrRemoveEditableList(mid);
|
145
|
+
onAdvancedMenuClick?.({ tid: tid, mid: mid, button: AdvancedMenuButtons.MakeEditable });
|
146
|
+
}
|
147
|
+
}] : []),
|
148
|
+
{
|
149
|
+
text: SDKUI_Localizator.DistinctValues,
|
150
|
+
icon: _jsx(IconDataList, {}),
|
144
151
|
onClick: () => {
|
145
|
-
|
146
|
-
|
152
|
+
handleMetadataSelection(tid, mid);
|
153
|
+
setShowDistinctValuesPanel(!showDistinctValuesPanel);
|
154
|
+
onAdvancedMenuClick?.({ tid: tid, mid: mid, button: AdvancedMenuButtons.DistinctValues });
|
147
155
|
}
|
148
|
-
});
|
149
|
-
}
|
150
|
-
menu.push({
|
151
|
-
text: SDKUI_Localizator.DistinctValues,
|
152
|
-
icon: _jsx(IconDataList, {}),
|
153
|
-
onClick: () => {
|
154
|
-
handleMetadataSelection(tid, mid);
|
155
|
-
setShowDistinctValuesPanel(!showDistinctValuesPanel);
|
156
|
-
onAdvancedMenuClick?.({ tid: tid, mid: mid, button: AdvancedMenuButtons.DistinctValues });
|
157
156
|
}
|
158
|
-
|
157
|
+
];
|
159
158
|
return menu;
|
160
159
|
};
|
161
160
|
return (_jsx(_Fragment, { children: deviceType === DeviceType.MOBILE ?
|
@@ -456,7 +456,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
456
456
|
_jsx(TMNothingToShow, { text: 'Nessun documento selezionato.', secondText: notAvalableMsg, icon: notAvalableIcon })
|
457
457
|
:
|
458
458
|
_jsxs(StyledContainer, { children: [isOpenBoard && _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID }), isOpenSysMetadata &&
|
459
|
-
_jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: !isOpenDistinctValues, TID: focusedItem?.TID, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] })] }) }) })
|
459
|
+
_jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: !isOpenDistinctValues, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] })] }) }) })
|
460
460
|
: _jsx(_Fragment, {}), isOpenPreview
|
461
461
|
? _jsx(TMLayoutItem, { children: _jsx(TMDcmtPreview, { onClose: () => { setIsOpenPreview(false); onClosePreview?.(); }, dcmtData: currentDcmt, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev') }) })
|
462
462
|
: _jsx(_Fragment, {})] }) })
|
@@ -13,9 +13,7 @@ import Menu from "./Menu";
|
|
13
13
|
import TextBox from "./TextBox";
|
14
14
|
import Chooser from "./Chooser";
|
15
15
|
import SelectBox from "./SelectBox";
|
16
|
-
import
|
17
|
-
import six_DESIGNER from '../../../assets/Designer-blu.svg';
|
18
|
-
import six_ORCHESTRATOR from '../../../assets/Orchestrator-blu.svg';
|
16
|
+
import six from '../../../assets/six.png';
|
19
17
|
import it from '../../../assets/italy.svg';
|
20
18
|
import en from '../../../assets/united-kingdom.svg';
|
21
19
|
import es from '../../../assets/spain.svg';
|
@@ -569,14 +567,14 @@ const TMLoginForm = (props) => {
|
|
569
567
|
window.removeEventListener('keydown', handleKeyDown);
|
570
568
|
};
|
571
569
|
}, [showContinueBtn, disableContinueBtn, showLoginBtn, disableLoginBtn, nextStepHandler, loginHandler]);
|
572
|
-
const
|
570
|
+
const welcomeAppName = useMemo(() => {
|
573
571
|
switch (SDK_Globals.appModule) {
|
574
|
-
case AppModules.ORCHESTRATOR: return
|
575
|
-
case AppModules.DESIGNER: return
|
576
|
-
default: return
|
572
|
+
case AppModules.ORCHESTRATOR: return AppModules.ORCHESTRATOR;
|
573
|
+
case AppModules.DESIGNER: return AppModules.DESIGNER;
|
574
|
+
default: return AppModules.SURFER;
|
577
575
|
}
|
578
576
|
}, [SDK_Globals.appModule]);
|
579
|
-
return (_jsxs(StyledWrapper, { children: [!isMobile && _jsxs(StyledVersionContainer, { children: [_jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.primary }, children: "\u25CF" }), SDK_Globals.appModule] }), _jsxs("p", { children: ["v.", SDK_Globals.appVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.tertiary }, children: "\u25CF" }), "SDKUI"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkuiVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.error }, children: "\u25CF" }), "SDK"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkVersion] })] })] }), _jsxs(StyledLoginContainer, { "$isMobile": isMobile, children: [_jsxs(StyledLeftSection, { "$isMobile": isMobile, "$isConnector": props.isConnector ?? false, children: [isMobile && _jsxs(StyledTopBar, { children: [_jsx(StyledTitle, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') + ' ' + SDK_Globals.appModule }), _jsx(StyledMobileVersionIcon, { onClick: showVersionPopup, children: _jsx(IconInfo, { fontSize: 20, color: TMColors.primary }) })] }), _jsx(StyledOverlay, { "$isMobile": isMobile, children: _jsx(StyledCustomLogo, { style: { backgroundImage: `url(${showDefaultLogo ? 'logo-default.svg' : 'logo-custom.svg'})` } }) }), (windowHeight === WindowHeight.LARGE || !isMobile) && _jsxs(StyledPoweredByContainer, { "$isMobile": isMobile, children: [" ", showDefaultLogo ? 'Powered by TopConsult' : _jsx("img", { src: "/logo-default.svg", alt: "Logo", width: isMobile ? 50 : 100 }), " "] })] }), _jsxs(StyledRightSection, { "$isMobile": isMobile, children: [((((getDeviceType() === 'desktop' || isDesktop || isTablet) && windowHeight !== WindowHeight.SMALL)) && !isMobile) && _jsxs(StyledLogoContainer, { "$isMobile": isMobile, children: [_jsx(StyledWelcomeText, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') }), _jsx(StyledLogo, { children: _jsx("img", { src:
|
577
|
+
return (_jsxs(StyledWrapper, { children: [!isMobile && _jsxs(StyledVersionContainer, { children: [_jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.primary }, children: "\u25CF" }), SDK_Globals.appModule] }), _jsxs("p", { children: ["v.", SDK_Globals.appVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.tertiary }, children: "\u25CF" }), "SDKUI"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkuiVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.error }, children: "\u25CF" }), "SDK"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkVersion] })] })] }), _jsxs(StyledLoginContainer, { "$isMobile": isMobile, children: [_jsxs(StyledLeftSection, { "$isMobile": isMobile, "$isConnector": props.isConnector ?? false, children: [isMobile && _jsxs(StyledTopBar, { children: [_jsx(StyledTitle, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') + ' ' + SDK_Globals.appModule }), _jsx(StyledMobileVersionIcon, { onClick: showVersionPopup, children: _jsx(IconInfo, { fontSize: 20, color: TMColors.primary }) })] }), _jsx(StyledOverlay, { "$isMobile": isMobile, children: _jsx(StyledCustomLogo, { style: { backgroundImage: `url(${showDefaultLogo ? 'logo-default.svg' : 'logo-custom.svg'})` } }) }), (windowHeight === WindowHeight.LARGE || !isMobile) && _jsxs(StyledPoweredByContainer, { "$isMobile": isMobile, children: [" ", showDefaultLogo ? 'Powered by TopConsult' : _jsx("img", { src: "/logo-default.svg", alt: "Logo", width: isMobile ? 50 : 100 }), " "] })] }), _jsxs(StyledRightSection, { "$isMobile": isMobile, children: [((((getDeviceType() === 'desktop' || isDesktop || isTablet) && windowHeight !== WindowHeight.SMALL)) && !isMobile) && _jsxs(StyledLogoContainer, { "$isMobile": isMobile, children: [_jsx(StyledWelcomeText, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') }), _jsx(StyledLogo, { children: _jsx("img", { src: six, alt: "six", height: 50 }) }), _jsx(StyledWelcomeText, { children: welcomeAppName })] }), _jsxs(StyledToolbarContainer, { children: [_jsx(StyledLanguageChooser, { onClick: () => setShowCultureIDs(true), children: _jsx(TMTooltip, { content: SDKUI_Localizator.CultureID, children: _jsx("img", { src: getCultureIDImg(), alt: "Lang", width: 25, height: 25 }) }) }), loginStep !== 3 && _jsx(TMButton, { btnStyle: "icon", onClick: () => setShowRapidAccess(true), icon: _jsx(IconFastAccess, { fontSize: 20 }), caption: LOGINLocalizator.QuickAccess }), showPasswordOperations && _jsx(TMButton, { disabled: disablePasswordOperations, btnStyle: "icon", onClick: () => setShowChangePassword(true), icon: _jsx(IconPasswordOutline, { fontSize: 19 }), caption: SDKUI_Localizator.ChangePassword })] }), _jsxs(StyledFormContainer, { "$isMobile": isMobile, "$windowHeight": windowHeight, children: [loginStep === 1 &&
|
580
578
|
_jsxs(StyledStepContainer, { children: [_jsx(Chooser, { isDropDown: isDesktop, dataSource: props.endpoints, value: 'Description', columns: accessPointChooserColumns, additionalIcons: accessPointAdditionalIcons, icon: _jsx(IconAccessPoint, {}), label: SDKUI_Localizator.Endpoint, onSelectionChanged: (ep) => { setEndpoint(ep); setDcmtArchive(undefined); }, validationItems: fieldValidations('endpoint'), selectedRow: endpoint ?? undefined }), _jsx(Chooser, { isDropDown: isDesktop, dataSource: dcmtArchives, value: 'description', columns: dcmtArchiveChooserColumns, icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, onSelectionChanged: (arch) => setDcmtArchive(arch), validationItems: fieldValidations('dcmtArchive'), disabled: !endpoint, selectedRow: dcmtArchive ?? undefined })] }), loginStep === 2 &&
|
581
579
|
_jsxs(StyledStepContainer, { "$windowHeight": windowHeight, style: { marginTop: '20px' }, children: [_jsxs(StyledSummaryContainer, { style: { position: 'absolute', top: getTopOffset(windowHeight, isMobile, isTablet), left: '50%', transform: 'translateX(-50%)', width: 'max-content' }, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: endpoint?.Description })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: dcmtArchive?.description })] })] }), _jsx(SelectBox, { value: authMode, options: authModeOptions, onValueChanged: (value) => setAuthMode(value), validationItems: fieldValidations('authenticationMode'), icon: _jsx(IconLogin, {}), label: SDKUI_Localizator.AuthMode }), _jsxs(StyledCredentialWrapper, { children: [authMode === AuthenticationModes.WindowsThroughTopMedia && _jsx(TextBox, { ref: authDomainRef, value: authDomain, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), authMode !== AuthenticationModes.MSAzure && _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameRef, secondaryRef: passwordRef, usernameValidator: fieldValidations('username'), passwordValidator: fieldValidations('password'), authMode: authMode, username: username, password: password, onUsernameChanged: (un) => setUsername(un), onPasswordChanged: (ps) => setPassword(ps) }), authMode === AuthenticationModes.TopMediaOnBehalfOf &&
|
582
580
|
_jsxs(StyledCredentialWrapper, { children: [_jsx(TextBox, { value: authDomain, ref: authDomainRef, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameOnBehalfOfRef, secondaryRef: passwordOnBehalfOfRRef, usernameValidator: fieldValidations('usernameOnBehalfOf'), passwordValidator: fieldValidations('passwordOnBehalfOf'), authMode: AuthenticationModes.TopMediaOnBehalfOf, username: usernameOnBehalf, password: passwordOnBehalf, onUsernameChanged: (un) => setUsernameOnBehalf(un), onPasswordChanged: (ps) => setPasswordOnBehalf(ps) })] })] }), authMode !== AuthenticationModes.TopMediaWithMFA &&
|
@@ -661,8 +659,8 @@ const getPadding = (windowHeight, isMobile) => {
|
|
661
659
|
return '20px';
|
662
660
|
};
|
663
661
|
const StyledMobileVersionIcon = styled.div ` display: flex; align-items: center; justify-content: center; border-radius: 30px; width: 25px; height: 25px; background-color: white; `;
|
664
|
-
const StyledWrapper = styled.div ` display: flex; align-items: center; justify-content: center; width: 100%; height: 100vh; overflow: hidden; background-color:
|
665
|
-
const StyledVersionContainer = styled.div ` position: absolute; bottom: 35px; left: 50%; transform: translateX(-50%); color:
|
662
|
+
const StyledWrapper = styled.div ` display: flex; align-items: center; justify-content: center; width: 100%; height: 100vh; overflow: hidden; background-color: transparent; `;
|
663
|
+
const StyledVersionContainer = styled.div ` position: absolute; bottom: 35px; left: 50%; transform: translateX(-50%); color: ${TMColors.primary}; font-size: 0.9rem; display:flex; align-items:center; gap:10px; `;
|
666
664
|
const StyledVersion = styled.div ` display: flex; align-items: center; gap: 2px; `;
|
667
665
|
const StyledVersionName = styled.p ` display: flex; align-items: center; gap: 3px; `;
|
668
666
|
const StyledLoginContainer = styled.div ` min-width: ${props => props.$isMobile ? '100%' : '800px'}; width: ${props => props.$isMobile ? '100%' : '50%'}; height:${props => props.$isMobile ? '100%' : '80%'}; background: #FFFFFF 0% 0% no-repeat padding-box; box-shadow: ${props => !props.$isMobile ? '7px 7px 5px #AEAEAFBF' : 'none'}; border-radius: ${props => !props.$isMobile ? '10px' : 'none'};; opacity: 1; display: flex; flex-direction: ${props => props.$isMobile ? 'column' : 'row'}; overflow: hidden; `;
|
@@ -671,7 +669,7 @@ const StyledOverlay = styled.div ` position: ${props => props.$isMobile ? 'unset
|
|
671
669
|
const StyledPoweredByContainer = styled.div ` position: absolute; width: 100%; height: 20px; bottom: ${props => props.$isMobile ? '10px' : '40px'}; left: 0; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.8rem; `;
|
672
670
|
const StyledRightSection = styled.div ` width: ${props => props.$isMobile ? '100%' : '67%'}; min-width: ${props => props.$isMobile ? '100%' : '500px'}; height: ${props => props.$isMobile ? '80%' : '100%'}; background: white; mix-blend-mode: multiply; opacity: 1; position: relative; display: flex; align-items: center; justify-content: center; `;
|
673
671
|
const StyledLogoContainer = styled.div ` position: absolute; top: ${props => props.$isMobile ? '40px' : '20px'}; left: 0; width: 100%; height: fit-content; padding: ${props => props.$isMobile ? '40px' : '30px'} 10px; transform:${props => props.$isMobile ? 'scale(0.8)' : 'scale(0.9)'}; display: flex; align-items: center; justify-content: center; gap: 10px; `;
|
674
|
-
const StyledWelcomeText = styled.h1 ` text-align: left; letter-spacing: 0px; color: ${TMColors.primary}; opacity: 1;
|
672
|
+
const StyledWelcomeText = styled.h1 ` text-align: left; letter-spacing: 0px; color: ${TMColors.primary}; opacity: 1; `;
|
675
673
|
const StyledLogo = styled.div ` display: flex; gap: 5px; align-items: center; `;
|
676
674
|
const StyledFormContainer = styled.div ` display: flex; flex-direction: column; padding: ${props => getPadding(props.$windowHeight, props.$isMobile)} ; align-items: center; justify-content: center; gap: 10px; width: 100%; height: fit-content; max-height: calc(100% - 100px); margin-top : ${props => !props.$isMobile && props.$windowHeight === WindowHeight.MEDIUM ? '70px' : '0'} ; `;
|
677
675
|
const StyledButtonContainer = styled.div ` display: flex; align-items: center; justify-content: center; padding: 10px; width: 100%; margin-top: 10px; `;
|
@@ -1,9 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import { useState, useEffect, useRef, useMemo } from 'react';
|
3
|
-
import
|
4
|
-
import six_DESIGNER from '../../assets/Designer-blu.svg';
|
5
|
-
import six_ORCHESTRATOR from '../../assets/Orchestrator-blu.svg';
|
6
|
-
import six from '../../assets/six.svg';
|
3
|
+
import six from '../../assets/six.png';
|
7
4
|
import { IconBxInfo, IconCloseOutline, IconLogout, IconPassword, IconSearch, IconSettings, IconUserProfile, SDKUI_Localizator } from '../../helper';
|
8
5
|
import styled from 'styled-components';
|
9
6
|
import { SDK_Globals, AuthenticationModes, AppModules } from '@topconsultnpm/sdk-ts-beta';
|
@@ -26,9 +23,10 @@ const StyledMenuItem = styled.p ` font-size: ${props => props.$fontSize}; displa
|
|
26
23
|
const StyledHeaderIcon = styled.div ` width: 50px; height: 50px; margin-left: 10px; display: flex; align-items: center; justify-content: center; color: ${props => props.$isSelected ? '#135596' : '#ffffff'}; transition: color ease 100ms; background-color: ${props => props.$isSelected && '#ffffff'}; cursor: pointer; &:hover { color: #ffffff; background-color: #0d3862; transition: color ease 100ms; } `;
|
27
24
|
const StyledSearchBarContainer = styled.div ` position: relative; height:30px; width: 100%; max-width: ${props => props.$isMobile ? '65%' : '650px'}; margin-left: ${props => props.$isMobile ? '10px' : '50px'}; `;
|
28
25
|
const StyledSearchBar = styled.input ` background: #FFFFFF 0% 0% no-repeat padding-box; border: 1px solid #dbdbdb; border-radius: 5px; padding: 5px 30px; width:100%; transition: 100ms linear; &:focus{ outline: none; border-bottom: 2px solid ${TMColors.primary}; } `;
|
26
|
+
const StyledHeaderAppText = styled.h2 ` text-align: left; letter-spacing: 0px; color: ${TMColors.primary}; opacity: 1; `;
|
29
27
|
export const TMSearchBar = ({ searchValue, onSearchValueChanged, maxWidth, marginLeft }) => {
|
30
28
|
const deviceType = useDeviceType();
|
31
|
-
return (_jsxs(StyledSearchBarContainer, { style: { maxWidth: maxWidth ? maxWidth : deviceType === DeviceType.MOBILE ? '65%' : '650px', marginLeft: marginLeft ? marginLeft : deviceType === DeviceType.MOBILE ? '10px' : '
|
29
|
+
return (_jsxs(StyledSearchBarContainer, { style: { maxWidth: maxWidth ? maxWidth : deviceType === DeviceType.MOBILE ? '65%' : '650px', marginLeft: marginLeft ? marginLeft : deviceType === DeviceType.MOBILE ? '10px' : '20px' }, "$isMobile": deviceType === DeviceType.MOBILE, children: [_jsx(IconSearch, { fontSize: 12, color: '#00000060', style: { position: 'absolute', width: '20px', height: '20px', left: '5px', top: '5px', zIndex: 1 } }), _jsx(StyledSearchBar, { placeholder: SDKUI_Localizator.Search + '...', type: "text", value: searchValue, onChange: (e) => onSearchValueChanged(e.target.value) }), searchValue.length > 0 && _jsx(IconCloseOutline, { onClick: () => onSearchValueChanged(''), color: '#00000060', style: { cursor: 'pointer', position: 'absolute', width: '20px', height: '20px', right: '5px', top: '5px', zIndex: 1 } })] }));
|
32
30
|
};
|
33
31
|
const TMHeader = ({ showSettingsMenu = true, showSearchBar = true, clearSearchJobValue, clearSearchQEValue, searchContext = TMSearchContext.JOBS, onChangePassword, onLogout, settingsMenuContext, onSeacrhJobsValueChange, onSeacrhJobslistValueChange, onSeacrhProcessMonitorValueChange, onSeacrhProcessValueChange, onSeacrhPlatformValueChange, onSeacrhQEValueChange, onSettingsClick }) => {
|
34
32
|
const [menuStatus, setMenuStatus] = useState(false);
|
@@ -40,11 +38,11 @@ const TMHeader = ({ showSettingsMenu = true, showSearchBar = true, clearSearchJo
|
|
40
38
|
const [searchQEValue, setSearchQEValue] = useState('');
|
41
39
|
const menuRef = useRef(null);
|
42
40
|
const userIcon = useRef(null);
|
43
|
-
const
|
41
|
+
const headerAppName = useMemo(() => {
|
44
42
|
switch (SDK_Globals.appModule) {
|
45
|
-
case AppModules.ORCHESTRATOR: return
|
46
|
-
case AppModules.DESIGNER: return
|
47
|
-
default: return
|
43
|
+
case AppModules.ORCHESTRATOR: return AppModules.ORCHESTRATOR;
|
44
|
+
case AppModules.DESIGNER: return AppModules.DESIGNER;
|
45
|
+
default: return AppModules.SURFER;
|
48
46
|
}
|
49
47
|
}, [SDK_Globals.appModule]);
|
50
48
|
const deviceType = useDeviceType();
|
@@ -84,6 +82,6 @@ const TMHeader = ({ showSettingsMenu = true, showSearchBar = true, clearSearchJo
|
|
84
82
|
document.addEventListener('click', handleClickOutside);
|
85
83
|
return () => document.removeEventListener('click', handleClickOutside);
|
86
84
|
}, [menuRef, userIcon, menuStatus]);
|
87
|
-
return (_jsxs(StyledHeaderContainer, { "$appName": SDK_Globals.appModule, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', width: '100%' }, children: [
|
85
|
+
return (_jsxs(StyledHeaderContainer, { "$appName": SDK_Globals.appModule, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', width: '100%' }, children: [_jsxs("div", { style: { height: '50px', display: 'flex', alignItems: 'center', gap: 10, justifyContent: 'center' }, children: [_jsx("img", { src: six, height: isMobile ? 35 : 40, alt: "" }), !isMobile && _jsx(StyledHeaderAppText, { children: headerAppName })] }), showSearchBar && _jsxs(_Fragment, { children: [searchContext === TMSearchContext.JOBS_LIST && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchJobListValue(e), searchValue: searchJobListValue }), searchContext === TMSearchContext.JOBS && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchJobsValue(e), searchValue: searchJobsValue }), searchContext === TMSearchContext.PROCESSES && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchProcessesValue(e), searchValue: searchProcessesValue }), searchContext === TMSearchContext.PROCESS_MONITOR && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchProcessMonitorValue(e), searchValue: searchProcessMonitorValue }), searchContext === TMSearchContext.PLATFORM && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchPlatformValue(e), searchValue: searchPlatformValue }), searchContext === TMSearchContext.QE && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchQEValue(e), searchValue: searchQEValue })] })] }), showSettingsMenu && _jsxs(StyledHeaderIcon, { onClick: () => onSettingsClick?.(), children: [" ", _jsx(IconSettings, { fontSize: 20 }), " "] }), _jsxs(StyledHeaderIcon, { "$isSelected": menuStatus, ref: userIcon, onClick: () => setMenuStatus(!menuStatus), children: [" ", _jsx(IconUserProfile, { fontSize: 20 }), " "] }), menuStatus && _jsxs(StyledMenu, { ref: menuRef, children: [SDK_Globals.tmSession?.SessionDescr?.authenticationMode === AuthenticationModes.TopMedia && _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); onChangePassword && onChangePassword(); }, style: { fontSize: FontSize.defaultFontSize }, children: [" ", _jsx("span", { children: _jsx(IconPassword, {}) }), " ", _jsx("span", { children: SDKUI_Localizator.ChangePassword }), " "] }), _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); onLogout && onLogout(); }, children: [_jsx("span", { children: _jsx(IconLogout, {}) }), " ", _jsx("span", { children: "Logout" }), " "] }), _jsx("div", { style: { width: '100%', height: '1px', backgroundColor: 'gray' } }), _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); TMMessageBoxManager.show({ buttons: [ButtonNames.OK], title: `About. ${SDK_Globals.appModule}`, message: _jsx(TMAboutApp, { app: true, skdui: true, sdk: true, websdk: true }) }); }, style: { fontSize: FontSize.defaultFontSize }, children: [" ", _jsx("span", { children: _jsx(IconBxInfo, {}) }), " ", _jsx("span", { children: "About" }), " "] })] })] }));
|
88
86
|
};
|
89
87
|
export default TMHeader;
|