@asaleh37/ui-base 25.9.16 → 25.9.17
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/index.js +58 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/App.tsx +11 -7
- package/src/components/ExampleTrial.tsx +24 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/ComboBox.tsx +3 -1
- package/src/navigationItems/index.tsx +8 -1
- package/src/routes/index.ts +5 -2
package/package.json
CHANGED
package/src/components/App.tsx
CHANGED
|
@@ -18,13 +18,17 @@ import { MsalProvider } from "@azure/msal-react";
|
|
|
18
18
|
|
|
19
19
|
const App: React.FC<AppInfo> = (props: AppInfo) => {
|
|
20
20
|
const dispatch = useDispatch();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
let msalInstance;
|
|
22
|
+
if (props?.authenticationMethod === "AZURE") {
|
|
23
|
+
msalInstance = new PublicClientApplication({
|
|
24
|
+
auth: {
|
|
25
|
+
clientId: props?.azureConfiguration?.frontEndClientId,
|
|
26
|
+
authority: `https://login.microsoftonline.com/${props?.azureConfiguration?.tenantId}`,
|
|
27
|
+
redirectUri: props?.azureConfiguration?.redirectURL,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
LicenseInfo.setLicenseKey(props.muiPremiumKey);
|
|
29
33
|
const LightThemeOptions: ThemeOptions = {
|
|
30
34
|
components: {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useApiActions } from "../hooks";
|
|
2
|
+
import { FormElementProps, TemplateForm } from "./templates";
|
|
3
|
+
|
|
4
|
+
const ExampleTrial: React.FC = () => {
|
|
5
|
+
const formElements: FormElementProps[] = [
|
|
6
|
+
{
|
|
7
|
+
mode: "props",
|
|
8
|
+
type: "field",
|
|
9
|
+
props: {
|
|
10
|
+
fieldLabel: "test",
|
|
11
|
+
fieldName: "test",
|
|
12
|
+
fieldType: "combobox",
|
|
13
|
+
commonStoreKey: "SystemParameterTypes",
|
|
14
|
+
optionValueField: "value",
|
|
15
|
+
optionDisplayField: "value",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
const apiActions = useApiActions({});
|
|
20
|
+
|
|
21
|
+
return <TemplateForm apiActions={apiActions} elements={formElements} />;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default ExampleTrial;
|
package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/ComboBox.tsx
CHANGED
|
@@ -73,11 +73,13 @@ const ComboBox: React.FC<ComboBoxProps> = (props) => {
|
|
|
73
73
|
props?.storeLoadParam,
|
|
74
74
|
props?.dataQueryId,
|
|
75
75
|
props?.commonStoreKey,
|
|
76
|
+
props?.options,
|
|
77
|
+
commonStoreData,
|
|
76
78
|
]);
|
|
77
79
|
|
|
78
80
|
const { t } = useTranslation();
|
|
79
81
|
const getValue = (v: string) => {
|
|
80
|
-
for (let option of
|
|
82
|
+
for (let option of comboboxData) {
|
|
81
83
|
if (option[props.valueField] == v) {
|
|
82
84
|
return option;
|
|
83
85
|
}
|
|
@@ -31,5 +31,12 @@ export const findNavigationItemById = (
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const NavigationItems: TreeViewBaseItem<ExtendedTreeItemProps>[] = [
|
|
34
|
-
...AdministrationItems
|
|
34
|
+
...AdministrationItems,
|
|
35
|
+
{
|
|
36
|
+
id: "example",
|
|
37
|
+
icon: "wind",
|
|
38
|
+
action: "NAVIGATION",
|
|
39
|
+
actionPayload: { path: "example" },
|
|
40
|
+
label: "Example",
|
|
41
|
+
},
|
|
35
42
|
];
|
package/src/routes/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import ExampleTrial from "../components/ExampleTrial";
|
|
2
2
|
import { ADMINISTRATION_ROUTES } from "./administration";
|
|
3
3
|
import { SystemRoute } from "./types";
|
|
4
4
|
|
|
5
|
-
export const SYSTEM_ROUTES: Array<SystemRoute> = [
|
|
5
|
+
export const SYSTEM_ROUTES: Array<SystemRoute> = [
|
|
6
|
+
...ADMINISTRATION_ROUTES,
|
|
7
|
+
{ path: "example", component: ExampleTrial },
|
|
8
|
+
];
|