@mohsinonxrm/pptb-fetchxml-studio 1.0.0 → 1.0.1
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/LICENSE +661 -0
- package/dist/assets/index-DD9fzkbz.js +232 -0
- package/dist/index.html +70 -0
- package/index.html +0 -1
- package/npm-shrinkwrap.json +6329 -0
- package/package.json +95 -51
- package/CHANGELOG.md +0 -120
- package/eslint.config.js +0 -23
- package/public/vite.svg +0 -1
- package/src/app/AppShell.tsx +0 -1733
- package/src/assets/20px-Microsoft_Office_Excel_(2025/342/200/223present).svg.png +0 -0
- package/src/assets/react.svg +0 -1
- package/src/features/fetchxml/api/dataverseMetadata.ts +0 -192
- package/src/features/fetchxml/api/excelExport.ts +0 -318
- package/src/features/fetchxml/api/formattedValues.ts +0 -107
- package/src/features/fetchxml/api/pptbClient.ts +0 -2635
- package/src/features/fetchxml/model/displaySettings.ts +0 -18
- package/src/features/fetchxml/model/fetchxml.ts +0 -346
- package/src/features/fetchxml/model/fetchxmlIntellisense.ts +0 -583
- package/src/features/fetchxml/model/fetchxmlParser.ts +0 -708
- package/src/features/fetchxml/model/layoutxml.ts +0 -372
- package/src/features/fetchxml/model/nodes.ts +0 -255
- package/src/features/fetchxml/model/operators.ts +0 -624
- package/src/features/fetchxml/model/treeUtils.ts +0 -174
- package/src/features/fetchxml/state/builderStore.tsx +0 -1160
- package/src/features/fetchxml/state/cache.ts +0 -393
- package/src/features/fetchxml/ui/Dialogs/BulkDeleteDialog.tsx +0 -352
- package/src/features/fetchxml/ui/Dialogs/DeleteConfirmDialog.tsx +0 -396
- package/src/features/fetchxml/ui/Dialogs/SaveViewDialog.tsx +0 -612
- package/src/features/fetchxml/ui/Dialogs/SolutionPicker.tsx +0 -114
- package/src/features/fetchxml/ui/Dialogs/WorkflowPickerDialog.tsx +0 -437
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel/editors/AttributeEditor.tsx +0 -214
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel/editors/ConditionEditor.tsx +0 -533
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel/editors/FetchOptionsEditor.tsx +0 -296
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel/editors/FilterEditor.tsx +0 -106
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel/editors/LinkEntityEditor.tsx +0 -433
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel/editors/OrderEditor.tsx +0 -161
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel/editors/ValueOfPicker.tsx +0 -194
- package/src/features/fetchxml/ui/LeftPane/PropertiesPanel.tsx +0 -225
- package/src/features/fetchxml/ui/LeftPane/TreeView.tsx +0 -604
- package/src/features/fetchxml/ui/RightPane/AddColumnsPanel.tsx +0 -800
- package/src/features/fetchxml/ui/RightPane/ColumnConfigDialog.tsx +0 -170
- package/src/features/fetchxml/ui/RightPane/DataGridCellRenderers.tsx +0 -356
- package/src/features/fetchxml/ui/RightPane/EditColumnsPanel.tsx +0 -372
- package/src/features/fetchxml/ui/RightPane/FetchXmlEditor.tsx +0 -399
- package/src/features/fetchxml/ui/RightPane/FormattedValueUtils.ts +0 -189
- package/src/features/fetchxml/ui/RightPane/LayoutXmlViewer.tsx +0 -171
- package/src/features/fetchxml/ui/RightPane/PreviewTabs.tsx +0 -471
- package/src/features/fetchxml/ui/RightPane/ResultsCommandBar.tsx +0 -430
- package/src/features/fetchxml/ui/RightPane/ResultsGrid.tsx +0 -983
- package/src/features/fetchxml/ui/RightPane/XmlTextArea.tsx +0 -65
- package/src/features/fetchxml/ui/Settings/SettingsDrawer.tsx +0 -175
- package/src/features/fetchxml/ui/Toolbar/EntitySelector.tsx +0 -788
- package/src/features/fetchxml/ui/Toolbar/LoadViewPicker.tsx +0 -274
- package/src/features/fetchxml/ui/Toolbar/SaveViewButton.tsx +0 -174
- package/src/main.tsx +0 -11
- package/src/shared/components/AttributePicker.tsx +0 -138
- package/src/shared/components/BetweenInputPicker.tsx +0 -120
- package/src/shared/components/BooleanValuePicker.tsx +0 -165
- package/src/shared/components/DateTimeInputPicker.tsx +0 -170
- package/src/shared/components/DynamicValueList.tsx +0 -128
- package/src/shared/components/ExcelIcon.tsx +0 -30
- package/src/shared/components/MultiValuePicker.tsx +0 -178
- package/src/shared/components/NumericInputPicker.tsx +0 -156
- package/src/shared/components/OptionSetValuePicker.tsx +0 -150
- package/src/shared/components/RelationshipPicker.tsx +0 -268
- package/src/shared/contexts/ThemeContext.tsx +0 -19
- package/src/shared/hooks/useAccessMode.ts +0 -77
- package/src/shared/hooks/useLazyMetadata.ts +0 -132
- package/src/shared/hooks/usePptbContext.ts +0 -170
- package/src/shared/hooks/usePublisherFilter.ts +0 -214
- package/src/shared/hooks/useSolutionFilter.ts +0 -162
- package/src/shared/utils/debug.ts +0 -87
- package/tsconfig.app.json +0 -28
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -7
|
@@ -1,624 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FetchXML operator definitions and filtering based on attribute type
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { OperatorType } from "./nodes";
|
|
6
|
-
|
|
7
|
-
export interface OperatorDefinition {
|
|
8
|
-
value: OperatorType;
|
|
9
|
-
label: string;
|
|
10
|
-
requiresValue: boolean; // Does it need any value?
|
|
11
|
-
requiresTwoValues?: boolean; // Does it need exactly TWO values? (e.g., between, in-fiscal-period-and-year)
|
|
12
|
-
requiresMultipleValues?: boolean; // Does it accept multiple values? (e.g., in, contain-values)
|
|
13
|
-
valueType?: "string" | "number" | "date" | "guid" | "boolean"; // What type of value(s)?
|
|
14
|
-
applicableTypes: string[]; // AttributeType values
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* All available FetchXML operators with their metadata
|
|
19
|
-
*/
|
|
20
|
-
export const ALL_OPERATORS: OperatorDefinition[] = [
|
|
21
|
-
// Comparison operators (most types)
|
|
22
|
-
{
|
|
23
|
-
value: "eq",
|
|
24
|
-
label: "Equals",
|
|
25
|
-
requiresValue: true,
|
|
26
|
-
applicableTypes: [
|
|
27
|
-
"String",
|
|
28
|
-
"Integer",
|
|
29
|
-
"BigInt",
|
|
30
|
-
"Decimal",
|
|
31
|
-
"Double",
|
|
32
|
-
"Money",
|
|
33
|
-
"DateTime",
|
|
34
|
-
"Boolean",
|
|
35
|
-
"Picklist",
|
|
36
|
-
"State",
|
|
37
|
-
"Status",
|
|
38
|
-
"Lookup",
|
|
39
|
-
"Customer",
|
|
40
|
-
"Owner",
|
|
41
|
-
"Uniqueidentifier",
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
value: "ne",
|
|
46
|
-
label: "Not Equals",
|
|
47
|
-
requiresValue: true,
|
|
48
|
-
applicableTypes: [
|
|
49
|
-
"String",
|
|
50
|
-
"Integer",
|
|
51
|
-
"BigInt",
|
|
52
|
-
"Decimal",
|
|
53
|
-
"Double",
|
|
54
|
-
"Money",
|
|
55
|
-
"DateTime",
|
|
56
|
-
"Boolean",
|
|
57
|
-
"Picklist",
|
|
58
|
-
"State",
|
|
59
|
-
"Status",
|
|
60
|
-
"Lookup",
|
|
61
|
-
"Customer",
|
|
62
|
-
"Owner",
|
|
63
|
-
"Uniqueidentifier",
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
value: "lt",
|
|
68
|
-
label: "Less Than",
|
|
69
|
-
requiresValue: true,
|
|
70
|
-
applicableTypes: ["Integer", "BigInt", "Decimal", "Double", "Money", "DateTime"],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
value: "le",
|
|
74
|
-
label: "Less Than or Equal",
|
|
75
|
-
requiresValue: true,
|
|
76
|
-
applicableTypes: ["Integer", "BigInt", "Decimal", "Double", "Money", "DateTime"],
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
value: "gt",
|
|
80
|
-
label: "Greater Than",
|
|
81
|
-
requiresValue: true,
|
|
82
|
-
applicableTypes: ["Integer", "BigInt", "Decimal", "Double", "Money", "DateTime"],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
value: "ge",
|
|
86
|
-
label: "Greater Than or Equal",
|
|
87
|
-
requiresValue: true,
|
|
88
|
-
applicableTypes: ["Integer", "BigInt", "Decimal", "Double", "Money", "DateTime"],
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
// String operators
|
|
92
|
-
{
|
|
93
|
-
value: "like",
|
|
94
|
-
label: "Like (pattern)",
|
|
95
|
-
requiresValue: true,
|
|
96
|
-
applicableTypes: ["String", "Memo"],
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
value: "not-like",
|
|
100
|
-
label: "Not Like",
|
|
101
|
-
requiresValue: true,
|
|
102
|
-
applicableTypes: ["String", "Memo"],
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
value: "begins-with",
|
|
106
|
-
label: "Begins With",
|
|
107
|
-
requiresValue: true,
|
|
108
|
-
applicableTypes: ["String", "Memo"],
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
value: "ends-with",
|
|
112
|
-
label: "Ends With",
|
|
113
|
-
requiresValue: true,
|
|
114
|
-
applicableTypes: ["String", "Memo"],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
value: "not-begin-with",
|
|
118
|
-
label: "Does Not Begin With",
|
|
119
|
-
requiresValue: true,
|
|
120
|
-
applicableTypes: ["String", "Memo"],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
value: "not-end-with",
|
|
124
|
-
label: "Does Not End With",
|
|
125
|
-
requiresValue: true,
|
|
126
|
-
applicableTypes: ["String", "Memo"],
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
// List operators
|
|
130
|
-
{
|
|
131
|
-
value: "in",
|
|
132
|
-
label: "In (list)",
|
|
133
|
-
requiresValue: true,
|
|
134
|
-
requiresMultipleValues: true,
|
|
135
|
-
valueType: "string",
|
|
136
|
-
applicableTypes: [
|
|
137
|
-
"String",
|
|
138
|
-
"Integer",
|
|
139
|
-
"BigInt",
|
|
140
|
-
"Decimal",
|
|
141
|
-
"Double",
|
|
142
|
-
"Money",
|
|
143
|
-
"Picklist",
|
|
144
|
-
"State",
|
|
145
|
-
"Status",
|
|
146
|
-
"Lookup",
|
|
147
|
-
"Customer",
|
|
148
|
-
"Owner",
|
|
149
|
-
"Uniqueidentifier",
|
|
150
|
-
],
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
value: "not-in",
|
|
154
|
-
label: "Not In (list)",
|
|
155
|
-
requiresValue: true,
|
|
156
|
-
requiresMultipleValues: true,
|
|
157
|
-
valueType: "string",
|
|
158
|
-
applicableTypes: [
|
|
159
|
-
"String",
|
|
160
|
-
"Integer",
|
|
161
|
-
"BigInt",
|
|
162
|
-
"Decimal",
|
|
163
|
-
"Double",
|
|
164
|
-
"Money",
|
|
165
|
-
"Picklist",
|
|
166
|
-
"State",
|
|
167
|
-
"Status",
|
|
168
|
-
"Lookup",
|
|
169
|
-
"Customer",
|
|
170
|
-
"Owner",
|
|
171
|
-
"Uniqueidentifier",
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
value: "between",
|
|
176
|
-
label: "Between (range)",
|
|
177
|
-
requiresValue: true,
|
|
178
|
-
requiresTwoValues: true,
|
|
179
|
-
valueType: "number",
|
|
180
|
-
applicableTypes: ["Integer", "BigInt", "Decimal", "Double", "Money", "DateTime"],
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
value: "not-between",
|
|
184
|
-
label: "Not Between",
|
|
185
|
-
requiresValue: true,
|
|
186
|
-
requiresTwoValues: true,
|
|
187
|
-
valueType: "number",
|
|
188
|
-
applicableTypes: ["Integer", "BigInt", "Decimal", "Double", "Money", "DateTime"],
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
// Null operators (all types)
|
|
192
|
-
{
|
|
193
|
-
value: "null",
|
|
194
|
-
label: "Is Null",
|
|
195
|
-
requiresValue: false,
|
|
196
|
-
applicableTypes: [
|
|
197
|
-
"String",
|
|
198
|
-
"Memo",
|
|
199
|
-
"Integer",
|
|
200
|
-
"BigInt",
|
|
201
|
-
"Decimal",
|
|
202
|
-
"Double",
|
|
203
|
-
"Money",
|
|
204
|
-
"DateTime",
|
|
205
|
-
"Boolean",
|
|
206
|
-
"Picklist",
|
|
207
|
-
"State",
|
|
208
|
-
"Status",
|
|
209
|
-
"Lookup",
|
|
210
|
-
"Customer",
|
|
211
|
-
"Owner",
|
|
212
|
-
"Uniqueidentifier",
|
|
213
|
-
],
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
value: "not-null",
|
|
217
|
-
label: "Is Not Null",
|
|
218
|
-
requiresValue: false,
|
|
219
|
-
applicableTypes: [
|
|
220
|
-
"String",
|
|
221
|
-
"Memo",
|
|
222
|
-
"Integer",
|
|
223
|
-
"BigInt",
|
|
224
|
-
"Decimal",
|
|
225
|
-
"Double",
|
|
226
|
-
"Money",
|
|
227
|
-
"DateTime",
|
|
228
|
-
"Boolean",
|
|
229
|
-
"Picklist",
|
|
230
|
-
"State",
|
|
231
|
-
"Status",
|
|
232
|
-
"Lookup",
|
|
233
|
-
"Customer",
|
|
234
|
-
"Owner",
|
|
235
|
-
"Uniqueidentifier",
|
|
236
|
-
],
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
// Choice (multi-select picklist) operators
|
|
240
|
-
{
|
|
241
|
-
value: "contain-values",
|
|
242
|
-
label: "Contains Values",
|
|
243
|
-
requiresValue: true,
|
|
244
|
-
requiresMultipleValues: true,
|
|
245
|
-
valueType: "number",
|
|
246
|
-
applicableTypes: ["Picklist", "State", "Status"],
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
value: "not-contain-values",
|
|
250
|
-
label: "Not Contain Values",
|
|
251
|
-
requiresValue: true,
|
|
252
|
-
requiresMultipleValues: true,
|
|
253
|
-
valueType: "number",
|
|
254
|
-
applicableTypes: ["Picklist", "State", "Status"],
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
// Date/Time operators (relative dates)
|
|
258
|
-
{ value: "yesterday", label: "Yesterday", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
259
|
-
{ value: "today", label: "Today", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
260
|
-
{ value: "tomorrow", label: "Tomorrow", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
261
|
-
{ value: "last-week", label: "Last Week", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
262
|
-
{ value: "this-week", label: "This Week", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
263
|
-
{ value: "next-week", label: "Next Week", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
264
|
-
{
|
|
265
|
-
value: "last-seven-days",
|
|
266
|
-
label: "Last Seven Days",
|
|
267
|
-
requiresValue: false,
|
|
268
|
-
applicableTypes: ["DateTime"],
|
|
269
|
-
},
|
|
270
|
-
{ value: "last-month", label: "Last Month", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
271
|
-
{ value: "this-month", label: "This Month", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
272
|
-
{ value: "next-month", label: "Next Month", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
273
|
-
{
|
|
274
|
-
value: "next-seven-days",
|
|
275
|
-
label: "Next Seven Days",
|
|
276
|
-
requiresValue: false,
|
|
277
|
-
applicableTypes: ["DateTime"],
|
|
278
|
-
},
|
|
279
|
-
{ value: "last-year", label: "Last Year", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
280
|
-
{ value: "this-year", label: "This Year", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
281
|
-
{ value: "next-year", label: "Next Year", requiresValue: false, applicableTypes: ["DateTime"] },
|
|
282
|
-
{
|
|
283
|
-
value: "last-x-hours",
|
|
284
|
-
label: "Last X Hours",
|
|
285
|
-
requiresValue: true,
|
|
286
|
-
applicableTypes: ["DateTime"],
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
value: "next-x-hours",
|
|
290
|
-
label: "Next X Hours",
|
|
291
|
-
requiresValue: true,
|
|
292
|
-
applicableTypes: ["DateTime"],
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
value: "last-x-days",
|
|
296
|
-
label: "Last X Days",
|
|
297
|
-
requiresValue: true,
|
|
298
|
-
applicableTypes: ["DateTime"],
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
value: "next-x-days",
|
|
302
|
-
label: "Next X Days",
|
|
303
|
-
requiresValue: true,
|
|
304
|
-
applicableTypes: ["DateTime"],
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
value: "last-x-weeks",
|
|
308
|
-
label: "Last X Weeks",
|
|
309
|
-
requiresValue: true,
|
|
310
|
-
applicableTypes: ["DateTime"],
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
value: "next-x-weeks",
|
|
314
|
-
label: "Next X Weeks",
|
|
315
|
-
requiresValue: true,
|
|
316
|
-
applicableTypes: ["DateTime"],
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
value: "last-x-months",
|
|
320
|
-
label: "Last X Months",
|
|
321
|
-
requiresValue: true,
|
|
322
|
-
applicableTypes: ["DateTime"],
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
value: "next-x-months",
|
|
326
|
-
label: "Next X Months",
|
|
327
|
-
requiresValue: true,
|
|
328
|
-
applicableTypes: ["DateTime"],
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
value: "last-x-years",
|
|
332
|
-
label: "Last X Years",
|
|
333
|
-
requiresValue: true,
|
|
334
|
-
applicableTypes: ["DateTime"],
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
value: "next-x-years",
|
|
338
|
-
label: "Next X Years",
|
|
339
|
-
requiresValue: true,
|
|
340
|
-
applicableTypes: ["DateTime"],
|
|
341
|
-
},
|
|
342
|
-
{ value: "on", label: "On (specific date)", requiresValue: true, applicableTypes: ["DateTime"] },
|
|
343
|
-
{
|
|
344
|
-
value: "on-or-before",
|
|
345
|
-
label: "On or Before",
|
|
346
|
-
requiresValue: true,
|
|
347
|
-
applicableTypes: ["DateTime"],
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
value: "on-or-after",
|
|
351
|
-
label: "On or After",
|
|
352
|
-
requiresValue: true,
|
|
353
|
-
applicableTypes: ["DateTime"],
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
value: "olderthan-x-minutes",
|
|
357
|
-
label: "Older Than X Minutes",
|
|
358
|
-
requiresValue: true,
|
|
359
|
-
applicableTypes: ["DateTime"],
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
value: "olderthan-x-hours",
|
|
363
|
-
label: "Older Than X Hours",
|
|
364
|
-
requiresValue: true,
|
|
365
|
-
applicableTypes: ["DateTime"],
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
value: "olderthan-x-days",
|
|
369
|
-
label: "Older Than X Days",
|
|
370
|
-
requiresValue: true,
|
|
371
|
-
applicableTypes: ["DateTime"],
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
value: "olderthan-x-weeks",
|
|
375
|
-
label: "Older Than X Weeks",
|
|
376
|
-
requiresValue: true,
|
|
377
|
-
applicableTypes: ["DateTime"],
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
value: "olderthan-x-months",
|
|
381
|
-
label: "Older Than X Months",
|
|
382
|
-
requiresValue: true,
|
|
383
|
-
applicableTypes: ["DateTime"],
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
value: "olderthan-x-years",
|
|
387
|
-
label: "Older Than X Years",
|
|
388
|
-
requiresValue: true,
|
|
389
|
-
applicableTypes: ["DateTime"],
|
|
390
|
-
},
|
|
391
|
-
|
|
392
|
-
// Fiscal period operators
|
|
393
|
-
{
|
|
394
|
-
value: "this-fiscal-year",
|
|
395
|
-
label: "This Fiscal Year",
|
|
396
|
-
requiresValue: false,
|
|
397
|
-
applicableTypes: ["DateTime"],
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
value: "this-fiscal-period",
|
|
401
|
-
label: "This Fiscal Period",
|
|
402
|
-
requiresValue: false,
|
|
403
|
-
applicableTypes: ["DateTime"],
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
value: "next-fiscal-year",
|
|
407
|
-
label: "Next Fiscal Year",
|
|
408
|
-
requiresValue: false,
|
|
409
|
-
applicableTypes: ["DateTime"],
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
value: "next-fiscal-period",
|
|
413
|
-
label: "Next Fiscal Period",
|
|
414
|
-
requiresValue: false,
|
|
415
|
-
applicableTypes: ["DateTime"],
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
value: "last-fiscal-year",
|
|
419
|
-
label: "Last Fiscal Year",
|
|
420
|
-
requiresValue: false,
|
|
421
|
-
applicableTypes: ["DateTime"],
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
value: "last-fiscal-period",
|
|
425
|
-
label: "Last Fiscal Period",
|
|
426
|
-
requiresValue: false,
|
|
427
|
-
applicableTypes: ["DateTime"],
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
value: "in-fiscal-year",
|
|
431
|
-
label: "In Fiscal Year",
|
|
432
|
-
requiresValue: true,
|
|
433
|
-
valueType: "number",
|
|
434
|
-
applicableTypes: ["DateTime"],
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
value: "in-fiscal-period",
|
|
438
|
-
label: "In Fiscal Period",
|
|
439
|
-
requiresValue: true,
|
|
440
|
-
valueType: "number",
|
|
441
|
-
applicableTypes: ["DateTime"],
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
value: "in-fiscal-period-and-year",
|
|
445
|
-
label: "In Fiscal Period and Year",
|
|
446
|
-
requiresValue: true,
|
|
447
|
-
requiresTwoValues: true,
|
|
448
|
-
valueType: "number",
|
|
449
|
-
applicableTypes: ["DateTime"],
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
value: "in-or-before-fiscal-period-and-year",
|
|
453
|
-
label: "In or Before Fiscal Period and Year",
|
|
454
|
-
requiresValue: true,
|
|
455
|
-
requiresTwoValues: true,
|
|
456
|
-
valueType: "number",
|
|
457
|
-
applicableTypes: ["DateTime"],
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
value: "in-or-after-fiscal-period-and-year",
|
|
461
|
-
label: "In or After Fiscal Period and Year",
|
|
462
|
-
requiresValue: true,
|
|
463
|
-
requiresTwoValues: true,
|
|
464
|
-
valueType: "number",
|
|
465
|
-
applicableTypes: ["DateTime"],
|
|
466
|
-
},
|
|
467
|
-
|
|
468
|
-
// User/Team context operators (Lookup, Owner types)
|
|
469
|
-
{
|
|
470
|
-
value: "eq-userid",
|
|
471
|
-
label: "Equals Current User",
|
|
472
|
-
requiresValue: false,
|
|
473
|
-
applicableTypes: ["Lookup", "Owner", "Customer", "Uniqueidentifier"],
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
value: "ne-userid",
|
|
477
|
-
label: "Not Equals Current User",
|
|
478
|
-
requiresValue: false,
|
|
479
|
-
applicableTypes: ["Lookup", "Owner", "Customer", "Uniqueidentifier"],
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
value: "eq-businessid",
|
|
483
|
-
label: "Equals Current Business Unit",
|
|
484
|
-
requiresValue: false,
|
|
485
|
-
applicableTypes: ["Lookup", "Uniqueidentifier"],
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
value: "ne-businessid",
|
|
489
|
-
label: "Not Equals Current Business Unit",
|
|
490
|
-
requiresValue: false,
|
|
491
|
-
applicableTypes: ["Lookup", "Uniqueidentifier"],
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
value: "eq-userteams",
|
|
495
|
-
label: "Equals User Teams",
|
|
496
|
-
requiresValue: false,
|
|
497
|
-
applicableTypes: ["Lookup", "Owner", "Customer", "Uniqueidentifier"],
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
value: "eq-useroruserteams",
|
|
501
|
-
label: "Equals User or User Teams",
|
|
502
|
-
requiresValue: false,
|
|
503
|
-
applicableTypes: ["Lookup", "Owner", "Customer", "Uniqueidentifier"],
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
value: "eq-useroruserhierarchy",
|
|
507
|
-
label: "Equals User or User Hierarchy",
|
|
508
|
-
requiresValue: false,
|
|
509
|
-
applicableTypes: ["Lookup", "Owner", "Customer", "Uniqueidentifier"],
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
value: "eq-useroruserhierarchyandteams",
|
|
513
|
-
label: "Equals User or User Hierarchy and Teams",
|
|
514
|
-
requiresValue: false,
|
|
515
|
-
applicableTypes: ["Lookup", "Owner", "Customer", "Uniqueidentifier"],
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
value: "eq-userlanguage",
|
|
519
|
-
label: "Equals User Language",
|
|
520
|
-
requiresValue: false,
|
|
521
|
-
applicableTypes: ["Integer"],
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
// Special operators
|
|
525
|
-
{
|
|
526
|
-
value: "under",
|
|
527
|
-
label: "Under (hierarchy)",
|
|
528
|
-
requiresValue: true,
|
|
529
|
-
applicableTypes: ["Lookup", "Uniqueidentifier"],
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
value: "not-under",
|
|
533
|
-
label: "Not Under (hierarchy)",
|
|
534
|
-
requiresValue: true,
|
|
535
|
-
applicableTypes: ["Lookup", "Uniqueidentifier"],
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
value: "above",
|
|
539
|
-
label: "Above (hierarchy)",
|
|
540
|
-
requiresValue: true,
|
|
541
|
-
applicableTypes: ["Lookup", "Uniqueidentifier"],
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
value: "eq-or-under",
|
|
545
|
-
label: "Equals or Under (hierarchy)",
|
|
546
|
-
requiresValue: true,
|
|
547
|
-
applicableTypes: ["Lookup", "Uniqueidentifier"],
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
value: "eq-or-above",
|
|
551
|
-
label: "Equals or Above (hierarchy)",
|
|
552
|
-
requiresValue: true,
|
|
553
|
-
applicableTypes: ["Lookup", "Uniqueidentifier"],
|
|
554
|
-
},
|
|
555
|
-
];
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* Get operators applicable to a specific attribute type
|
|
559
|
-
* @param attributeType - The AttributeType from metadata (e.g., 'String', 'Integer', 'DateTime')
|
|
560
|
-
* @returns Array of operator definitions applicable to this type
|
|
561
|
-
*/
|
|
562
|
-
export function getOperatorsForAttributeType(
|
|
563
|
-
attributeType: string | undefined
|
|
564
|
-
): OperatorDefinition[] {
|
|
565
|
-
if (!attributeType) {
|
|
566
|
-
// No type info - return all operators as fallback
|
|
567
|
-
return ALL_OPERATORS;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
// Normalize type name (handle both 'String' and 'StringType' formats)
|
|
571
|
-
const normalizedType = attributeType.replace(/Type$/, "");
|
|
572
|
-
|
|
573
|
-
// Filter operators that support this attribute type
|
|
574
|
-
const filtered = ALL_OPERATORS.filter((op) =>
|
|
575
|
-
op.applicableTypes.some((type) => type.toLowerCase() === normalizedType.toLowerCase())
|
|
576
|
-
);
|
|
577
|
-
|
|
578
|
-
// If no matches found (unknown type), return all as fallback
|
|
579
|
-
return filtered.length > 0 ? filtered : ALL_OPERATORS;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* Check if an operator requires a value input
|
|
584
|
-
* @param operator - The operator to check
|
|
585
|
-
* @returns true if the operator requires a value, false otherwise
|
|
586
|
-
*/
|
|
587
|
-
export function operatorRequiresValue(operator: OperatorType): boolean {
|
|
588
|
-
const definition = ALL_OPERATORS.find((op) => op.value === operator);
|
|
589
|
-
return definition?.requiresValue ?? true; // Default to requiring value if not found
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Get common operators (subset for simpler UIs)
|
|
594
|
-
* These are the most frequently used operators across all types
|
|
595
|
-
*/
|
|
596
|
-
export function getCommonOperators(): OperatorDefinition[] {
|
|
597
|
-
const commonValues: OperatorType[] = [
|
|
598
|
-
"eq",
|
|
599
|
-
"ne",
|
|
600
|
-
"lt",
|
|
601
|
-
"le",
|
|
602
|
-
"gt",
|
|
603
|
-
"ge",
|
|
604
|
-
"like",
|
|
605
|
-
"begins-with",
|
|
606
|
-
"in",
|
|
607
|
-
"not-in",
|
|
608
|
-
"between",
|
|
609
|
-
"null",
|
|
610
|
-
"not-null",
|
|
611
|
-
"today",
|
|
612
|
-
"yesterday",
|
|
613
|
-
"tomorrow",
|
|
614
|
-
"this-week",
|
|
615
|
-
"this-month",
|
|
616
|
-
"this-year",
|
|
617
|
-
"last-x-days",
|
|
618
|
-
"next-x-days",
|
|
619
|
-
"eq-userid",
|
|
620
|
-
"ne-userid",
|
|
621
|
-
];
|
|
622
|
-
|
|
623
|
-
return ALL_OPERATORS.filter((op) => commonValues.includes(op.value));
|
|
624
|
-
}
|