quidproquo-web-admin 0.0.211 → 0.0.213
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/lib/commonjs/LogViewer/logic/getFederationManifestUrl.d.ts +0 -1
- package/lib/commonjs/LogViewer/logic/getFederationManifestUrl.js +1 -8
- package/lib/commonjs/components/AutocompleteInput.d.ts +13 -0
- package/lib/commonjs/components/AutocompleteInput.js +15 -0
- package/lib/commonjs/components/DataGrid.d.ts +3 -2
- package/lib/commonjs/components/DataGrid.js +1 -0
- package/lib/commonjs/components/index.d.ts +1 -0
- package/lib/commonjs/components/index.js +1 -0
- package/lib/commonjs/useFederatedAddon.js +1 -1
- package/lib/esm/LogViewer/logic/getFederationManifestUrl.d.ts +0 -1
- package/lib/esm/LogViewer/logic/getFederationManifestUrl.js +0 -4
- package/lib/esm/components/AutocompleteInput.d.ts +13 -0
- package/lib/esm/components/AutocompleteInput.js +11 -0
- package/lib/esm/components/DataGrid.d.ts +3 -2
- package/lib/esm/components/DataGrid.js +1 -0
- package/lib/esm/components/index.d.ts +1 -0
- package/lib/esm/components/index.js +1 -0
- package/lib/esm/useFederatedAddon.js +2 -2
- package/package.json +6 -6
|
@@ -9,15 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getFederationManifest =
|
|
12
|
+
exports.getFederationManifest = void 0;
|
|
13
13
|
const logic_1 = require("../../logic");
|
|
14
|
-
function getFederationManifestUrl(apiBaseUrl, accessToken) {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const manifestUrl = yield (0, logic_1.apiRequestGet)(`/admin/fmurl`, apiBaseUrl, accessToken);
|
|
17
|
-
return manifestUrl;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.getFederationManifestUrl = getFederationManifestUrl;
|
|
21
14
|
function getFederationManifest(apiBaseUrl, url) {
|
|
22
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
16
|
const manifestUrlJson = yield (0, logic_1.apiRequestGet)(url, apiBaseUrl);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AutocompleteOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
interface AutocompleteInputProps {
|
|
7
|
+
label: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
options: AutocompleteOption[];
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const AutocompleteInput: React.FC<AutocompleteInputProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutocompleteInput = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const AutocompleteInput = ({ label, value, options, onChange }) => {
|
|
7
|
+
const handleChange = (event, newValue) => {
|
|
8
|
+
onChange(newValue ? newValue.value : '');
|
|
9
|
+
};
|
|
10
|
+
const selectedValue = options.find((option) => option.value === value) || null;
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { options: options, getOptionLabel: (option) => option.label, value: selectedValue, onChange: handleChange, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { label: label, InputLabelProps: {
|
|
12
|
+
shrink: true,
|
|
13
|
+
} }))) }) })));
|
|
14
|
+
};
|
|
15
|
+
exports.AutocompleteInput = AutocompleteInput;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export interface DataGridColumDefinitions {
|
|
1
|
+
export interface DataGridColumDefinitions<T> {
|
|
2
2
|
field: string;
|
|
3
3
|
headerName: string;
|
|
4
4
|
widthScale?: number;
|
|
5
5
|
sortable?: boolean;
|
|
6
|
+
valueGetter?: (i: T) => any;
|
|
6
7
|
}
|
|
7
8
|
interface DataGridProps<T> {
|
|
8
9
|
items: T[];
|
|
9
|
-
columns: DataGridColumDefinitions[];
|
|
10
|
+
columns: DataGridColumDefinitions<T>[];
|
|
10
11
|
onRowClick?: (item: T) => void;
|
|
11
12
|
}
|
|
12
13
|
export declare const DataGrid: <T>({ items, columns, onRowClick }: DataGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,7 @@ const DataGrid = ({ items, columns, onRowClick }) => {
|
|
|
15
15
|
headerName: col.headerName,
|
|
16
16
|
flex: col.widthScale,
|
|
17
17
|
sortable: col.sortable !== undefined ? col.sortable : true,
|
|
18
|
+
valueGetter: col.valueGetter ? (item) => { var _a; return (_a = col.valueGetter) === null || _a === void 0 ? void 0 : _a.call(col, item.row); } : undefined,
|
|
18
19
|
}));
|
|
19
20
|
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { height: '100%', width: '100%' } }, { children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { rows: items, columns: muiColumns, onRowClick: handleRowClick }) })));
|
|
20
21
|
};
|
|
@@ -22,7 +22,7 @@ function useFederatedAddon() {
|
|
|
22
22
|
(0, react_1.useEffect)(() => {
|
|
23
23
|
const doAsyncWork = () => __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
setLoading(true);
|
|
25
|
-
const manifestUrl =
|
|
25
|
+
const manifestUrl = `${baseUrlResolvers.getMFManifestUrl()}/mf-manifest.json`;
|
|
26
26
|
console.log(`manifestUrl: [${manifestUrl}]`);
|
|
27
27
|
if (!manifestUrl) {
|
|
28
28
|
console.log(`Missing manifest Url`);
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { apiRequestGet } from '../../logic';
|
|
2
|
-
export async function getFederationManifestUrl(apiBaseUrl, accessToken) {
|
|
3
|
-
const manifestUrl = await apiRequestGet(`/admin/fmurl`, apiBaseUrl, accessToken);
|
|
4
|
-
return manifestUrl;
|
|
5
|
-
}
|
|
6
2
|
export async function getFederationManifest(apiBaseUrl, url) {
|
|
7
3
|
const manifestUrlJson = await apiRequestGet(url, apiBaseUrl);
|
|
8
4
|
return manifestUrlJson;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AutocompleteOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
interface AutocompleteInputProps {
|
|
7
|
+
label: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
options: AutocompleteOption[];
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const AutocompleteInput: React.FC<AutocompleteInputProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl, TextField, Autocomplete } from '@mui/material';
|
|
3
|
+
export const AutocompleteInput = ({ label, value, options, onChange }) => {
|
|
4
|
+
const handleChange = (event, newValue) => {
|
|
5
|
+
onChange(newValue ? newValue.value : '');
|
|
6
|
+
};
|
|
7
|
+
const selectedValue = options.find((option) => option.value === value) || null;
|
|
8
|
+
return (_jsx(FormControl, { fullWidth: true, children: _jsx(Autocomplete, { options: options, getOptionLabel: (option) => option.label, value: selectedValue, onChange: handleChange, renderInput: (params) => (_jsx(TextField, { ...params, label: label, InputLabelProps: {
|
|
9
|
+
shrink: true,
|
|
10
|
+
} })) }) }));
|
|
11
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export interface DataGridColumDefinitions {
|
|
1
|
+
export interface DataGridColumDefinitions<T> {
|
|
2
2
|
field: string;
|
|
3
3
|
headerName: string;
|
|
4
4
|
widthScale?: number;
|
|
5
5
|
sortable?: boolean;
|
|
6
|
+
valueGetter?: (i: T) => any;
|
|
6
7
|
}
|
|
7
8
|
interface DataGridProps<T> {
|
|
8
9
|
items: T[];
|
|
9
|
-
columns: DataGridColumDefinitions[];
|
|
10
|
+
columns: DataGridColumDefinitions<T>[];
|
|
10
11
|
onRowClick?: (item: T) => void;
|
|
11
12
|
}
|
|
12
13
|
export declare const DataGrid: <T>({ items, columns, onRowClick }: DataGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,6 +12,7 @@ export const DataGrid = ({ items, columns, onRowClick }) => {
|
|
|
12
12
|
headerName: col.headerName,
|
|
13
13
|
flex: col.widthScale,
|
|
14
14
|
sortable: col.sortable !== undefined ? col.sortable : true,
|
|
15
|
+
valueGetter: col.valueGetter ? (item) => col.valueGetter?.(item.row) : undefined,
|
|
15
16
|
}));
|
|
16
17
|
return (_jsx(Box, { sx: { height: '100%', width: '100%' }, children: _jsx(MuiDataGrid, { rows: items, columns: muiColumns, onRowClick: handleRowClick }) }));
|
|
17
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { loadRemote, registerRemotes } from '@module-federation/enhanced/runtime';
|
|
3
|
-
import { getFederationManifest
|
|
3
|
+
import { getFederationManifest } from './LogViewer/logic';
|
|
4
4
|
import { useAuthAccessToken, useBaseUrlResolvers } from 'quidproquo-web-react';
|
|
5
5
|
export function useFederatedAddon() {
|
|
6
6
|
const [federatedAddons, setFederatedAddons] = useState([]);
|
|
@@ -10,7 +10,7 @@ export function useFederatedAddon() {
|
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
const doAsyncWork = async () => {
|
|
12
12
|
setLoading(true);
|
|
13
|
-
const manifestUrl =
|
|
13
|
+
const manifestUrl = `${baseUrlResolvers.getMFManifestUrl()}/mf-manifest.json`;
|
|
14
14
|
console.log(`manifestUrl: [${manifestUrl}]`);
|
|
15
15
|
if (!manifestUrl) {
|
|
16
16
|
console.log(`Missing manifest Url`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-web-admin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.213",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"date-fns": "^2.30.0",
|
|
43
43
|
"dayjs": "^1.11.7",
|
|
44
44
|
"javascript-time-ago": "^2.5.9",
|
|
45
|
-
"quidproquo-core": "0.0.
|
|
46
|
-
"quidproquo-web": "0.0.
|
|
47
|
-
"quidproquo-webserver": "0.0.
|
|
48
|
-
"quidproquo-tsconfig": "0.0.
|
|
49
|
-
"quidproquo-web-react": "0.0.
|
|
45
|
+
"quidproquo-core": "0.0.213",
|
|
46
|
+
"quidproquo-web": "0.0.213",
|
|
47
|
+
"quidproquo-webserver": "0.0.213",
|
|
48
|
+
"quidproquo-tsconfig": "0.0.213",
|
|
49
|
+
"quidproquo-web-react": "0.0.213",
|
|
50
50
|
"react": "18.3.1",
|
|
51
51
|
"react-d3-tree": "^3.6.0",
|
|
52
52
|
"react-dom": "18.3.1",
|