@abpjs/tenant-management 2.0.0 → 2.2.0
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/hooks/useTenantManagement.d.ts +8 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +18 -0
- package/dist/index.mjs +18 -0
- package/package.json +4 -4
|
@@ -69,6 +69,14 @@ export interface UseTenantManagementReturn {
|
|
|
69
69
|
setSortOrder: (order: SortOrder) => void;
|
|
70
70
|
/** Handle shared database checkbox change @since 1.1.0 */
|
|
71
71
|
onSharedDatabaseChange: (value: boolean) => void;
|
|
72
|
+
/** Whether the features modal is visible @since 2.2.0 */
|
|
73
|
+
visibleFeatures: boolean;
|
|
74
|
+
/** Provider key for the features modal (tenant ID) @since 2.2.0 */
|
|
75
|
+
featuresProviderKey: string;
|
|
76
|
+
/** Callback when features modal visibility changes @since 2.2.0 */
|
|
77
|
+
onVisibleFeaturesChange: (value: boolean) => void;
|
|
78
|
+
/** Open the features modal for a tenant @since 2.2.0 */
|
|
79
|
+
openFeaturesModal: (providerKey: string) => void;
|
|
72
80
|
/** Reset all state */
|
|
73
81
|
reset: () => void;
|
|
74
82
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @abpjs/tenant-management
|
|
3
3
|
* ABP Framework Tenant Management module for React
|
|
4
|
-
* Translated from @abp/ng.tenant-management v2.
|
|
4
|
+
* Translated from @abp/ng.tenant-management v2.2.0
|
|
5
|
+
*
|
|
6
|
+
* Changes in v2.2.0:
|
|
7
|
+
* - Added openFeaturesModal(providerKey: string) to useTenantManagement hook
|
|
8
|
+
* - Added visibleFeatures state to useTenantManagement hook
|
|
9
|
+
* - Added featuresProviderKey state to useTenantManagement hook
|
|
10
|
+
* - Added onVisibleFeaturesChange callback to useTenantManagement hook
|
|
11
|
+
* - Dependency updates to @abp/ng.theme.shared v2.2.0, @abp/ng.feature-management v2.2.0
|
|
12
|
+
*
|
|
13
|
+
* Changes in v2.1.0:
|
|
14
|
+
* - Version bump only (dependency updates to @abp/ng.theme.shared v2.1.0, @abp/ng.feature-management v2.1.0)
|
|
5
15
|
*
|
|
6
16
|
* Changes in v2.0.0:
|
|
7
17
|
* - Removed TENANT_MANAGEMENT_ROUTES constant (deprecated in v0.9.0)
|
package/dist/index.js
CHANGED
|
@@ -308,6 +308,8 @@ function useTenantManagement() {
|
|
|
308
308
|
const [useSharedDatabase, setUseSharedDatabase] = (0, import_react.useState)(true);
|
|
309
309
|
const [sortKey, setSortKey] = (0, import_react.useState)("name");
|
|
310
310
|
const [sortOrder, setSortOrder] = (0, import_react.useState)("");
|
|
311
|
+
const [visibleFeatures, setVisibleFeatures] = (0, import_react.useState)(false);
|
|
312
|
+
const [featuresProviderKey, setFeaturesProviderKey] = (0, import_react.useState)("");
|
|
311
313
|
const fetchTenants = (0, import_react.useCallback)(async (params) => {
|
|
312
314
|
setIsLoading(true);
|
|
313
315
|
setError(null);
|
|
@@ -462,6 +464,16 @@ function useTenantManagement() {
|
|
|
462
464
|
setDefaultConnectionString("");
|
|
463
465
|
}
|
|
464
466
|
}, []);
|
|
467
|
+
const onVisibleFeaturesChange = (0, import_react.useCallback)((value) => {
|
|
468
|
+
setVisibleFeatures(value);
|
|
469
|
+
if (!value) {
|
|
470
|
+
setFeaturesProviderKey("");
|
|
471
|
+
}
|
|
472
|
+
}, []);
|
|
473
|
+
const openFeaturesModal = (0, import_react.useCallback)((providerKey) => {
|
|
474
|
+
setFeaturesProviderKey(providerKey);
|
|
475
|
+
setVisibleFeatures(true);
|
|
476
|
+
}, []);
|
|
465
477
|
const isDisabledSaveButton = (0, import_react.useMemo)(() => {
|
|
466
478
|
return !useSharedDatabase && !defaultConnectionString.trim();
|
|
467
479
|
}, [useSharedDatabase, defaultConnectionString]);
|
|
@@ -473,6 +485,8 @@ function useTenantManagement() {
|
|
|
473
485
|
setError(null);
|
|
474
486
|
setDefaultConnectionString("");
|
|
475
487
|
setUseSharedDatabase(true);
|
|
488
|
+
setVisibleFeatures(false);
|
|
489
|
+
setFeaturesProviderKey("");
|
|
476
490
|
}, []);
|
|
477
491
|
return {
|
|
478
492
|
tenants,
|
|
@@ -485,6 +499,8 @@ function useTenantManagement() {
|
|
|
485
499
|
sortKey,
|
|
486
500
|
sortOrder,
|
|
487
501
|
isDisabledSaveButton,
|
|
502
|
+
visibleFeatures,
|
|
503
|
+
featuresProviderKey,
|
|
488
504
|
fetchTenants,
|
|
489
505
|
fetchTenantById,
|
|
490
506
|
createTenant,
|
|
@@ -499,6 +515,8 @@ function useTenantManagement() {
|
|
|
499
515
|
setSortKey,
|
|
500
516
|
setSortOrder,
|
|
501
517
|
onSharedDatabaseChange,
|
|
518
|
+
onVisibleFeaturesChange,
|
|
519
|
+
openFeaturesModal,
|
|
502
520
|
reset
|
|
503
521
|
};
|
|
504
522
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -276,6 +276,8 @@ function useTenantManagement() {
|
|
|
276
276
|
const [useSharedDatabase, setUseSharedDatabase] = useState(true);
|
|
277
277
|
const [sortKey, setSortKey] = useState("name");
|
|
278
278
|
const [sortOrder, setSortOrder] = useState("");
|
|
279
|
+
const [visibleFeatures, setVisibleFeatures] = useState(false);
|
|
280
|
+
const [featuresProviderKey, setFeaturesProviderKey] = useState("");
|
|
279
281
|
const fetchTenants = useCallback(async (params) => {
|
|
280
282
|
setIsLoading(true);
|
|
281
283
|
setError(null);
|
|
@@ -430,6 +432,16 @@ function useTenantManagement() {
|
|
|
430
432
|
setDefaultConnectionString("");
|
|
431
433
|
}
|
|
432
434
|
}, []);
|
|
435
|
+
const onVisibleFeaturesChange = useCallback((value) => {
|
|
436
|
+
setVisibleFeatures(value);
|
|
437
|
+
if (!value) {
|
|
438
|
+
setFeaturesProviderKey("");
|
|
439
|
+
}
|
|
440
|
+
}, []);
|
|
441
|
+
const openFeaturesModal = useCallback((providerKey) => {
|
|
442
|
+
setFeaturesProviderKey(providerKey);
|
|
443
|
+
setVisibleFeatures(true);
|
|
444
|
+
}, []);
|
|
433
445
|
const isDisabledSaveButton = useMemo(() => {
|
|
434
446
|
return !useSharedDatabase && !defaultConnectionString.trim();
|
|
435
447
|
}, [useSharedDatabase, defaultConnectionString]);
|
|
@@ -441,6 +453,8 @@ function useTenantManagement() {
|
|
|
441
453
|
setError(null);
|
|
442
454
|
setDefaultConnectionString("");
|
|
443
455
|
setUseSharedDatabase(true);
|
|
456
|
+
setVisibleFeatures(false);
|
|
457
|
+
setFeaturesProviderKey("");
|
|
444
458
|
}, []);
|
|
445
459
|
return {
|
|
446
460
|
tenants,
|
|
@@ -453,6 +467,8 @@ function useTenantManagement() {
|
|
|
453
467
|
sortKey,
|
|
454
468
|
sortOrder,
|
|
455
469
|
isDisabledSaveButton,
|
|
470
|
+
visibleFeatures,
|
|
471
|
+
featuresProviderKey,
|
|
456
472
|
fetchTenants,
|
|
457
473
|
fetchTenantById,
|
|
458
474
|
createTenant,
|
|
@@ -467,6 +483,8 @@ function useTenantManagement() {
|
|
|
467
483
|
setSortKey,
|
|
468
484
|
setSortOrder,
|
|
469
485
|
onSharedDatabaseChange,
|
|
486
|
+
onVisibleFeaturesChange,
|
|
487
|
+
openFeaturesModal,
|
|
470
488
|
reset
|
|
471
489
|
};
|
|
472
490
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/tenant-management",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "ABP Framework tenant-management components for React - translated from @abp/ng.tenant-management",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@chakra-ui/react": "^3.2.0",
|
|
25
25
|
"@emotion/react": "^11.11.0",
|
|
26
|
-
"@abpjs/
|
|
27
|
-
"@abpjs/
|
|
26
|
+
"@abpjs/theme-shared": "2.2.0",
|
|
27
|
+
"@abpjs/core": "2.2.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abp/ng.tenant-management": "2.
|
|
30
|
+
"@abp/ng.tenant-management": "2.2.0",
|
|
31
31
|
"@testing-library/jest-dom": "^6.4.0",
|
|
32
32
|
"@testing-library/react": "^14.2.0",
|
|
33
33
|
"@types/react": "^18.2.0",
|