@dexteel/mesf-core 5.11.0 → 5.12.1
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +35 -0
- package/CLAUDE.md +89 -0
- package/dist/configuration/pages/asset/components/AssetConfiguration/AssetSearchInput.d.ts +10 -0
- package/dist/configuration/pages/asset/hooks/useAssetSearch.d.ts +29 -0
- package/dist/configuration/pages/users/repositories/UsersRepository.d.ts +1 -0
- package/dist/context/userContext.d.ts +20 -0
- package/dist/index.esm.js +303 -42
- package/dist/index.esm.js.map +1 -1
- package/dist/reducers/UserReducer.d.ts +19 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [5.12.1](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v5.12.0...@dexteel/mesf-core-v5.12.1) (2025-09-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **Settings:** rewrite UTLSettingContext to make sure settings are lo… ([3f6c367](https://github.com/dexteel/mesf-core-frontend/commit/3f6c36797ce0e0bed33dc574589347ba0a39f34e))
|
|
9
|
+
* **Settings:** rewrite UTLSettingContext to make sure settings are loaded before application ([eb262d9](https://github.com/dexteel/mesf-core-frontend/commit/eb262d92c51880f3a63349accc8ef259e843de7e))
|
|
10
|
+
|
|
11
|
+
## [5.12.0] - 2025-09-09
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Changelog
|
|
16
|
+
|
|
17
|
+
## [5.12.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v5.11.0...@dexteel/mesf-core-v5.12.0) (2025-09-09)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **asset-configuration:** add search functionality to Assets Tree ([ef22460](https://github.com/dexteel/mesf-core-frontend/commit/ef22460bc96f75b3a5454fc4aee0fbf1cb3b7d80))
|
|
23
|
+
* **asset-configuration:** add search functionality to Assets Tree ([2fefd83](https://github.com/dexteel/mesf-core-frontend/commit/2fefd83a61a05f083882c0898b8b0826f216517e))
|
|
24
|
+
* **userContext:** add useHasProfile hook ([#460](https://github.com/dexteel/mesf-core-frontend/issues/460)) ([8788000](https://github.com/dexteel/mesf-core-frontend/commit/8788000718b33c4af2732f88f8c0f47a9cecb29a))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **real-time-config:** Show the names of SP instead of id's ([c97ad12](https://github.com/dexteel/mesf-core-frontend/commit/c97ad128d1519c7498784fa575c7e6fb7741f0d7))
|
|
30
|
+
* **real-time-config:** Show the names of SP instead of id's ([b994a0b](https://github.com/dexteel/mesf-core-frontend/commit/b994a0bdb46c9d74e8d85bc3d4a0b1cdd2c862cb))
|
|
31
|
+
|
|
32
|
+
## [5.11.0] - 2025-09-08
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
1
36
|
# Changelog
|
|
2
37
|
|
|
3
38
|
## [5.11.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v5.10.0...@dexteel/mesf-core-v5.11.0) (2025-09-03)
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Development Commands
|
|
6
|
+
|
|
7
|
+
### Build and Development
|
|
8
|
+
- `npm run build` - Build the library for production using Rollup
|
|
9
|
+
- `npm run watch` or `npm start` - Build in watch mode for development
|
|
10
|
+
- `npm run ci` - Clean build for CI environments
|
|
11
|
+
|
|
12
|
+
### Code Quality
|
|
13
|
+
- `npx @biomejs/biome check --write ./src` - Format and organize imports with Biome
|
|
14
|
+
- Pre-commit hook automatically runs Biome formatting on staged files
|
|
15
|
+
|
|
16
|
+
## Architecture Overview
|
|
17
|
+
|
|
18
|
+
This is `@dexteel/mesf-core`, a React component library built as an NPM package using TypeScript and Rollup. The library provides a comprehensive set of components and utilities for manufacturing execution systems.
|
|
19
|
+
|
|
20
|
+
### Key Architecture Patterns
|
|
21
|
+
|
|
22
|
+
**Library Structure**: The project follows a modular library architecture with clear separation between:
|
|
23
|
+
- Components (UI elements)
|
|
24
|
+
- Context providers (state management)
|
|
25
|
+
- Services (API communication)
|
|
26
|
+
- Configuration modules (settings and user management)
|
|
27
|
+
- Utilities and hooks
|
|
28
|
+
|
|
29
|
+
**Export Strategy**: All public APIs are exported through `src/index.ts` using barrel exports, making the library consumable as a single package.
|
|
30
|
+
|
|
31
|
+
**State Management**: Uses React Context pattern extensively:
|
|
32
|
+
- `UTLSettingContext` - User settings and preferences
|
|
33
|
+
- `userContext` - User authentication and profile data
|
|
34
|
+
- `assetContext` - Asset management state
|
|
35
|
+
- `axiosInstance` - HTTP client configuration with interceptors
|
|
36
|
+
|
|
37
|
+
**Real-time Communication**: Integrates SignalR (`@microsoft/signalr`) for real-time updates via the `useMesfRealtime` hook.
|
|
38
|
+
|
|
39
|
+
### Directory Structure
|
|
40
|
+
|
|
41
|
+
- **src/components/** - Reusable UI components organized by domain
|
|
42
|
+
- `navigation/` - Header, menu components
|
|
43
|
+
- `modals/` - Dialog components
|
|
44
|
+
- `shared/` - Common utility components
|
|
45
|
+
|
|
46
|
+
- **src/configuration/** - Admin and configuration modules
|
|
47
|
+
- Handles user management, system settings
|
|
48
|
+
- Contains pages for administrative functions
|
|
49
|
+
|
|
50
|
+
- **src/context/** - React Context providers
|
|
51
|
+
- Authentication, settings, and shared state management
|
|
52
|
+
- Axios configuration with request/response interceptors
|
|
53
|
+
|
|
54
|
+
- **src/hooks/** - Custom React hooks
|
|
55
|
+
- Real-time data hooks, search utilities
|
|
56
|
+
|
|
57
|
+
- **src/services/** - API communication layer
|
|
58
|
+
- **src/utils/** - Utility functions and helpers
|
|
59
|
+
- **src/controls/** - Form controls and input components
|
|
60
|
+
|
|
61
|
+
### Technology Stack
|
|
62
|
+
|
|
63
|
+
**Core Framework**: React 17 with TypeScript
|
|
64
|
+
**Build Tool**: Rollup with TypeScript plugin
|
|
65
|
+
**Styling**: Material-UI v4 with custom theme support
|
|
66
|
+
**State**: Redux Toolkit for complex state, React Context for simpler state
|
|
67
|
+
**Authentication**: Azure MSAL for Microsoft authentication
|
|
68
|
+
**Data Visualization**: Nivo charts, Chart.js with react-chartjs-2
|
|
69
|
+
**Grid Component**: AG Grid (Enterprise features available)
|
|
70
|
+
**Date Handling**: Moment.js with timezone support
|
|
71
|
+
|
|
72
|
+
### Key Dependencies
|
|
73
|
+
|
|
74
|
+
The library has extensive peer dependencies that consuming applications must provide:
|
|
75
|
+
- Material-UI components and theming
|
|
76
|
+
- AG Grid for data tables
|
|
77
|
+
- Chart libraries (Nivo, Chart.js)
|
|
78
|
+
- React Router DOM for navigation
|
|
79
|
+
- Redux Toolkit for state management
|
|
80
|
+
|
|
81
|
+
### Development Notes
|
|
82
|
+
|
|
83
|
+
**Styling**: Uses Material-UI v4 theming system. Custom theme exports available via `src/css/themeMESF`.
|
|
84
|
+
|
|
85
|
+
**Internationalization**: Components support timezone handling via `moment-timezone` and `date-fns-tz`.
|
|
86
|
+
|
|
87
|
+
**Bundle Optimization**: Rollup configuration externalizes React and Babel runtime to prevent duplication in consuming applications.
|
|
88
|
+
|
|
89
|
+
**Code Quality**: Biome is configured for formatting and import organization, but linting is disabled (see biome.json).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NodeModel } from "@minoru/react-dnd-treeview";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AssetSearchResult } from "../../hooks/useAssetSearch";
|
|
4
|
+
import { FileProperties } from "../../models/FileProperties";
|
|
5
|
+
interface AssetSearchInputProps {
|
|
6
|
+
assetNodes: NodeModel<FileProperties>[];
|
|
7
|
+
onSearchResultClick: (result: AssetSearchResult) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AssetSearchInput: React.FC<AssetSearchInputProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NodeModel } from "@minoru/react-dnd-treeview";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FileProperties } from "../models/FileProperties";
|
|
4
|
+
export interface AssetSearchResult {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
isDroppable: boolean;
|
|
9
|
+
hasChildren: boolean;
|
|
10
|
+
node: NodeModel<FileProperties>;
|
|
11
|
+
}
|
|
12
|
+
interface UseAssetSearchProps {
|
|
13
|
+
assetNodes: NodeModel<FileProperties>[];
|
|
14
|
+
externalSearchTerm?: string;
|
|
15
|
+
onSearchTermChange?: (term: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const useAssetSearch: ({ assetNodes, externalSearchTerm, onSearchTermChange, }: UseAssetSearchProps) => {
|
|
18
|
+
searchTerm: string;
|
|
19
|
+
searchResults: AssetSearchResult[];
|
|
20
|
+
showSearchResults: boolean;
|
|
21
|
+
focusedSearchIndex: number;
|
|
22
|
+
searchResultsRefs: React.MutableRefObject<(HTMLElement | null)[]>;
|
|
23
|
+
handleSearchChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
24
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => AssetSearchResult | undefined;
|
|
25
|
+
scrollFocusedItemIntoView: (index: number) => void;
|
|
26
|
+
clearSearch: () => void;
|
|
27
|
+
triggerSearch: (term: string) => void;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export declare const useUserContext: () => {
|
|
|
7
7
|
defaultAreaName: string | null;
|
|
8
8
|
userLogged: boolean;
|
|
9
9
|
permissions: string[];
|
|
10
|
+
profiles: string[];
|
|
10
11
|
};
|
|
11
12
|
actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
12
13
|
setUserId(state: import("immer/dist/internal").WritableDraft<{
|
|
@@ -16,6 +17,7 @@ export declare const useUserContext: () => {
|
|
|
16
17
|
defaultAreaName: string | null;
|
|
17
18
|
userLogged: boolean;
|
|
18
19
|
permissions: string[];
|
|
20
|
+
profiles: string[];
|
|
19
21
|
}>, { payload }: {
|
|
20
22
|
payload: any;
|
|
21
23
|
type: string;
|
|
@@ -27,6 +29,7 @@ export declare const useUserContext: () => {
|
|
|
27
29
|
defaultAreaName: string | null;
|
|
28
30
|
userLogged: boolean;
|
|
29
31
|
permissions: string[];
|
|
32
|
+
profiles: string[];
|
|
30
33
|
}>, { payload }: {
|
|
31
34
|
payload: any;
|
|
32
35
|
type: string;
|
|
@@ -38,6 +41,7 @@ export declare const useUserContext: () => {
|
|
|
38
41
|
defaultAreaName: string | null;
|
|
39
42
|
userLogged: boolean;
|
|
40
43
|
permissions: string[];
|
|
44
|
+
profiles: string[];
|
|
41
45
|
}>, { payload }: {
|
|
42
46
|
payload: any;
|
|
43
47
|
type: string;
|
|
@@ -49,6 +53,7 @@ export declare const useUserContext: () => {
|
|
|
49
53
|
defaultAreaName: string | null;
|
|
50
54
|
userLogged: boolean;
|
|
51
55
|
permissions: string[];
|
|
56
|
+
profiles: string[];
|
|
52
57
|
}>, { payload }: {
|
|
53
58
|
payload: any;
|
|
54
59
|
type: string;
|
|
@@ -60,6 +65,7 @@ export declare const useUserContext: () => {
|
|
|
60
65
|
defaultAreaName: string | null;
|
|
61
66
|
userLogged: boolean;
|
|
62
67
|
permissions: string[];
|
|
68
|
+
profiles: string[];
|
|
63
69
|
}>, { payload }: {
|
|
64
70
|
payload: any;
|
|
65
71
|
type: string;
|
|
@@ -71,6 +77,19 @@ export declare const useUserContext: () => {
|
|
|
71
77
|
defaultAreaName: string | null;
|
|
72
78
|
userLogged: boolean;
|
|
73
79
|
permissions: string[];
|
|
80
|
+
profiles: string[];
|
|
81
|
+
}>, { payload }: {
|
|
82
|
+
payload: any;
|
|
83
|
+
type: string;
|
|
84
|
+
}): void;
|
|
85
|
+
setProfiles(state: import("immer/dist/internal").WritableDraft<{
|
|
86
|
+
userLastName: string;
|
|
87
|
+
userId: number | null;
|
|
88
|
+
defaultAreaId: number | string | null;
|
|
89
|
+
defaultAreaName: string | null;
|
|
90
|
+
userLogged: boolean;
|
|
91
|
+
permissions: string[];
|
|
92
|
+
profiles: string[];
|
|
74
93
|
}>, { payload }: {
|
|
75
94
|
payload: any;
|
|
76
95
|
type: string;
|
|
@@ -79,6 +98,7 @@ export declare const useUserContext: () => {
|
|
|
79
98
|
isLoading: boolean;
|
|
80
99
|
};
|
|
81
100
|
export declare const useHasPermission: () => (permission: string) => boolean;
|
|
101
|
+
export declare const useHasProfile: () => (profile: string) => boolean;
|
|
82
102
|
export declare const UserProvider: ({ children }: {
|
|
83
103
|
children: ReactNode;
|
|
84
104
|
}) => React.JSX.Element;
|