@qrvey/utils 1.2.10-2 → 1.2.10-5
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 +6 -0
- package/bitbucket-pipelines.yml +1 -1
- package/dist/cjs/columns/helpers/getModelColumn.js +1 -1
- package/dist/cjs/filters/adapters/UIToFD.js +2 -1
- package/dist/cjs/filters/adapters/adaptDateGroupingProperty.d.ts +2 -2
- package/dist/cjs/filters/adapters/adaptDateGroupingProperty.js +2 -2
- package/dist/cjs/filters/helpers/applyHierarchyForAggFilters.d.ts +3 -3
- package/dist/cjs/filters/helpers/applyHierarchyForAggFilters.js +3 -3
- package/dist/cjs/filters/helpers/backend/getAggFiltersBySummaryIndex.d.ts +5 -3
- package/dist/cjs/filters/helpers/backend/getAggFiltersBySummaryIndex.js +5 -3
- package/dist/cjs/filters/helpers/backend/getBackendValues.js +3 -1
- package/dist/cjs/filters/helpers/getAggFiltersFromFilterData.d.ts +5 -4
- package/dist/cjs/filters/helpers/getAggFiltersFromFilterData.js +5 -5
- package/dist/cjs/filters/helpers/ui/getUIValues.d.ts +4 -5
- package/dist/cjs/filters/helpers/ui/getUIValues.js +4 -5
- package/dist/cjs/format/localization.js +2 -1
- package/dist/cjs/general/object/get.d.ts +0 -20
- package/dist/cjs/general/object/get.js +0 -20
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderConditionalFormatting.d.ts +2 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.js +2 -0
- package/dist/columns/helpers/getModelColumn.js +1 -1
- package/dist/filters/adapters/UIToFD.js +2 -1
- package/dist/filters/adapters/adaptDateGroupingProperty.d.ts +2 -2
- package/dist/filters/adapters/adaptDateGroupingProperty.js +2 -2
- package/dist/filters/helpers/applyHierarchyForAggFilters.d.ts +3 -3
- package/dist/filters/helpers/applyHierarchyForAggFilters.js +3 -3
- package/dist/filters/helpers/backend/getAggFiltersBySummaryIndex.d.ts +5 -3
- package/dist/filters/helpers/backend/getAggFiltersBySummaryIndex.js +5 -3
- package/dist/filters/helpers/backend/getBackendValues.js +3 -1
- package/dist/filters/helpers/getAggFiltersFromFilterData.d.ts +5 -4
- package/dist/filters/helpers/getAggFiltersFromFilterData.js +5 -5
- package/dist/filters/helpers/ui/getUIValues.d.ts +4 -5
- package/dist/filters/helpers/ui/getUIValues.js +4 -5
- package/dist/format/localization.js +2 -1
- package/dist/general/object/get.d.ts +0 -20
- package/dist/general/object/get.js +0 -20
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderConditionalFormatting.d.ts +2 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.js +2 -0
- package/jsdoc.config.json +14 -0
- package/package.json +3 -1
- package/publishing.js +191 -0
- package/src/columns/helpers/getModelColumn.ts +1 -1
- package/src/filters/adapters/UIToFD.ts +2 -1
- package/src/filters/adapters/adaptDateGroupingProperty.ts +2 -2
- package/src/filters/helpers/applyHierarchyForAggFilters.ts +3 -3
- package/src/filters/helpers/backend/getAggFiltersBySummaryIndex.ts +5 -3
- package/src/filters/helpers/backend/getBackendValues.ts +3 -1
- package/src/filters/helpers/getAggFiltersFromFilterData.ts +5 -5
- package/src/filters/helpers/ui/getUIValues.ts +4 -5
- package/src/format/localization.ts +2 -1
- package/src/general/object/get.ts +0 -22
- package/src/globalization/interfaces/chart_builder/II18nChartBuilderConditionalFormatting.ts +2 -0
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.ts +2 -0
package/README.md
CHANGED
package/bitbucket-pipelines.yml
CHANGED
|
@@ -24,9 +24,10 @@ function UIToFD(uFilterData) {
|
|
|
24
24
|
exports.UIToFD = UIToFD;
|
|
25
25
|
/**
|
|
26
26
|
* Builds the Fitler Data structure from UI filter data
|
|
27
|
+
* @private
|
|
27
28
|
* @param uFilterData The UI filter Data object
|
|
28
29
|
* @param version the version of the structure
|
|
29
|
-
* @returns
|
|
30
|
+
* @returns a Filter Data structure
|
|
30
31
|
*/
|
|
31
32
|
function UI21ToFD(uFilterData, version) {
|
|
32
33
|
return {
|
|
@@ -2,7 +2,7 @@ import { IFProperty } from "../interfaces/IFProperty";
|
|
|
2
2
|
/**
|
|
3
3
|
* [TODO: For 2022, eliminate this adapter]
|
|
4
4
|
* Get the new property base on the old date grouping properties
|
|
5
|
-
* @param property
|
|
6
|
-
* @returns
|
|
5
|
+
* @param property the property to be adapted
|
|
6
|
+
* @returns a adapted property
|
|
7
7
|
*/
|
|
8
8
|
export declare function adaptDateGroupingProperty(property: IFProperty | any): IFProperty;
|
|
@@ -6,8 +6,8 @@ const DATE_DISTINCT_TIME_PROPERTY_1 = require("../../dates/constants/DATE_DISTIN
|
|
|
6
6
|
/**
|
|
7
7
|
* [TODO: For 2022, eliminate this adapter]
|
|
8
8
|
* Get the new property base on the old date grouping properties
|
|
9
|
-
* @param property
|
|
10
|
-
* @returns
|
|
9
|
+
* @param property the property to be adapted
|
|
10
|
+
* @returns a adapted property
|
|
11
11
|
*/
|
|
12
12
|
function adaptDateGroupingProperty(property) {
|
|
13
13
|
return property === 'p&quarter' ? DATE_DISTINCT_PROPERTY_1.DATE_DISTINCT_PROPERTY.YEAR_QUARTER :
|
|
@@ -4,8 +4,8 @@ import { IFUChartSettings } from "../interfaces/ui/IFUChartSettings";
|
|
|
4
4
|
/**
|
|
5
5
|
* [TODO: Make a proper description for this function]
|
|
6
6
|
* @param chartSettings Chart Settings for the Filter Builder
|
|
7
|
-
* @param scopes
|
|
8
|
-
* @param currentScope
|
|
9
|
-
* @returns
|
|
7
|
+
* @param scopes the pair id/label scopes
|
|
8
|
+
* @param currentScope the scope to be validated
|
|
9
|
+
* @returns the chart settings
|
|
10
10
|
*/
|
|
11
11
|
export declare function applyHierarchyForAggFilters(chartSettings: IFUChartSettings, scopes?: IFSScopeID[], currentScope?: IFScope): IFUChartSettings;
|
|
@@ -8,9 +8,9 @@ const getScopesByHierarchy_1 = require("./getScopesByHierarchy");
|
|
|
8
8
|
/**
|
|
9
9
|
* [TODO: Make a proper description for this function]
|
|
10
10
|
* @param chartSettings Chart Settings for the Filter Builder
|
|
11
|
-
* @param scopes
|
|
12
|
-
* @param currentScope
|
|
13
|
-
* @returns
|
|
11
|
+
* @param scopes the pair id/label scopes
|
|
12
|
+
* @param currentScope the scope to be validated
|
|
13
|
+
* @returns the chart settings
|
|
14
14
|
*/
|
|
15
15
|
function applyHierarchyForAggFilters(chartSettings, scopes = [], currentScope = FILTER_SCOPE_1.FILTER_SCOPE.GLOBAL) {
|
|
16
16
|
if ((0, isEmpty_1.isEmpty)(chartSettings))
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IFBFilterAggregate } from "../../interfaces/backend/IFBFilterAggregate";
|
|
2
2
|
/**
|
|
3
|
+
* @todo Make a proper description for this function
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @
|
|
5
|
+
* Gets the aggFilters structure by an index
|
|
6
|
+
* @param aggFilters The aggFilter Structure
|
|
7
|
+
* @param summaryIndex an index
|
|
8
|
+
* @returns a new aggFilters structure
|
|
7
9
|
*/
|
|
8
10
|
export declare function getAggFiltersBySummaryIndex(aggFilters: IFBFilterAggregate, summaryIndex: number): IFBFilterAggregate;
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAggFiltersBySummaryIndex = void 0;
|
|
4
4
|
const filterNestedTree_1 = require("../../../general/array/filterNestedTree");
|
|
5
5
|
/**
|
|
6
|
+
* @todo Make a proper description for this function
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
* @param
|
|
9
|
-
* @
|
|
8
|
+
* Gets the aggFilters structure by an index
|
|
9
|
+
* @param aggFilters The aggFilter Structure
|
|
10
|
+
* @param summaryIndex an index
|
|
11
|
+
* @returns a new aggFilters structure
|
|
10
12
|
*/
|
|
11
13
|
function getAggFiltersBySummaryIndex(aggFilters, summaryIndex) {
|
|
12
14
|
if (!aggFilters)
|
|
@@ -68,9 +68,10 @@ function getBackendValues(filter) {
|
|
|
68
68
|
exports.getBackendValues = getBackendValues;
|
|
69
69
|
/**
|
|
70
70
|
* Gets the expression values. Depending on the column type
|
|
71
|
+
* @private
|
|
71
72
|
* @param values a collection of filter values
|
|
72
73
|
* @param filter The filter structure
|
|
73
|
-
* @returns
|
|
74
|
+
* @returns Expression values
|
|
74
75
|
*/
|
|
75
76
|
function getResultValues(values, filter) {
|
|
76
77
|
return (values || []).map((value) => {
|
|
@@ -86,6 +87,7 @@ function getResultValues(values, filter) {
|
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
88
89
|
* Gets the Ranking values.
|
|
90
|
+
* @private
|
|
89
91
|
* @param values a collection of filter values in the ranking structure
|
|
90
92
|
* @param rankingGroupIndex determine the value by this index to build and return it
|
|
91
93
|
* @returns Expression values for ranking
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IFBFilterAggregate } from "../interfaces/backend/IFBFilterAggregate";
|
|
2
2
|
import { IFSData } from "../interfaces/common/IFSData";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
* @param
|
|
7
|
-
* @
|
|
4
|
+
* @todo FIX AGGREGATE FILTERS
|
|
5
|
+
* @private
|
|
6
|
+
* @param filterData
|
|
7
|
+
* @param _summaries
|
|
8
|
+
* @returns the aggFilters structure
|
|
8
9
|
*/
|
|
9
10
|
export declare function getAggFiltersFromFilterData(filterData: IFSData, _summaries: any[]): IFBFilterAggregate;
|
|
@@ -4,12 +4,12 @@ exports.getAggFiltersFromFilterData = void 0;
|
|
|
4
4
|
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
5
5
|
const getFiltersByAggregateColumn_1 = require("./common/getFiltersByAggregateColumn");
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
* @param
|
|
10
|
-
* @
|
|
7
|
+
* @todo FIX AGGREGATE FILTERS
|
|
8
|
+
* @private
|
|
9
|
+
* @param filterData
|
|
10
|
+
* @param _summaries
|
|
11
|
+
* @returns the aggFilters structure
|
|
11
12
|
*/
|
|
12
|
-
// [TODO: FILTERS - FIX AGGREGATE FILTERS]
|
|
13
13
|
function getAggFiltersFromFilterData(filterData, _summaries) {
|
|
14
14
|
filterData = Object.assign({}, (0, getFiltersByAggregateColumn_1.getFiltersByAggregateColumn)(filterData));
|
|
15
15
|
if ((0, isEmpty_1.isEmpty)(filterData))
|
|
@@ -2,10 +2,9 @@ import { IFSFilter } from "../../interfaces/common/IFSFilter";
|
|
|
2
2
|
import { IFUValue } from "../../interfaces/ui/IFUValue";
|
|
3
3
|
import { IFUUIValueSettings } from "../../interfaces/ui/IFUUIValueSettings";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param filter
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
9
|
-
* @returns
|
|
5
|
+
* Gets the UI Values generated depending on the validator
|
|
6
|
+
* @param filter the filter structure
|
|
7
|
+
* @param settings a settings for this function
|
|
8
|
+
* @returns the UI Values
|
|
10
9
|
*/
|
|
11
10
|
export declare function getUIValues(filter: IFSFilter, settings?: IFUUIValueSettings): IFUValue[];
|
|
@@ -10,11 +10,10 @@ const flattenDeep_1 = require("../../../general/array/flattenDeep");
|
|
|
10
10
|
const RELATIVE_CURSOR_INFO_1 = require("../../../dates/relative/constants/RELATIVE_CURSOR_INFO");
|
|
11
11
|
const getI18nDateGroupLabel_1 = require("../../../globalization/helpers/getI18nDateGroupLabel");
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param filter
|
|
15
|
-
* @param
|
|
16
|
-
* @
|
|
17
|
-
* @returns
|
|
13
|
+
* Gets the UI Values generated depending on the validator
|
|
14
|
+
* @param filter the filter structure
|
|
15
|
+
* @param settings a settings for this function
|
|
16
|
+
* @returns the UI Values
|
|
18
17
|
*/
|
|
19
18
|
function getUIValues(filter, settings) {
|
|
20
19
|
var _a;
|
|
@@ -32,7 +32,8 @@ const formatWithLocale = (value, outputFormat, config = {}) => {
|
|
|
32
32
|
exports.formatWithLocale = formatWithLocale;
|
|
33
33
|
function formatLocaleDate(value, outputFormat, config) {
|
|
34
34
|
const { lang = definition_1.LANG_DEFAULT, options } = config;
|
|
35
|
-
const
|
|
35
|
+
const dateValue = value === null || value === void 0 ? void 0 : value.replace('.000Z', '');
|
|
36
|
+
const dateParam = new Date(dateValue);
|
|
36
37
|
let langOpts = options;
|
|
37
38
|
if (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.originalFormat) {
|
|
38
39
|
const { format } = outputFormat.originalFormat;
|
|
@@ -27,23 +27,3 @@
|
|
|
27
27
|
* @returns the resolved value.
|
|
28
28
|
*/
|
|
29
29
|
export declare function _get<T = any>(baseObject: T, path: string | string[], defaultValue?: any): any;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* /**
|
|
33
|
-
* Like lodash _.get.
|
|
34
|
-
* Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
|
|
35
|
-
* @param baseObject The object to query
|
|
36
|
-
* @param path The path of the property to get.
|
|
37
|
-
* @param defaultValue The value returned for undefined resolved values.
|
|
38
|
-
* @returns the resolved value.
|
|
39
|
-
export function get(baseObject: any, path: string, defaultValue?: any): any {
|
|
40
|
-
function fn() {
|
|
41
|
-
try {
|
|
42
|
-
const value = eval(`this.${path}`.replace('.[', '['));
|
|
43
|
-
return typeof value !== 'undefined' ? value : defaultValue;
|
|
44
|
-
} catch (e) { return defaultValue; }
|
|
45
|
-
}
|
|
46
|
-
return fn.apply(baseObject, null);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
*/
|
|
@@ -45,23 +45,3 @@ function validateToReturnDefaultValue(baseObject, path) {
|
|
|
45
45
|
path == null ||
|
|
46
46
|
(typeof path !== 'string' && !Array.isArray(path));
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* /**
|
|
51
|
-
* Like lodash _.get.
|
|
52
|
-
* Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
|
|
53
|
-
* @param baseObject The object to query
|
|
54
|
-
* @param path The path of the property to get.
|
|
55
|
-
* @param defaultValue The value returned for undefined resolved values.
|
|
56
|
-
* @returns the resolved value.
|
|
57
|
-
export function get(baseObject: any, path: string, defaultValue?: any): any {
|
|
58
|
-
function fn() {
|
|
59
|
-
try {
|
|
60
|
-
const value = eval(`this.${path}`.replace('.[', '['));
|
|
61
|
-
return typeof value !== 'undefined' ? value : defaultValue;
|
|
62
|
-
} catch (e) { return defaultValue; }
|
|
63
|
-
}
|
|
64
|
-
return fn.apply(baseObject, null);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
*/
|
|
@@ -20,9 +20,10 @@ export function UIToFD(uFilterData) {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Builds the Fitler Data structure from UI filter data
|
|
23
|
+
* @private
|
|
23
24
|
* @param uFilterData The UI filter Data object
|
|
24
25
|
* @param version the version of the structure
|
|
25
|
-
* @returns
|
|
26
|
+
* @returns a Filter Data structure
|
|
26
27
|
*/
|
|
27
28
|
function UI21ToFD(uFilterData, version) {
|
|
28
29
|
return {
|
|
@@ -2,7 +2,7 @@ import { IFProperty } from "../interfaces/IFProperty";
|
|
|
2
2
|
/**
|
|
3
3
|
* [TODO: For 2022, eliminate this adapter]
|
|
4
4
|
* Get the new property base on the old date grouping properties
|
|
5
|
-
* @param property
|
|
6
|
-
* @returns
|
|
5
|
+
* @param property the property to be adapted
|
|
6
|
+
* @returns a adapted property
|
|
7
7
|
*/
|
|
8
8
|
export declare function adaptDateGroupingProperty(property: IFProperty | any): IFProperty;
|
|
@@ -3,8 +3,8 @@ import { DATE_DISTINCT_TIME_PROPERTY } from "../../dates/constants/DATE_DISTINCT
|
|
|
3
3
|
/**
|
|
4
4
|
* [TODO: For 2022, eliminate this adapter]
|
|
5
5
|
* Get the new property base on the old date grouping properties
|
|
6
|
-
* @param property
|
|
7
|
-
* @returns
|
|
6
|
+
* @param property the property to be adapted
|
|
7
|
+
* @returns a adapted property
|
|
8
8
|
*/
|
|
9
9
|
export function adaptDateGroupingProperty(property) {
|
|
10
10
|
return property === 'p&quarter' ? DATE_DISTINCT_PROPERTY.YEAR_QUARTER :
|
|
@@ -4,8 +4,8 @@ import { IFUChartSettings } from "../interfaces/ui/IFUChartSettings";
|
|
|
4
4
|
/**
|
|
5
5
|
* [TODO: Make a proper description for this function]
|
|
6
6
|
* @param chartSettings Chart Settings for the Filter Builder
|
|
7
|
-
* @param scopes
|
|
8
|
-
* @param currentScope
|
|
9
|
-
* @returns
|
|
7
|
+
* @param scopes the pair id/label scopes
|
|
8
|
+
* @param currentScope the scope to be validated
|
|
9
|
+
* @returns the chart settings
|
|
10
10
|
*/
|
|
11
11
|
export declare function applyHierarchyForAggFilters(chartSettings: IFUChartSettings, scopes?: IFSScopeID[], currentScope?: IFScope): IFUChartSettings;
|
|
@@ -5,9 +5,9 @@ import { getScopesByHierarchy } from "./getScopesByHierarchy";
|
|
|
5
5
|
/**
|
|
6
6
|
* [TODO: Make a proper description for this function]
|
|
7
7
|
* @param chartSettings Chart Settings for the Filter Builder
|
|
8
|
-
* @param scopes
|
|
9
|
-
* @param currentScope
|
|
10
|
-
* @returns
|
|
8
|
+
* @param scopes the pair id/label scopes
|
|
9
|
+
* @param currentScope the scope to be validated
|
|
10
|
+
* @returns the chart settings
|
|
11
11
|
*/
|
|
12
12
|
export function applyHierarchyForAggFilters(chartSettings, scopes = [], currentScope = FILTER_SCOPE.GLOBAL) {
|
|
13
13
|
if (isEmpty(chartSettings))
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IFBFilterAggregate } from "../../interfaces/backend/IFBFilterAggregate";
|
|
2
2
|
/**
|
|
3
|
+
* @todo Make a proper description for this function
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @
|
|
5
|
+
* Gets the aggFilters structure by an index
|
|
6
|
+
* @param aggFilters The aggFilter Structure
|
|
7
|
+
* @param summaryIndex an index
|
|
8
|
+
* @returns a new aggFilters structure
|
|
7
9
|
*/
|
|
8
10
|
export declare function getAggFiltersBySummaryIndex(aggFilters: IFBFilterAggregate, summaryIndex: number): IFBFilterAggregate;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { filterNestedTree } from "../../../general/array/filterNestedTree";
|
|
2
2
|
/**
|
|
3
|
+
* @todo Make a proper description for this function
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @
|
|
5
|
+
* Gets the aggFilters structure by an index
|
|
6
|
+
* @param aggFilters The aggFilter Structure
|
|
7
|
+
* @param summaryIndex an index
|
|
8
|
+
* @returns a new aggFilters structure
|
|
7
9
|
*/
|
|
8
10
|
export function getAggFiltersBySummaryIndex(aggFilters, summaryIndex) {
|
|
9
11
|
if (!aggFilters)
|
|
@@ -64,9 +64,10 @@ export function getBackendValues(filter) {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Gets the expression values. Depending on the column type
|
|
67
|
+
* @private
|
|
67
68
|
* @param values a collection of filter values
|
|
68
69
|
* @param filter The filter structure
|
|
69
|
-
* @returns
|
|
70
|
+
* @returns Expression values
|
|
70
71
|
*/
|
|
71
72
|
function getResultValues(values, filter) {
|
|
72
73
|
return (values || []).map((value) => {
|
|
@@ -82,6 +83,7 @@ function getResultValues(values, filter) {
|
|
|
82
83
|
}
|
|
83
84
|
/**
|
|
84
85
|
* Gets the Ranking values.
|
|
86
|
+
* @private
|
|
85
87
|
* @param values a collection of filter values in the ranking structure
|
|
86
88
|
* @param rankingGroupIndex determine the value by this index to build and return it
|
|
87
89
|
* @returns Expression values for ranking
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IFBFilterAggregate } from "../interfaces/backend/IFBFilterAggregate";
|
|
2
2
|
import { IFSData } from "../interfaces/common/IFSData";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
* @param
|
|
7
|
-
* @
|
|
4
|
+
* @todo FIX AGGREGATE FILTERS
|
|
5
|
+
* @private
|
|
6
|
+
* @param filterData
|
|
7
|
+
* @param _summaries
|
|
8
|
+
* @returns the aggFilters structure
|
|
8
9
|
*/
|
|
9
10
|
export declare function getAggFiltersFromFilterData(filterData: IFSData, _summaries: any[]): IFBFilterAggregate;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isEmpty } from "../../general/mix/isEmpty";
|
|
2
2
|
import { getFiltersByAggregateColumn } from "./common/getFiltersByAggregateColumn";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
* @param
|
|
7
|
-
* @
|
|
4
|
+
* @todo FIX AGGREGATE FILTERS
|
|
5
|
+
* @private
|
|
6
|
+
* @param filterData
|
|
7
|
+
* @param _summaries
|
|
8
|
+
* @returns the aggFilters structure
|
|
8
9
|
*/
|
|
9
|
-
// [TODO: FILTERS - FIX AGGREGATE FILTERS]
|
|
10
10
|
export function getAggFiltersFromFilterData(filterData, _summaries) {
|
|
11
11
|
filterData = Object.assign({}, getFiltersByAggregateColumn(filterData));
|
|
12
12
|
if (isEmpty(filterData))
|
|
@@ -2,10 +2,9 @@ import { IFSFilter } from "../../interfaces/common/IFSFilter";
|
|
|
2
2
|
import { IFUValue } from "../../interfaces/ui/IFUValue";
|
|
3
3
|
import { IFUUIValueSettings } from "../../interfaces/ui/IFUUIValueSettings";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param filter
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
9
|
-
* @returns
|
|
5
|
+
* Gets the UI Values generated depending on the validator
|
|
6
|
+
* @param filter the filter structure
|
|
7
|
+
* @param settings a settings for this function
|
|
8
|
+
* @returns the UI Values
|
|
10
9
|
*/
|
|
11
10
|
export declare function getUIValues(filter: IFSFilter, settings?: IFUUIValueSettings): IFUValue[];
|
|
@@ -7,11 +7,10 @@ import { flattenDeep } from "../../../general/array/flattenDeep";
|
|
|
7
7
|
import { RELATIVE_CURSOR_INFO } from "../../../dates/relative/constants/RELATIVE_CURSOR_INFO";
|
|
8
8
|
import { getI18nDateGroupLabel } from "../../../globalization/helpers/getI18nDateGroupLabel";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param filter
|
|
12
|
-
* @param
|
|
13
|
-
* @
|
|
14
|
-
* @returns
|
|
10
|
+
* Gets the UI Values generated depending on the validator
|
|
11
|
+
* @param filter the filter structure
|
|
12
|
+
* @param settings a settings for this function
|
|
13
|
+
* @returns the UI Values
|
|
15
14
|
*/
|
|
16
15
|
export function getUIValues(filter, settings) {
|
|
17
16
|
var _a;
|
|
@@ -26,7 +26,8 @@ export const formatWithLocale = (value, outputFormat, config = {}) => {
|
|
|
26
26
|
};
|
|
27
27
|
function formatLocaleDate(value, outputFormat, config) {
|
|
28
28
|
const { lang = LANG_DEFAULT, options } = config;
|
|
29
|
-
const
|
|
29
|
+
const dateValue = value === null || value === void 0 ? void 0 : value.replace('.000Z', '');
|
|
30
|
+
const dateParam = new Date(dateValue);
|
|
30
31
|
let langOpts = options;
|
|
31
32
|
if (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.originalFormat) {
|
|
32
33
|
const { format } = outputFormat.originalFormat;
|
|
@@ -27,23 +27,3 @@
|
|
|
27
27
|
* @returns the resolved value.
|
|
28
28
|
*/
|
|
29
29
|
export declare function _get<T = any>(baseObject: T, path: string | string[], defaultValue?: any): any;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* /**
|
|
33
|
-
* Like lodash _.get.
|
|
34
|
-
* Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
|
|
35
|
-
* @param baseObject The object to query
|
|
36
|
-
* @param path The path of the property to get.
|
|
37
|
-
* @param defaultValue The value returned for undefined resolved values.
|
|
38
|
-
* @returns the resolved value.
|
|
39
|
-
export function get(baseObject: any, path: string, defaultValue?: any): any {
|
|
40
|
-
function fn() {
|
|
41
|
-
try {
|
|
42
|
-
const value = eval(`this.${path}`.replace('.[', '['));
|
|
43
|
-
return typeof value !== 'undefined' ? value : defaultValue;
|
|
44
|
-
} catch (e) { return defaultValue; }
|
|
45
|
-
}
|
|
46
|
-
return fn.apply(baseObject, null);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
*/
|
|
@@ -41,23 +41,3 @@ function validateToReturnDefaultValue(baseObject, path) {
|
|
|
41
41
|
path == null ||
|
|
42
42
|
(typeof path !== 'string' && !Array.isArray(path));
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* /**
|
|
47
|
-
* Like lodash _.get.
|
|
48
|
-
* Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
|
|
49
|
-
* @param baseObject The object to query
|
|
50
|
-
* @param path The path of the property to get.
|
|
51
|
-
* @param defaultValue The value returned for undefined resolved values.
|
|
52
|
-
* @returns the resolved value.
|
|
53
|
-
export function get(baseObject: any, path: string, defaultValue?: any): any {
|
|
54
|
-
function fn() {
|
|
55
|
-
try {
|
|
56
|
-
const value = eval(`this.${path}`.replace('.[', '['));
|
|
57
|
-
return typeof value !== 'undefined' ? value : defaultValue;
|
|
58
|
-
} catch (e) { return defaultValue; }
|
|
59
|
-
}
|
|
60
|
-
return fn.apply(baseObject, null);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": ["plugins/markdown"],
|
|
3
|
+
"source": {
|
|
4
|
+
"include": ["./dist"],
|
|
5
|
+
"exclude": ["./node_modules", "./src"],
|
|
6
|
+
"includePattern": "./dist/.+\\.js",
|
|
7
|
+
"excludePattern": "./dist/cjs/.+\\.js"
|
|
8
|
+
},
|
|
9
|
+
"opts": {
|
|
10
|
+
"package": "./package.json",
|
|
11
|
+
"readme": "./README.md",
|
|
12
|
+
"recurse": true
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qrvey/utils",
|
|
3
|
-
"version": "1.2.10-
|
|
3
|
+
"version": "1.2.10-5",
|
|
4
4
|
"description": "Helper, Utils for all Qrvey Projects",
|
|
5
5
|
"homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc && tsc -m commonjs --outDir dist/cjs",
|
|
9
|
+
"docs": "./node_modules/.bin/jsdoc -c ./jsdoc.config.json",
|
|
9
10
|
"publishing": "node prepareToPublish.js && np",
|
|
10
11
|
"publishing-prerelease": "node prepareToPublish.js && np --any-branch --tag=$npm_config_tag",
|
|
12
|
+
"publishing-v2": "node publishing.js --np-new-version=$npm_config_np_new_version --np-any-branch=$npm_config_np_any_branch --np-tag=$npm_config_np_tag",
|
|
11
13
|
"test": "jest test",
|
|
12
14
|
"test:watch": "jest --watch test",
|
|
13
15
|
"lint": "eslint src --quiet --exit-on-fatal-error --ext .ts,.js",
|
package/publishing.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// IN DEVELOPMENT
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const util = require('util');
|
|
4
|
+
const childProcess = require('child_process');
|
|
5
|
+
const exec = util.promisify(childProcess.exec);
|
|
6
|
+
const spawn = childProcess.spawn;
|
|
7
|
+
const proc = require('process');
|
|
8
|
+
const readline = require("readline");
|
|
9
|
+
const { exit } = require('process');
|
|
10
|
+
const rl = readline.createInterface({
|
|
11
|
+
input: proc.stdin,
|
|
12
|
+
output: proc.stdout
|
|
13
|
+
});
|
|
14
|
+
const question = util.promisify(rl.question).bind(rl);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
async function execute(command) {
|
|
18
|
+
console.log(command);
|
|
19
|
+
const response = await exec(command);
|
|
20
|
+
if (response.error != null) {
|
|
21
|
+
throw new Error(response.error);
|
|
22
|
+
}
|
|
23
|
+
if (response.stderr != null && response.stderr !== '') {
|
|
24
|
+
console.error(response.stderr);
|
|
25
|
+
}
|
|
26
|
+
if (response.stdout != null && response.stdout !== '') {
|
|
27
|
+
console.log(response.stdout);
|
|
28
|
+
}
|
|
29
|
+
return response;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function spawning(command, sArguments) {
|
|
33
|
+
let newProcess;
|
|
34
|
+
await new Promise(function (resolve, reject) {
|
|
35
|
+
newProcess = spawn(command, sArguments, { shell: true });
|
|
36
|
+
newProcess.stdout.on("data", data => {
|
|
37
|
+
console.log(`stdout: ${data}`);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
newProcess.stderr.on("data", data => {
|
|
41
|
+
console.log(`stderr: ${data}`);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
newProcess.on('error', (_error) => {
|
|
45
|
+
newProcess.stdin.pause();
|
|
46
|
+
newProcess.stdin.destroy();
|
|
47
|
+
newProcess.stdout.pause();
|
|
48
|
+
newProcess.stdout.destroy();
|
|
49
|
+
newProcess.kill();
|
|
50
|
+
reject();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
newProcess.on("close", code => {
|
|
54
|
+
newProcess.stdin.pause();
|
|
55
|
+
newProcess.stdin.destroy();
|
|
56
|
+
newProcess.stdout.pause();
|
|
57
|
+
newProcess.stdout.destroy();
|
|
58
|
+
newProcess.kill();
|
|
59
|
+
if (code == '1') {
|
|
60
|
+
reject();
|
|
61
|
+
}
|
|
62
|
+
resolve();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function getPackageJson(settings) {
|
|
68
|
+
console.log('==>>> Opening package.json file...');
|
|
69
|
+
const packageJson = await fs.readFileSync(settings.packagePath, 'utf8');
|
|
70
|
+
const packageObject = JSON.parse(packageJson);
|
|
71
|
+
if (packageObject != null) {
|
|
72
|
+
console.log(`**** The current version is ${packageObject.version}`);
|
|
73
|
+
return packageObject.version;
|
|
74
|
+
}
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function getNewVersion() {
|
|
79
|
+
console.log('==>>> Checking the new version provided...');
|
|
80
|
+
let newVersion;
|
|
81
|
+
const versionIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-new-version='); });
|
|
82
|
+
if (versionIndex > -1) {
|
|
83
|
+
const versionArg = proc.argv[versionIndex].split('--np-new-version=');
|
|
84
|
+
newVersion = versionArg[1] == null || versionArg[1] === '' ? undefined : versionArg[1];
|
|
85
|
+
}
|
|
86
|
+
if (newVersion == null) {
|
|
87
|
+
newVersion = question('No version provided. Type the new version: ');
|
|
88
|
+
}
|
|
89
|
+
console.log('**** Version to publish: ' + newVersion);
|
|
90
|
+
return newVersion;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function cleaningProject(settings) {
|
|
94
|
+
console.log('==>>> Cleaning project...');
|
|
95
|
+
await execute(`rm -f ${settings.packageLockPath}`);
|
|
96
|
+
await execute(`rm -f -R ${settings.nodeModulesPath}`);
|
|
97
|
+
await execute(`rm -f -R ${settings.distPath}`);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function buildingBundle(_settings) {
|
|
101
|
+
console.log('==>>> Installing Dependencies...');
|
|
102
|
+
await execute('npm install');
|
|
103
|
+
|
|
104
|
+
console.log('==>>> Generating Build...');
|
|
105
|
+
await execute('npm run build');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async function startPublishingVersion(settings) {
|
|
109
|
+
await callingPublisher(settings);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async function callingPublisher(settings) {
|
|
113
|
+
console.log('==>>> Calling Publisher');
|
|
114
|
+
let anyBranch = '', tag = '';
|
|
115
|
+
const anyBranchIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-any-branch='); });
|
|
116
|
+
const tagIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-tag='); });
|
|
117
|
+
if (anyBranchIndex > -1) {
|
|
118
|
+
const anyBranchArg = proc.argv[anyBranchIndex].split('--np-any-branch=');
|
|
119
|
+
anyBranch = anyBranchArg[1] == null || anyBranchArg[1] === '' ? '' : '--any-branch';
|
|
120
|
+
}
|
|
121
|
+
if (tagIndex > -1) {
|
|
122
|
+
const tagArg = proc.argv[tagIndex].split('--np-tag=');
|
|
123
|
+
tag = tagArg[1] == null || tagArg[1] === '' ? '' : proc.argv[tagIndex].replace('--np-tag=', '--tag=');
|
|
124
|
+
}
|
|
125
|
+
await spawning(`np ${settings.newVersion}`, [anyBranch, tag]);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function startGeneratingDocs(settings) {
|
|
129
|
+
console.log('==>>> Starting the Docs generation');
|
|
130
|
+
|
|
131
|
+
await generatingDocument(settings);
|
|
132
|
+
await pushingChanges(settings);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async function generatingDocument(settings) {
|
|
136
|
+
console.log('==>>> Generating Document...');
|
|
137
|
+
await execute(`doxdox './dist/.+\\.js' --output ${settings.docsFileName} --ignore './dist/cjs/.+\\.js' --package ${settings.packagePath}`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async function pushingChanges(settings) {
|
|
141
|
+
console.log('==>>> Commiting and Pushing Docs changes...');
|
|
142
|
+
|
|
143
|
+
const gitStdout = await execute('git rev-parse --abbrev-ref HEAD');
|
|
144
|
+
console.log('gitStdout', gitStdout);
|
|
145
|
+
await execute(`git add ${settings.docsPath}`);
|
|
146
|
+
await execute(`git commit -m "📝 docs: Updated docs${settings.newVersion != null || settings.newVersion !== '' ? ' for ' + settings.newVersion : ''}"`);
|
|
147
|
+
await execute(`git push -u origin ${gitStdout.stdout}`);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async function revertChanges(settings) {
|
|
151
|
+
console.log('>>> Checking for modifications...');
|
|
152
|
+
console.warn(`>>> Unstaging posible changes from ${settings.docsFileName} and ${settings.packageFileName} file`);
|
|
153
|
+
await execute(`git restore --staged ${settings.docsPath} ${settings.packagePath}`);
|
|
154
|
+
console.warn(`>>> Discarting posible changes of ${settings.docsFileName} and ${settings.packageFileName} file`);
|
|
155
|
+
await execute(`git checkout -- ${settings.docsPath} ${settings.packagePath}`);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function init() {
|
|
159
|
+
let settings = {
|
|
160
|
+
currentVersion: '',
|
|
161
|
+
distPath: './dist',
|
|
162
|
+
docsPath: './README.md',
|
|
163
|
+
docsFileName: 'README.md',
|
|
164
|
+
newVersion: undefined,
|
|
165
|
+
nodeModulesPath: './node_modules',
|
|
166
|
+
packageFileName: 'package.json',
|
|
167
|
+
packageLockPath: './package-lock.json',
|
|
168
|
+
packagePath: './package.json',
|
|
169
|
+
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
console.log('Welcome. The publishing operationg will begin.');
|
|
173
|
+
try {
|
|
174
|
+
settings["currentVersion"] = await getPackageJson(settings);
|
|
175
|
+
settings["newVersion"] = await getNewVersion();
|
|
176
|
+
|
|
177
|
+
await cleaningProject(settings);
|
|
178
|
+
await buildingBundle(settings);
|
|
179
|
+
await startPublishingVersion(settings);
|
|
180
|
+
await startGeneratingDocs(settings);
|
|
181
|
+
console.info('Finished Publishing');
|
|
182
|
+
} catch (err) {
|
|
183
|
+
console.error('Error: ', err);
|
|
184
|
+
await revertChanges(settings);
|
|
185
|
+
} finally {
|
|
186
|
+
console.log('Execution finished');
|
|
187
|
+
exit();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
init();
|
|
@@ -24,6 +24,6 @@ export function getModelColumn(column: Partial<IColumn>, model: IModel): IColumn
|
|
|
24
24
|
* @returns the question data array from model object
|
|
25
25
|
*/
|
|
26
26
|
function getQuestionData(model: IModel): IColumn[] {
|
|
27
|
-
debugger
|
|
27
|
+
// debugger
|
|
28
28
|
return _get(model, 'questions.data', []);
|
|
29
29
|
}
|
|
@@ -27,9 +27,10 @@ import { IFUScope } from "../interfaces/ui/IFUScope";
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Builds the Fitler Data structure from UI filter data
|
|
30
|
+
* @private
|
|
30
31
|
* @param uFilterData The UI filter Data object
|
|
31
32
|
* @param version the version of the structure
|
|
32
|
-
* @returns
|
|
33
|
+
* @returns a Filter Data structure
|
|
33
34
|
*/
|
|
34
35
|
function UI21ToFD(uFilterData: IFUData, version): IFSData {
|
|
35
36
|
return {
|
|
@@ -5,8 +5,8 @@ import { DATE_DISTINCT_TIME_PROPERTY } from "../../dates/constants/DATE_DISTINCT
|
|
|
5
5
|
/**
|
|
6
6
|
* [TODO: For 2022, eliminate this adapter]
|
|
7
7
|
* Get the new property base on the old date grouping properties
|
|
8
|
-
* @param property
|
|
9
|
-
* @returns
|
|
8
|
+
* @param property the property to be adapted
|
|
9
|
+
* @returns a adapted property
|
|
10
10
|
*/
|
|
11
11
|
export function adaptDateGroupingProperty(property: IFProperty | any): IFProperty {
|
|
12
12
|
return property === 'p&quarter' ? DATE_DISTINCT_PROPERTY.YEAR_QUARTER :
|
|
@@ -9,9 +9,9 @@ import { getScopesByHierarchy } from "./getScopesByHierarchy";
|
|
|
9
9
|
/**
|
|
10
10
|
* [TODO: Make a proper description for this function]
|
|
11
11
|
* @param chartSettings Chart Settings for the Filter Builder
|
|
12
|
-
* @param scopes
|
|
13
|
-
* @param currentScope
|
|
14
|
-
* @returns
|
|
12
|
+
* @param scopes the pair id/label scopes
|
|
13
|
+
* @param currentScope the scope to be validated
|
|
14
|
+
* @returns the chart settings
|
|
15
15
|
*/
|
|
16
16
|
export function applyHierarchyForAggFilters(chartSettings: IFUChartSettings, scopes: IFSScopeID[] = [], currentScope: IFScope = FILTER_SCOPE.GLOBAL): IFUChartSettings {
|
|
17
17
|
if (isEmpty(chartSettings)) return;
|
|
@@ -2,10 +2,12 @@ import { filterNestedTree } from "../../../general/array/filterNestedTree";
|
|
|
2
2
|
import { IFBFilterAggregate } from "../../interfaces/backend/IFBFilterAggregate";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* @todo Make a proper description for this function
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
7
|
+
* Gets the aggFilters structure by an index
|
|
8
|
+
* @param aggFilters The aggFilter Structure
|
|
9
|
+
* @param summaryIndex an index
|
|
10
|
+
* @returns a new aggFilters structure
|
|
9
11
|
*/
|
|
10
12
|
export function getAggFiltersBySummaryIndex(aggFilters: IFBFilterAggregate, summaryIndex: number): IFBFilterAggregate {
|
|
11
13
|
if (!aggFilters) return undefined;
|
|
@@ -75,9 +75,10 @@ export function getBackendValues(filter: IFSFilter): IFBackendExpressionValue[]
|
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Gets the expression values. Depending on the column type
|
|
78
|
+
* @private
|
|
78
79
|
* @param values a collection of filter values
|
|
79
80
|
* @param filter The filter structure
|
|
80
|
-
* @returns
|
|
81
|
+
* @returns Expression values
|
|
81
82
|
*/
|
|
82
83
|
function getResultValues(values: IFSValue[], filter: IFSFilter): IFBExpressionValue[] {
|
|
83
84
|
return (values || []).map((value: IFSValue) => {
|
|
@@ -93,6 +94,7 @@ function getResultValues(values: IFSValue[], filter: IFSFilter): IFBExpressionVa
|
|
|
93
94
|
|
|
94
95
|
/**
|
|
95
96
|
* Gets the Ranking values.
|
|
97
|
+
* @private
|
|
96
98
|
* @param values a collection of filter values in the ranking structure
|
|
97
99
|
* @param rankingGroupIndex determine the value by this index to build and return it
|
|
98
100
|
* @returns Expression values for ranking
|
|
@@ -4,12 +4,12 @@ import { IFSData } from "../interfaces/common/IFSData";
|
|
|
4
4
|
import { getFiltersByAggregateColumn } from "./common/getFiltersByAggregateColumn";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
* @param
|
|
10
|
-
* @
|
|
7
|
+
* @todo FIX AGGREGATE FILTERS
|
|
8
|
+
* @private
|
|
9
|
+
* @param filterData
|
|
10
|
+
* @param _summaries
|
|
11
|
+
* @returns the aggFilters structure
|
|
11
12
|
*/
|
|
12
|
-
// [TODO: FILTERS - FIX AGGREGATE FILTERS]
|
|
13
13
|
export function getAggFiltersFromFilterData(filterData: IFSData, _summaries: any[]): IFBFilterAggregate {
|
|
14
14
|
filterData = { ...getFiltersByAggregateColumn(filterData) };
|
|
15
15
|
if (isEmpty(filterData)) return;
|
|
@@ -16,11 +16,10 @@ import { getI18nDateGroupLabel } from "../../../globalization/helpers/getI18nDat
|
|
|
16
16
|
import { IDateColumnPropertyType } from "../../../columns/interfaces/IDateColumnPropertyType";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param filter
|
|
21
|
-
* @param
|
|
22
|
-
* @
|
|
23
|
-
* @returns
|
|
19
|
+
* Gets the UI Values generated depending on the validator
|
|
20
|
+
* @param filter the filter structure
|
|
21
|
+
* @param settings a settings for this function
|
|
22
|
+
* @returns the UI Values
|
|
24
23
|
*/
|
|
25
24
|
export function getUIValues(filter: IFSFilter, settings?: IFUUIValueSettings): IFUValue[] {
|
|
26
25
|
settings = getUiValuesSettings(settings);
|
|
@@ -29,7 +29,8 @@ export const formatWithLocale = (value: any, outputFormat: IFormatOutputFormat,
|
|
|
29
29
|
|
|
30
30
|
function formatLocaleDate(value: any, outputFormat: IFormatOutputFormat, config: IFormatConfig) {
|
|
31
31
|
const { lang = LANG_DEFAULT, options } = config;
|
|
32
|
-
const
|
|
32
|
+
const dateValue = value?.replace('.000Z', '');
|
|
33
|
+
const dateParam = new Date(dateValue);
|
|
33
34
|
let langOpts = options;
|
|
34
35
|
if (outputFormat?.originalFormat) {
|
|
35
36
|
const { format } = outputFormat.originalFormat;
|
|
@@ -42,25 +42,3 @@ function validateToReturnDefaultValue(baseObject: any, path: string | string[]):
|
|
|
42
42
|
path == null ||
|
|
43
43
|
(typeof path !== 'string' && !Array.isArray(path));
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* /**
|
|
50
|
-
* Like lodash _.get.
|
|
51
|
-
* Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
|
|
52
|
-
* @param baseObject The object to query
|
|
53
|
-
* @param path The path of the property to get.
|
|
54
|
-
* @param defaultValue The value returned for undefined resolved values.
|
|
55
|
-
* @returns the resolved value.
|
|
56
|
-
export function get(baseObject: any, path: string, defaultValue?: any): any {
|
|
57
|
-
function fn() {
|
|
58
|
-
try {
|
|
59
|
-
const value = eval(`this.${path}`.replace('.[', '['));
|
|
60
|
-
return typeof value !== 'undefined' ? value : defaultValue;
|
|
61
|
-
} catch (e) { return defaultValue; }
|
|
62
|
-
}
|
|
63
|
-
return fn.apply(baseObject, null);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
*/
|