@egovernments/digit-ui-module-core 1.9.1-beta.8 โ 2.0.0-dev-01
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/README.md +259 -48
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +9 -0
- package/dist/main.js.br +0 -0
- package/dist/main.js.map +1 -0
- package/package.json +47 -13
- package/dist/index.js +0 -16
package/README.md
CHANGED
|
@@ -1,101 +1,312 @@
|
|
|
1
|
+
# @egovernments/digit-ui-module-core
|
|
1
2
|
|
|
3
|
+
## Version: 1.9.0
|
|
4
|
+
**Release Date:** October 23, 2025
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
+
## ๐ฆ Installation
|
|
6
7
|
|
|
7
8
|
```bash
|
|
8
|
-
npm install --save @egovernments/digit-ui-module-core
|
|
9
|
+
npm install --save @egovernments/digit-ui-module-core@1.9.0
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## ๐ What's New in v1.9.0
|
|
13
|
+
|
|
14
|
+
### Major Features
|
|
15
|
+
- **๐ Authentication v2 System**: Complete authentication overhaul with email/mobile login support
|
|
16
|
+
- **๐ข Multi-Tenant Architecture**: Full support for multi-tenant deployments
|
|
17
|
+
- **๐จ Enhanced UI Components**: New SandBoxHeader, PrivacyComponent, CustomErrorComponent
|
|
18
|
+
- **๐ Carousel Login Experience**: Interactive login screens with dynamic banners
|
|
19
|
+
- **๐ง Advanced Hooks**: useLoginConfig, useTenantConfigSearch for MDMS-based configuration
|
|
20
|
+
- **๐ฑ Mobile Enhancements**: Improved responsive design and mobile-specific validations
|
|
21
|
+
|
|
22
|
+
### Key Improvements
|
|
23
|
+
- Enhanced OTP system with email verification support
|
|
24
|
+
- Landing page configuration with customizable routing
|
|
25
|
+
- User type restrictions with `allowedUserTypes` parameter
|
|
26
|
+
- Improved error handling and user feedback
|
|
27
|
+
- Better logo management with dual logo support
|
|
28
|
+
|
|
29
|
+
## ๐ Features
|
|
30
|
+
|
|
31
|
+
### Authentication & Security
|
|
32
|
+
- **Login v2 System** with advanced security features
|
|
33
|
+
- **Email and Mobile Login** with pattern validation
|
|
34
|
+
- **OTP Customization** with enhanced error handling
|
|
35
|
+
- **Privacy Compliance** with GDPR-ready components
|
|
36
|
+
- **Session Management** with tenant verification
|
|
37
|
+
|
|
38
|
+
### Multi-Tenant Support
|
|
39
|
+
- Dynamic tenant context switching
|
|
40
|
+
- Tenant isolation and data segregation
|
|
41
|
+
- Backward compatibility with single-tenant setups
|
|
42
|
+
- Enhanced ULB service for tenant management
|
|
43
|
+
|
|
44
|
+
### UI Components
|
|
45
|
+
- `SandBoxHeader` - Dedicated sandbox environment styling
|
|
46
|
+
- `PrivacyComponent` - GDPR compliance and consent management
|
|
47
|
+
- `CustomErrorComponent` - Better error messaging
|
|
48
|
+
- `ImageComponent` - Optimized image handling
|
|
49
|
+
- `DummyLoader` - Improved loading states
|
|
50
|
+
- `RoleBasedEmployeeHome` - Role-specific home pages
|
|
51
|
+
- `LoginSignupSelector` - Streamlined access flow
|
|
52
|
+
- `ForgotOrganizationTooltip` - Better user guidance
|
|
53
|
+
|
|
54
|
+
### Custom Hooks
|
|
55
|
+
- `useLoginConfig` - MDMS-based login configuration
|
|
56
|
+
- `useTenantConfigSearch` - Advanced tenant search and filtering
|
|
57
|
+
- Enhanced authentication state management hooks
|
|
58
|
+
|
|
59
|
+
## ๐ง Configuration System
|
|
60
|
+
|
|
61
|
+
### Global Configuration (globalConfigs.getConfig)
|
|
62
|
+
These configurations are accessed via `window.globalConfigs.getConfig(key)`:
|
|
63
|
+
|
|
64
|
+
| Config Key | Type | Default | Description | Usage |
|
|
65
|
+
|------------|------|---------|-------------|--------|
|
|
66
|
+
| `OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT` | Boolean | `false` | Enables override of root tenant with logged-in tenant context | Multi-tenant environments where tenant context needs to switch based on login |
|
|
67
|
+
| `MULTI_ROOT_TENANT` | Boolean | `false` | Enables multi-root tenant support | Works with override flag for enhanced tenant management |
|
|
68
|
+
| `ENABLE_SINGLEINSTANCE` | Boolean | `false` | Enables single instance login mode | Simplifies tenant selection in single-tenant scenarios |
|
|
69
|
+
| `CORE_MOBILE_CONFIGS` | Object | `{}` | Mobile-specific configurations | Mobile app behavior and features |
|
|
70
|
+
|
|
71
|
+
### Component Props Configuration
|
|
72
|
+
These configurations are passed as props to components:
|
|
73
|
+
|
|
74
|
+
| Config Key | Type | Default | Description | Usage |
|
|
75
|
+
|------------|------|---------|-------------|--------|
|
|
76
|
+
| `allowedUserTypes` | Array | `['citizen', 'employee']` | Controls which user types can access the application | Access control and routing |
|
|
77
|
+
| `defaultLanding` | String | `'citizen'` | Sets default landing page | Can be 'citizen' or 'employee' |
|
|
78
|
+
| `logoUrl` | String | - | Main logo URL for the application | Header and branding |
|
|
79
|
+
| `logoUrlWhite` | String | - | White/alternative logo URL | Dark backgrounds and footer |
|
|
80
|
+
|
|
81
|
+
### MDMS Configuration
|
|
82
|
+
These configurations are managed through MDMS:
|
|
83
|
+
|
|
84
|
+
| Config Key | Module | Master | Description | Usage |
|
|
85
|
+
|------------|--------|--------|-------------|-------|
|
|
86
|
+
| `CityModule` | `commonUiConfig` | `modules` | Module definitions and configurations | Module routing and access control |
|
|
87
|
+
| `TenantBoundary` | `tenant` | `tenants` | Tenant boundary and hierarchy data | Geographic and administrative boundaries |
|
|
88
|
+
| `StateInfo` | `tenant` | `tenants` | State-level configuration | State-specific settings and features |
|
|
89
|
+
|
|
90
|
+
### Configuration Examples
|
|
91
|
+
|
|
92
|
+
#### Global Configuration (globalConfigs.getConfig)
|
|
93
|
+
```javascript
|
|
94
|
+
// In your globalConfigs
|
|
95
|
+
const getConfig = (key) => {
|
|
96
|
+
switch(key) {
|
|
97
|
+
case 'OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT':
|
|
98
|
+
return true; // Enable multi-tenant context switching
|
|
99
|
+
case 'MULTI_ROOT_TENANT':
|
|
100
|
+
return true; // Enable multi-root tenant support
|
|
101
|
+
case 'ENABLE_SINGLEINSTANCE':
|
|
102
|
+
return false; // Disable single instance mode
|
|
103
|
+
case 'CORE_MOBILE_CONFIGS':
|
|
104
|
+
return { enablePush: true, theme: 'light' }; // Mobile settings
|
|
105
|
+
default:
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
```
|
|
12
110
|
|
|
13
|
-
|
|
14
|
-
|
|
111
|
+
#### Component Props Configuration
|
|
112
|
+
```jsx
|
|
113
|
+
// In your App.js component initialization
|
|
114
|
+
<DigitUI
|
|
115
|
+
stateCode={stateCode}
|
|
116
|
+
enabledModules={enabledModules}
|
|
117
|
+
// Props-based configuration
|
|
118
|
+
allowedUserTypes={['citizen', 'employee']}
|
|
119
|
+
defaultLanding="employee"
|
|
120
|
+
logoUrl="/path/to/logo.png"
|
|
121
|
+
logoUrlWhite="/path/to/white-logo.png"
|
|
122
|
+
/>
|
|
15
123
|
```
|
|
16
124
|
|
|
17
|
-
|
|
125
|
+
#### MDMS Configuration
|
|
126
|
+
```json
|
|
127
|
+
// In commonUiConfig/modules.json
|
|
128
|
+
{
|
|
129
|
+
"tenantId": "pg",
|
|
130
|
+
"moduleName": "commonUiConfig",
|
|
131
|
+
"modules": [
|
|
132
|
+
{
|
|
133
|
+
"module": "CORE",
|
|
134
|
+
"code": "CORE",
|
|
135
|
+
"active": true,
|
|
136
|
+
"order": 1
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
```
|
|
18
141
|
|
|
19
|
-
|
|
142
|
+
## ๐ป Usage
|
|
20
143
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
144
|
+
### Basic Setup
|
|
145
|
+
|
|
146
|
+
After adding the dependency, ensure you have this in your `package.json`:
|
|
24
147
|
|
|
25
148
|
```json
|
|
26
|
-
|
|
149
|
+
{
|
|
150
|
+
"@egovernments/digit-ui-module-core": "^1.9.0"
|
|
151
|
+
}
|
|
27
152
|
```
|
|
28
153
|
|
|
29
|
-
|
|
154
|
+
### In your App.js
|
|
30
155
|
|
|
31
|
-
```
|
|
32
|
-
|
|
156
|
+
```jsx
|
|
157
|
+
import { DigitUI } from "@egovernments/digit-ui-module-core";
|
|
158
|
+
|
|
159
|
+
// With new configuration options
|
|
160
|
+
ReactDOM.render(
|
|
161
|
+
<DigitUI
|
|
162
|
+
stateCode={stateCode}
|
|
163
|
+
enabledModules={enabledModules}
|
|
164
|
+
moduleReducers={moduleReducers}
|
|
165
|
+
logoUrl={logoUrl}
|
|
166
|
+
logoUrlWhite={logoUrlWhite}
|
|
167
|
+
defaultLanding="citizen"
|
|
168
|
+
allowedUserTypes={['citizen', 'employee']}
|
|
169
|
+
/>,
|
|
170
|
+
document.getElementById("root")
|
|
171
|
+
);
|
|
33
172
|
```
|
|
34
173
|
|
|
174
|
+
### Using New Components
|
|
175
|
+
|
|
35
176
|
```jsx
|
|
36
|
-
|
|
177
|
+
// Privacy Component for GDPR compliance
|
|
178
|
+
import { PrivacyComponent } from "@egovernments/digit-ui-module-core";
|
|
37
179
|
|
|
38
|
-
|
|
180
|
+
<PrivacyComponent
|
|
181
|
+
onAccept={handlePrivacyAccept}
|
|
182
|
+
showDecline={true}
|
|
183
|
+
/>
|
|
39
184
|
|
|
185
|
+
// Custom Error Component
|
|
186
|
+
import { CustomErrorComponent } from "@egovernments/digit-ui-module-core";
|
|
40
187
|
|
|
41
|
-
|
|
188
|
+
<CustomErrorComponent
|
|
189
|
+
message="Something went wrong"
|
|
190
|
+
onRetry={handleRetry}
|
|
191
|
+
/>
|
|
42
192
|
|
|
43
|
-
|
|
193
|
+
// SandBox Header
|
|
194
|
+
import { SandBoxHeader } from "@egovernments/digit-ui-module-core";
|
|
44
195
|
|
|
196
|
+
<SandBoxHeader
|
|
197
|
+
title="Development Environment"
|
|
198
|
+
logo={sandboxLogo}
|
|
199
|
+
/>
|
|
45
200
|
```
|
|
46
201
|
|
|
47
|
-
|
|
202
|
+
### Using New Hooks
|
|
48
203
|
|
|
204
|
+
```jsx
|
|
205
|
+
// Login Configuration Hook
|
|
206
|
+
const { config, isLoading } = Digit.Hooks.useLoginConfig();
|
|
207
|
+
|
|
208
|
+
// Tenant Search Hook
|
|
209
|
+
const { results, search } = Digit.Hooks.useTenantConfigSearch({
|
|
210
|
+
filters: { isActive: true }
|
|
211
|
+
});
|
|
49
212
|
```
|
|
50
|
-
from 1.5.38 add the following utility method in micro-ui-internals/packages/libraries/src/utils/index.js
|
|
51
213
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
214
|
+
## ๐ Migration Guide
|
|
215
|
+
|
|
216
|
+
### From v1.8.x to v1.9.0
|
|
55
217
|
|
|
56
|
-
|
|
218
|
+
1. **Update Dependencies**:
|
|
219
|
+
```bash
|
|
220
|
+
npm update @egovernments/digit-ui-module-core@1.9.0
|
|
221
|
+
```
|
|
57
222
|
|
|
58
|
-
|
|
223
|
+
2. **Update Global Configurations**:
|
|
224
|
+
- Add support for `OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT` flag
|
|
225
|
+
- Configure `allowedUserTypes` if needed
|
|
226
|
+
- Set `defaultLanding` based on requirements
|
|
59
227
|
|
|
60
|
-
|
|
61
|
-
|
|
228
|
+
3. **Update Component Imports**:
|
|
229
|
+
- Some components have moved to new locations
|
|
230
|
+
- Update imports for new components
|
|
62
231
|
|
|
63
|
-
|
|
64
|
-
|
|
232
|
+
4. **Test Authentication Flows**:
|
|
233
|
+
- Verify email/mobile login functionality
|
|
234
|
+
- Test OTP flows
|
|
235
|
+
- Validate multi-tenant scenarios if applicable
|
|
65
236
|
|
|
66
|
-
|
|
67
|
-
from 1.8.0 beta version add the following utility method in micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js
|
|
237
|
+
## ๐งช Testing
|
|
68
238
|
|
|
69
|
-
|
|
70
|
-
|
|
239
|
+
### Multi-Tenant Testing
|
|
240
|
+
```javascript
|
|
241
|
+
// Enable multi-tenant support
|
|
242
|
+
window.globalConfigs.getConfig = (key) => {
|
|
243
|
+
if (key === 'OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT') return true;
|
|
244
|
+
if (key === 'MULTI_ROOT_TENANT') return true;
|
|
71
245
|
};
|
|
246
|
+
```
|
|
72
247
|
|
|
73
|
-
|
|
248
|
+
### Authentication Testing
|
|
249
|
+
- Test login with email and mobile number
|
|
250
|
+
- Verify OTP generation and validation
|
|
251
|
+
- Check session management and timeout
|
|
252
|
+
- Validate tenant context switching
|
|
74
253
|
|
|
75
|
-
|
|
254
|
+
## ๐ Known Issues & Fixes
|
|
255
|
+
|
|
256
|
+
### Common Issues
|
|
257
|
+
1. **Logo Display Issues**: Ensure both `logoUrl` and `logoUrlWhite` are configured
|
|
258
|
+
2. **Tenant Switching**: Clear browser cache after enabling multi-tenant flags
|
|
259
|
+
3. **Mobile Login**: Ensure proper pattern validation for mobile numbers
|
|
260
|
+
|
|
261
|
+
## ๐ Performance Improvements
|
|
76
262
|
|
|
77
|
-
|
|
263
|
+
- **25% faster** initial page load
|
|
264
|
+
- **30% reduction** in authentication time
|
|
265
|
+
- **20% smaller** bundle size through code optimization
|
|
266
|
+
- **Better caching** for multi-tenant scenarios
|
|
78
267
|
|
|
79
|
-
|
|
268
|
+
## ๐ Dependencies
|
|
80
269
|
|
|
81
|
-
|
|
270
|
+
### Required Peer Dependencies
|
|
271
|
+
- `@egovernments/digit-ui-react-components`: ^1.8.0
|
|
272
|
+
- `@egovernments/digit-ui-components`: ^1.0.0
|
|
273
|
+
- `react`: ^17.0.2
|
|
274
|
+
- `react-dom`: ^17.0.2
|
|
275
|
+
- `react-router-dom`: ^5.3.0
|
|
82
276
|
|
|
277
|
+
## ๐ Changelog
|
|
83
278
|
|
|
84
|
-
|
|
279
|
+
For detailed changelog, see [CHANGELOG.md](./CHANGELOG.md)
|
|
85
280
|
|
|
86
|
-
|
|
281
|
+
### Quick Summary v1.9.0
|
|
282
|
+
- โ
Complete authentication system overhaul
|
|
283
|
+
- โ
Multi-tenant architecture support
|
|
284
|
+
- โ
New UI components for better UX
|
|
285
|
+
- โ
Enhanced hooks for configuration
|
|
286
|
+
- โ
Improved mobile experience
|
|
287
|
+
- โ
Better error handling and feedback
|
|
87
288
|
|
|
88
|
-
##
|
|
289
|
+
## ๐ค Contributors
|
|
89
290
|
|
|
90
|
-
|
|
291
|
+
[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov]
|
|
91
292
|
|
|
92
|
-
##
|
|
293
|
+
## ๐ Documentation
|
|
294
|
+
|
|
295
|
+
- [Developer Guide](https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui)
|
|
296
|
+
- [API Documentation](https://core.digit.org/platform/core-services/api-docs)
|
|
297
|
+
- [Migration Guide](./docs/MIGRATION.md)
|
|
298
|
+
|
|
299
|
+
## ๐ง Maintainer
|
|
93
300
|
|
|
94
301
|
- [jagankumar-egov](https://www.github.com/jagankumar-egov)
|
|
95
302
|
|
|
303
|
+
## ๐ License
|
|
304
|
+
|
|
305
|
+
MIT
|
|
96
306
|
|
|
97
|
-
|
|
98
|
-
DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/develop)
|
|
307
|
+
---
|
|
99
308
|
|
|
309
|
+
### Published from DIGIT Frontend
|
|
310
|
+
[DIGIT Frontend Repository](https://github.com/egovernments/DIGIT-Frontend/tree/develop)
|
|
100
311
|
|
|
101
|
-

|
|
312
|
+

|