@genesislcap/pbc-reporting-ui 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/dist/dts/assets/images/index.d.ts +11 -0
- package/dist/dts/assets/images/index.d.ts.map +1 -0
- package/dist/dts/components/components.d.ts +5 -0
- package/dist/dts/components/components.d.ts.map +1 -0
- package/dist/dts/components/create-edit/create-edit.d.ts +17 -0
- package/dist/dts/components/create-edit/create-edit.d.ts.map +1 -0
- package/dist/dts/components/create-edit/create-edit.styles.d.ts +2 -0
- package/dist/dts/components/create-edit/create-edit.styles.d.ts.map +1 -0
- package/dist/dts/components/create-edit/create-edit.template.d.ts +3 -0
- package/dist/dts/components/create-edit/create-edit.template.d.ts.map +1 -0
- package/dist/dts/components/create-edit/index.d.ts +4 -0
- package/dist/dts/components/create-edit/index.d.ts.map +1 -0
- package/dist/dts/components/index.d.ts +2 -0
- package/dist/dts/components/index.d.ts.map +1 -0
- package/dist/dts/components/list/columns.d.ts +14 -0
- package/dist/dts/components/list/columns.d.ts.map +1 -0
- package/dist/dts/components/list/index.d.ts +4 -0
- package/dist/dts/components/list/index.d.ts.map +1 -0
- package/dist/dts/components/list/list.d.ts +19 -0
- package/dist/dts/components/list/list.d.ts.map +1 -0
- package/dist/dts/components/list/list.styles.d.ts +2 -0
- package/dist/dts/components/list/list.styles.d.ts.map +1 -0
- package/dist/dts/components/list/list.template.d.ts +3 -0
- package/dist/dts/components/list/list.template.d.ts.map +1 -0
- package/dist/dts/components/preview/columns.d.ts +15 -0
- package/dist/dts/components/preview/columns.d.ts.map +1 -0
- package/dist/dts/components/preview/index.d.ts +4 -0
- package/dist/dts/components/preview/index.d.ts.map +1 -0
- package/dist/dts/components/preview/preview.d.ts +28 -0
- package/dist/dts/components/preview/preview.d.ts.map +1 -0
- package/dist/dts/components/preview/preview.styles.d.ts +2 -0
- package/dist/dts/components/preview/preview.styles.d.ts.map +1 -0
- package/dist/dts/components/preview/preview.template.d.ts +3 -0
- package/dist/dts/components/preview/preview.template.d.ts.map +1 -0
- package/dist/dts/components/select-fields/columns.d.ts +65 -0
- package/dist/dts/components/select-fields/columns.d.ts.map +1 -0
- package/dist/dts/components/select-fields/data.d.ts +49 -0
- package/dist/dts/components/select-fields/data.d.ts.map +1 -0
- package/dist/dts/components/select-fields/index.d.ts +3 -0
- package/dist/dts/components/select-fields/index.d.ts.map +1 -0
- package/dist/dts/components/select-fields/select-fields.d.ts +57 -0
- package/dist/dts/components/select-fields/select-fields.d.ts.map +1 -0
- package/dist/dts/components/select-fields/select-fields.styles.d.ts +2 -0
- package/dist/dts/components/select-fields/select-fields.styles.d.ts.map +1 -0
- package/dist/dts/components/select-fields/select-fields.template.d.ts +4 -0
- package/dist/dts/components/select-fields/select-fields.template.d.ts.map +1 -0
- package/dist/dts/components/select-filters/columns.d.ts +88 -0
- package/dist/dts/components/select-filters/columns.d.ts.map +1 -0
- package/dist/dts/components/select-filters/index.d.ts +4 -0
- package/dist/dts/components/select-filters/index.d.ts.map +1 -0
- package/dist/dts/components/select-filters/select-filters.d.ts +46 -0
- package/dist/dts/components/select-filters/select-filters.d.ts.map +1 -0
- package/dist/dts/components/select-filters/select-filters.styles.d.ts +2 -0
- package/dist/dts/components/select-filters/select-filters.styles.d.ts.map +1 -0
- package/dist/dts/components/select-filters/select-filters.template.d.ts +4 -0
- package/dist/dts/components/select-filters/select-filters.template.d.ts.map +1 -0
- package/dist/dts/components/wizard/debug.d.ts +3 -0
- package/dist/dts/components/wizard/debug.d.ts.map +1 -0
- package/dist/dts/components/wizard/index.d.ts +3 -0
- package/dist/dts/components/wizard/index.d.ts.map +1 -0
- package/dist/dts/components/wizard/steps/filters.d.ts +3 -0
- package/dist/dts/components/wizard/steps/filters.d.ts.map +1 -0
- package/dist/dts/components/wizard/steps/index.d.ts +5 -0
- package/dist/dts/components/wizard/steps/index.d.ts.map +1 -0
- package/dist/dts/components/wizard/steps/name.d.ts +4 -0
- package/dist/dts/components/wizard/steps/name.d.ts.map +1 -0
- package/dist/dts/components/wizard/steps/run.d.ts +3 -0
- package/dist/dts/components/wizard/steps/run.d.ts.map +1 -0
- package/dist/dts/components/wizard/steps/select.d.ts +3 -0
- package/dist/dts/components/wizard/steps/select.d.ts.map +1 -0
- package/dist/dts/components/wizard/wizard.d.ts +83 -0
- package/dist/dts/components/wizard/wizard.d.ts.map +1 -0
- package/dist/dts/components/wizard/wizard.styles.d.ts +2 -0
- package/dist/dts/components/wizard/wizard.styles.d.ts.map +1 -0
- package/dist/dts/components/wizard/wizard.template.d.ts +4 -0
- package/dist/dts/components/wizard/wizard.template.d.ts.map +1 -0
- package/dist/dts/components/wizard/wizard.types.d.ts +41 -0
- package/dist/dts/components/wizard/wizard.types.d.ts.map +1 -0
- package/dist/dts/constants/grid-config.d.ts +17 -0
- package/dist/dts/constants/grid-config.d.ts.map +1 -0
- package/dist/dts/index.d.ts +3 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/layouts/default.d.ts +3 -0
- package/dist/dts/layouts/default.d.ts.map +1 -0
- package/dist/dts/layouts/index.d.ts +3 -0
- package/dist/dts/layouts/index.d.ts.map +1 -0
- package/dist/dts/layouts/two-pane-horizontal.d.ts +6 -0
- package/dist/dts/layouts/two-pane-horizontal.d.ts.map +1 -0
- package/dist/dts/main/index.d.ts +3 -0
- package/dist/dts/main/index.d.ts.map +1 -0
- package/dist/dts/main/main.d.ts +18 -0
- package/dist/dts/main/main.d.ts.map +1 -0
- package/dist/dts/main/main.styles.d.ts +2 -0
- package/dist/dts/main/main.styles.d.ts.map +1 -0
- package/dist/dts/main/main.template.d.ts +6 -0
- package/dist/dts/main/main.template.d.ts.map +1 -0
- package/dist/dts/routes/config.d.ts +25 -0
- package/dist/dts/routes/config.d.ts.map +1 -0
- package/dist/dts/routes/index.d.ts +2 -0
- package/dist/dts/routes/index.d.ts.map +1 -0
- package/dist/dts/routes/not-found/not-found.d.ts +4 -0
- package/dist/dts/routes/not-found/not-found.d.ts.map +1 -0
- package/dist/dts/routes/protected/protected.d.ts +8 -0
- package/dist/dts/routes/protected/protected.d.ts.map +1 -0
- package/dist/dts/routes/protected/protected.styles.d.ts +2 -0
- package/dist/dts/routes/protected/protected.styles.d.ts.map +1 -0
- package/dist/dts/routes/protected/protected.template.d.ts +3 -0
- package/dist/dts/routes/protected/protected.template.d.ts.map +1 -0
- package/dist/dts/routes/reporting-home/reporting-home-styles.d.ts +2 -0
- package/dist/dts/routes/reporting-home/reporting-home-styles.d.ts.map +1 -0
- package/dist/dts/routes/reporting-home/reporting-home-template.d.ts +4 -0
- package/dist/dts/routes/reporting-home/reporting-home-template.d.ts.map +1 -0
- package/dist/dts/routes/reporting-home/reporting-home.d.ts +26 -0
- package/dist/dts/routes/reporting-home/reporting-home.d.ts.map +1 -0
- package/dist/dts/routes/reporting-home/types.d.ts +13 -0
- package/dist/dts/routes/reporting-home/types.d.ts.map +1 -0
- package/dist/dts/styles/colors.d.ts +17 -0
- package/dist/dts/styles/colors.d.ts.map +1 -0
- package/dist/dts/styles/helpers.d.ts +5 -0
- package/dist/dts/styles/helpers.d.ts.map +1 -0
- package/dist/dts/styles/index.d.ts +5 -0
- package/dist/dts/styles/index.d.ts.map +1 -0
- package/dist/dts/styles/normalize.d.ts +5 -0
- package/dist/dts/styles/normalize.d.ts.map +1 -0
- package/dist/dts/styles/styles.d.ts +4 -0
- package/dist/dts/styles/styles.d.ts.map +1 -0
- package/dist/dts/utils/filterObjectArray.d.ts +12 -0
- package/dist/dts/utils/filterObjectArray.d.ts.map +1 -0
- package/dist/dts/utils/getFiltersByType.d.ts +12 -0
- package/dist/dts/utils/getFiltersByType.d.ts.map +1 -0
- package/dist/dts/utils/getSelectedFields.d.ts +5 -0
- package/dist/dts/utils/getSelectedFields.d.ts.map +1 -0
- package/dist/dts/utils/index.d.ts +5 -0
- package/dist/dts/utils/index.d.ts.map +1 -0
- package/dist/dts/utils/logger.d.ts +2 -0
- package/dist/dts/utils/logger.d.ts.map +1 -0
- package/dist/esm/assets/images/index.js +60 -0
- package/dist/esm/components/components.js +51 -0
- package/dist/esm/components/create-edit/create-edit.js +70 -0
- package/dist/esm/components/create-edit/create-edit.styles.js +18 -0
- package/dist/esm/components/create-edit/create-edit.template.js +13 -0
- package/dist/esm/components/create-edit/index.js +3 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/list/columns.js +105 -0
- package/dist/esm/components/list/index.js +3 -0
- package/dist/esm/components/list/list.js +127 -0
- package/dist/esm/components/list/list.styles.js +28 -0
- package/dist/esm/components/list/list.template.js +25 -0
- package/dist/esm/components/preview/columns.js +21 -0
- package/dist/esm/components/preview/index.js +3 -0
- package/dist/esm/components/preview/preview.js +111 -0
- package/dist/esm/components/preview/preview.styles.js +21 -0
- package/dist/esm/components/preview/preview.template.js +30 -0
- package/dist/esm/components/select-fields/columns.js +51 -0
- package/dist/esm/components/select-fields/data.js +218 -0
- package/dist/esm/components/select-fields/index.js +3 -0
- package/dist/esm/components/select-fields/select-fields.js +197 -0
- package/dist/esm/components/select-fields/select-fields.styles.js +21 -0
- package/dist/esm/components/select-fields/select-fields.template.js +49 -0
- package/dist/esm/components/select-filters/columns.js +43 -0
- package/dist/esm/components/select-filters/index.js +3 -0
- package/dist/esm/components/select-filters/select-filters.js +192 -0
- package/dist/esm/components/select-filters/select-filters.styles.js +20 -0
- package/dist/esm/components/select-filters/select-filters.template.js +51 -0
- package/dist/esm/components/wizard/debug.js +34 -0
- package/dist/esm/components/wizard/index.js +2 -0
- package/dist/esm/components/wizard/steps/filters.js +9 -0
- package/dist/esm/components/wizard/steps/index.js +4 -0
- package/dist/esm/components/wizard/steps/name.js +58 -0
- package/dist/esm/components/wizard/steps/run.js +11 -0
- package/dist/esm/components/wizard/steps/select.js +11 -0
- package/dist/esm/components/wizard/wizard.js +363 -0
- package/dist/esm/components/wizard/wizard.styles.js +193 -0
- package/dist/esm/components/wizard/wizard.template.js +113 -0
- package/dist/esm/components/wizard/wizard.types.js +7 -0
- package/dist/esm/constants/grid-config.js +19 -0
- package/dist/esm/index.federated.js +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/layouts/default.js +27 -0
- package/dist/esm/layouts/index.js +2 -0
- package/dist/esm/layouts/two-pane-horizontal.js +86 -0
- package/dist/esm/main/index.js +2 -0
- package/dist/esm/main/main.js +80 -0
- package/dist/esm/main/main.styles.js +15 -0
- package/dist/esm/main/main.template.js +12 -0
- package/dist/esm/routes/config.js +84 -0
- package/dist/esm/routes/index.js +1 -0
- package/dist/esm/routes/not-found/not-found.js +29 -0
- package/dist/esm/routes/protected/protected.js +32 -0
- package/dist/esm/routes/protected/protected.styles.js +18 -0
- package/dist/esm/routes/protected/protected.template.js +7 -0
- package/dist/esm/routes/reporting-home/reporting-home-styles.js +74 -0
- package/dist/esm/routes/reporting-home/reporting-home-template.js +85 -0
- package/dist/esm/routes/reporting-home/reporting-home.js +103 -0
- package/dist/esm/routes/reporting-home/types.js +7 -0
- package/dist/esm/styles/colors.js +17 -0
- package/dist/esm/styles/helpers.js +179 -0
- package/dist/esm/styles/index.js +4 -0
- package/dist/esm/styles/normalize.js +13 -0
- package/dist/esm/styles/styles.js +22 -0
- package/dist/esm/utils/filterObjectArray.js +13 -0
- package/dist/esm/utils/getFiltersByType.js +62 -0
- package/dist/esm/utils/getSelectedFields.js +13 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/logger.js +2 -0
- package/index.html +26 -0
- package/package.json +79 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { css, html } from '@microsoft/fast-element';
|
|
2
|
+
import { FASTElementLayout } from '@microsoft/fast-router';
|
|
3
|
+
export const defaultLayout = new FASTElementLayout(html `
|
|
4
|
+
<div class="container">
|
|
5
|
+
<div class="content">
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
`, css `
|
|
10
|
+
:host {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: block;
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.content {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
bottom: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
}
|
|
27
|
+
`);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, css, customElement, FASTElement, html, when } from '@microsoft/fast-element';
|
|
3
|
+
import { ColorHEX } from '../styles';
|
|
4
|
+
const { cyan } = ColorHEX;
|
|
5
|
+
var Divider;
|
|
6
|
+
(function (Divider) {
|
|
7
|
+
Divider["equal"] = "hyphen";
|
|
8
|
+
Divider["leftMain"] = "";
|
|
9
|
+
Divider["rightMain"] = "hyphen";
|
|
10
|
+
})(Divider || (Divider = {}));
|
|
11
|
+
const name = 'layout-two-pane-horizontal';
|
|
12
|
+
const styles = css `
|
|
13
|
+
.container {
|
|
14
|
+
align-items: stretch;
|
|
15
|
+
column-gap: 4rem;
|
|
16
|
+
display: grid;
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.container.equal {
|
|
21
|
+
grid-template-columns: 1fr 1fr;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.container.left-main {
|
|
25
|
+
grid-template-columns: 3fr 1fr;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.container.right-main {
|
|
29
|
+
grid-template-columns: 1fr 3fr;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.left {
|
|
33
|
+
position: relative;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.left .divider {
|
|
37
|
+
display: flex;
|
|
38
|
+
font-size: 3.2rem;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
position: absolute;
|
|
41
|
+
right: -4rem;
|
|
42
|
+
top: 50%;
|
|
43
|
+
width: 4rem;
|
|
44
|
+
color: ${cyan};
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
const template = html `
|
|
48
|
+
<div class="container ${(x) => x.splitRatio}" part="split-container">
|
|
49
|
+
<section class="left" part="left-section">
|
|
50
|
+
<slot name="left-section"></slot>
|
|
51
|
+
|
|
52
|
+
${when((x) => !x.hideDivider, html `
|
|
53
|
+
<div class="divider" part="divider">
|
|
54
|
+
<slot name="divider">
|
|
55
|
+
<zero-icon name="chevron-right"></zero-icon>
|
|
56
|
+
</slot>
|
|
57
|
+
</div>
|
|
58
|
+
`)}
|
|
59
|
+
</section>
|
|
60
|
+
|
|
61
|
+
<section class="right" part="right-section">
|
|
62
|
+
<slot name="right-section"></slot>
|
|
63
|
+
</section>
|
|
64
|
+
</div>
|
|
65
|
+
`;
|
|
66
|
+
let LayoutTwoPaneHorizontal = class LayoutTwoPaneHorizontal extends FASTElement {
|
|
67
|
+
constructor() {
|
|
68
|
+
super(...arguments);
|
|
69
|
+
this.hideDivider = false;
|
|
70
|
+
this.splitRatio = 'equal';
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
__decorate([
|
|
74
|
+
attr({ mode: 'boolean' })
|
|
75
|
+
], LayoutTwoPaneHorizontal.prototype, "hideDivider", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
attr
|
|
78
|
+
], LayoutTwoPaneHorizontal.prototype, "splitRatio", void 0);
|
|
79
|
+
LayoutTwoPaneHorizontal = __decorate([
|
|
80
|
+
customElement({
|
|
81
|
+
name,
|
|
82
|
+
styles,
|
|
83
|
+
template,
|
|
84
|
+
})
|
|
85
|
+
], LayoutTwoPaneHorizontal);
|
|
86
|
+
export { LayoutTwoPaneHorizontal };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
|
+
import { Session } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { customElement, FASTElement, observable } from '@microsoft/fast-element';
|
|
4
|
+
import { Container, inject, Registration } from '@microsoft/fast-foundation';
|
|
5
|
+
import { DefaultRouteRecognizer } from '@microsoft/fast-router';
|
|
6
|
+
import * as Components from '../components';
|
|
7
|
+
import { MainRouterConfig } from '../routes';
|
|
8
|
+
import { logger } from '../utils';
|
|
9
|
+
import { MainStyles as styles } from './main.styles';
|
|
10
|
+
import { LoadingTemplate, MainTemplate, MainTemplate as template } from './main.template';
|
|
11
|
+
const name = 'foundation-reporting';
|
|
12
|
+
let Reporting = class Reporting extends FASTElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.ready = false;
|
|
16
|
+
this.data = null;
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
this.container.register(Registration.transient(DefaultRouteRecognizer, DefaultRouteRecognizer));
|
|
20
|
+
super.connectedCallback();
|
|
21
|
+
logger.debug(`${name} is now connected to the DOM`);
|
|
22
|
+
this.loadRemotes();
|
|
23
|
+
this.checkForSSOToken();
|
|
24
|
+
}
|
|
25
|
+
checkForSSOToken() {
|
|
26
|
+
const queryParams = new URLSearchParams(window.location.search);
|
|
27
|
+
const ssoToken = queryParams.get('SSO_TOKEN');
|
|
28
|
+
if (ssoToken) {
|
|
29
|
+
this.session.setSessionStorageItem('ssoToken', ssoToken);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
loadRemotes() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
/**
|
|
35
|
+
* Send event to indicate some async work is happening. Will be picked up by overlay micro frontend.
|
|
36
|
+
*/
|
|
37
|
+
const remoteComponents = yield Components.loadRemotes({});
|
|
38
|
+
/**
|
|
39
|
+
* Simulate loading delay, TODO: Remove
|
|
40
|
+
*
|
|
41
|
+
* await new Promise(resolve => setTimeout(resolve, 3000));
|
|
42
|
+
*/
|
|
43
|
+
this.ready = true;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
selectTemplate() {
|
|
47
|
+
return this.ready ? MainTemplate : LoadingTemplate;
|
|
48
|
+
}
|
|
49
|
+
providerChanged() {
|
|
50
|
+
/**
|
|
51
|
+
* Configure foundation ui design system provider if needed
|
|
52
|
+
*/
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
__decorate([
|
|
56
|
+
inject(MainRouterConfig)
|
|
57
|
+
], Reporting.prototype, "config", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
Container
|
|
60
|
+
], Reporting.prototype, "container", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
Session
|
|
63
|
+
], Reporting.prototype, "session", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
observable
|
|
66
|
+
], Reporting.prototype, "provider", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
observable
|
|
69
|
+
], Reporting.prototype, "ready", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
observable
|
|
72
|
+
], Reporting.prototype, "data", void 0);
|
|
73
|
+
Reporting = __decorate([
|
|
74
|
+
customElement({
|
|
75
|
+
name,
|
|
76
|
+
template,
|
|
77
|
+
styles,
|
|
78
|
+
})
|
|
79
|
+
], Reporting);
|
|
80
|
+
export { Reporting };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
export const MainStyles = css `
|
|
3
|
+
:host {
|
|
4
|
+
contain: content;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host,
|
|
8
|
+
zero-design-system-provider,
|
|
9
|
+
.dynamic-template,
|
|
10
|
+
fast-router {
|
|
11
|
+
display: flex;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html, ref } from '@microsoft/fast-element';
|
|
2
|
+
export const DynamicTemplate = html `
|
|
3
|
+
<zero-design-system-provider ${ref('provider')}>
|
|
4
|
+
<div class="dynamic-template">${(x) => x.selectTemplate()}</div>
|
|
5
|
+
</zero-design-system-provider>
|
|
6
|
+
`;
|
|
7
|
+
export const LoadingTemplate = html `
|
|
8
|
+
<fast-progress-ring></fast-progress-ring>
|
|
9
|
+
`;
|
|
10
|
+
export const MainTemplate = html `
|
|
11
|
+
<fast-router :config=${(x) => x.config}></fast-router>
|
|
12
|
+
`;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { __decorate, __param } from "tslib";
|
|
2
|
+
import { Auth, Session, FoundationAnalytics, FoundationAnalyticsEventType, } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { Container } from '@microsoft/fast-foundation';
|
|
4
|
+
import { RouterConfiguration, Route } from '@microsoft/fast-router';
|
|
5
|
+
import { defaultLayout } from '../layouts';
|
|
6
|
+
import { NotFound } from './not-found/not-found';
|
|
7
|
+
import { Protected } from './protected/protected';
|
|
8
|
+
import { ReportingHome } from './reporting-home/reporting-home';
|
|
9
|
+
let MainRouterConfig = class MainRouterConfig extends RouterConfiguration {
|
|
10
|
+
constructor(auth, container, analytics, session) {
|
|
11
|
+
super();
|
|
12
|
+
this.auth = auth;
|
|
13
|
+
this.container = container;
|
|
14
|
+
this.analytics = analytics;
|
|
15
|
+
this.session = session;
|
|
16
|
+
}
|
|
17
|
+
configure() {
|
|
18
|
+
this.title = 'Reporting';
|
|
19
|
+
this.defaultLayout = defaultLayout;
|
|
20
|
+
this.routes.map({
|
|
21
|
+
path: '',
|
|
22
|
+
element: ReportingHome,
|
|
23
|
+
title: 'Reporting',
|
|
24
|
+
name: 'reporting-home',
|
|
25
|
+
settings: {
|
|
26
|
+
public: true,
|
|
27
|
+
resetPassword: true,
|
|
28
|
+
forgotPassword: true,
|
|
29
|
+
requestAccount: true,
|
|
30
|
+
},
|
|
31
|
+
}, { path: 'protected', element: Protected, title: 'Protected', name: 'protected' }, { path: 'not-found', element: NotFound, title: 'Not Found', name: 'not-found' });
|
|
32
|
+
const session = this.session;
|
|
33
|
+
const auth = this.auth;
|
|
34
|
+
const analytics = this.analytics;
|
|
35
|
+
/**
|
|
36
|
+
* Example of a FallbackRouteDefinition
|
|
37
|
+
*/
|
|
38
|
+
this.routes.fallback(() => auth.isLoggedIn ? { redirect: 'not-found' } : { redirect: 'reporting-home' });
|
|
39
|
+
/**
|
|
40
|
+
* Example of a NavigationContributor
|
|
41
|
+
*/
|
|
42
|
+
this.contributors.push({
|
|
43
|
+
navigate: (phase) => {
|
|
44
|
+
const settings = phase.route.settings;
|
|
45
|
+
/**
|
|
46
|
+
* TODO: Centralise
|
|
47
|
+
* Suspect this should be done via createEventSink, but it's not fully clear how-to do that as no docs
|
|
48
|
+
*/
|
|
49
|
+
analytics.trackEvent(FoundationAnalyticsEventType.routeChanged, {
|
|
50
|
+
path: phase.route.endpoint.path,
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* If public route don't block
|
|
54
|
+
*/
|
|
55
|
+
if (settings && settings.public) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* If logged in don't block
|
|
60
|
+
*/
|
|
61
|
+
if (auth.isLoggedIn) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Otherwise route them to login
|
|
66
|
+
*/
|
|
67
|
+
phase.cancel(() => {
|
|
68
|
+
session.captureReturnUrl();
|
|
69
|
+
Route.name.replace(phase.router, 'reporting-home');
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
construct(Type) {
|
|
75
|
+
return this.container.get(Type);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
MainRouterConfig = __decorate([
|
|
79
|
+
__param(0, Auth),
|
|
80
|
+
__param(1, Container),
|
|
81
|
+
__param(2, FoundationAnalytics),
|
|
82
|
+
__param(3, Session)
|
|
83
|
+
], MainRouterConfig);
|
|
84
|
+
export { MainRouterConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, customElement, FASTElement, html } from '@microsoft/fast-element';
|
|
3
|
+
import { mixinScreen } from '../../styles';
|
|
4
|
+
const template = html `
|
|
5
|
+
<h1>Not found! 404</h1>
|
|
6
|
+
`;
|
|
7
|
+
const styles = css `
|
|
8
|
+
:host {
|
|
9
|
+
${mixinScreen()}
|
|
10
|
+
}
|
|
11
|
+
:host {
|
|
12
|
+
contain: content;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
height: 100%;
|
|
16
|
+
width: 100%;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
let NotFound = class NotFound extends FASTElement {
|
|
21
|
+
};
|
|
22
|
+
NotFound = __decorate([
|
|
23
|
+
customElement({
|
|
24
|
+
name: 'foundation-reporting-not-found',
|
|
25
|
+
template,
|
|
26
|
+
styles,
|
|
27
|
+
})
|
|
28
|
+
], NotFound);
|
|
29
|
+
export { NotFound };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
|
+
import { Auth, Connect } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { customElement, FASTElement } from '@microsoft/fast-element';
|
|
4
|
+
import { Route } from '@microsoft/fast-router';
|
|
5
|
+
import { ProtectedStyles as styles } from './protected.styles';
|
|
6
|
+
import { ProtectedTemplate as template } from './protected.template';
|
|
7
|
+
const name = 'foundation-reporting-protected';
|
|
8
|
+
let Protected = class Protected extends FASTElement {
|
|
9
|
+
logout() {
|
|
10
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const result = yield this.auth.logout();
|
|
12
|
+
if (!result.success) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
Route.path.push('/');
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
Connect
|
|
21
|
+
], Protected.prototype, "connect", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
Auth
|
|
24
|
+
], Protected.prototype, "auth", void 0);
|
|
25
|
+
Protected = __decorate([
|
|
26
|
+
customElement({
|
|
27
|
+
name,
|
|
28
|
+
template,
|
|
29
|
+
styles,
|
|
30
|
+
})
|
|
31
|
+
], Protected);
|
|
32
|
+
export { Protected };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
export const ProtectedStyles = css `
|
|
3
|
+
:host {
|
|
4
|
+
contain: content;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.protected-page {
|
|
12
|
+
align-items: center;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
height: 100%;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { neutralForegroundRest, neutralLayer4 } from '@microsoft/fast-components';
|
|
2
|
+
import { css } from '@microsoft/fast-element';
|
|
3
|
+
import { helperStyles } from '../../styles';
|
|
4
|
+
import { ColorHEX } from '../../styles/colors';
|
|
5
|
+
const { blackPearl, lightBlue, dark } = ColorHEX;
|
|
6
|
+
export const ReportingHomeStyles = css `
|
|
7
|
+
${helperStyles}
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
--design-unit: 3.5;
|
|
14
|
+
--zero-fill-color: ${blackPearl};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.container {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
color: white;
|
|
23
|
+
background-color: ${blackPearl};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.notification-container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
position: absolute;
|
|
30
|
+
z-index: 10;
|
|
31
|
+
right: calc(var(--design-unit) * 10px);
|
|
32
|
+
bottom: calc(var(--design-unit) * 10px);
|
|
33
|
+
color: ${neutralForegroundRest};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.header {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
|
|
41
|
+
margin-bottom: 10px;
|
|
42
|
+
padding: 10px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.title {
|
|
46
|
+
font-size: 18px;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tabs {
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
|
|
54
|
+
--zero-card-fill-color: ${neutralLayer4};
|
|
55
|
+
--accent-foreground-rest: ${lightBlue};
|
|
56
|
+
--type-ramp-base-font-size: 13px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::part(tablist),
|
|
60
|
+
.tabs .tablist {
|
|
61
|
+
height: 37;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
zero-tab-panel {
|
|
65
|
+
background-color: ${neutralLayer4};
|
|
66
|
+
height: calc(100% - 110px);
|
|
67
|
+
padding: 1px 1rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.controls {
|
|
71
|
+
align-items: center;
|
|
72
|
+
display: flex;
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { html, repeat, ref, when } from '@microsoft/fast-element';
|
|
2
|
+
const notificationToast = html `
|
|
3
|
+
<div class="notification-container" data-test-id="notification-container">
|
|
4
|
+
${repeat((x) => x.notifications, html `
|
|
5
|
+
<zero-toast
|
|
6
|
+
notify=${(notification) => notification.type}
|
|
7
|
+
auto-close=${(notification) => notification.autoClose}
|
|
8
|
+
data-test-id="toast"
|
|
9
|
+
>
|
|
10
|
+
<div slot="top" data-test-id="toast-title">${(notification) => notification.title}</div>
|
|
11
|
+
<p slot="content" data-test-id="toast-message">
|
|
12
|
+
${(notification) => notification.message}
|
|
13
|
+
</p>
|
|
14
|
+
</zero-toast>
|
|
15
|
+
`)}
|
|
16
|
+
</div>
|
|
17
|
+
`;
|
|
18
|
+
const header = html `
|
|
19
|
+
<div class="header" data-test-id="header">
|
|
20
|
+
<h1 id="title" class="title" data-test-id="report-title">All Reports</h1>
|
|
21
|
+
<div class="controls" data-test-id="controls">
|
|
22
|
+
<zero-button
|
|
23
|
+
appearance="neutral-grey"
|
|
24
|
+
class="button"
|
|
25
|
+
?disabled=${(x) => !x.selectedRows.length}
|
|
26
|
+
@click=${(x) => x.reportsGrid.batchDelete()}
|
|
27
|
+
data-test-id="delete-reports-button"
|
|
28
|
+
>
|
|
29
|
+
Delete Reports
|
|
30
|
+
</zero-button>
|
|
31
|
+
|
|
32
|
+
<zero-button
|
|
33
|
+
appearance="primary-gradient"
|
|
34
|
+
class="button"
|
|
35
|
+
@click=${(x) => x.create()}
|
|
36
|
+
data-test-id="add-report-button"
|
|
37
|
+
>
|
|
38
|
+
Add new report
|
|
39
|
+
</zero-button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
export const ReportingHomeTemplate = html `
|
|
44
|
+
${when((x) => x.notifications.length, notificationToast)}
|
|
45
|
+
|
|
46
|
+
<div class="container" data-test-id="reporting-home">
|
|
47
|
+
<zero-design-system-provider>
|
|
48
|
+
<zero-tabs ${ref('tabs')} class="tabs" data-test-id="tabs">
|
|
49
|
+
<span part="start" class="start" slot="start" data-test-id="reporting-tab">Reporting</span>
|
|
50
|
+
<zero-tab id="list-reports" slot="tab" data-test-id="list-reports-tab">
|
|
51
|
+
All Reports
|
|
52
|
+
</zero-tab>
|
|
53
|
+
<zero-tab id="create-edit-report" slot="tab" data-test-id="create-edit-report-tab">
|
|
54
|
+
Create Report
|
|
55
|
+
</zero-tab>
|
|
56
|
+
${when((x) => Object.keys(x.activeReport).length > 0, html `
|
|
57
|
+
<zero-tab id="run-report" slot="tab" data-test-id="run-report-tab">Run Report</zero-tab>
|
|
58
|
+
`)}
|
|
59
|
+
|
|
60
|
+
<zero-tab-panel slot="tabpanel" class="tab-panel" data-test-id="list-reports-panel">
|
|
61
|
+
${header}
|
|
62
|
+
<reporting-list ${ref('reportsGrid')} data-test-id="report-list"></reporting-list>
|
|
63
|
+
</zero-tab-panel>
|
|
64
|
+
|
|
65
|
+
<zero-tab-panel slot="tabpanel" class="tab-panel" data-test-id="create-edit-report-panel">
|
|
66
|
+
<reporting-create-edit
|
|
67
|
+
:report=${(x) => x.activeReport}
|
|
68
|
+
:setPageTab=${(x) => x.setPageTab}
|
|
69
|
+
:datasourceSettings=${(x) => x.datasourceSettings}
|
|
70
|
+
data-test-id="create-edit-report-component"
|
|
71
|
+
/>
|
|
72
|
+
</zero-tab-panel>
|
|
73
|
+
${when((x) => Object.keys(x.activeReport).length > 0, html `
|
|
74
|
+
<zero-tab-panel slot="tabpanel" class="tab-panel" data-test-id="report-preview-panel">
|
|
75
|
+
<reporting-preview
|
|
76
|
+
:report=${(x) => x.activeReport}
|
|
77
|
+
:datasourceSettings=${(x) => x.datasourceSettings}
|
|
78
|
+
data-test-id="report-preview-component"
|
|
79
|
+
/>
|
|
80
|
+
</zero-tab-panel>
|
|
81
|
+
`)}
|
|
82
|
+
</zero-tabs>
|
|
83
|
+
</zero-design-system-provider>
|
|
84
|
+
</div>
|
|
85
|
+
`;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
|
+
import { Connect, DatasourceDefaults } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { customElement, observable } from '@microsoft/fast-element';
|
|
4
|
+
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
5
|
+
import { ReportingHomeStyles as styles } from './reporting-home-styles';
|
|
6
|
+
import { ReportingHomeTemplate as template } from './reporting-home-template';
|
|
7
|
+
import { ReportingEventListeners } from './types';
|
|
8
|
+
const name = 'reporting-home';
|
|
9
|
+
let ReportingHome = class ReportingHome extends FoundationElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.fields = [];
|
|
13
|
+
this.selectedRows = [];
|
|
14
|
+
this.activeReport = {};
|
|
15
|
+
this.notifications = [];
|
|
16
|
+
}
|
|
17
|
+
enter(phase) {
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
this.datasourceSettings = {
|
|
21
|
+
maxRows: (_b = (_a = phase.route.settings) === null || _a === void 0 ? void 0 : _a.maxRows) !== null && _b !== void 0 ? _b : DatasourceDefaults.MAX_ROWS_250,
|
|
22
|
+
maxView: (_d = (_c = phase.route.settings) === null || _c === void 0 ? void 0 : _c.maxView) !== null && _d !== void 0 ? _d : DatasourceDefaults.MAX_VIEW_1000,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
const _super = Object.create(null, {
|
|
28
|
+
connectedCallback: { get: () => super.connectedCallback }
|
|
29
|
+
});
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
_super.connectedCallback.call(this);
|
|
32
|
+
this.reportsGrid.addEventListener('rowSelectionEvent', (e) => {
|
|
33
|
+
this.selectedRows = e.detail.selectedRows();
|
|
34
|
+
});
|
|
35
|
+
this.addEventListener(ReportingEventListeners.notify, (e) => {
|
|
36
|
+
this.notifications = [...this.notifications, e.detail];
|
|
37
|
+
});
|
|
38
|
+
this.addEventListener(ReportingEventListeners.listReports, (e) => {
|
|
39
|
+
this.setPageTab('list-reports');
|
|
40
|
+
this.activeReport = {};
|
|
41
|
+
});
|
|
42
|
+
this.reportsGrid.addEventListener(ReportingEventListeners.runReport, (e) => {
|
|
43
|
+
this.run(e.detail);
|
|
44
|
+
});
|
|
45
|
+
this.reportsGrid.addEventListener(ReportingEventListeners.editReport, (e) => {
|
|
46
|
+
this.edit(e.detail);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// TODO: use const for tab identifiers
|
|
51
|
+
create() {
|
|
52
|
+
this.activeReport = {};
|
|
53
|
+
this.setPageTab('create-edit-report');
|
|
54
|
+
}
|
|
55
|
+
edit(rowData) {
|
|
56
|
+
this.activeReport = Object.assign(Object.assign({}, rowData), { REPORT_COLUMNS: JSON.parse(rowData['REPORT_COLUMNS']) });
|
|
57
|
+
this.setPageTab('create-edit-report');
|
|
58
|
+
}
|
|
59
|
+
run(rowData) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
this.activeReport = Object.assign(Object.assign({}, rowData), { REPORT_COLUMNS: JSON.parse(rowData['REPORT_COLUMNS']) });
|
|
62
|
+
this.setPageTab('run-report');
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
setPageTab(tab) {
|
|
66
|
+
this.tabs.activeid = tab;
|
|
67
|
+
}
|
|
68
|
+
getFields(resourceName) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const temp = yield this.connect.getMetadata(resourceName);
|
|
71
|
+
for (let i = 0; i < temp.FIELD.length; i += 1) {
|
|
72
|
+
this.fields.push(temp.FIELD[i].NAME);
|
|
73
|
+
}
|
|
74
|
+
this.listBox.hidden = false;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
__decorate([
|
|
79
|
+
Connect
|
|
80
|
+
], ReportingHome.prototype, "connect", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
observable
|
|
83
|
+
], ReportingHome.prototype, "fields", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
observable
|
|
86
|
+
], ReportingHome.prototype, "selectedRows", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
observable
|
|
89
|
+
], ReportingHome.prototype, "activeReport", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
observable
|
|
92
|
+
], ReportingHome.prototype, "notifications", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
observable
|
|
95
|
+
], ReportingHome.prototype, "datasourceSettings", void 0);
|
|
96
|
+
ReportingHome = __decorate([
|
|
97
|
+
customElement({
|
|
98
|
+
name,
|
|
99
|
+
template,
|
|
100
|
+
styles,
|
|
101
|
+
})
|
|
102
|
+
], ReportingHome);
|
|
103
|
+
export { ReportingHome };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var ReportingEventListeners;
|
|
2
|
+
(function (ReportingEventListeners) {
|
|
3
|
+
ReportingEventListeners["notify"] = "notify";
|
|
4
|
+
ReportingEventListeners["listReports"] = "listReports";
|
|
5
|
+
ReportingEventListeners["runReport"] = "runReport";
|
|
6
|
+
ReportingEventListeners["editReport"] = "editReport";
|
|
7
|
+
})(ReportingEventListeners || (ReportingEventListeners = {}));
|