@genesislcap/pbc-reporting-ui 1.0.366 → 1.0.367

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.
@@ -1 +1 @@
1
- {"version":3,"file":"rapid-components.d.ts","sourceRoot":"","sources":["../../../src/components/rapid-components.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,eAAO,MAAM,6BAA6B,qBA0BzC,CAAC"}
1
+ {"version":3,"file":"rapid-components.d.ts","sourceRoot":"","sources":["../../../src/components/rapid-components.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,eAAO,MAAM,6BAA6B,qBAgCzC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './config';
2
2
  export * from './main';
3
+ export * from './sandbox';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
@@ -23,6 +23,7 @@ export declare class FoundationReporting extends GenesisElement {
23
23
  activeReport: any;
24
24
  notifications: Notification[];
25
25
  datasourceSettings: any;
26
+ ready: boolean;
26
27
  config: ReportingConfig;
27
28
  listBox: HTMLElement;
28
29
  reportsGrid: List;
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAiB,cAAc,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,OAAO,EAAE,YAAY,EAA2B,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,qBAKa,mBAAoB,SAAQ,cAAc;IAC5C,OAAO,EAAG,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,YAAY,QAAM;IAClB,YAAY,EAAE,GAAG,CAAM;IACvB,aAAa,EAAE,YAAY,EAAE,CAAM;IACnC,kBAAkB,MAAC;IACd,MAAM,EAAG,eAAe,CAAC;IAEnC,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,EAAG,IAAI,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IAEZ,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;IAOtC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBjC,MAAM;IAKN,IAAI,CAAC,OAAO,KAAA;IAQN,GAAG,CAAC,OAAO,KAAA;IAQjB,UAAU,CAAC,GAAG,EAAE,MAAM;IAIhB,SAAS,CAAC,YAAY,EAAE,MAAM;CAO5C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAKa,cAAe,SAAQ,mBAAmB;IACrD;;OAEG;IACG,iBAAiB;IAKvB;;OAEG;cACa,WAAW;CAI5B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAKa,aAAc,SAAQ,mBAAmB;IACpD;;OAEG;IACG,iBAAiB;IAKvB;;OAEG;cACa,WAAW;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,aAAa;CAAG"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAiB,cAAc,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,OAAO,EAAE,YAAY,EAA2B,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,qBAKa,mBAAoB,SAAQ,cAAc;IAC5C,OAAO,EAAG,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,YAAY,QAAM;IAClB,YAAY,EAAE,GAAG,CAAM;IACvB,aAAa,EAAE,YAAY,EAAE,CAAM;IACnC,kBAAkB,MAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACV,MAAM,EAAG,eAAe,CAAC;IAEnC,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,EAAG,IAAI,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IAEZ,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;IAOtC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBjC,MAAM;IAKN,IAAI,CAAC,OAAO,KAAA;IAQN,GAAG,CAAC,OAAO,KAAA;IAQjB,UAAU,CAAC,GAAG,EAAE,MAAM;IAIhB,SAAS,CAAC,YAAY,EAAE,MAAM;CAO5C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAKa,cAAe,SAAQ,mBAAmB;IACrD;;OAEG;IACG,iBAAiB;IAKvB;;OAEG;cACa,WAAW;CAK5B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAKa,aAAc,SAAQ,mBAAmB;IACpD;;OAEG;IACG,iBAAiB;IAKvB;;OAEG;cACa,WAAW;CAK5B;AAED;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,aAAa;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQ9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAgExC,eAAO,MAAM,YAAY,8BAiDxB,CAAC"}
1
+ {"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQ9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAgExC,eAAO,MAAM,YAAY,8BAiDrB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { GenesisElement } from "@genesislcap/web-core";
2
+ import { Auth, Connect } from "@genesislcap/foundation-comms";
3
+ export declare class ReportingSandbox extends GenesisElement {
4
+ connect: Connect;
5
+ auth: Auth;
6
+ ready: boolean;
7
+ connectedCallback(): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAC,IAAI,EAAY,OAAO,EAAC,MAAM,+BAA+B,CAAC;AAEtE,qBAOa,gBAAiB,SAAQ,cAAc;IACvC,OAAO,EAAG,OAAO,CAAC;IACrB,IAAI,EAAG,IAAI,CAAC;IACN,KAAK,UAAS;IAEpB,iBAAiB;CAe1B"}
@@ -1,4 +1,4 @@
1
- import { __awaiter, __decorate } from "tslib";
1
+ import { __decorate } from "tslib";
2
2
  import { Connect } from '@genesislcap/foundation-comms';
3
3
  import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
4
4
  import { ReportingEventListeners } from '../../main/types';
@@ -12,11 +12,11 @@ let CreateEdit = class CreateEdit extends GenesisElement {
12
12
  /**
13
13
  * Create report save handle
14
14
  */
15
- this.saveReport = (isEdit, body) => __awaiter(this, void 0, void 0, function* () {
15
+ this.saveReport = async (isEdit, body) => {
16
16
  let notification = null;
17
17
  const payload = Object.assign(Object.assign({}, body), { REPORT_COLUMNS: JSON.stringify(body['REPORT_COLUMNS']) });
18
18
  const event = isEdit ? 'EVENT_SAVED_REPORTS_UPDATE' : 'EVENT_SAVED_REPORTS_INSERT';
19
- const result = yield this.connect.commitEvent(event, {
19
+ const result = await this.connect.commitEvent(event, {
20
20
  DETAILS: Object.assign(Object.assign({}, payload), (isEdit ? { REPORT_ID: this.report.REPORT_ID } : {})),
21
21
  IGNORE_WARNINGS: true,
22
22
  VALIDATE: false,
@@ -39,7 +39,7 @@ let CreateEdit = class CreateEdit extends GenesisElement {
39
39
  };
40
40
  }
41
41
  this.$emit(ReportingEventListeners.notify, notification);
42
- });
42
+ };
43
43
  }
44
44
  /**
45
45
  * Trigger parent event listReports that navigates to list reports tab
@@ -1,4 +1,4 @@
1
- import { __awaiter, __decorate } from "tslib";
1
+ import { __decorate } from "tslib";
2
2
  import { Connect } from '@genesislcap/foundation-comms';
3
3
  import { getActionsMenuDef } from '@genesislcap/grid-pro';
4
4
  import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
@@ -54,54 +54,47 @@ let List = class List extends GenesisElement {
54
54
  },
55
55
  }, actionsOpenIcon());
56
56
  }
57
- connectedCallback() {
58
- const _super = Object.create(null, {
59
- connectedCallback: { get: () => super.connectedCallback }
60
- });
61
- return __awaiter(this, void 0, void 0, function* () {
62
- _super.connectedCallback.call(this);
63
- this.grid.addEventListener('onGridReady', () => {
64
- window.addEventListener('resize', () => {
65
- setTimeout(() => {
66
- var _a, _b;
67
- (_b = (_a = this.grid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
68
- });
69
- });
70
- this.grid.gridApi.addEventListener('firstDataRendered', () => {
57
+ async connectedCallback() {
58
+ super.connectedCallback();
59
+ this.grid.addEventListener('onGridReady', () => {
60
+ window.addEventListener('resize', () => {
61
+ setTimeout(() => {
71
62
  var _a, _b;
72
63
  (_b = (_a = this.grid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
73
64
  });
74
- this.grid.gridApi.addEventListener('selectionChanged', () => {
75
- this.selectedRows = this.grid.gridApi.getSelectedRows();
76
- this.dispatchEvent(this.slectionEvent);
77
- });
65
+ });
66
+ this.grid.gridApi.addEventListener('firstDataRendered', () => {
67
+ var _a, _b;
68
+ (_b = (_a = this.grid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
69
+ });
70
+ this.grid.gridApi.addEventListener('selectionChanged', () => {
71
+ this.selectedRows = this.grid.gridApi.getSelectedRows();
72
+ this.dispatchEvent(this.slectionEvent);
78
73
  });
79
74
  });
80
75
  }
81
- delete(rowData) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- let notification = null;
84
- const { REPORT_ID } = rowData;
85
- const result = yield this.connect.commitEvent('EVENT_SAVED_REPORTS_DELETE', {
86
- DETAILS: { REPORT_ID },
87
- IGNORE_WARNINGS: true,
88
- VALIDATE: false,
89
- });
90
- result.MESSAGE_TYPE === 'EVENT_ACK'
91
- ? (notification = {
92
- message: `'${rowData.REPORT_NAME}' was deleted`,
93
- title: 'Success:',
94
- type: 'success',
95
- autoClose: true,
96
- })
97
- : (notification = {
98
- message: `'${rowData.REPORT_NAME}' was not deleted due to the following error "${result.ERROR[0].TEXT}"`,
99
- title: 'Error:',
100
- type: 'warning',
101
- autoClose: true,
102
- });
103
- this.$emit(ReportingEventListeners.notify, notification);
76
+ async delete(rowData) {
77
+ let notification = null;
78
+ const { REPORT_ID } = rowData;
79
+ const result = await this.connect.commitEvent('EVENT_SAVED_REPORTS_DELETE', {
80
+ DETAILS: { REPORT_ID },
81
+ IGNORE_WARNINGS: true,
82
+ VALIDATE: false,
104
83
  });
84
+ result.MESSAGE_TYPE === 'EVENT_ACK'
85
+ ? (notification = {
86
+ message: `'${rowData.REPORT_NAME}' was deleted`,
87
+ title: 'Success:',
88
+ type: 'success',
89
+ autoClose: true,
90
+ })
91
+ : (notification = {
92
+ message: `'${rowData.REPORT_NAME}' was not deleted due to the following error "${result.ERROR[0].TEXT}"`,
93
+ title: 'Error:',
94
+ type: 'warning',
95
+ autoClose: true,
96
+ });
97
+ this.$emit(ReportingEventListeners.notify, notification);
105
98
  }
106
99
  batchDelete() {
107
100
  // service does not accept arrays so have to loop
@@ -1,4 +1,4 @@
1
- import { __awaiter, __decorate } from "tslib";
1
+ import { __decorate } from "tslib";
2
2
  import { Datasource } from '@genesislcap/foundation-comms';
3
3
  import { formatDateTimestamp, formatDateTimeTimestamp } from '@genesislcap/foundation-utils';
4
4
  import { customElement, GenesisElement, observable, attr } from '@genesislcap/web-core';
@@ -14,15 +14,15 @@ let Preview = class Preview extends GenesisElement {
14
14
  /**
15
15
  * Fetch data from server and load to grid
16
16
  */
17
- this.fetchAndLoadToGrid = () => __awaiter(this, void 0, void 0, function* () {
17
+ this.fetchAndLoadToGrid = async () => {
18
18
  // Get the data from the selected dataserver
19
19
  // NOTE: Backend field REPORT_DATASOURCE and REPORT_DATA_SOURCE are not consistent in Events and Dataserver
20
20
  const resourceName = this.report['REPORT_DATASOURCE'] || this.report['REPORT_DATA_SOURCE'];
21
- yield this.datasource.init(Object.assign({ resourceName }, this.datasourceSettings), true);
22
- this.data = yield this.datasource.snapshotFiltered();
21
+ await this.datasource.init(Object.assign({ resourceName }, this.datasourceSettings), true);
22
+ this.data = await this.datasource.snapshotFiltered();
23
23
  // Map data from dataserver to the grid
24
24
  this.grid['gridOptions'] = Object.assign(Object.assign({}, getGridOptions()), { columnDefs: getColumns(this.report['REPORT_COLUMNS']), rowData: this.data });
25
- });
25
+ };
26
26
  /**
27
27
  * Export to csv handle
28
28
  */
@@ -1,10 +1,9 @@
1
- import { __awaiter } from "tslib";
2
- import { baseComponents, provideDesignSystem, rapidIcon, rapidButton, rapidCard, rapidTabs, rapidTab, rapidTabPanel, rapidTextField, rapidTextArea, rapidRadioGroup, rapidRadio, rapidToast, } from '@genesislcap/rapid-design-system';
1
+ import { baseComponents, provideDesignSystem, rapidIcon, rapidButton, rapidCard, rapidTabs, rapidTab, rapidTabPanel, rapidTextField, rapidTextArea, rapidRadioGroup, rapidRadio, rapidToast, rapidActionsMenu, rapidMenu, rapidMenuItem, rapidDialog, rapidSelect, rapidListboxOption, } from '@genesislcap/rapid-design-system';
3
2
  import { rapidGridComponents } from '@genesislcap/rapid-grid-pro';
4
3
  /**
5
4
  * @public
6
5
  */
7
- export const registerCommonRapidComponents = () => __awaiter(void 0, void 0, void 0, function* () {
6
+ export const registerCommonRapidComponents = async () => {
8
7
  /**
9
8
  * Register the components the app is using with the system.
10
9
  */
@@ -13,9 +12,9 @@ export const registerCommonRapidComponents = () => __awaiter(void 0, void 0, voi
13
12
  /**
14
13
  * Common across most routes, so batch register these lightweight components upfront.
15
14
  */
16
- rapidIcon(), rapidButton(), rapidCard(), rapidTabs(), rapidTab(), rapidTabPanel(), rapidTextField(), rapidTextArea(), rapidRadioGroup(), rapidRadio(), rapidToast(),
15
+ rapidIcon(), rapidButton(), rapidCard(), rapidDialog(), rapidSelect(), rapidTabs(), rapidListboxOption(), rapidTab(), rapidTabPanel(), rapidTextField(), rapidTextArea(), rapidRadioGroup(), rapidRadio(), rapidToast(), rapidActionsMenu(), rapidMenu(), rapidMenuItem(),
17
16
  /**
18
17
  * A re-export of designSystemProvider is missing from the top level index file in rapid
19
18
  */
20
19
  baseComponents.designSystemProvider(), rapidGridComponents);
21
- });
20
+ };
@@ -1,4 +1,4 @@
1
- import { __awaiter, __decorate } from "tslib";
1
+ import { __decorate } from "tslib";
2
2
  import { Connect } from '@genesislcap/foundation-comms';
3
3
  import { RapidAgTextRenderer } from '@genesislcap/rapid-grid-pro';
4
4
  import { customElement, GenesisElement, observable, attr } from '@genesislcap/web-core';
@@ -30,7 +30,7 @@ let SelectFields = class SelectFields extends GenesisElement {
30
30
  * @param value string
31
31
  * @param params Object
32
32
  */
33
- this.onTextFieldChange = (value, params) => __awaiter(this, void 0, void 0, function* () {
33
+ this.onTextFieldChange = async (value, params) => {
34
34
  const newFields = this.selectedFields.map((field) => {
35
35
  let newField = Object.assign({}, field);
36
36
  if (field.name === params.node.data.name) {
@@ -39,7 +39,7 @@ let SelectFields = class SelectFields extends GenesisElement {
39
39
  return newField;
40
40
  });
41
41
  this.setSelectedFields(newFields);
42
- });
42
+ };
43
43
  /**
44
44
  * Refresh select field grid data
45
45
  */
@@ -91,68 +91,64 @@ let SelectFields = class SelectFields extends GenesisElement {
91
91
  /**
92
92
  * Loads the allFieldsGrid
93
93
  */
94
- loadAllFieldsGrid() {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- this.allFieldsGrid.gridOptions = Object.assign(Object.assign({}, FIELD_SELECT_CONFIG.gridOptions), { columnDefs: FIELD_SELECT_CONFIG.colDefs, rowData: [...this.fieldData], onSelectionChanged: () => {
97
- if (this.selectedFields) {
98
- this.selectedFields = getSelectedFields(this.allFieldsGrid, this.selectedFields);
99
- this.setSelectedFields([...this.makeSureFieldValueIsNotLost(this.selectedFields)]);
100
- }
101
- else {
102
- this.setSelectedFields([
103
- ...this.makeSureFieldValueIsNotLost(this.allFieldsGrid.gridApi.getSelectedRows()),
104
- ]);
105
- }
106
- }, onFirstDataRendered: () => {
107
- var _a, _b;
108
- (_b = (_a = this.allFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
109
- this.selectDefaultFields();
110
- }, onGridReady: () => {
111
- window.addEventListener('resize', () => {
112
- setTimeout(() => {
113
- var _a, _b;
114
- (_b = (_a = this.allFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
115
- });
94
+ async loadAllFieldsGrid() {
95
+ this.allFieldsGrid.gridOptions = Object.assign(Object.assign({}, FIELD_SELECT_CONFIG.gridOptions), { columnDefs: FIELD_SELECT_CONFIG.colDefs, rowData: [...this.fieldData], onSelectionChanged: () => {
96
+ if (this.selectedFields) {
97
+ this.selectedFields = getSelectedFields(this.allFieldsGrid, this.selectedFields);
98
+ this.setSelectedFields([...this.makeSureFieldValueIsNotLost(this.selectedFields)]);
99
+ }
100
+ else {
101
+ this.setSelectedFields([
102
+ ...this.makeSureFieldValueIsNotLost(this.allFieldsGrid.gridApi.getSelectedRows()),
103
+ ]);
104
+ }
105
+ }, onFirstDataRendered: () => {
106
+ var _a, _b;
107
+ (_b = (_a = this.allFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
108
+ this.selectDefaultFields();
109
+ }, onGridReady: () => {
110
+ window.addEventListener('resize', () => {
111
+ setTimeout(() => {
112
+ var _a, _b;
113
+ (_b = (_a = this.allFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
116
114
  });
117
- } });
118
- });
115
+ });
116
+ } });
119
117
  }
120
118
  /**
121
119
  * Loads the allFieldsGrid
122
120
  */
123
- loadSelectedFieldsGrid() {
124
- return __awaiter(this, void 0, void 0, function* () {
125
- this.selectedFieldsGrid.gridOptions = Object.assign(Object.assign({}, SELECTED_FIELDS_CONFIG.gridOptions), { onRowDragEnd: this.refreshSelectFieldGridData, columnDefs: [
126
- ...SELECTED_FIELDS_CONFIG.colDefs,
127
- {
128
- field: 'displayName',
129
- headerName: 'Display name',
130
- cellRenderer: RapidAgTextRenderer,
131
- cellRendererParams: {
132
- accessor: 'displayName',
133
- onChange: this.onTextFieldChange,
134
- },
135
- },
136
- {
137
- rowDrag: true,
138
- width: 60,
139
- sortable: false,
140
- filter: false,
121
+ async loadSelectedFieldsGrid() {
122
+ this.selectedFieldsGrid.gridOptions = Object.assign(Object.assign({}, SELECTED_FIELDS_CONFIG.gridOptions), { onRowDragEnd: this.refreshSelectFieldGridData, columnDefs: [
123
+ ...SELECTED_FIELDS_CONFIG.colDefs,
124
+ {
125
+ field: 'displayName',
126
+ headerName: 'Display name',
127
+ cellRenderer: RapidAgTextRenderer,
128
+ cellRendererParams: {
129
+ accessor: 'displayName',
130
+ onChange: this.onTextFieldChange,
141
131
  },
142
- ], rowData: [], onGridReady: () => {
143
- window.addEventListener('resize', () => {
144
- setTimeout(() => {
145
- var _a, _b;
146
- (_b = (_a = this.selectedFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
147
- });
132
+ },
133
+ {
134
+ rowDrag: true,
135
+ width: 60,
136
+ sortable: false,
137
+ filter: false,
138
+ },
139
+ ], rowData: [], onGridReady: () => {
140
+ window.addEventListener('resize', () => {
141
+ setTimeout(() => {
142
+ var _a, _b;
143
+ (_b = (_a = this.selectedFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
148
144
  });
149
- }, onFirstDataRendered: () => {
150
- var _a, _b;
151
- (_b = (_a = this.selectedFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
152
- }, onSelectionChanged: () => {
153
- this.fieldsToRemove = this.selectedFieldsGrid.gridApi.getSelectedRows();
154
- } });
155
- });
145
+ });
146
+ }, onFirstDataRendered: () => {
147
+ var _a, _b;
148
+ (_b = (_a = this.selectedFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
149
+ }, onSelectionChanged: () => {
150
+ this.fieldsToRemove = this.selectedFieldsGrid.gridApi.getSelectedRows();
151
+ } });
156
152
  }
157
153
  /**
158
154
  * Select default fields
@@ -1,4 +1,4 @@
1
- import { __awaiter, __decorate } from "tslib";
1
+ import { __decorate } from "tslib";
2
2
  import { Connect } from '@genesislcap/foundation-comms';
3
3
  import { RapidAgSelectRenderer, RapidAgTextRenderer } from '@genesislcap/rapid-grid-pro';
4
4
  import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
@@ -86,25 +86,23 @@ let SelectFilters = class SelectFilters extends GenesisElement {
86
86
  /**
87
87
  * Loads availableFieldsGrid with data from the field selection step
88
88
  */
89
- loadAvailableFieldsGrid() {
90
- return __awaiter(this, void 0, void 0, function* () {
91
- this.availableFieldsGrid.gridOptions = Object.assign(Object.assign({}, AVAILABLE_FIELDS_CONFIG.gridOptions), { columnDefs: AVAILABLE_FIELDS_CONFIG.colDefs, rowData: [...this.selectedFields], onGridReady: () => {
92
- window.addEventListener('resize', () => {
93
- setTimeout(() => {
94
- var _a, _b;
95
- (_b = (_a = this.availableFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
96
- });
89
+ async loadAvailableFieldsGrid() {
90
+ this.availableFieldsGrid.gridOptions = Object.assign(Object.assign({}, AVAILABLE_FIELDS_CONFIG.gridOptions), { columnDefs: AVAILABLE_FIELDS_CONFIG.colDefs, rowData: [...this.selectedFields], onGridReady: () => {
91
+ window.addEventListener('resize', () => {
92
+ setTimeout(() => {
93
+ var _a, _b;
94
+ (_b = (_a = this.availableFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
97
95
  });
98
- }, onFirstDataRendered: () => {
99
- var _a, _b;
100
- (_b = (_a = this.availableFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
101
- this.selectDefaultFilters();
102
- }, onSelectionChanged: () => {
103
- this.setSelectedFilters([
104
- ...this.makeSureFieldValueIsNotLost(this.availableFieldsGrid.gridApi.getSelectedRows()),
105
- ]);
106
- } });
107
- });
96
+ });
97
+ }, onFirstDataRendered: () => {
98
+ var _a, _b;
99
+ (_b = (_a = this.availableFieldsGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.sizeColumnsToFit();
100
+ this.selectDefaultFilters();
101
+ }, onSelectionChanged: () => {
102
+ this.setSelectedFilters([
103
+ ...this.makeSureFieldValueIsNotLost(this.availableFieldsGrid.gridApi.getSelectedRows()),
104
+ ]);
105
+ } });
108
106
  }
109
107
  /**
110
108
  * Loads the selectedFiltersGrid
@@ -1,4 +1,4 @@
1
- import { __awaiter, __decorate, __rest } from "tslib";
1
+ import { __decorate, __rest } from "tslib";
2
2
  import { Connect } from '@genesislcap/foundation-comms';
3
3
  import { customElement, GenesisElement, observable, volatile } from '@genesislcap/web-core';
4
4
  import { ReportingEventListeners } from '../../main/types';
@@ -122,31 +122,29 @@ let Wizard = class Wizard extends GenesisElement {
122
122
  /**
123
123
  * When report variable changes handle
124
124
  */
125
- reportChanged(old, newValue) {
125
+ async reportChanged(old, newValue) {
126
126
  var _a;
127
- return __awaiter(this, void 0, void 0, function* () {
128
- this.fieldData = (_a = this.fieldData) === null || _a === void 0 ? void 0 : _a.map((_a) => {
129
- var { filter } = _a, fields = __rest(_a, ["filter"]);
130
- return fields;
131
- });
132
- if (Object.keys(newValue).length) {
133
- const { REPORT_NAME, REPORT_DESCRIPTION, REPORT_DATASOURCE, REPORT_DATA_SOURCE, REPORT_COLUMNS, } = newValue;
134
- this.isEdit = true;
135
- this.selectedFields = REPORT_COLUMNS;
136
- this.reportName = REPORT_NAME;
137
- this.reportDescription = REPORT_DESCRIPTION;
138
- this.selectedDatasource = REPORT_DATASOURCE || REPORT_DATA_SOURCE;
139
- }
140
- else {
141
- this.isEdit = false;
142
- this.reportName = '';
143
- this.reportDescription = '';
144
- this.selectedDatasource = null;
145
- this.selectedFields = [];
146
- this.selectedFilters = [];
147
- }
148
- this.setActiveTab(0);
127
+ this.fieldData = (_a = this.fieldData) === null || _a === void 0 ? void 0 : _a.map((_a) => {
128
+ var { filter } = _a, fields = __rest(_a, ["filter"]);
129
+ return fields;
149
130
  });
131
+ if (Object.keys(newValue).length) {
132
+ const { REPORT_NAME, REPORT_DESCRIPTION, REPORT_DATASOURCE, REPORT_DATA_SOURCE, REPORT_COLUMNS, } = newValue;
133
+ this.isEdit = true;
134
+ this.selectedFields = REPORT_COLUMNS;
135
+ this.reportName = REPORT_NAME;
136
+ this.reportDescription = REPORT_DESCRIPTION;
137
+ this.selectedDatasource = REPORT_DATASOURCE || REPORT_DATA_SOURCE;
138
+ }
139
+ else {
140
+ this.isEdit = false;
141
+ this.reportName = '';
142
+ this.reportDescription = '';
143
+ this.selectedDatasource = null;
144
+ this.selectedFields = [];
145
+ this.selectedFilters = [];
146
+ }
147
+ this.setActiveTab(0);
150
148
  }
151
149
  /**
152
150
  * Set selected fields
@@ -158,40 +156,38 @@ let Wizard = class Wizard extends GenesisElement {
158
156
  /**
159
157
  * When report variable changes handle
160
158
  */
161
- selectedDatasourceChanged(old, newValue) {
162
- return __awaiter(this, void 0, void 0, function* () {
163
- // Reset
164
- this.selectedFields = [];
165
- this.selectedFilters = [];
166
- this.fieldData = [];
167
- // Prepare field data structure from field metadata response
168
- const fieldMetadata = yield this.fetchFieldsFromDatasource();
169
- if (this.isEdit && Object.keys(this.report).length) {
170
- this.selectedFields = this.report['REPORT_COLUMNS'];
171
- const reportDatasource = this.report['REPORT_DATASOURCE'] || this.report['REPORT_DATA_SOURCE'];
172
- if (reportDatasource === newValue) {
173
- this.fieldData = fieldMetadata.map(({ FIELD_NAME, TYPE }) => this.selectedFields.find((field) => field.name === FIELD_NAME) || {
159
+ async selectedDatasourceChanged(old, newValue) {
160
+ // Reset
161
+ this.selectedFields = [];
162
+ this.selectedFilters = [];
163
+ this.fieldData = [];
164
+ // Prepare field data structure from field metadata response
165
+ const fieldMetadata = await this.fetchFieldsFromDatasource();
166
+ if (this.isEdit && Object.keys(this.report).length) {
167
+ this.selectedFields = this.report['REPORT_COLUMNS'];
168
+ const reportDatasource = this.report['REPORT_DATASOURCE'] || this.report['REPORT_DATA_SOURCE'];
169
+ if (reportDatasource === newValue) {
170
+ this.fieldData = fieldMetadata.map(({ FIELD_NAME, TYPE }) => this.selectedFields.find((field) => field.name === FIELD_NAME) || {
171
+ name: FIELD_NAME,
172
+ type: TYPE,
173
+ displayName: FIELD_NAME,
174
+ selected: false,
175
+ });
176
+ }
177
+ }
178
+ else {
179
+ fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.forEach(({ FIELD_NAME, TYPE }) => {
180
+ this.fieldData = [
181
+ ...this.fieldData,
182
+ {
174
183
  name: FIELD_NAME,
175
184
  type: TYPE,
176
185
  displayName: FIELD_NAME,
177
186
  selected: false,
178
- });
179
- }
180
- }
181
- else {
182
- fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.forEach(({ FIELD_NAME, TYPE }) => {
183
- this.fieldData = [
184
- ...this.fieldData,
185
- {
186
- name: FIELD_NAME,
187
- type: TYPE,
188
- displayName: FIELD_NAME,
189
- selected: false,
190
- },
191
- ];
192
- });
193
- }
194
- });
187
+ },
188
+ ];
189
+ });
190
+ }
195
191
  }
196
192
  /**
197
193
  * Make sure to update selected fields when field data changes
@@ -235,32 +231,30 @@ let Wizard = class Wizard extends GenesisElement {
235
231
  /**
236
232
  * Fetch a list of datasources
237
233
  */
238
- getDatasources() {
239
- return __awaiter(this, void 0, void 0, function* () {
240
- yield this.connect
241
- .request('ALL_REPORT_DATASOURCES', {
242
- REQUEST: {},
243
- })
244
- .then((response) => {
245
- var _a;
246
- (_a = response === null || response === void 0 ? void 0 : response.REPLY) === null || _a === void 0 ? void 0 : _a.forEach(({ DATASOURCE_NAME, RECORD_ID }) => {
247
- this.datasourceOptions = [
248
- ...this.datasourceOptions,
249
- {
250
- id: RECORD_ID,
251
- name: DATASOURCE_NAME,
252
- },
253
- ];
254
- });
255
- })
256
- .catch((err) => {
257
- this.$emit(ReportingEventListeners.notify, {
258
- type: 'warning',
259
- title: 'Error:',
260
- message: `There was an error fetching data sources:
234
+ async getDatasources() {
235
+ await this.connect
236
+ .request('ALL_REPORT_DATASOURCES', {
237
+ REQUEST: {},
238
+ })
239
+ .then((response) => {
240
+ var _a;
241
+ (_a = response === null || response === void 0 ? void 0 : response.REPLY) === null || _a === void 0 ? void 0 : _a.forEach(({ DATASOURCE_NAME, RECORD_ID }) => {
242
+ this.datasourceOptions = [
243
+ ...this.datasourceOptions,
244
+ {
245
+ id: RECORD_ID,
246
+ name: DATASOURCE_NAME,
247
+ },
248
+ ];
249
+ });
250
+ })
251
+ .catch((err) => {
252
+ this.$emit(ReportingEventListeners.notify, {
253
+ type: 'warning',
254
+ title: 'Error:',
255
+ message: `There was an error fetching data sources:
261
256
  ${(err === null || err === void 0 ? void 0 : err.ERROR) ? err.ERROR : JSON.stringify(err)}
262
257
  `,
263
- });
264
258
  });
265
259
  });
266
260
  }
@@ -1,10 +1,9 @@
1
- import { __awaiter } from "tslib";
2
1
  import { provideDesignSystem, zeroIcon, zeroButton, zeroCard, zeroTabs, zeroTab, zeroTabPanel, zeroTextField, zeroTextArea, zeroRadioGroup, zeroRadio, zeroToast, zeroDesignSystemProvider, } from '@genesislcap/foundation-zero';
3
2
  import { zeroGridComponents } from '@genesislcap/foundation-zero-grid-pro';
4
3
  /**
5
4
  * @public
6
5
  */
7
- export const registerCommonZeroComponents = () => __awaiter(void 0, void 0, void 0, function* () {
6
+ export const registerCommonZeroComponents = async () => {
8
7
  /**
9
8
  * Register the components the app is using with the system.
10
9
  */
@@ -14,4 +13,4 @@ export const registerCommonZeroComponents = () => __awaiter(void 0, void 0, void
14
13
  * Common across most routes, so batch register these lightweight components upfront.
15
14
  */
16
15
  zeroIcon(), zeroButton(), zeroCard(), zeroTabs(), zeroTab(), zeroTabPanel(), zeroTextField(), zeroTextArea(), zeroRadioGroup(), zeroRadio(), zeroToast(), zeroDesignSystemProvider(), zeroGridComponents);
17
- });
16
+ };
@@ -1,4 +1,3 @@
1
- import { __awaiter } from "tslib";
2
1
  import { DI, GenesisElement, Registration } from '@genesislcap/web-core';
3
2
  import { ReportingConfig, defaultReportingConfig } from './config';
4
3
  /**
@@ -28,31 +27,29 @@ import { ReportingConfig, defaultReportingConfig } from './config';
28
27
  * @param config - A partial ReportingConfig.
29
28
  * @public
30
29
  */
31
- export function configure(config) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- /**
34
- * Merge the configs
35
- */
36
- const value = Object.assign(Object.assign({}, defaultReportingConfig), config);
37
- if (config.templateOptions) {
38
- value.templateOptions = Object.assign(Object.assign(Object.assign({}, defaultReportingConfig.templateOptions), { designSystemProvider: 'template' }), config.templateOptions);
39
- }
40
- /**
41
- * Register a new ReportingConfig
42
- */
43
- DI.getOrCreateDOMContainer().register(Registration.instance(ReportingConfig, value));
44
- /**
45
- * Lazily reference and define the micro frontend element post config setting.
46
- */
47
- const { Reporting, MainStyles, MainTemplate } = yield import('../main');
48
- const { name, attributes, shadowOptions, elementOptions } = value;
49
- return GenesisElement.define(Reporting, {
50
- name,
51
- template: MainTemplate,
52
- styles: MainStyles,
53
- attributes,
54
- shadowOptions,
55
- elementOptions,
56
- });
30
+ export async function configure(config) {
31
+ /**
32
+ * Merge the configs
33
+ */
34
+ const value = Object.assign(Object.assign({}, defaultReportingConfig), config);
35
+ if (config.templateOptions) {
36
+ value.templateOptions = Object.assign(Object.assign(Object.assign({}, defaultReportingConfig.templateOptions), { designSystemProvider: 'template' }), config.templateOptions);
37
+ }
38
+ /**
39
+ * Register a new ReportingConfig
40
+ */
41
+ DI.getOrCreateDOMContainer().register(Registration.instance(ReportingConfig, value));
42
+ /**
43
+ * Lazily reference and define the micro frontend element post config setting.
44
+ */
45
+ const { Reporting, MainStyles, MainTemplate } = await import('../main');
46
+ const { name, attributes, shadowOptions, elementOptions } = value;
47
+ return GenesisElement.define(Reporting, {
48
+ name,
49
+ template: MainTemplate,
50
+ styles: MainStyles,
51
+ attributes,
52
+ shadowOptions,
53
+ elementOptions,
57
54
  });
58
55
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './config';
2
2
  export * from './main';
3
+ export * from './sandbox';
@@ -1,4 +1,4 @@
1
- import { __awaiter, __decorate } from "tslib";
1
+ import { __decorate } from "tslib";
2
2
  import { Connect, DatasourceDefaults } from '@genesislcap/foundation-comms';
3
3
  import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
4
4
  import { MainStyles as styles } from './main.styles';
@@ -25,38 +25,32 @@ let FoundationReporting = class FoundationReporting extends GenesisElement {
25
25
  this.activeReport = {};
26
26
  this.notifications = [];
27
27
  }
28
- enter(phase) {
28
+ async enter(phase) {
29
29
  var _a, _b, _c, _d;
30
- return __awaiter(this, void 0, void 0, function* () {
31
- this.datasourceSettings = {
32
- maxRows: (_b = (_a = phase.route.settings) === null || _a === void 0 ? void 0 : _a.maxRows) !== null && _b !== void 0 ? _b : DatasourceDefaults.MAX_ROWS_250,
33
- maxView: (_d = (_c = phase.route.settings) === null || _c === void 0 ? void 0 : _c.maxView) !== null && _d !== void 0 ? _d : DatasourceDefaults.MAX_VIEW_1000,
34
- };
35
- });
30
+ this.datasourceSettings = {
31
+ maxRows: (_b = (_a = phase.route.settings) === null || _a === void 0 ? void 0 : _a.maxRows) !== null && _b !== void 0 ? _b : DatasourceDefaults.MAX_ROWS_250,
32
+ maxView: (_d = (_c = phase.route.settings) === null || _c === void 0 ? void 0 : _c.maxView) !== null && _d !== void 0 ? _d : DatasourceDefaults.MAX_VIEW_1000,
33
+ };
36
34
  }
37
- connectedCallback() {
38
- const _super = Object.create(null, {
39
- connectedCallback: { get: () => super.connectedCallback }
35
+ async connectedCallback() {
36
+ super.connectedCallback();
37
+ this.ready = true;
38
+ console.log('reporting config', this.config);
39
+ this.reportsGrid.addEventListener('rowSelectionEvent', (e) => {
40
+ this.selectedRows = e.detail.selectedRows();
41
+ });
42
+ this.addEventListener(ReportingEventListeners.notify, (e) => {
43
+ this.notifications = [...this.notifications, e.detail];
44
+ });
45
+ this.addEventListener(ReportingEventListeners.listReports, (e) => {
46
+ this.setPageTab('list-reports');
47
+ this.activeReport = {};
48
+ });
49
+ this.reportsGrid.addEventListener(ReportingEventListeners.runReport, (e) => {
50
+ this.run(e.detail);
40
51
  });
41
- return __awaiter(this, void 0, void 0, function* () {
42
- _super.connectedCallback.call(this);
43
- console.log('reporting config', this.config);
44
- this.reportsGrid.addEventListener('rowSelectionEvent', (e) => {
45
- this.selectedRows = e.detail.selectedRows();
46
- });
47
- this.addEventListener(ReportingEventListeners.notify, (e) => {
48
- this.notifications = [...this.notifications, e.detail];
49
- });
50
- this.addEventListener(ReportingEventListeners.listReports, (e) => {
51
- this.setPageTab('list-reports');
52
- this.activeReport = {};
53
- });
54
- this.reportsGrid.addEventListener(ReportingEventListeners.runReport, (e) => {
55
- this.run(e.detail);
56
- });
57
- this.reportsGrid.addEventListener(ReportingEventListeners.editReport, (e) => {
58
- this.edit(e.detail);
59
- });
52
+ this.reportsGrid.addEventListener(ReportingEventListeners.editReport, (e) => {
53
+ this.edit(e.detail);
60
54
  });
61
55
  }
62
56
  // TODO: use const for tab identifiers
@@ -68,23 +62,19 @@ let FoundationReporting = class FoundationReporting extends GenesisElement {
68
62
  this.activeReport = Object.assign(Object.assign({}, rowData), { REPORT_COLUMNS: JSON.parse(rowData['REPORT_COLUMNS']) });
69
63
  this.setPageTab('create-edit-report');
70
64
  }
71
- run(rowData) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- this.activeReport = Object.assign(Object.assign({}, rowData), { REPORT_COLUMNS: JSON.parse(rowData['REPORT_COLUMNS']) });
74
- this.setPageTab('run-report');
75
- });
65
+ async run(rowData) {
66
+ this.activeReport = Object.assign(Object.assign({}, rowData), { REPORT_COLUMNS: JSON.parse(rowData['REPORT_COLUMNS']) });
67
+ this.setPageTab('run-report');
76
68
  }
77
69
  setPageTab(tab) {
78
70
  this.tabs.activeid = tab;
79
71
  }
80
- getFields(resourceName) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- const temp = yield this.connect.getMetadata(resourceName);
83
- for (let i = 0; i < temp.FIELD.length; i += 1) {
84
- this.fields.push(temp.FIELD[i].NAME);
85
- }
86
- this.listBox.hidden = false;
87
- });
72
+ async getFields(resourceName) {
73
+ const temp = await this.connect.getMetadata(resourceName);
74
+ for (let i = 0; i < temp.FIELD.length; i += 1) {
75
+ this.fields.push(temp.FIELD[i].NAME);
76
+ }
77
+ this.listBox.hidden = false;
88
78
  }
89
79
  };
90
80
  __decorate([
@@ -105,6 +95,9 @@ __decorate([
105
95
  __decorate([
106
96
  observable
107
97
  ], FoundationReporting.prototype, "datasourceSettings", void 0);
98
+ __decorate([
99
+ observable
100
+ ], FoundationReporting.prototype, "ready", void 0);
108
101
  __decorate([
109
102
  ReportingConfig
110
103
  ], FoundationReporting.prototype, "config", void 0);
@@ -143,23 +136,17 @@ let RapidReporting = class RapidReporting extends FoundationReporting {
143
136
  /**
144
137
  * @internal
145
138
  */
146
- connectedCallback() {
147
- const _super = Object.create(null, {
148
- connectedCallback: { get: () => super.connectedCallback }
149
- });
150
- return __awaiter(this, void 0, void 0, function* () {
151
- _super.connectedCallback.call(this);
152
- yield this.loadRemotes();
153
- });
139
+ async connectedCallback() {
140
+ await this.loadRemotes();
141
+ await super.connectedCallback();
154
142
  }
155
143
  /**
156
144
  * @internal
157
145
  */
158
- loadRemotes() {
159
- return __awaiter(this, void 0, void 0, function* () {
160
- const { registerCommonRapidComponents } = yield import('../components/rapid-components');
161
- yield registerCommonRapidComponents();
162
- });
146
+ async loadRemotes() {
147
+ const { registerCommonRapidComponents } = await import('../components/rapid-components');
148
+ await registerCommonRapidComponents();
149
+ this.ready = true;
163
150
  }
164
151
  };
165
152
  RapidReporting = __decorate([
@@ -197,23 +184,17 @@ let ZeroReporting = class ZeroReporting extends FoundationReporting {
197
184
  /**
198
185
  * @internal
199
186
  */
200
- connectedCallback() {
201
- const _super = Object.create(null, {
202
- connectedCallback: { get: () => super.connectedCallback }
203
- });
204
- return __awaiter(this, void 0, void 0, function* () {
205
- _super.connectedCallback.call(this);
206
- yield this.loadRemotes();
207
- });
187
+ async connectedCallback() {
188
+ await this.loadRemotes();
189
+ await super.connectedCallback();
208
190
  }
209
191
  /**
210
192
  * @internal
211
193
  */
212
- loadRemotes() {
213
- return __awaiter(this, void 0, void 0, function* () {
214
- const { registerCommonZeroComponents } = yield import('../components/zero-components');
215
- yield registerCommonZeroComponents();
216
- });
194
+ async loadRemotes() {
195
+ const { registerCommonZeroComponents } = await import('../components/zero-components');
196
+ await registerCommonZeroComponents();
197
+ this.ready = true;
217
198
  }
218
199
  };
219
200
  ZeroReporting = __decorate([
@@ -57,8 +57,8 @@ const header = html `
57
57
  `;
58
58
  export const MainTemplate = html `
59
59
  ${when((x) => x.notifications.length, notificationToast)}
60
- <div class="container" data-test-id="reporting-home">
61
-
60
+ ${when(x => x.ready, html `
61
+ <div class="container" data-test-id="reporting-home">
62
62
  <${tabsTag} ${ref("tabs")} class="tabs" data-test-id="tabs">
63
63
  <span part="start" class="start" slot="start" data-test-id="reporting-tab">Reporting</span>
64
64
  <${tabTag} id="list-reports" slot="tab" data-test-id="list-reports-tab">
@@ -96,4 +96,4 @@ export const MainTemplate = html `
96
96
  </${tabsTag}>
97
97
 
98
98
  </div>
99
- `;
99
+ `)}`;
@@ -0,0 +1,41 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement, GenesisElement, html, observable, when } from "@genesislcap/web-core";
3
+ import { Auth, AuthType, Connect } from "@genesislcap/foundation-comms";
4
+ let ReportingSandbox = class ReportingSandbox extends GenesisElement {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.ready = false;
8
+ }
9
+ async connectedCallback() {
10
+ super.connectedCallback();
11
+ console.log('Running with following env vars:', {
12
+ GENX_SANDBOX_DEFAULT_USER,
13
+ GENX_SANDBOX_DEFAULT_PASSWORD,
14
+ GENX_SANDBOX_API_HOST
15
+ });
16
+ await this.connect.connect(GENX_SANDBOX_API_HOST);
17
+ await this.auth.login({ username: GENX_SANDBOX_DEFAULT_USER, password: GENX_SANDBOX_DEFAULT_PASSWORD, type: AuthType.BASIC });
18
+ this.auth.isLoggedIn$.subscribe(isLoggedIn => {
19
+ this.ready = isLoggedIn;
20
+ });
21
+ }
22
+ };
23
+ __decorate([
24
+ Connect
25
+ ], ReportingSandbox.prototype, "connect", void 0);
26
+ __decorate([
27
+ Auth
28
+ ], ReportingSandbox.prototype, "auth", void 0);
29
+ __decorate([
30
+ observable
31
+ ], ReportingSandbox.prototype, "ready", void 0);
32
+ ReportingSandbox = __decorate([
33
+ customElement({
34
+ name: 'reporting-sandbox',
35
+ template: html `${when(x => x.ready, html `
36
+ <rapid-design-system-provider>
37
+ <rapid-reporting></rapid-reporting>
38
+ </rapid-design-system-provider>`)}`,
39
+ })
40
+ ], ReportingSandbox);
41
+ export { ReportingSandbox };
package/index.html CHANGED
@@ -1,26 +1,27 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
3
+ <head>
4
4
  <meta charset="utf-8"/>
5
- <title>{{htmlWebpackPlugin.options.title}}</title>
6
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- </head>
8
- <style>
9
- html,
10
- body {
6
+ <title>{{htmlWebpackPlugin.options.title}}</title>
7
+ <style>
8
+ html,
9
+ body {
11
10
  width: 100%;
12
11
  height: 100%;
13
12
  padding: 0;
14
13
  margin: 0;
15
- }
16
- :not(:defined) {
14
+ }
15
+ :not(:defined) {
17
16
  visibility: hidden;
18
- }
19
- </style>
20
- <body>
21
- <foundation-reporting></foundation-reporting>
22
- {{#if insertEntryPoint}}
23
- <script type="module" src="/src/index.ts"></script>
24
- {{/if}}
25
- </body>
17
+ }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ <reporting-sandbox></reporting-sandbox>
22
+ {{#if insertEntryPoint}}
23
+ <script type="module" src="/src/sandbox.ts"></script>
24
+ <script type="module" src="/src/index.ts"></script>
25
+ {{/if}}
26
+ </body>
26
27
  </html>
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": "1.0.366",
4
+ "version": "1.0.367",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-reporting.d.ts",
@@ -45,7 +45,7 @@
45
45
  "build:webpack:stats": "genx analyze",
46
46
  "clean": "rimraf dist tsconfig.tsbuildinfo",
47
47
  "circular": "npx madge --extensions ts --circular ./src",
48
- "dev": "genx dev -e API_HOST,ENABLE_SSO",
48
+ "dev": "genx dev",
49
49
  "dev:docker": "npm run dev -- --host 0.0.0.0",
50
50
  "dev:intellij": "genx dev -e ENABLE_SSO",
51
51
  "dev:no-open": "npm run dev -- --no-open",