@genesislcap/pbc-reporting-ui 14.396.3 → 14.396.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/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.d.ts.map +1 -1
- package/dist/dts/new/store/slices/datasources-config.d.ts +1 -0
- package/dist/dts/new/store/slices/datasources-config.d.ts.map +1 -1
- package/dist/dts/new/store/store.d.ts +7 -0
- package/dist/dts/new/store/store.d.ts.map +1 -1
- package/dist/esm/new/main/edit-config/col-filters/col-filters-grid.helpers.js +3 -1
- package/dist/esm/new/main/edit-config/col-filters/col-filters-grid.helpers.test.js +33 -0
- package/dist/esm/new/store/slices/datasources-config.js +9 -6
- package/package.json +22 -22
- package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.test.ts +38 -0
- package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.ts +4 -1
- package/src/new/store/slices/datasources-config.ts +13 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"col-filters-grid.helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/new/main/edit-config/col-filters/col-filters-grid.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAQ3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"col-filters-grid.helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/new/main/edit-config/col-filters/col-filters-grid.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAQ3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,IAAI,CAqBvF"}
|
|
@@ -33,6 +33,7 @@ export declare const datasourceSlice: import("@reduxjs/toolkit").Slice<Datasourc
|
|
|
33
33
|
column: string;
|
|
34
34
|
included: boolean;
|
|
35
35
|
type?: Genesis.GenesisFieldTypes;
|
|
36
|
+
setDefaultFormat?: boolean;
|
|
36
37
|
}>): void;
|
|
37
38
|
setFieldsOrder(state: DatasourceConfig, action: PayloadAction<{
|
|
38
39
|
key: DatasourceName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasources-config.d.ts","sourceRoot":"","sources":["../../../../../src/new/store/slices/datasources-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EAErB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,gBAAqB,CAAC;AAEjD,eAAO,MAAM,eAAe;uCAKf,gBAAgB,UACf,aAAa,CAAC;QACpB,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,CAAC;QACnE,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;+BAgCK,gBAAgB,UACf,aAAa,CAAC;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;sCAKvD,gBAAgB,UACf,aAAa,CAAC;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,qBAAqB,CAAA;KAAE,CAAC;4BAIxD,gBAAgB,UAAU,aAAa,CAAC;QAAE,GAAG,EAAE,cAAc,CAAA;KAAE,CAAC;2BAI/E,gBAAgB,UACf,aAAa,CAAC;QACpB,GAAG,EAAE,cAAc,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IAcJ;;OAEG;6BAEM,gBAAgB,UACf,aAAa,CAAC;QACpB,GAAG,EAAE,cAAc,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"datasources-config.d.ts","sourceRoot":"","sources":["../../../../../src/new/store/slices/datasources-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EAErB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,gBAAqB,CAAC;AAEjD,eAAO,MAAM,eAAe;uCAKf,gBAAgB,UACf,aAAa,CAAC;QACpB,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,CAAC;QACnE,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;+BAgCK,gBAAgB,UACf,aAAa,CAAC;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;sCAKvD,gBAAgB,UACf,aAAa,CAAC;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,qBAAqB,CAAA;KAAE,CAAC;4BAIxD,gBAAgB,UAAU,aAAa,CAAC;QAAE,GAAG,EAAE,cAAc,CAAA;KAAE,CAAC;2BAI/E,gBAAgB,UACf,aAAa,CAAC;QACpB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AAgB,OAAO,MAAM,gBAAgB;;;;;;;kCAGpC,gBAAgB,OAAO,cAAc;;;;;2BAG5C,gBAAgB,OAAO,cAAc,UAAU,MAAM;;;;;;;;;;EAQ9E,CAAC"}
|
|
@@ -41,6 +41,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
41
41
|
column: string;
|
|
42
42
|
included: boolean;
|
|
43
43
|
type?: import("../types").Genesis.GenesisFieldTypes;
|
|
44
|
+
setDefaultFormat?: boolean;
|
|
44
45
|
}>): void;
|
|
45
46
|
setFieldsOrder(state: import("./slices").DatasourceConfig, action: import("@reduxjs/toolkit").PayloadAction<{
|
|
46
47
|
key: import("./slices").DatasourceName;
|
|
@@ -134,6 +135,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
134
135
|
column: string;
|
|
135
136
|
included: boolean;
|
|
136
137
|
type?: import("../types").Genesis.GenesisFieldTypes;
|
|
138
|
+
setDefaultFormat?: boolean;
|
|
137
139
|
}>): void;
|
|
138
140
|
setFieldsOrder(state: import("./slices").DatasourceConfig, action: import("@reduxjs/toolkit").PayloadAction<{
|
|
139
141
|
key: import("./slices").DatasourceName;
|
|
@@ -230,6 +232,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
230
232
|
column: string;
|
|
231
233
|
included: boolean;
|
|
232
234
|
type?: import("../types").Genesis.GenesisFieldTypes;
|
|
235
|
+
setDefaultFormat?: boolean;
|
|
233
236
|
}>): void;
|
|
234
237
|
setFieldsOrder(state: import("./slices").DatasourceConfig, action: import("@reduxjs/toolkit").PayloadAction<{
|
|
235
238
|
key: import("./slices").DatasourceName;
|
|
@@ -323,6 +326,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
323
326
|
column: string;
|
|
324
327
|
included: boolean;
|
|
325
328
|
type?: import("../types").Genesis.GenesisFieldTypes;
|
|
329
|
+
setDefaultFormat?: boolean;
|
|
326
330
|
}>): void;
|
|
327
331
|
setFieldsOrder(state: import("./slices").DatasourceConfig, action: import("@reduxjs/toolkit").PayloadAction<{
|
|
328
332
|
key: import("./slices").DatasourceName;
|
|
@@ -416,6 +420,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
416
420
|
column: string;
|
|
417
421
|
included: boolean;
|
|
418
422
|
type?: import("../types").Genesis.GenesisFieldTypes;
|
|
423
|
+
setDefaultFormat?: boolean;
|
|
419
424
|
}>): void;
|
|
420
425
|
setFieldsOrder(state: import("./slices").DatasourceConfig, action: import("@reduxjs/toolkit").PayloadAction<{
|
|
421
426
|
key: import("./slices").DatasourceName;
|
|
@@ -509,6 +514,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
509
514
|
column: string;
|
|
510
515
|
included: boolean;
|
|
511
516
|
type?: import("../types").Genesis.GenesisFieldTypes;
|
|
517
|
+
setDefaultFormat?: boolean;
|
|
512
518
|
}>): void;
|
|
513
519
|
setFieldsOrder(state: import("./slices").DatasourceConfig, action: import("@reduxjs/toolkit").PayloadAction<{
|
|
514
520
|
key: import("./slices").DatasourceName;
|
|
@@ -602,6 +608,7 @@ export declare const store: import("../types").RootStateFromSlices<(import("@red
|
|
|
602
608
|
column: string;
|
|
603
609
|
included: boolean;
|
|
604
610
|
type?: import("../types").Genesis.GenesisFieldTypes;
|
|
611
|
+
setDefaultFormat?: boolean;
|
|
605
612
|
}>): void;
|
|
606
613
|
setFieldsOrder(state: import("./slices").DatasourceConfig, action: import("@reduxjs/toolkit").PayloadAction<{
|
|
607
614
|
key: import("./slices").DatasourceName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/new/store/store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,eAO7B,CAAC;AAEF,eAAO,MACL,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAsB6qE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAApuE,CAAC;wBAAqD,CAAC;;;;;;;;;;;;;oBAA4nE,mEAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAd11I,CAAC;AAE/D,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG,OAAO,QAAQ,CAAC;AAE1C,eAAO,MAAM,eAAe,GAAI,OAAO,eAAe,SAGrD,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,eAGhC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { actions } from '../../../store';
|
|
1
|
+
import { actions, selectors } from '../../../store';
|
|
2
2
|
import { GridColumnNames, datasourceNameFromDisplay, lookupColumnIsIncluded, shouldDisableColumn, } from '../shared';
|
|
3
3
|
/**
|
|
4
4
|
* Handler for row selection changes in the grid
|
|
@@ -14,11 +14,13 @@ export function rowSelectionChangedHandler(event) {
|
|
|
14
14
|
return;
|
|
15
15
|
if (shouldDisableColumn(event.data))
|
|
16
16
|
return;
|
|
17
|
+
const setDefaultFormat = selectors.baseConfig.getConfig().OUTPUT_FORMAT !== 'XLSX';
|
|
17
18
|
actions.datasourceConfig.setColumnIncluded({
|
|
18
19
|
key: datasourceNameFromDisplay(event.data[GridColumnNames.Datasource]),
|
|
19
20
|
column: event.data[GridColumnNames.ColumnName],
|
|
20
21
|
included: (_b = event.node.isSelected()) !== null && _b !== void 0 ? _b : true,
|
|
21
22
|
type: event.data[GridColumnNames.Type],
|
|
23
|
+
setDefaultFormat,
|
|
22
24
|
});
|
|
23
25
|
event.api.redrawRows();
|
|
24
26
|
}
|
|
@@ -7,6 +7,7 @@ import { rowSelectionChangedHandler } from './col-filters-grid.helpers';
|
|
|
7
7
|
const RowSelectionChangedHandler = suite('rowSelectionChangedHandler');
|
|
8
8
|
RowSelectionChangedHandler.before.each(() => {
|
|
9
9
|
sinon.restore();
|
|
10
|
+
sinon.stub(selectors.baseConfig, 'getConfig').returns({ OUTPUT_FORMAT: 'CSV' });
|
|
10
11
|
});
|
|
11
12
|
RowSelectionChangedHandler('should return early if event.data is undefined', () => {
|
|
12
13
|
const event = { data: undefined };
|
|
@@ -100,8 +101,39 @@ RowSelectionChangedHandler('should update include and redraw when selection chan
|
|
|
100
101
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].key, 'REQ_REP_TEST');
|
|
101
102
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].column, 'testColumn');
|
|
102
103
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].included, false);
|
|
104
|
+
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, true);
|
|
103
105
|
assert.equal(mockEvent.api.redrawRows.calledOnce, true);
|
|
104
106
|
});
|
|
107
|
+
RowSelectionChangedHandler('should not set default format if output format is XLSX', () => {
|
|
108
|
+
selectors.baseConfig.getConfig.returns({ OUTPUT_FORMAT: 'XLSX' });
|
|
109
|
+
const mockData = {
|
|
110
|
+
[GridColumnNames.Datasource]: 'TEST (Snapshot)',
|
|
111
|
+
[GridColumnNames.ColumnName]: 'testColumn',
|
|
112
|
+
[GridColumnNames.Type]: 'INT',
|
|
113
|
+
};
|
|
114
|
+
const mockEvent = {
|
|
115
|
+
data: mockData,
|
|
116
|
+
node: {
|
|
117
|
+
isSelected: sinon.stub().returns(false),
|
|
118
|
+
},
|
|
119
|
+
api: {
|
|
120
|
+
redrawRows: sinon.stub(),
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
const setColumnIncludedStub = sinon.stub(actions.datasourceConfig, 'setColumnIncluded');
|
|
124
|
+
sinon.stub(selectors.datasourceConfig, 'getDatasource').returns({
|
|
125
|
+
KEY: 'test',
|
|
126
|
+
NAME: 'Test Datasource',
|
|
127
|
+
INPUT_TYPE: 'REQ_REP',
|
|
128
|
+
OUTPUT_TYPE: 'TABLE',
|
|
129
|
+
TRANSFORMER_CONFIGURATION: {
|
|
130
|
+
INCLUDE_COLUMNS: ['testColumn'],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
rowSelectionChangedHandler(mockEvent);
|
|
134
|
+
assert.equal(setColumnIncludedStub.calledOnce, true);
|
|
135
|
+
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, false);
|
|
136
|
+
});
|
|
105
137
|
RowSelectionChangedHandler('should handle undefined selection state', () => {
|
|
106
138
|
const mockData = {
|
|
107
139
|
[GridColumnNames.Datasource]: 'TEST (Snapshot)',
|
|
@@ -130,6 +162,7 @@ RowSelectionChangedHandler('should handle undefined selection state', () => {
|
|
|
130
162
|
rowSelectionChangedHandler(mockEvent);
|
|
131
163
|
assert.equal(setColumnIncludedStub.calledOnce, true);
|
|
132
164
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].included, true);
|
|
165
|
+
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, true);
|
|
133
166
|
assert.equal(mockEvent.api.redrawRows.calledOnce, true);
|
|
134
167
|
});
|
|
135
168
|
RowSelectionChangedHandler.run();
|
|
@@ -59,17 +59,20 @@ export const datasourceSlice = createSlice({
|
|
|
59
59
|
*/
|
|
60
60
|
setColumnIncluded(state, action) {
|
|
61
61
|
var _a, _b;
|
|
62
|
-
const { key, column, included, type } = action.payload;
|
|
62
|
+
const { key, column, included, type, setDefaultFormat = true } = action.payload;
|
|
63
63
|
if (included) {
|
|
64
64
|
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS = [
|
|
65
65
|
...((_a = state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS) !== null && _a !== void 0 ? _a : []),
|
|
66
66
|
column,
|
|
67
67
|
];
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
const defaultFormat = getDefaultFormat(type);
|
|
69
|
+
if (defaultFormat && setDefaultFormat) {
|
|
70
|
+
datasourceSlice.caseReducers.setColumnFormat(state, Object.assign(Object.assign({}, action), { payload: {
|
|
71
|
+
key,
|
|
72
|
+
column,
|
|
73
|
+
format: defaultFormat,
|
|
74
|
+
} }));
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
else {
|
|
75
78
|
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS = ((_b = state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS) !== null && _b !== void 0 ? _b : []).filter((col) => col !== column);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/pbc-reporting-ui",
|
|
3
3
|
"description": "Genesis PBC Reporting UI",
|
|
4
|
-
"version": "14.396.
|
|
4
|
+
"version": "14.396.4",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/dts/index.d.ts",
|
|
@@ -104,21 +104,21 @@
|
|
|
104
104
|
"@ag-grid-community/core": "29.2.0"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@genesislcap/foundation-comms": "14.396.
|
|
108
|
-
"@genesislcap/foundation-entity-management": "14.396.
|
|
109
|
-
"@genesislcap/foundation-events": "14.396.
|
|
110
|
-
"@genesislcap/foundation-forms": "14.396.
|
|
111
|
-
"@genesislcap/foundation-logger": "14.396.
|
|
112
|
-
"@genesislcap/foundation-notifications": "14.396.
|
|
113
|
-
"@genesislcap/foundation-ui": "14.396.
|
|
114
|
-
"@genesislcap/foundation-user": "14.396.
|
|
115
|
-
"@genesislcap/foundation-utils": "14.396.
|
|
116
|
-
"@genesislcap/foundation-zero": "14.396.
|
|
117
|
-
"@genesislcap/foundation-zero-grid-pro": "14.396.
|
|
118
|
-
"@genesislcap/grid-pro": "14.396.
|
|
119
|
-
"@genesislcap/rapid-design-system": "14.396.
|
|
120
|
-
"@genesislcap/rapid-grid-pro": "14.396.
|
|
121
|
-
"@genesislcap/web-core": "14.396.
|
|
107
|
+
"@genesislcap/foundation-comms": "14.396.4",
|
|
108
|
+
"@genesislcap/foundation-entity-management": "14.396.4",
|
|
109
|
+
"@genesislcap/foundation-events": "14.396.4",
|
|
110
|
+
"@genesislcap/foundation-forms": "14.396.4",
|
|
111
|
+
"@genesislcap/foundation-logger": "14.396.4",
|
|
112
|
+
"@genesislcap/foundation-notifications": "14.396.4",
|
|
113
|
+
"@genesislcap/foundation-ui": "14.396.4",
|
|
114
|
+
"@genesislcap/foundation-user": "14.396.4",
|
|
115
|
+
"@genesislcap/foundation-utils": "14.396.4",
|
|
116
|
+
"@genesislcap/foundation-zero": "14.396.4",
|
|
117
|
+
"@genesislcap/foundation-zero-grid-pro": "14.396.4",
|
|
118
|
+
"@genesislcap/grid-pro": "14.396.4",
|
|
119
|
+
"@genesislcap/rapid-design-system": "14.396.4",
|
|
120
|
+
"@genesislcap/rapid-grid-pro": "14.396.4",
|
|
121
|
+
"@genesislcap/web-core": "14.396.4",
|
|
122
122
|
"@reduxjs/toolkit": "^2.2.5",
|
|
123
123
|
"@types/node": "^22.10.2",
|
|
124
124
|
"change-case": "^5.4.3",
|
|
@@ -127,11 +127,11 @@
|
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"@genesiscommunitysuccess/cep-fast-plugin": "^5.0.3",
|
|
129
129
|
"@genesiscommunitysuccess/custom-elements-lsp": "^5.0.3",
|
|
130
|
-
"@genesislcap/eslint-config": "14.396.
|
|
131
|
-
"@genesislcap/foundation-testing": "14.396.
|
|
132
|
-
"@genesislcap/genx": "14.396.
|
|
133
|
-
"@genesislcap/prettier-config": "14.396.
|
|
134
|
-
"@genesislcap/stylelint-config": "14.396.
|
|
130
|
+
"@genesislcap/eslint-config": "14.396.4",
|
|
131
|
+
"@genesislcap/foundation-testing": "14.396.4",
|
|
132
|
+
"@genesislcap/genx": "14.396.4",
|
|
133
|
+
"@genesislcap/prettier-config": "14.396.4",
|
|
134
|
+
"@genesislcap/stylelint-config": "14.396.4",
|
|
135
135
|
"@types/json-schema": "^7.0.11",
|
|
136
136
|
"playwright-lighthouse": "^4.0.0",
|
|
137
137
|
"rimraf": "^5.0.0"
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"access": "public"
|
|
141
141
|
},
|
|
142
142
|
"customElements": "dist/custom-elements.json",
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "22b084a85ffa76ae84a99415b8600f69402f5ad2"
|
|
144
144
|
}
|
|
@@ -12,6 +12,7 @@ const RowSelectionChangedHandler = suite('rowSelectionChangedHandler');
|
|
|
12
12
|
|
|
13
13
|
RowSelectionChangedHandler.before.each(() => {
|
|
14
14
|
sinon.restore();
|
|
15
|
+
sinon.stub(selectors.baseConfig, 'getConfig').returns({ OUTPUT_FORMAT: 'CSV' } as any);
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
RowSelectionChangedHandler('should return early if event.data is undefined', () => {
|
|
@@ -121,9 +122,45 @@ RowSelectionChangedHandler('should update include and redraw when selection chan
|
|
|
121
122
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].key, 'REQ_REP_TEST');
|
|
122
123
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].column, 'testColumn');
|
|
123
124
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].included, false);
|
|
125
|
+
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, true);
|
|
124
126
|
assert.equal((<any>mockEvent.api.redrawRows).calledOnce, true);
|
|
125
127
|
});
|
|
126
128
|
|
|
129
|
+
RowSelectionChangedHandler('should not set default format if output format is XLSX', () => {
|
|
130
|
+
(selectors.baseConfig.getConfig as any).returns({ OUTPUT_FORMAT: 'XLSX' });
|
|
131
|
+
const mockData = {
|
|
132
|
+
[GridColumnNames.Datasource]: 'TEST (Snapshot)',
|
|
133
|
+
[GridColumnNames.ColumnName]: 'testColumn',
|
|
134
|
+
[GridColumnNames.Type]: 'INT',
|
|
135
|
+
} as ColFilterData;
|
|
136
|
+
|
|
137
|
+
const mockEvent = {
|
|
138
|
+
data: mockData,
|
|
139
|
+
node: {
|
|
140
|
+
isSelected: sinon.stub().returns(false),
|
|
141
|
+
},
|
|
142
|
+
api: {
|
|
143
|
+
redrawRows: sinon.stub(),
|
|
144
|
+
},
|
|
145
|
+
} as unknown as RowSelectedEvent<ColFilterData>;
|
|
146
|
+
|
|
147
|
+
const setColumnIncludedStub = sinon.stub(actions.datasourceConfig, 'setColumnIncluded');
|
|
148
|
+
sinon.stub(selectors.datasourceConfig, 'getDatasource').returns({
|
|
149
|
+
KEY: 'test',
|
|
150
|
+
NAME: 'Test Datasource',
|
|
151
|
+
INPUT_TYPE: 'REQ_REP' as const,
|
|
152
|
+
OUTPUT_TYPE: 'TABLE' as const,
|
|
153
|
+
TRANSFORMER_CONFIGURATION: <TransformerConfig>{
|
|
154
|
+
INCLUDE_COLUMNS: ['testColumn'],
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
rowSelectionChangedHandler(mockEvent);
|
|
159
|
+
|
|
160
|
+
assert.equal(setColumnIncludedStub.calledOnce, true);
|
|
161
|
+
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, false);
|
|
162
|
+
});
|
|
163
|
+
|
|
127
164
|
RowSelectionChangedHandler('should handle undefined selection state', () => {
|
|
128
165
|
const mockData = {
|
|
129
166
|
[GridColumnNames.Datasource]: 'TEST (Snapshot)',
|
|
@@ -156,6 +193,7 @@ RowSelectionChangedHandler('should handle undefined selection state', () => {
|
|
|
156
193
|
|
|
157
194
|
assert.equal(setColumnIncludedStub.calledOnce, true);
|
|
158
195
|
assert.equal(setColumnIncludedStub.getCall(0).args[0].included, true);
|
|
196
|
+
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, true);
|
|
159
197
|
assert.equal((<any>mockEvent.api.redrawRows).calledOnce, true);
|
|
160
198
|
});
|
|
161
199
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RowSelectedEvent } from '@ag-grid-community/core';
|
|
2
|
-
import { actions } from '../../../store';
|
|
2
|
+
import { actions, selectors } from '../../../store';
|
|
3
3
|
import {
|
|
4
4
|
GridColumnNames,
|
|
5
5
|
datasourceNameFromDisplay,
|
|
@@ -21,11 +21,14 @@ export function rowSelectionChangedHandler(event: RowSelectedEvent<ColFilterData
|
|
|
21
21
|
|
|
22
22
|
if (shouldDisableColumn(event.data)) return;
|
|
23
23
|
|
|
24
|
+
const setDefaultFormat = selectors.baseConfig.getConfig().OUTPUT_FORMAT !== 'XLSX';
|
|
25
|
+
|
|
24
26
|
actions.datasourceConfig.setColumnIncluded({
|
|
25
27
|
key: datasourceNameFromDisplay(event.data[GridColumnNames.Datasource]),
|
|
26
28
|
column: event.data[GridColumnNames.ColumnName],
|
|
27
29
|
included: event.node.isSelected() ?? true,
|
|
28
30
|
type: event.data[GridColumnNames.Type],
|
|
31
|
+
setDefaultFormat,
|
|
29
32
|
});
|
|
30
33
|
|
|
31
34
|
event.api.redrawRows();
|
|
@@ -100,22 +100,26 @@ export const datasourceSlice = createSlice({
|
|
|
100
100
|
column: string;
|
|
101
101
|
included: boolean;
|
|
102
102
|
type?: Genesis.GenesisFieldTypes;
|
|
103
|
+
setDefaultFormat?: boolean;
|
|
103
104
|
}>,
|
|
104
105
|
) {
|
|
105
|
-
const { key, column, included, type } = action.payload;
|
|
106
|
+
const { key, column, included, type, setDefaultFormat = true } = action.payload;
|
|
106
107
|
if (included) {
|
|
107
108
|
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS = [
|
|
108
109
|
...(state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS ?? []),
|
|
109
110
|
column,
|
|
110
111
|
];
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
const defaultFormat = getDefaultFormat(type);
|
|
113
|
+
if (defaultFormat && setDefaultFormat) {
|
|
114
|
+
datasourceSlice.caseReducers.setColumnFormat(state, {
|
|
115
|
+
...action,
|
|
116
|
+
payload: {
|
|
117
|
+
key,
|
|
118
|
+
column,
|
|
119
|
+
format: defaultFormat,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}
|
|
119
123
|
} else {
|
|
120
124
|
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS = (
|
|
121
125
|
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS ?? []
|