@topconsultnpm/sdkui-react-beta 6.14.2 → 6.14.4
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/helper/queryHelper.js +54 -5
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDsAsNumber, MetadataDataTypes, QueryDescriptor, QueryFunctions, SelectItem, SelectItemVisibilities, FromItem, LayoutModes, QueryOperators, SavedQueryDescriptor, SearchEngine, WhereItem, OrderByItem } from '@topconsultnpm/sdk-ts-beta';
|
|
1
|
+
import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDsAsNumber, MetadataDataTypes, QueryDescriptor, QueryFunctions, SelectItem, SelectItemVisibilities, FromItem, LayoutModes, QueryOperators, SavedQueryDescriptor, SearchEngine, WhereItem, OrderByItem, SDK_Globals, AppModules } from '@topconsultnpm/sdk-ts-beta';
|
|
2
2
|
import { DateDisplayTypes, Globalization } from './Globalization';
|
|
3
3
|
import { MetadataValueDescriptorEx } from '../ts';
|
|
4
4
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
@@ -59,10 +59,8 @@ export const prepareQdForSearchAsync = async (qdInput) => {
|
|
|
59
59
|
let qd = new QueryDescriptor();
|
|
60
60
|
qd.init({ ...qdInput });
|
|
61
61
|
let fromTID = qd?.from?.tid;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (!qd.orderBy)
|
|
65
|
-
qd.orderBy = [];
|
|
62
|
+
qd.select ??= [];
|
|
63
|
+
qd.orderBy ??= [];
|
|
66
64
|
let qdWithAggrFunctions = qd.select?.some(o => o.function != QueryFunctions.None && o.function != undefined);
|
|
67
65
|
if (!qd.isDistinct && !qdWithAggrFunctions) {
|
|
68
66
|
addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.TID);
|
|
@@ -103,8 +101,59 @@ export const prepareQdForSearchAsync = async (qdInput) => {
|
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
103
|
qd.isLexProt = 1;
|
|
104
|
+
//Apply Filters for Connectors
|
|
105
|
+
addWhereClausesForConnect(qd);
|
|
106
106
|
return qd;
|
|
107
107
|
};
|
|
108
|
+
function addWhereClausesForConnect(qd) {
|
|
109
|
+
switch (SDK_Globals.tmSession?.SessionDescr?.appModuleID) {
|
|
110
|
+
case AppModules.EXCEL_CONNECTOR:
|
|
111
|
+
case AppModules.OUTLOOK_CONNECTOR:
|
|
112
|
+
case AppModules.POWERPOINT_CONNECTOR:
|
|
113
|
+
case AppModules.WORD_CONNECTOR:
|
|
114
|
+
break; // Continua l'esecuzione per questi moduli
|
|
115
|
+
default:
|
|
116
|
+
return; // Esci dalla funzione per tutti gli altri moduli
|
|
117
|
+
}
|
|
118
|
+
let connectForWEPExts = '';
|
|
119
|
+
switch (SDK_Globals.tmSession?.SessionDescr?.appModuleID) {
|
|
120
|
+
case AppModules.EXCEL_CONNECTOR:
|
|
121
|
+
connectForWEPExts = "'XLS', 'XLT', 'XLM', 'XLSX', 'XLSM', 'XLSB', 'XLAM', 'XLTX', 'XLTM'";
|
|
122
|
+
break;
|
|
123
|
+
case AppModules.POWERPOINT_CONNECTOR:
|
|
124
|
+
connectForWEPExts = "'PPT', 'PPTX', 'PPTM', 'PPSX', 'PPS', 'PPSM'";
|
|
125
|
+
break;
|
|
126
|
+
case AppModules.WORD_CONNECTOR:
|
|
127
|
+
connectForWEPExts = "'DOCX', 'DOCM', 'DOTX', 'DOTM', 'DOC', 'DOT', 'HTM', 'HTML', 'RTF', 'MHT', 'MHTML', 'XML', 'ODT', 'TXT'";
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
qd.where ??= [];
|
|
131
|
+
// ( <filtri utente> ) AND FileCount > 0 [AND FileExt IN (....)]
|
|
132
|
+
if (qd.where.length >= 2) {
|
|
133
|
+
qd.where[0].leftBrackets = '(' + qd.where[0].leftBrackets;
|
|
134
|
+
qd.where[qd.where.length - 1].rightBrackets += ')';
|
|
135
|
+
}
|
|
136
|
+
let wiFileCount = new WhereItem();
|
|
137
|
+
wiFileCount.tid = qd.from?.tid;
|
|
138
|
+
wiFileCount.mid = SystemMIDsAsNumber.FileCount;
|
|
139
|
+
wiFileCount.operator = QueryOperators.Greater;
|
|
140
|
+
wiFileCount.value1 = '0';
|
|
141
|
+
wiFileCount.or = false;
|
|
142
|
+
wiFileCount.leftBrackets = '(';
|
|
143
|
+
wiFileCount.rightBrackets = ')';
|
|
144
|
+
qd.where.push(wiFileCount);
|
|
145
|
+
if (connectForWEPExts !== '') {
|
|
146
|
+
let wiFileExt = new WhereItem();
|
|
147
|
+
wiFileExt.tid = qd.from?.tid;
|
|
148
|
+
wiFileExt.mid = SystemMIDsAsNumber.FileExt;
|
|
149
|
+
wiFileExt.operator = QueryOperators.In;
|
|
150
|
+
wiFileExt.value1 = connectForWEPExts;
|
|
151
|
+
wiFileExt.or = false;
|
|
152
|
+
wiFileExt.leftBrackets = '(';
|
|
153
|
+
wiFileExt.rightBrackets = ')';
|
|
154
|
+
qd.where.push(wiFileExt);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
108
157
|
export function getDefaultOperator(dataDomain, dataType) {
|
|
109
158
|
if (dataDomain == MetadataDataDomains.DataList)
|
|
110
159
|
return QueryOperators.In;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"lib"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@topconsultnpm/sdk-ts-beta": "6.14.
|
|
45
|
+
"@topconsultnpm/sdk-ts-beta": "6.14.2",
|
|
46
46
|
"buffer": "^6.0.3",
|
|
47
47
|
"devextreme": "24.2.6",
|
|
48
48
|
"devextreme-react": "24.2.6",
|