@genesislcap/blank-app-seed 3.25.1 → 3.26.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": "3.25.1",
4
+ "version": "3.26.0",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "lint": "eslint .",
@@ -1,8 +1,9 @@
1
1
  import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { User, getUser } from '@genesislcap/foundation-user';
4
- import { GridOptionsConfig } from "@genesislcap/rapid-grid-pro";
5
- import { getDateFormatter, getNumberFormatter, getViewUpdateRightComponent } from '../../utils';
4
+ import { GridOptionsConfig } from '@genesislcap/rapid-grid-pro';
5
+ import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
6
+ import { getViewUpdateRightComponent } from '../../utils';
6
7
  import { ErrorMessageComponent } from '../../components/error-message/error-message.component';
7
8
  import { environment } from '../../../environments/environment';
8
9
  {{#if route.FDC3EventHandlersEnabled}}
@@ -26,7 +27,7 @@ export class {{pascalCase route.name}}Component {
26
27
  {{#if route.FDC3EventHandlersEnabled}}
27
28
  sendEventOnChannel = sendEventOnChannel;
28
29
  {{/if}}
29
-
30
+
30
31
  {{#each route.tiles}}
31
32
  tile{{this.config.index}} = { {{#if this.config.createFormUiSchema}}
32
33
  "createFormUiSchema": {{{ this.config.createFormUiSchema }}},{{/if}}{{#if this.config.updateFormUiSchema}}
@@ -1,5 +1,8 @@
1
1
  import { ColDef } from '@ag-grid-community/core';
2
- import { getDateFormatter, getNumberFormatter{{#if route.FDC3EventHandlersEnabled}}, sendEventOnChannel{{/if}} } from '../../../utils';
2
+ import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
3
+ {{#if route.FDC3EventHandlersEnabled}}
4
+ import { sendEventOnChannel } from '../../../utils';
5
+ {{/if}}
3
6
 
4
7
  {{#if tile.config.columns}}
5
8
  export const columnDefs: ColDef[] = {{{ tile.config.columns }}}
@@ -1,6 +1,8 @@
1
1
  import { GridOptionsConfig } from '@genesislcap/rapid-grid-pro';
2
- import { getDateFormatter, getNumberFormatter{{#if route.FDC3EventHandlersEnabled}}, sendEventOnChannel{{/if}} } from '../../../utils';
3
-
2
+ import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
3
+ {{#if route.FDC3EventHandlersEnabled}}
4
+ import { sendEventOnChannel } from '../../../utils';
5
+ {{/if}}
4
6
  {{#if tile.config.gridOptions}}
5
7
  export const gridOptions: GridOptionsConfig = {{{ tile.config.gridOptions }}}
6
- {{/if}}
8
+ {{/if}}
@@ -1,3 +1,3 @@
1
1
  # for reference see https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
2
2
 
3
- * @cistov @derekdon @MrBrunoWolff @skawian @kievitsp @jacinpoz @khouari1 @rafaelnferreira @matteematt
3
+ * @cistov @derekdon @MrBrunoWolff @skawian @kievitsp @jacinpoz @khouari1 @rafaelnferreira @matteematt @SzymonZur
@@ -36,7 +36,7 @@ rm -rf blankappseedtest && npx -y @genesislcap/genx@latest init blankappseedtest
36
36
  ### Route and CSV parameter handling test
37
37
 
38
38
  ```
39
- rm -rf blankappseedtest && npx -y @genesislcap/genx@latest init blankappseedtest --ref %YOUR-BRANCH-NAME% --no-npm -x --routes '[{"name":"Home","tiles":[{"title":"Entity manager","type":"entity-manager","config":{ "modalPosition": "centre", "sizeColumnsToFit": true, "enableSearchBar": true, "resourceName":"ALL_POSITIONS","title":"My Positions","updateEvent":"EVENT_COUNTERPARTY_MODIFY","deleteEvent":"EVENT_COUNTERPARTY_DELETE","createEvent":"EVENT_COUNTERPARTY_INSERT", "createFormUiSchema": {"type":"VerticalLayout","elements":[{"type":"Control","label":"Inline create schema - main contact","scope":"#/properties/MAIN_CONTACT"},{"type":"Control","label":"Issuer Name - Local Schema","scope":"#/properties/ISSUER_NAME","options":{"readonly":true}},{"type":"Control","label":"Price","scope":"#/properties/PRICE"},{"type":"Control","scope":"#/properties/COUNTERPARTY","options":{"allOptionsResourceName":"ALL_COUNTERPARTYS","valueField":"COUNTERPARTY_ID","labelField":"COUNTERPARTY_ID"}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"isPassword":true}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"textarea":true}}]}, "updateFormUiSchema": {"type":"VerticalLayout","elements":[{"type":"Control","label":"Inline update schema - main contact","scope":"#/properties/MAIN_CONTACT"},{"type":"Control","label":"Issuer Name - Local Schema","scope":"#/properties/ISSUER_NAME","options":{"readonly":true}},{"type":"Control","label":"Price","scope":"#/properties/PRICE"},{"type":"Control","scope":"#/properties/COUNTERPARTY","options":{"allOptionsResourceName":"ALL_COUNTERPARTYS","valueField":"COUNTERPARTY_ID","labelField":"COUNTERPARTY_ID"}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"isPassword":true}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"textarea":true}}]}, "columns": [{"field":"INSTRUMENT_NAME","headerName":"Instrument Name"},{"field":"VALUE","headerName":"Inline coldef - VALUE"},{"field":"QUANTITY","headerName":"Quantity"},{"field":"PNL","headerName":"PNL"}] }},{"title":"Grid","type":"grid-pro","config":{"resourceName":"ALL_TRADES", "deferredGridOptions": {"columnDefs":[{"field":"INSTRUMENT_NAME","headerName":"Instrument Name"},{"field":"VALUE","headerName":"Inline coldef - VALUE"},{"field":"QUANTITY","headerName":"Quantity"},{"field":"PNL","headerName":"PNL"}]} }},{"title":"Form","type":"smart-form","config":{"resourceName":"EVENT_COUNTERPARTY_INSERT", "uischema": {"type":"VerticalLayout","elements":[{"type":"Control","label":"Inline form schema - main contact","scope":"#/properties/MAIN_CONTACT"},{"type":"Control","label":"Issuer Name - Local Schema","scope":"#/properties/ISSUER_NAME","options":{"readonly":true}},{"type":"Control","label":"Price","scope":"#/properties/PRICE"},{"type":"Control","scope":"#/properties/COUNTERPARTY","options":{"allOptionsResourceName":"ALL_COUNTERPARTYS","valueField":"COUNTERPARTY_ID","labelField":"COUNTERPARTY_ID"}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"isPassword":true}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"textarea":true}}]} }}]}, {"name":"Realtime Dashboard","tiles":[{"title":"Entity manager tile","type":"entity-manager","config":{"resourceName":"ALL_COUNTERPARTYS","title":"Counterparty Management","updateEvent":"EVENT_COUNTERPARTY_MODIFY","deleteEvent":"EVENT_COUNTERPARTY_DELETE","createEvent":"EVENT_COUNTERPARTY_INSERT"}},{"title":"Form tile","type":"smart-form","config":{"resourceName":"EVENT_COUNTERPARTY_INSERT"}}]},{"name":"Analytics","tiles":[{"title":"Grid Tile","type":"grid-pro","config":{"resourceName":"ALL_POSITIONS"}},{"title":"Charts Tile 1","type":"chart","config":{"type":"line","resourceName":"ALL_POSITIONS","xField":"INSTRUMENT_NAME","yField":"VALUE"}},{"title":"Charts Tile 2","type":"chart","config":{"type":"pie","resourceName":"ALL_POSITIONS","xField":"INSTRUMENT_NAME","yField":"VALUE"}},{"title":"Charts Tile 3","type":"chart","config":{"type":"column","resourceName":"ALL_POSITIONS","xField":"INSTRUMENT_ID","yField":"VALUE"}}]}]' --csv '[{"name": "trade", "fields": ["a", "B"]}, {"name": "position", "fields": ["id", "TYPE"]} ]' --apiHost 'wss://public-foundation.genesislab.global/gwf/' --no-shell && cd blankappseedtest/client && npm run bootstrap && npm run dev
39
+ rm -rf blankappseedtest && npx -y @genesislcap/genx@latest init blankappseedtest --ref %YOUR-BRANCH-NAME% --no-npm -x --routes '[{"name":"Home","tiles":[{"title":"Entity manager","type":"entity-manager","config":{ "modalPosition": "centre", "sizeColumnsToFit": true, "enableSearchBar": true, "resourceName":"ALL_POSITIONS","title":"My Positions","updateEvent":"EVENT_COUNTERPARTY_MODIFY","deleteEvent":"EVENT_COUNTERPARTY_DELETE","createEvent":"EVENT_COUNTERPARTY_INSERT", "createFormUiSchema": {"type":"VerticalLayout","elements":[{"type":"Control","label":"Inline create schema - main contact","scope":"#/properties/MAIN_CONTACT"},{"type":"Control","label":"Issuer Name - Local Schema","scope":"#/properties/ISSUER_NAME","options":{"readonly":true}},{"type":"Control","label":"Price","scope":"#/properties/PRICE"},{"type":"Control","scope":"#/properties/COUNTERPARTY","options":{"allOptionsResourceName":"ALL_COUNTERPARTYS","valueField":"COUNTERPARTY_ID","labelField":"COUNTERPARTY_ID"}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"isPassword":true}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"textarea":true}}]}, "updateFormUiSchema": {"type":"VerticalLayout","elements":[{"type":"Control","label":"Inline update schema - main contact","scope":"#/properties/MAIN_CONTACT"},{"type":"Control","label":"Issuer Name - Local Schema","scope":"#/properties/ISSUER_NAME","options":{"readonly":true}},{"type":"Control","label":"Price","scope":"#/properties/PRICE"},{"type":"Control","scope":"#/properties/COUNTERPARTY","options":{"allOptionsResourceName":"ALL_COUNTERPARTYS","valueField":"COUNTERPARTY_ID","labelField":"COUNTERPARTY_ID"}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"isPassword":true}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"textarea":true}}]}, "columns": [{"field":"INSTRUMENT_NAME","headerName":"Instrument Name"},{"field":"VALUE","headerName":"Inline coldef - VALUE"},{"field":"QUANTITY","headerName":"Quantity"},{"field":"PNL","headerName":"PNL"}] }},{"title":"Grid","type":"grid-pro","config":{"resourceName":"ALL_TRADES", "gridOptions": {"columnDefs":[{"field":"INSTRUMENT_NAME","headerName":"Instrument Name"},{"field":"VALUE","headerName":"Inline coldef - VALUE"},{"field":"QUANTITY","headerName":"Quantity"},{"field":"PNL","headerName":"PNL"}]} }},{"title":"Form","type":"smart-form","config":{"resourceName":"EVENT_COUNTERPARTY_INSERT", "uischema": {"type":"VerticalLayout","elements":[{"type":"Control","label":"Inline form schema - main contact","scope":"#/properties/MAIN_CONTACT"},{"type":"Control","label":"Issuer Name - Local Schema","scope":"#/properties/ISSUER_NAME","options":{"readonly":true}},{"type":"Control","label":"Price","scope":"#/properties/PRICE"},{"type":"Control","scope":"#/properties/COUNTERPARTY","options":{"allOptionsResourceName":"ALL_COUNTERPARTYS","valueField":"COUNTERPARTY_ID","labelField":"COUNTERPARTY_ID"}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"isPassword":true}},{"type":"Control","label":"Password","scope":"#/properties/PASSWORD","options":{"textarea":true}}]} }}]}, {"name":"Realtime Dashboard","tiles":[{"title":"Entity manager tile","type":"entity-manager","config":{"resourceName":"ALL_COUNTERPARTYS","title":"Counterparty Management","updateEvent":"EVENT_COUNTERPARTY_MODIFY","deleteEvent":"EVENT_COUNTERPARTY_DELETE","createEvent":"EVENT_COUNTERPARTY_INSERT"}},{"title":"Form tile","type":"smart-form","config":{"resourceName":"EVENT_COUNTERPARTY_INSERT"}}]},{"name":"Analytics","tiles":[{"title":"Grid Tile","type":"grid-pro","config":{"resourceName":"ALL_POSITIONS"}},{"title":"Charts Tile 1","type":"chart","config":{"type":"line","resourceName":"ALL_POSITIONS","xField":"INSTRUMENT_NAME","yField":"VALUE"}},{"title":"Charts Tile 2","type":"chart","config":{"type":"pie","resourceName":"ALL_POSITIONS","xField":"INSTRUMENT_NAME","yField":"VALUE"}},{"title":"Charts Tile 3","type":"chart","config":{"type":"column","resourceName":"ALL_POSITIONS","xField":"INSTRUMENT_ID","yField":"VALUE"}}]}]' --csv '[{"name": "trade", "fields": ["a", "B"]}, {"name": "position", "fields": ["id", "TYPE"]} ]' --apiHost 'wss://public-foundation.genesislab.global/gwf/' --no-shell && cd blankappseedtest/client && npm run bootstrap && npm run dev
40
40
  ```
41
41
 
42
42
  ✅   **Checklist**
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.26.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.25.2...v3.26.0) (2024-07-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * sso in angular [FUI-2069](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/2069) (#282) 577c5a3
9
+
10
+ ## [3.25.2](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.25.1...v3.25.2) (2024-07-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * move formatters to platform [FUI-2064](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/2064) (#285) ff712dd
16
+
3
17
  ## [3.25.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.25.0...v3.25.1) (2024-07-22)
4
18
 
5
19
 
@@ -48,6 +48,7 @@
48
48
  "@genesislcap/foundation-entity-management": "{{versions.UI}}",
49
49
  "@genesislcap/foundation-header": "{{versions.UI}}",
50
50
  "@genesislcap/foundation-ui": "{{versions.UI}}",
51
+ "@genesislcap/foundation-utils": "{{versions.UI}}",
51
52
  "@genesislcap/foundation-user": "{{versions.UI}}",
52
53
  "@genesislcap/rapid-design-system": "{{versions.UI}}",
53
54
  "@genesislcap/rapid-grid-pro": "{{versions.UI}}",
@@ -1,4 +1,3 @@
1
- export * from './formatters';
2
1
  export * from './getLayoutNameByRoute';
3
2
  export * from './permissions';
4
3
  export * from './fdc3';
@@ -0,0 +1,41 @@
1
+ // Set the appHostURL from which the providers are to be fetched.
2
+ const appHostURL = `${location.protocol}//${location.host}/gwf/`;
3
+
4
+ const fetchIDPs = async () => {
5
+ const ipdsEndpoint = `${appHostURL}sso/list`;
6
+ console.log('IPD endpoint', ipdsEndpoint);
7
+ return fetch(ipdsEndpoint)
8
+ .then((res) => {
9
+ if (res.ok) return res;
10
+ throw new Error(res.statusText);
11
+ })
12
+ .then((res) => res.json())
13
+ .then((json) => json.IDPS)
14
+ .catch(() => {
15
+ console.error('Failed to fetch identity providers.');
16
+ return [{ ID: 'error', DESCRIPTION: 'Failed to fetch providers.' }];
17
+ });
18
+ };
19
+
20
+ // If we do not have initSSO token in our sessionStorage,
21
+ // then we check the list of providers and get ssoToken
22
+ if (!sessionStorage.getItem('initSSO')) {
23
+ fetchIDPs().then((allIdps) => {
24
+ console.log('Fetched IDPs', allIdps);
25
+ idps = allIdps.map((idp) => ({
26
+ id: idp.ID,
27
+ type: idp.TYPE,
28
+ }));
29
+
30
+ // Set initSSO token in sessionStorage after the first fetch of providers
31
+ sessionStorage.setItem('initSSO', 'true');
32
+
33
+ // If your environment has more providers and you want to test it - set a number corresponding to the number of your providers
34
+ if (idps.length === 1 && idps[0].type) {
35
+ const ssoLoginRoute = `/gwf/${idps[0].type}/login`;
36
+ const ssoLoginUrl = `${location.protocol}//${new URL(appHostURL).host}${ssoLoginRoute}?idp=${idps[0].id}`;
37
+
38
+ window.open(ssoLoginUrl, '_self');
39
+ }
40
+ });
41
+ }
@@ -6,6 +6,9 @@
6
6
  <base href="/">
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
8
8
  <link rel="icon" type="image/x-icon" href="favicon.ico">
9
+ {{#if enableSSO}}
10
+ <script src="assets/initSSO.js"></script>
11
+ {{/if}}
9
12
  </head>
10
13
  <body>
11
14
  <{{rootElement}}></{{rootElement}}>
@@ -1,4 +1,3 @@
1
1
  export * from './fdc3';
2
- export * from './formatters';
3
2
  export * from './logger';
4
3
  export * from './permissions';
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": "3.25.1",
4
+ "version": "3.26.0",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"
@@ -1,35 +0,0 @@
1
- import Numeral from 'numeral';
2
- import 'numeral/locales';
3
-
4
- const defaultDateOptions: Intl.DateTimeFormatOptions = {
5
- year: 'numeric',
6
- month: '2-digit',
7
- day: '2-digit',
8
- timeZone: 'UTC',
9
- };
10
-
11
- export function getNumberFormatter(format: string, locale?: string | null) {
12
- return (params: any) => {
13
- // bigdecimals are sent as strings
14
- if (!(params && (typeof params.value === 'number' || typeof params.value === 'string'))) {
15
- return '';
16
- }
17
-
18
- if (locale) {
19
- Numeral.locale(locale);
20
- }
21
-
22
- return Numeral(params.value).format(format);
23
- };
24
- }
25
-
26
- export function getDateFormatter(
27
- locale: string = 'en-GB',
28
- options: Intl.DateTimeFormatOptions = defaultDateOptions,
29
- ) {
30
- return (params: any) => {
31
- if (!(params && typeof params.value === 'number')) return '';
32
-
33
- return new Intl.DateTimeFormat(locale, options).format(params.value);
34
- };
35
- }
@@ -1,35 +0,0 @@
1
- import Numeral from 'numeral';
2
- import 'numeral/locales';
3
-
4
- const defaultDateOptions: Intl.DateTimeFormatOptions = {
5
- year: 'numeric',
6
- month: '2-digit',
7
- day: '2-digit',
8
- timeZone: 'UTC',
9
- };
10
-
11
- export function getNumberFormatter(format: string, locale?: string) {
12
- return (params) => {
13
- // bigdecimals are sent as strings
14
- if (!(params && (typeof params.value === 'number' || typeof params.value === 'string'))) {
15
- return '';
16
- }
17
-
18
- if (locale) {
19
- Numeral.locale(locale);
20
- }
21
-
22
- return Numeral(params.value).format(format);
23
- };
24
- }
25
-
26
- export function getDateFormatter(
27
- locale: string = 'en-GB',
28
- options: Intl.DateTimeFormatOptions = defaultDateOptions,
29
- ) {
30
- return (params) => {
31
- if (!(params && typeof params.value === 'number')) return '';
32
-
33
- return new Intl.DateTimeFormat(locale, options).format(params.value);
34
- };
35
- }