@genesislcap/pbc-reporting-ui 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dts/new/main/generated-reports/generated-reports.template.d.ts.map +1 -1
- package/dist/dts/new/utils/endpoint.d.ts +1 -0
- package/dist/dts/new/utils/endpoint.d.ts.map +1 -1
- package/dist/esm/new/main/generated-reports/generated-reports.js +2 -2
- package/dist/esm/new/main/generated-reports/generated-reports.template.js +1 -0
- package/dist/esm/new/utils/endpoint.js +9 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-reports.template.d.ts","sourceRoot":"","sources":["../../../../../src/new/main/generated-reports/generated-reports.template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"generated-reports.template.d.ts","sourceRoot":"","sources":["../../../../../src/new/main/generated-reports/generated-reports.template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAqBvD,eAAO,MAAM,wBAAwB,uEAGpC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { Genesis } from '../types';
|
|
3
|
+
export declare const tryReadFromSession: (key: string) => string;
|
|
3
4
|
export declare const getEndpointUrl: (endpoint: string, urlRoot?: string) => string;
|
|
4
5
|
export declare const getDatasourceSchema: (connect: Connect) => (resourceName: string) => Promise<Genesis.JSONSchema7>;
|
|
5
6
|
//# sourceMappingURL=endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,eAAO,MAAM,kBAAkB,QAAS,MAAM,WAK7C,CAAC;AAEF,eAAO,MAAM,cAAc,aACf,MAAM,YACP,MAAM,KACd,MAWF,CAAC;AAEF,eAAO,MAAM,mBAAmB,YAAa,OAAO,oBAA0B,MAAM,iCAwBnF,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { customElement, GenesisElement, html, observable } from '@genesislcap/we
|
|
|
6
6
|
import { Permissions } from '../../types';
|
|
7
7
|
import { permissionGuard, showNotificationToast } from '../../utils';
|
|
8
8
|
import { getFilterParams } from '../../utils/date-filter-params';
|
|
9
|
-
import { getEndpointUrl } from '../../utils/endpoint';
|
|
9
|
+
import { getEndpointUrl, tryReadFromSession } from '../../utils/endpoint';
|
|
10
10
|
import { getFormattedDateTime } from '../../utils/formatters';
|
|
11
11
|
import { buttonCellRenderer } from '../../utils/renderer';
|
|
12
12
|
import { GeneratedReportsStyles as styles } from './generated-reports.styles';
|
|
@@ -159,7 +159,7 @@ let GeneratedReports = class GeneratedReports extends GenesisElement {
|
|
|
159
159
|
}
|
|
160
160
|
async downloadReport(fileStorageId) {
|
|
161
161
|
const headers = new Headers();
|
|
162
|
-
headers.append('SESSION_AUTH_TOKEN',
|
|
162
|
+
headers.append('SESSION_AUTH_TOKEN', tryReadFromSession('authToken'));
|
|
163
163
|
const endpoint = getEndpointUrl(`file-server/download?fileStorageId=${fileStorageId}`);
|
|
164
164
|
try {
|
|
165
165
|
let filename;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { Session } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
export const tryReadFromSession = (key) => {
|
|
4
|
+
const container = DI.getOrCreateDOMContainer();
|
|
5
|
+
const session = container.get(Session);
|
|
6
|
+
// session.getSessionStorageItem accounts for namespaced storage
|
|
7
|
+
return session.getSessionStorageItem(key) || sessionStorage.getItem(key) || '';
|
|
8
|
+
};
|
|
9
|
+
export const getEndpointUrl = (endpoint, urlRoot = tryReadFromSession('hostUrl')) => {
|
|
2
10
|
const url = new URL(urlRoot);
|
|
3
11
|
const path = url.pathname && url.pathname[url.pathname.length - 1] == '/'
|
|
4
12
|
? url.pathname
|
package/package.json
CHANGED