@genesislcap/blank-app-seed 2.0.2 → 2.2.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed-config",
3
3
  "description": "Genesis Blank App Seed Configuration",
4
- "version": "2.0.2",
4
+ "version": "2.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "genxSeedConfig": {
7
7
  "exclude": [
package/.gitignore CHANGED
@@ -42,6 +42,7 @@ target/
42
42
  client/bootstrapDone
43
43
  .husky/.gitignore
44
44
  build-cache/
45
+ server/h2/
45
46
 
46
47
  # Ignore Gradle GUI config
47
48
  gradle-app.setting
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.1.0...v2.2.0) (2024-03-11)
4
+
5
+
6
+ ### Features
7
+
8
+ * add ui pbc compatibility [PLAT-1028](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/1028) (#139) 2a1f927
9
+
10
+ ## [2.1.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.0.2...v2.1.0) (2024-03-11)
11
+
12
+
13
+ ### Features
14
+
15
+ * Make H2 the default DB in blank app seed([PSD-50](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/50)) (#142) 8bd473b
16
+
3
17
  ## [2.0.2](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.0.1...v2.0.2) (2024-03-11)
4
18
 
5
19
 
@@ -0,0 +1,8 @@
1
+ [*]
2
+ indent_style = space
3
+ indent_size = 2
4
+ insert_final_newline = true
5
+
6
+ [*.json]
7
+ indent_style = space
8
+ indent_size = 2
@@ -88,12 +88,15 @@
88
88
  "dependencies": {
89
89
  "@genesislcap/foundation-comms": "{{versions.UI}}",
90
90
  "@genesislcap/foundation-entity-management": "{{versions.UI}}",
91
+ "@genesislcap/foundation-events": "{{versions.UI}}",
91
92
  "@genesislcap/foundation-forms": "{{versions.UI}}",
92
93
  "@genesislcap/foundation-header": "{{versions.UI}}",
93
94
  "@genesislcap/foundation-inbox": "{{versions.UI}}",
94
95
  "@genesislcap/foundation-layout": "{{versions.UI}}",
95
96
  "@genesislcap/foundation-logger": "{{versions.UI}}",
96
97
  "@genesislcap/foundation-login": "{{versions.UI}}",
98
+ "@genesislcap/foundation-shell": "{{versions.UI}}",
99
+ "@genesislcap/foundation-store": "{{versions.UI}}",
97
100
  "@genesislcap/foundation-ui": "{{versions.UI}}",
98
101
  "@genesislcap/foundation-utils": "{{versions.UI}}",
99
102
  "@genesislcap/foundation-zero": "{{versions.UI}}",
@@ -106,5 +109,23 @@
106
109
  "@microsoft/fast-web-utilities": "^5.1.0",
107
110
  "rxjs": "^7.5.4",
108
111
  "tslib": "^2.3.1"
109
- }
112
+ },
113
+ "overrides": {
114
+ "@genesislcap/foundation-comms": "{{versions.UI}}",
115
+ "@genesislcap/foundation-entity-management": "{{versions.UI}}",
116
+ "@genesislcap/foundation-events": "{{versions.UI}}",
117
+ "@genesislcap/foundation-forms": "{{versions.UI}}",
118
+ "@genesislcap/foundation-header": "{{versions.UI}}",
119
+ "@genesislcap/foundation-inbox": "{{versions.UI}}",
120
+ "@genesislcap/foundation-layout": "{{versions.UI}}",
121
+ "@genesislcap/foundation-logger": "{{versions.UI}}",
122
+ "@genesislcap/foundation-login": "{{versions.UI}}",
123
+ "@genesislcap/foundation-shell": "{{versions.UI}}",
124
+ "@genesislcap/foundation-store": "{{versions.UI}}",
125
+ "@genesislcap/foundation-ui": "{{versions.UI}}",
126
+ "@genesislcap/foundation-utils": "{{versions.UI}}",
127
+ "@genesislcap/foundation-zero": "{{versions.UI}}",
128
+ "@genesislcap/foundation-zero-grid-pro": "{{versions.UI}}",
129
+ "@genesislcap/g2plot-chart": "{{versions.UI}}"
130
+ }
110
131
  }
@@ -1,57 +1,75 @@
1
1
  import { EntityManagement } from '@genesislcap/foundation-entity-management';
2
2
  import { Form } from '@genesislcap/foundation-forms';
3
+ import { Navigation } from '@genesislcap/foundation-header';
3
4
  import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
5
+ import { getApp } from '@genesislcap/foundation-shell/app';
6
+ import { FoundationRouter } from '@genesislcap/foundation-ui';
7
+ import {
8
+ assureDesignSystem,
9
+ DesignSystemModule,
10
+ ResourceType,
11
+ } from '@genesislcap/foundation-utils';
4
12
  import { zeroGridComponents } from '@genesislcap/foundation-zero-grid-pro';
5
13
  import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
6
- import { FASTRouter } from '@microsoft/fast-router';
7
14
  import { logger } from '../utils';
8
15
 
9
- EntityManagement;
10
- Form;
11
-
12
- enum ResourceType {
13
- LOCAL = 'LOCAL',
14
- REMOTE = 'REMOTE',
15
- }
16
-
17
16
  /**
18
- * TODO: Think about sharing import functions across micro frontends.
17
+ * Ensure tree shaking doesn't remove these.
19
18
  */
20
- function loadZeroFallback() {
21
- return import(
22
- /* webpackMode: "lazy" */
23
- '@genesislcap/foundation-zero'
24
- );
25
- }
19
+ FoundationRouter;
20
+ Navigation;
21
+ EntityManagement;
22
+ Form;
26
23
 
27
24
  /**
28
- * Granular
25
+ * zeroDesignSystemImport.
26
+ * @remarks
27
+ * Attempts to use a module federation version of zero before falling back to the version that was bundled with the app.
28
+ * @internal
29
29
  */
30
- async function loadZeroDesignSystem() {
31
- let type = ResourceType.REMOTE;
30
+ async function zeroDesignSystemImport(): Promise<DesignSystemModule> {
31
+ let module: DesignSystemModule;
32
+ let type: ResourceType = ResourceType.remote;
32
33
  try {
33
- // @ts-ignore
34
- return await import('foundationZero/ZeroDesignSystem');
34
+ module = await import(
35
+ /* webpackChunkName: "foundation-zero" */
36
+ 'foundationZero/ZeroDesignSystem'
37
+ );
38
+ return assureDesignSystem(module);
35
39
  } catch (e) {
36
- type = ResourceType.LOCAL;
37
- return await loadZeroFallback();
40
+ logger.info(
41
+ `Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`,
42
+ );
43
+ type = ResourceType.local;
44
+ module = await import(
45
+ /* webpackChunkName: "foundation-zero" */
46
+ '@genesislcap/foundation-zero'
47
+ );
48
+ return assureDesignSystem(module);
38
49
  } finally {
39
- logger.debug(`Using '${type}' version of foundationZero/ZeroDesignSystem`);
50
+ logger.debug(`Using '${type}' version of foundation-zero`);
40
51
  }
41
52
  }
42
53
 
43
- export type LoadRemotesOptions = {};
54
+ /**
55
+ * registerComponents.
56
+ * @public
57
+ */
58
+ export async function registerComponents() {
59
+ const designSystem = await zeroDesignSystemImport();
60
+ const { provideDesignSystem, baseComponents } = designSystem;
44
61
 
45
- export async function loadRemotes() {
46
- const { provideDesignSystem, baseComponents } = await loadZeroDesignSystem();
47
- return {
48
- ZeroDesignSystem: provideDesignSystem().register(
49
- baseComponents,
50
- zeroGridComponents,
51
- g2plotChartsComponents,
52
- foundationLayoutComponents,
53
- ),
54
- };
55
- }
62
+ /**
63
+ * Register any PBC components with the design system
64
+ */
65
+ getApp().registerComponents({
66
+ designSystem,
67
+ });
56
68
 
57
- FASTRouter;
69
+ provideDesignSystem().register(
70
+ baseComponents,
71
+ zeroGridComponents,
72
+ g2plotChartsComponents,
73
+ foundationLayoutComponents,
74
+ );
75
+ }
@@ -1,5 +1,12 @@
1
- import { css, html, repeat } from '@microsoft/fast-element';
1
+ import { getApp } from '@genesislcap/foundation-shell/app';
2
+ import type { FoundationRouter } from '@genesislcap/foundation-ui';
3
+ import { css, html } from '@microsoft/fast-element';
2
4
  import { FASTElementLayout } from '@microsoft/fast-router';
5
+ import type { Store } from '../store';
6
+
7
+ type ClientAppRouter = FoundationRouter & { store: Store };
8
+
9
+ const app = getApp();
3
10
 
4
11
  const baseLayoutCss = css`
5
12
  .container {
@@ -19,7 +26,7 @@ const baseLayoutCss = css`
19
26
  `;
20
27
 
21
28
  export const loginLayout = new FASTElementLayout(
22
- html`
29
+ html<ClientAppRouter>`
23
30
  <div class="container">
24
31
  <div class="content">
25
32
  <slot></slot>
@@ -30,84 +37,76 @@ export const loginLayout = new FASTElementLayout(
30
37
  );
31
38
 
32
39
  export const defaultLayout = new FASTElementLayout(
33
- html`
40
+ html<ClientAppRouter>`
34
41
  <div class="container">
42
+ ${app.registerElementsTarget('layout-start')}
35
43
  <foundation-header
36
44
  show-luminance-toggle-button
37
45
  show-misc-toggle-button
38
- show-notification-button
46
+ :routeNavItems=${(x) => x.config.getNavItems()}
39
47
  >
40
- ${repeat(
41
- (x) => x.config.allRoutes,
42
- html`
43
- <zero-button
44
- appearance="neutral-grey"
45
- slot="routes"
46
- value="${(x) => x.index}"
47
- @click=${(x, c) => c.parent.navigation.navigateTo(x.path)}
48
- >
49
- <zero-icon variant="${(x) => x.variant}" name="${(x) => x.icon}"></zero-icon>
50
- ${(x) => x.title}
51
- </zero-button>
52
- `,
53
- )}
54
- <span slot="group-title-1">GROUP SLOT</span>
55
- <zero-tree-view slot="nav-items-1">
56
- <zero-tree-item>
57
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
58
- Slot Tree Item
59
- </zero-tree-item>
60
- <zero-tree-item>
61
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
62
- Slot Tree Item
63
- </zero-tree-item>
64
- <zero-tree-item>
65
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
66
- Slot Tree Item
67
- </zero-tree-item>
68
- <zero-tree-item>
69
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
70
- Slot Tree Item
71
- </zero-tree-item>
72
- </zero-tree-view>
73
- <span slot="group-title-2">GROUP SLOT 2</span>
74
- <zero-tree-view slot="nav-items-2">
75
- <zero-tree-item>
76
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
77
- Slot Tree Item 2
78
- </zero-tree-item>
79
- <zero-tree-item>
80
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
81
- Slot Tree Item 2
82
- </zero-tree-item>
83
- <zero-tree-item>
84
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
85
- Slot Tree Item 2
86
- </zero-tree-item>
87
- <zero-tree-item>
88
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
89
- Slot Tree Item 2
90
- </zero-tree-item>
91
- </zero-tree-view>
92
- <span slot="group-title-3">GROUP SLOT 3</span>
93
- <zero-tree-view slot="nav-items-3">
94
- <zero-tree-item>
95
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
96
- User Slot
97
- </zero-tree-item>
98
- <zero-tree-item>
99
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
100
- Reporting Slot
101
- </zero-tree-item>
102
- <zero-tree-item>
103
- <zero-icon variant="solid" name="location-arrow"></zero-icon>
104
- Settings Slot
105
- </zero-tree-item>
106
- </zero-tree-view>
48
+ <div slot="menu-contents">
49
+ <span slot="group-title-1">GROUP SLOT</span>
50
+ <zero-tree-view slot="nav-items-1">
51
+ <zero-tree-item>
52
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
53
+ Slot Tree Item
54
+ </zero-tree-item>
55
+ <zero-tree-item>
56
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
57
+ Slot Tree Item
58
+ </zero-tree-item>
59
+ <zero-tree-item>
60
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
61
+ Slot Tree Item
62
+ </zero-tree-item>
63
+ <zero-tree-item>
64
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
65
+ Slot Tree Item
66
+ </zero-tree-item>
67
+ </zero-tree-view>
68
+ <span slot="group-title-2">GROUP SLOT 2</span>
69
+ <zero-tree-view slot="nav-items-2">
70
+ <zero-tree-item>
71
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
72
+ Slot Tree Item 2
73
+ </zero-tree-item>
74
+ <zero-tree-item>
75
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
76
+ Slot Tree Item 2
77
+ </zero-tree-item>
78
+ <zero-tree-item>
79
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
80
+ Slot Tree Item 2
81
+ </zero-tree-item>
82
+ <zero-tree-item>
83
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
84
+ Slot Tree Item 2
85
+ </zero-tree-item>
86
+ </zero-tree-view>
87
+ <span slot="group-title-3">GROUP SLOT 3</span>
88
+ <zero-tree-view slot="nav-items-3">
89
+ <zero-tree-item>
90
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
91
+ User Slot
92
+ </zero-tree-item>
93
+ <zero-tree-item>
94
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
95
+ Reporting Slot
96
+ </zero-tree-item>
97
+ <zero-tree-item>
98
+ <zero-icon variant="solid" name="location-arrow"></zero-icon>
99
+ Settings Slot
100
+ </zero-tree-item>
101
+ </zero-tree-view>
102
+ </div>
107
103
  </foundation-header>
108
104
  <div class="content">
105
+ ${app.registerElementsTarget('content-start')}
109
106
  <slot></slot>
107
+ ${app.registerElementsTarget(['content', 'content-end'])}
110
108
  </div>
109
+ ${app.registerElementsTarget(['layout', 'layout-end'])}
111
110
  </div>
112
111
  `,
113
112
  css`
@@ -131,5 +130,23 @@ export const defaultLayout = new FASTElementLayout(
131
130
  color: #879ba6;
132
131
  padding-right: 10px;
133
132
  }
134
- `,
133
+
134
+ foundation-header::part(nav-visibility-icon) {
135
+ color: var(--accent-foreground-rest);
136
+ }
137
+
138
+ foundation-header::part(notifications-button) {
139
+ position: relative;
140
+ }
141
+
142
+ zero-flyout::part(flyout) {
143
+ width: 40%;
144
+ min-width: 320px;
145
+ padding: 0;
146
+ }
147
+
148
+ zero-flyout::part(content) {
149
+ height: 100%;
150
+ }
151
+ `.withBehaviors(app.registerStylesTarget('layout')),
135
152
  );
@@ -8,7 +8,7 @@ body {
8
8
  margin: 0;
9
9
  }
10
10
 
11
- fast-router {
11
+ foundation-router {
12
12
  padding-top: 60px;
13
13
  }
14
14
 
@@ -1,3 +1,4 @@
1
+ import { getApp } from '@genesislcap/foundation-shell/app';
1
2
  import { css } from '@microsoft/fast-element';
2
3
  import { stylesFontFaces } from '../styles';
3
4
  import './main.css';
@@ -13,9 +14,9 @@ export const MainStyles = css`
13
14
  :host,
14
15
  zero-design-system-provider,
15
16
  .dynamic-template,
16
- fast-router {
17
+ foundation-router {
17
18
  display: flex;
18
19
  width: 100%;
19
20
  height: 100%;
20
21
  }
21
- `;
22
+ `.withBehaviors(getApp().registerStylesTarget('main'));
@@ -1,11 +1,14 @@
1
+ import { LAYOUT_POPOUT_CONTAINER_CLASS } from '@genesislcap/foundation-layout';
1
2
  import { html, ref } from '@microsoft/fast-element';
2
3
  import type { ViewTemplate } from '@microsoft/fast-element';
3
4
  import type { MainApplication } from './main';
4
5
 
5
6
  export const DynamicTemplate: ViewTemplate<MainApplication> = html`
6
- <zero-design-system-provider ${ref('provider')}>
7
- <div class="dynamic-template">${(x) => x.selectTemplate()}</div>
8
- </zero-design-system-provider>
7
+ <template>
8
+ <zero-design-system-provider ${ref('provider')} class="${LAYOUT_POPOUT_CONTAINER_CLASS}">
9
+ <div class="dynamic-template">${(x) => x.selectTemplate()}</div>
10
+ </zero-design-system-provider>
11
+ </template>
9
12
  `;
10
13
 
11
14
  export const LoadingTemplate: ViewTemplate<MainApplication> = html`
@@ -13,9 +16,9 @@ export const LoadingTemplate: ViewTemplate<MainApplication> = html`
13
16
  `;
14
17
 
15
18
  export const MainTemplate: ViewTemplate<MainApplication> = html`
16
- <fast-router
19
+ <foundation-router
17
20
  @luminance-icon-clicked=${(x) => x.onDarkModeToggle()}
18
21
  :config=${(x) => x.config}
19
- :navigation=${(x) => x.navigation}
20
- ></fast-router>
22
+ :store=${(x) => x.store}
23
+ ></foundation-router>
21
24
  `;
@@ -1,5 +1,7 @@
1
1
  import { Connect, ConnectConfig, defaultConnectConfig } from '@genesislcap/foundation-comms';
2
- import { Navigation } from '@genesislcap/foundation-header';
2
+ import { EventEmitter } from '@genesislcap/foundation-events';
3
+ import { App } from '@genesislcap/foundation-shell/app';
4
+ import { importPBCAssets } from '@genesislcap/foundation-shell/pbc';
3
5
  import { configureDesignSystem } from '@genesislcap/foundation-ui';
4
6
  import { baseLayerLuminance, StandardLuminance } from '@microsoft/fast-components';
5
7
  import { FASTElement, customElement, observable, DOM } from '@microsoft/fast-element';
@@ -7,35 +9,40 @@ import { Container, inject, Registration } from '@microsoft/fast-foundation';
7
9
  import { DefaultRouteRecognizer } from '@microsoft/fast-router';
8
10
  import * as Components from '../components';
9
11
  import { MainRouterConfig } from '../routes';
12
+ import { Store, StoreEventDetailMap } from '../store';
10
13
  import designTokens from '../styles/design-tokens.json';
11
- import { logger } from '../utils';
12
14
  import { MainStyles as styles } from './main.styles';
13
15
  import { DynamicTemplate as template, LoadingTemplate, MainTemplate } from './main.template';
14
16
 
15
- // eslint-disable-next-line
16
- declare var API_HOST: string;
17
-
18
- const hostEnv = location.host;
19
- const hostUrl = API_HOST || `wss://${hostEnv}/gwf/`;
17
+ const name = '{{rootElement}}';
20
18
 
19
+ /**
20
+ * @fires store-connected - Fired when the store is connected.
21
+ * @fires store-ready - Fired when the store is ready.
22
+ */
21
23
  @customElement({
22
- name: '{{rootElement}}',
24
+ name,
23
25
  template,
24
26
  styles,
25
27
  })
26
- export class MainApplication extends FASTElement {
27
- @inject(MainRouterConfig) config!: MainRouterConfig;
28
- @inject(Navigation) navigation!: Navigation;
28
+ export class MainApplication extends EventEmitter<StoreEventDetailMap>(FASTElement) {
29
+ @App app: App;
29
30
  @Connect connect!: Connect;
30
31
  @Container container!: Container;
32
+ @Store store: Store;
33
+
34
+ @inject(MainRouterConfig) config!: MainRouterConfig;
35
+
31
36
  @observable provider!: any;
32
37
  @observable ready: boolean = false;
33
38
  @observable data: any = null;
34
39
 
35
40
  async connectedCallback() {
36
- super.connectedCallback();
37
- logger.debug('{{rootElement}} is now connected to the DOM');
38
41
  this.registerDIDependencies();
42
+ super.connectedCallback();
43
+ this.addEventListeners();
44
+ this.readyStore();
45
+ await this.loadPBCs();
39
46
  await this.loadRemotes();
40
47
  DOM.queueUpdate(() => {
41
48
  configureDesignSystem(this.provider, designTokens);
@@ -44,6 +51,8 @@ export class MainApplication extends FASTElement {
44
51
 
45
52
  disconnectedCallback() {
46
53
  super.disconnectedCallback();
54
+ this.removeEventListeners();
55
+ this.disconnectStore();
47
56
  }
48
57
 
49
58
  onDarkModeToggle() {
@@ -55,16 +64,28 @@ export class MainApplication extends FASTElement {
55
64
  );
56
65
  }
57
66
 
58
- async loadRemotes() {
59
- await Components.loadRemotes();
67
+ async loadPBCs() {
68
+ /**
69
+ * Import PBC assets that may have been added to the ./pbc directory by genx or by hand
70
+ */
71
+ const pbcAssets = await importPBCAssets();
60
72
  /**
61
- * Simulate loading delay
62
- * await new Promise(resolve => setTimeout(resolve, 3000));
73
+ * Register bulk assets
63
74
  */
75
+ this.app.registerAssets(pbcAssets);
76
+ /**
77
+ * Register the top-level route collection
78
+ */
79
+ this.app.registerRouteCollection(this.config.routes);
80
+ }
81
+
82
+ async loadRemotes() {
83
+ const { registerComponents } = Components;
84
+ await registerComponents();
64
85
  this.ready = true;
65
86
  }
66
87
 
67
- public selectTemplate() {
88
+ selectTemplate() {
68
89
  return this.ready ? MainTemplate : LoadingTemplate;
69
90
  }
70
91
 
@@ -90,6 +111,30 @@ export class MainApplication extends FASTElement {
90
111
  heartbeatInterval: 15_000,
91
112
  },
92
113
  }),
114
+ /**
115
+ * // example of setting grid options for all grids from app level
116
+ * Registration.instance<GridOptionsConfig>(GridOptionsConfig, {
117
+ * defaultCsvExportParams: csvExportParams,
118
+ * }),
119
+ */
93
120
  );
94
121
  }
122
+
123
+ protected addEventListeners() {
124
+ this.addEventListener('store-connected', this.store.onConnected);
125
+ }
126
+
127
+ protected removeEventListeners() {
128
+ this.removeEventListener('store-connected', this.store.onConnected);
129
+ }
130
+
131
+ protected readyStore() {
132
+ // @ts-ignore
133
+ this.$emit('store-connected', this);
134
+ this.$emit('store-ready', true);
135
+ }
136
+
137
+ protected disconnectStore() {
138
+ this.$emit('store-disconnected');
139
+ }
95
140
  }
@@ -0,0 +1,8 @@
1
+ # PBC
2
+
3
+ This directory contains PBCs that have been added dynamically via the `genx add` command. Each `genx add` will create
4
+ a new changeset for you and your team to review and merge. You may choose to tailor the generate PBC assets post
5
+ `genx add` for fine grain control, but be aware that doing so makes it more difficult to automate future PBC upgrades.
6
+ You may need to re-add a PBC that you have previously edited and re-merge any changes to it yourself.
7
+
8
+ See the app README.md in `@genesislcap/foundation-shell/app` or visit https://learn.genesis.global/docs/web/ to learn more.
@@ -1,18 +1,12 @@
1
- import {
2
- Auth,
3
- FoundationAnalytics,
4
- FoundationAnalyticsEvent,
5
- FoundationAnalyticsEventType,
6
- Session,
7
- } from '@genesislcap/foundation-comms';
1
+ import { Auth, Session } from '@genesislcap/foundation-comms';
8
2
  import {
9
3
  defaultLoginConfig,
10
4
  LoginConfig,
11
5
  Settings as LoginSettings,
12
6
  } from '@genesislcap/foundation-login';
13
- import { Constructable } from '@microsoft/fast-element';
14
- import { Container, optional } from '@microsoft/fast-foundation';
15
- import { Route, RouterConfiguration } from '@microsoft/fast-router';
7
+ import { FoundationRouterConfiguration } from '@genesislcap/foundation-ui';
8
+ import { optional } from '@microsoft/fast-foundation';
9
+ import { Route } from '@microsoft/fast-router';
16
10
  import { defaultLayout, loginLayout } from '../layouts';
17
11
  import { Home } from './home/home';
18
12
  import { NotFound } from './not-found/not-found';
@@ -31,11 +25,9 @@ const ssoSettings =
31
25
  }
32
26
  : {};
33
27
 
34
- export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
28
+ export class MainRouterConfig extends FoundationRouterConfiguration<LoginSettings> {
35
29
  constructor(
36
30
  @Auth private auth: Auth,
37
- @Container private container: Container,
38
- @FoundationAnalytics private analytics: FoundationAnalytics,
39
31
  @Session private session: Session,
40
32
  @optional(LoginConfig)
41
33
  private loginConfig: LoginConfig = { ...defaultLoginConfig, autoAuth: true, autoConnect: true },
@@ -43,9 +35,8 @@ export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
43
35
  super();
44
36
  }
45
37
 
46
- public allRoutes = [{ index: 1, path: 'home', title: 'Home', icon: 'home', variant: 'solid' }];
47
-
48
- public configure() {
38
+ async configure() {
39
+ this.configureAnalytics();
49
40
  this.title = 'Blank App Demo';
50
41
  this.defaultLayout = defaultLayout;
51
42
 
@@ -78,12 +69,24 @@ export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
78
69
  settings: { public: true },
79
70
  childRouters: true,
80
71
  },
81
- { path: 'home', element: Home, title: 'Home', name: 'home' },
72
+ {
73
+ path: 'home',
74
+ name: 'home',
75
+ title: 'Home',
76
+ element: Home,
77
+ navItems: [
78
+ {
79
+ title: 'Home',
80
+ icon: {
81
+ name: 'home',
82
+ variant: 'solid',
83
+ },
84
+ },
85
+ ],
86
+ },
82
87
  { path: 'not-found', element: NotFound, title: 'Not Found', name: 'not-found' },
83
88
  );
84
89
 
85
- const auth = this.auth;
86
-
87
90
  /**
88
91
  * Example of a FallbackRouteDefinition
89
92
  */
@@ -98,12 +101,6 @@ export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
98
101
  navigate: async (phase) => {
99
102
  const settings = phase.route.settings;
100
103
 
101
- this.analytics.trackEvent(FoundationAnalyticsEventType.routeChanged, <
102
- FoundationAnalyticsEvent.RouteChanged
103
- >{
104
- path: phase.route.endpoint.path,
105
- });
106
-
107
104
  /**
108
105
  * If public route don't block
109
106
  */
@@ -121,7 +118,7 @@ export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
121
118
  /**
122
119
  * If allowAutoAuth and session is valid try to connect+auto-login
123
120
  */
124
- if (this.loginConfig.autoAuth && (await auth.reAuthFromSession())) {
121
+ if (this.loginConfig.autoAuth && (await this.auth.reAuthFromSession())) {
125
122
  return;
126
123
  }
127
124
 
@@ -135,8 +132,4 @@ export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
135
132
  },
136
133
  });
137
134
  }
138
-
139
- public construct<T>(Type: Constructable<T>): T {
140
- return this.container.get(Type) as T;
141
- }
142
135
  }
@@ -0,0 +1 @@
1
+ export * from './store';
@@ -0,0 +1,29 @@
1
+ import { CustomEventMap } from '@genesislcap/foundation-events';
2
+ import { getApp } from '@genesislcap/foundation-shell/app';
3
+ import {
4
+ AbstractStoreRoot,
5
+ registerStore,
6
+ StoreRoot,
7
+ StoreRootEventDetailMap,
8
+ } from '@genesislcap/foundation-store';
9
+
10
+ export interface Store extends StoreRoot {}
11
+
12
+ export type StoreEventDetailMap = StoreRootEventDetailMap & {};
13
+
14
+ declare global {
15
+ interface HTMLElementEventMap extends CustomEventMap<StoreEventDetailMap> {}
16
+ }
17
+
18
+ class DefaultStore extends AbstractStoreRoot<Store, StoreEventDetailMap> implements Store {
19
+ constructor() {
20
+ super();
21
+
22
+ /**
23
+ * Register the store root
24
+ */
25
+ getApp().registerStoreRoot(this);
26
+ }
27
+ }
28
+
29
+ export const Store = registerStore(DefaultStore, 'Store');
@@ -0,0 +1,5 @@
1
+ declare module 'foundationZero/ZeroDesignSystem';
2
+ declare module '*.png';
3
+ declare module '*.jpg';
4
+ declare module '*.svg';
5
+ declare module '*.css';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed",
3
3
  "description": "Genesis Blank App Seed",
4
- "version": "2.0.2",
4
+ "version": "2.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"
@@ -7,6 +7,9 @@ plugins {
7
7
  subprojects {
8
8
  apply(plugin = "org.gradle.maven-publish")
9
9
 
10
+ dependencies {
11
+ implementation("com.h2database:h2:2.2.224")
12
+ }
10
13
  tasks {
11
14
  withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
12
15
  kotlinOptions {
@@ -1,11 +1,11 @@
1
1
  systemDefinition {
2
2
  global {
3
3
  item(name = "DbLayer", value = "SQL")
4
- item(name = "DbHost", value = "jdbc:postgresql://localhost:5432/?user=postgres&password=docker")
4
+ item(name = "DictionarySource", value = "FILE")
5
+ item(name = "DbHost", value = "jdbc:h2:file:./server/h2/test;DB_CLOSE_DELAY=-1;NON_KEYWORDS=VALUE,KEY;AUTO_SERVER=TRUE")
6
+ item(name = "DbQuotedIdentifiers", value = true)
5
7
  item(name = "DEPLOYED_PRODUCT", value = "{{appName}}")
6
8
  item(name = "MqLayer", value = env["MQ_LAYER", "ZeroMQ"])
7
-
8
- item(name = "DictionarySource", value = "DB")
9
9
  item(name = "AliasSource", value = "DB")
10
10
  item(name = "HookStateStore", value = "DB")
11
11
  item(name = "MetricsEnabled", value = "false")