@qrvey/utils 1.18.15 → 1.18.16

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.18.15*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.18.16*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -5,6 +5,7 @@ exports.formatDeltaColumnCaption = formatDeltaColumnCaption;
5
5
  exports.formatReferenceColumnCaption = formatReferenceColumnCaption;
6
6
  exports.stripColumnMarker = stripColumnMarker;
7
7
  exports.resolveComparativeColumnCaption = resolveComparativeColumnCaption;
8
+ exports.isNullDateOperator = isNullDateOperator;
8
9
  exports.formatPeriodLabel = formatPeriodLabel;
9
10
  exports.formatComparativePeriodCaption = formatComparativePeriodCaption;
10
11
  exports.formatDeltaDefaultCaption = formatDeltaDefaultCaption;
@@ -79,7 +80,13 @@ function resolveComparativeColumnCaption(chartModel, columnKey, allDatesText) {
79
80
  return formatDeltaColumnCaption(customLabels[dataFieldKey]);
80
81
  return formatDeltaDefaultCaption(comparativeAnalisis.referencePeriod, comparativeAnalisis.compareTo, fallbackAllDates, defaultName);
81
82
  }
83
+ function isNullDateOperator(operator) {
84
+ const id = String(operator?.label ?? operator?.key ?? "").toUpperCase();
85
+ return id === "IS_NULL" || id === "IS_NOT_NULL";
86
+ }
82
87
  function formatPeriodLabel(period, allDatesText) {
88
+ if (isNullDateOperator(period?.operator))
89
+ return period.operator.text || allDatesText;
83
90
  if (period?.customLabel)
84
91
  return period.customLabel;
85
92
  if (!period?.date1)
@@ -323,7 +330,7 @@ function buildComparativeChartComparison(myBus, chart, groups) {
323
330
  if (!periodData || !periodData.operator)
324
331
  return null;
325
332
  const operatorLabel = periodData.operator.label;
326
- const isNullType = operatorLabel === "IS_NULL" || operatorLabel === "IS_NOT_NULL";
333
+ const isNullType = isNullDateOperator(periodData.operator);
327
334
  if (!isNullType && !periodData.date1)
328
335
  return null;
329
336
  const validationType = mapOperatorToValidationType(operatorLabel);
@@ -11,6 +11,7 @@ export interface ComparativeVirtualColumn {
11
11
  deltaDataField?: string;
12
12
  extraDeltaDataFields?: string[];
13
13
  }
14
+ export declare function isNullDateOperator(operator: any): boolean;
14
15
  export declare function formatPeriodLabel(period: any, allDatesText: string): string;
15
16
  export declare function formatComparativePeriodCaption(period: any, allDatesText: string, colLabel?: string): string;
16
17
  export declare function formatDeltaDefaultCaption(referencePeriod: any, compareTo: any, allDatesText: string, colLabel?: string): string;
@@ -60,7 +60,13 @@ export function resolveComparativeColumnCaption(chartModel, columnKey, allDatesT
60
60
  return formatDeltaColumnCaption(customLabels[dataFieldKey]);
61
61
  return formatDeltaDefaultCaption(comparativeAnalisis.referencePeriod, comparativeAnalisis.compareTo, fallbackAllDates, defaultName);
62
62
  }
63
+ export function isNullDateOperator(operator) {
64
+ const id = String(operator?.label ?? operator?.key ?? "").toUpperCase();
65
+ return id === "IS_NULL" || id === "IS_NOT_NULL";
66
+ }
63
67
  export function formatPeriodLabel(period, allDatesText) {
68
+ if (isNullDateOperator(period?.operator))
69
+ return period.operator.text || allDatesText;
64
70
  if (period?.customLabel)
65
71
  return period.customLabel;
66
72
  if (!period?.date1)
@@ -304,7 +310,7 @@ export function buildComparativeChartComparison(myBus, chart, groups) {
304
310
  if (!periodData || !periodData.operator)
305
311
  return null;
306
312
  const operatorLabel = periodData.operator.label;
307
- const isNullType = operatorLabel === "IS_NULL" || operatorLabel === "IS_NOT_NULL";
313
+ const isNullType = isNullDateOperator(periodData.operator);
308
314
  if (!isNullType && !periodData.date1)
309
315
  return null;
310
316
  const validationType = mapOperatorToValidationType(operatorLabel);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.18.15",
3
+ "version": "1.18.16",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/cjs/index.js",