@manojkmfsi/monodog 1.1.37 → 1.1.39
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/CHANGELOG.md +12 -0
- package/monodog-dashboard/dist/assets/index-C08ciT3A.js +20 -0
- package/monodog-dashboard/dist/assets/index-C08ciT3A.js.map +1 -0
- package/monodog-dashboard/dist/assets/index-Dc2vaUOq.css +1 -0
- package/monodog-dashboard/{index.html → dist/index.html} +2 -1
- package/monodog-dashboard/package.json +0 -3
- package/package.json +2 -2
- package/monodog-dashboard/THEME_SYSTEM.md +0 -309
- package/monodog-dashboard/__tests__/AuthCallbackPage.test.ts +0 -138
- package/monodog-dashboard/__tests__/ConfigInspector.test.ts +0 -33
- package/monodog-dashboard/__tests__/DependencyGraph.test.ts +0 -72
- package/monodog-dashboard/__tests__/HealthStatus.test.ts +0 -69
- package/monodog-dashboard/__tests__/LoginPage.test.ts +0 -79
- package/monodog-dashboard/__tests__/PackageDetail.test.ts +0 -22
- package/monodog-dashboard/__tests__/ReleaseManager.test.tsx +0 -510
- package/monodog-dashboard/__tests__/api-client.test.ts +0 -475
- package/monodog-dashboard/__tests__/components.test.ts +0 -117
- package/monodog-dashboard/__tests__/dashboard.utils.test.ts +0 -144
- package/monodog-dashboard/__tests__/dependency.utils.test.ts +0 -125
- package/monodog-dashboard/__tests__/monorepoService.unit.test.ts +0 -103
- package/monodog-dashboard/__tests__/packages.utils.test.ts +0 -37
- package/monodog-dashboard/__tests__/pages.test.ts +0 -103
- package/monodog-dashboard/package-lock.json +0 -4587
- package/monodog-dashboard/postcss.config.js +0 -6
- package/monodog-dashboard/src/components/App.tsx +0 -36
- package/monodog-dashboard/src/components/LoadingState.tsx +0 -18
- package/monodog-dashboard/src/components/PermissionGuard.tsx +0 -92
- package/monodog-dashboard/src/components/ProtectedRoute.tsx +0 -24
- package/monodog-dashboard/src/components/configuration/Configuration.tsx +0 -91
- package/monodog-dashboard/src/components/configuration/components/BrandingSettings.tsx +0 -128
- package/monodog-dashboard/src/components/configuration/components/ConfigurationHeader.tsx +0 -34
- package/monodog-dashboard/src/components/configuration/components/ConfigurationModal.tsx +0 -20
- package/monodog-dashboard/src/components/configuration/components/ConfigurationTabs.tsx +0 -30
- package/monodog-dashboard/src/components/configuration/components/FeatureToggles.tsx +0 -66
- package/monodog-dashboard/src/components/configuration/components/GeneralSettings.tsx +0 -77
- package/monodog-dashboard/src/components/configuration/components/MonorepoSettings.tsx +0 -179
- package/monodog-dashboard/src/components/configuration/components/index.ts +0 -8
- package/monodog-dashboard/src/components/configuration/types/config.types.ts +0 -52
- package/monodog-dashboard/src/components/configuration/utils/config.utils.tsx +0 -115
- package/monodog-dashboard/src/components/main-dashboard/Dashboard.tsx +0 -242
- package/monodog-dashboard/src/components/main-dashboard/Layout.tsx +0 -112
- package/monodog-dashboard/src/components/main-dashboard/components/Header.tsx +0 -47
- package/monodog-dashboard/src/components/main-dashboard/components/PackageDistribution.tsx +0 -35
- package/monodog-dashboard/src/components/main-dashboard/components/PackageSearchFilter.tsx +0 -47
- package/monodog-dashboard/src/components/main-dashboard/components/PackageTable.tsx +0 -87
- package/monodog-dashboard/src/components/main-dashboard/components/QuickActions.tsx +0 -60
- package/monodog-dashboard/src/components/main-dashboard/components/StatsCards.tsx +0 -73
- package/monodog-dashboard/src/components/main-dashboard/components/index.ts +0 -7
- package/monodog-dashboard/src/components/main-dashboard/types/dashboard.types.ts +0 -33
- package/monodog-dashboard/src/components/main-dashboard/utils/dashboard.utils.tsx +0 -70
- package/monodog-dashboard/src/components/modules/ci-integration/CIIntegration.tsx +0 -277
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildDetails.tsx +0 -228
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildList.tsx +0 -212
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildOverview.tsx +0 -158
- package/monodog-dashboard/src/components/modules/ci-integration/components/CIIntegrationHeader.tsx +0 -38
- package/monodog-dashboard/src/components/modules/ci-integration/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/ci-integration/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/ci-integration/components/PipelineStatus.tsx +0 -223
- package/monodog-dashboard/src/components/modules/ci-integration/components/index.ts +0 -8
- package/monodog-dashboard/src/components/modules/ci-integration/types/ci.types.ts +0 -97
- package/monodog-dashboard/src/components/modules/ci-integration/utils/ci.utils.tsx +0 -264
- package/monodog-dashboard/src/components/modules/config-inspector/ConfigInspector.tsx +0 -324
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigEditor.tsx +0 -93
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigInspectorHeader.tsx +0 -36
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigPreview.tsx +0 -89
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigSidebar.tsx +0 -141
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigToolbar.tsx +0 -184
- package/monodog-dashboard/src/components/modules/config-inspector/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/config-inspector/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/config-inspector/components/ValidationPanel.tsx +0 -155
- package/monodog-dashboard/src/components/modules/config-inspector/components/index.ts +0 -9
- package/monodog-dashboard/src/components/modules/config-inspector/types/config.types.ts +0 -100
- package/monodog-dashboard/src/components/modules/config-inspector/utils/config.utils.tsx +0 -704
- package/monodog-dashboard/src/components/modules/dependency-graph/DependencyGraph.tsx +0 -224
- package/monodog-dashboard/src/components/modules/dependency-graph/components/CircularDependencies.tsx +0 -177
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyDetails.tsx +0 -192
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyGraphHeader.tsx +0 -30
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyList.tsx +0 -177
- package/monodog-dashboard/src/components/modules/dependency-graph/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphLegend.tsx +0 -89
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphStats.tsx +0 -141
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphToolbar.tsx +0 -107
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphVisualization.tsx +0 -179
- package/monodog-dashboard/src/components/modules/dependency-graph/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/dependency-graph/components/index.ts +0 -11
- package/monodog-dashboard/src/components/modules/dependency-graph/types/dependency.types.ts +0 -105
- package/monodog-dashboard/src/components/modules/dependency-graph/utils/dependency.utils.tsx +0 -433
- package/monodog-dashboard/src/components/modules/health-status/HealthStatus.tsx +0 -739
- package/monodog-dashboard/src/components/modules/health-status/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/health-status/components/HealthActions.tsx +0 -122
- package/monodog-dashboard/src/components/modules/health-status/components/HealthAlerts.tsx +0 -151
- package/monodog-dashboard/src/components/modules/health-status/components/HealthMetrics.tsx +0 -132
- package/monodog-dashboard/src/components/modules/health-status/components/HealthStatusHeader.tsx +0 -30
- package/monodog-dashboard/src/components/modules/health-status/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/health-status/components/OverallHealthScore.tsx +0 -122
- package/monodog-dashboard/src/components/modules/health-status/components/PackageHealthList.tsx +0 -195
- package/monodog-dashboard/src/components/modules/health-status/types/health.types.ts +0 -80
- package/monodog-dashboard/src/components/modules/health-status/utils/health.utils.tsx +0 -220
- package/monodog-dashboard/src/components/modules/packages/PackageDetail.tsx +0 -255
- package/monodog-dashboard/src/components/modules/packages/PackagesOverview.tsx +0 -166
- package/monodog-dashboard/src/components/modules/packages/components/ConfigurationTab.tsx +0 -311
- package/monodog-dashboard/src/components/modules/packages/components/DependenciesTab.tsx +0 -154
- package/monodog-dashboard/src/components/modules/packages/components/ErrorState.tsx +0 -21
- package/monodog-dashboard/src/components/modules/packages/components/HealthMetricsTab.tsx +0 -275
- package/monodog-dashboard/src/components/modules/packages/components/LoadingState.tsx +0 -14
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailHeader.tsx +0 -167
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailTabs.tsx +0 -49
- package/monodog-dashboard/src/components/modules/packages/components/PackageStats.tsx +0 -70
- package/monodog-dashboard/src/components/modules/packages/components/PackagesTable.tsx +0 -163
- package/monodog-dashboard/src/components/modules/packages/components/RecentCommitsTab.tsx +0 -90
- package/monodog-dashboard/src/components/modules/packages/components/SearchAndFilter.tsx +0 -66
- package/monodog-dashboard/src/components/modules/packages/components/index.ts +0 -12
- package/monodog-dashboard/src/components/modules/packages/types/packages.types.ts +0 -101
- package/monodog-dashboard/src/components/modules/packages/utils/packages.utils.tsx +0 -178
- package/monodog-dashboard/src/components/pipeline/JobsList.tsx +0 -83
- package/monodog-dashboard/src/components/pipeline/LogViewer.tsx +0 -392
- package/monodog-dashboard/src/components/pipeline/PipelineManager.tsx +0 -562
- package/monodog-dashboard/src/components/pipeline/WorkflowRunsList.tsx +0 -272
- package/monodog-dashboard/src/components/pipeline/WorkflowTrigger.tsx +0 -182
- package/monodog-dashboard/src/components/pipeline/utils/pipeline.utils.tsx +0 -11
- package/monodog-dashboard/src/components/publish-control/PublishControl.tsx +0 -229
- package/monodog-dashboard/src/components/publish-control/components/ChangelogViewer.tsx +0 -103
- package/monodog-dashboard/src/components/publish-control/components/ErrorState.tsx +0 -23
- package/monodog-dashboard/src/components/publish-control/components/LoadingState.tsx +0 -10
- package/monodog-dashboard/src/components/publish-control/components/PackageReleaseTable.tsx +0 -140
- package/monodog-dashboard/src/components/publish-control/components/PublishHeader.tsx +0 -30
- package/monodog-dashboard/src/components/publish-control/components/QuickActionCards.tsx +0 -56
- package/monodog-dashboard/src/components/publish-control/components/ReleaseSchedule.tsx +0 -104
- package/monodog-dashboard/src/components/publish-control/components/index.ts +0 -8
- package/monodog-dashboard/src/components/publish-control/types/publish.types.ts +0 -39
- package/monodog-dashboard/src/components/publish-control/utils/publish.utils.ts +0 -59
- package/monodog-dashboard/src/components/release-manager/ReleaseManager.tsx +0 -342
- package/monodog-dashboard/src/components/release-manager/components/ChangesetPreview.tsx +0 -123
- package/monodog-dashboard/src/components/release-manager/components/ErrorState.tsx +0 -38
- package/monodog-dashboard/src/components/release-manager/components/LoadingState.tsx +0 -18
- package/monodog-dashboard/src/components/release-manager/components/PackageSelector.tsx +0 -137
- package/monodog-dashboard/src/components/release-manager/components/PublishConfirmation.tsx +0 -150
- package/monodog-dashboard/src/components/release-manager/components/ReleaseValidation.tsx +0 -138
- package/monodog-dashboard/src/components/release-manager/components/VersionBumpSelector.tsx +0 -142
- package/monodog-dashboard/src/components/release-manager/types/index.ts +0 -9
- package/monodog-dashboard/src/components/release-manager/types/release-manager.types.ts +0 -29
- package/monodog-dashboard/src/components/setup-guide/SetupGuide.tsx +0 -96
- package/monodog-dashboard/src/components/setup-guide/components/SetupHeader.tsx +0 -24
- package/monodog-dashboard/src/components/setup-guide/components/SetupModal.tsx +0 -24
- package/monodog-dashboard/src/components/setup-guide/components/SetupProgress.tsx +0 -29
- package/monodog-dashboard/src/components/setup-guide/components/StepContent.tsx +0 -272
- package/monodog-dashboard/src/components/setup-guide/components/StepNavigation.tsx +0 -62
- package/monodog-dashboard/src/components/setup-guide/components/index.ts +0 -6
- package/monodog-dashboard/src/components/setup-guide/types/setup.types.ts +0 -38
- package/monodog-dashboard/src/components/setup-guide/utils/setup.utils.ts +0 -79
- package/monodog-dashboard/src/constants/api-config.ts +0 -81
- package/monodog-dashboard/src/constants/index.ts +0 -9
- package/monodog-dashboard/src/constants/messages.ts +0 -40
- package/monodog-dashboard/src/icons/heroicons.ts +0 -65
- package/monodog-dashboard/src/icons/index.tsx +0 -1788
- package/monodog-dashboard/src/index.css +0 -175
- package/monodog-dashboard/src/main.tsx +0 -9
- package/monodog-dashboard/src/pages/AuthCallbackPage.tsx +0 -103
- package/monodog-dashboard/src/pages/CIPage.tsx +0 -6
- package/monodog-dashboard/src/pages/ConfigPage.tsx +0 -6
- package/monodog-dashboard/src/pages/DashboardPage.tsx +0 -6
- package/monodog-dashboard/src/pages/DependenciesPage.tsx +0 -6
- package/monodog-dashboard/src/pages/HealthPage.tsx +0 -6
- package/monodog-dashboard/src/pages/LoginPage.tsx +0 -77
- package/monodog-dashboard/src/pages/PackageDetailPage.tsx +0 -6
- package/monodog-dashboard/src/pages/PackagesPage.tsx +0 -6
- package/monodog-dashboard/src/pages/PipelinePage.tsx +0 -22
- package/monodog-dashboard/src/pages/PublishPage.tsx +0 -6
- package/monodog-dashboard/src/pages/ReleaseManagerPage.tsx +0 -9
- package/monodog-dashboard/src/pages/index.ts +0 -28
- package/monodog-dashboard/src/routes/AppRouter.tsx +0 -89
- package/monodog-dashboard/src/routes/AppRouterPages.tsx +0 -56
- package/monodog-dashboard/src/routes/index.ts +0 -10
- package/monodog-dashboard/src/routes/routes.config.ts +0 -94
- package/monodog-dashboard/src/services/api/api-client.ts +0 -189
- package/monodog-dashboard/src/services/api/index.ts +0 -30
- package/monodog-dashboard/src/services/api/types/api.types.ts +0 -63
- package/monodog-dashboard/src/services/auth-context.tsx +0 -344
- package/monodog-dashboard/src/services/monorepoService.ts +0 -733
- package/monodog-dashboard/src/services/permission-context.tsx +0 -193
- package/monodog-dashboard/src/theme/COMPONENT_UPDATES.md +0 -273
- package/monodog-dashboard/src/theme/INTEGRATION.md +0 -381
- package/monodog-dashboard/src/theme/README.md +0 -239
- package/monodog-dashboard/src/theme/examples.tsx +0 -386
- package/monodog-dashboard/src/theme/index.ts +0 -402
- package/monodog-dashboard/src/theme/migration-guide.md +0 -335
- package/monodog-dashboard/src/types/auth-context.types.ts +0 -51
- package/monodog-dashboard/src/types/component.types.ts +0 -96
- package/monodog-dashboard/src/types/icons.types.ts +0 -13
- package/monodog-dashboard/src/types/index.ts +0 -68
- package/monodog-dashboard/src/types/monorepo-service.types.ts +0 -53
- package/monodog-dashboard/src/types/permission-context.types.ts +0 -49
- package/monodog-dashboard/src/types/pipeline.types.ts +0 -89
- package/monodog-dashboard/src/types/routes.types.ts +0 -12
- package/monodog-dashboard/src/utils/cookies.ts +0 -47
- package/monodog-dashboard/tailwind.config.js +0 -68
- package/monodog-dashboard/tsconfig.app.json +0 -14
- package/monodog-dashboard/tsconfig.json +0 -17
- package/monodog-dashboard/tsconfig.node.json +0 -10
- package/monodog-dashboard/vite.config.ts +0 -9
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Permission Context and Hooks
|
|
3
|
-
* Manages repository permissions per user
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, {
|
|
7
|
-
createContext,
|
|
8
|
-
useState,
|
|
9
|
-
useCallback,
|
|
10
|
-
ReactNode,
|
|
11
|
-
} from 'react';
|
|
12
|
-
import { DASHBOARD_ERROR_MESSAGES } from '../constants/messages';
|
|
13
|
-
import apiClient from './api';
|
|
14
|
-
import type {
|
|
15
|
-
RepositoryPermission,
|
|
16
|
-
MonoDogPermissionRole,
|
|
17
|
-
PermissionCheckResponse,
|
|
18
|
-
PermissionContextType,
|
|
19
|
-
PermissionProviderProps,
|
|
20
|
-
} from '../types/permission-context.types';
|
|
21
|
-
|
|
22
|
-
const PermissionContext = createContext<PermissionContextType | undefined>(
|
|
23
|
-
undefined
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export function PermissionProvider({ children }: PermissionProviderProps) {
|
|
27
|
-
const [permissions, setPermissions] = useState<
|
|
28
|
-
Map<string, PermissionCheckResponse>
|
|
29
|
-
>(new Map());
|
|
30
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
31
|
-
const [error, setError] = useState<string | null>(null);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Get cache key for permission
|
|
35
|
-
*/
|
|
36
|
-
const getCacheKey = (owner: string, repo: string): string => {
|
|
37
|
-
return `${owner}/${repo}`;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Check user's permission for a repository
|
|
42
|
-
*/
|
|
43
|
-
const checkPermission = useCallback(
|
|
44
|
-
async (
|
|
45
|
-
sessionToken: string,
|
|
46
|
-
owner: string,
|
|
47
|
-
repo: string
|
|
48
|
-
): Promise<PermissionCheckResponse | null> => {
|
|
49
|
-
try {
|
|
50
|
-
setIsLoading(true);
|
|
51
|
-
setError(null);
|
|
52
|
-
|
|
53
|
-
const cacheKey = getCacheKey(owner, repo);
|
|
54
|
-
|
|
55
|
-
// Check cache first
|
|
56
|
-
if (permissions.has(cacheKey)) {
|
|
57
|
-
return permissions.get(cacheKey) || null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const response = await apiClient.get(`/permissions/${owner}/${repo}`);
|
|
61
|
-
|
|
62
|
-
if (!response.success) {
|
|
63
|
-
if (response.error.status === 401) {
|
|
64
|
-
throw new Error(DASHBOARD_ERROR_MESSAGES.AUTHENTICATION_ERROR);
|
|
65
|
-
}
|
|
66
|
-
throw new Error(DASHBOARD_ERROR_MESSAGES.FAILED_TO_CHECK_PERMISSION);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const data = response.data as any;
|
|
70
|
-
|
|
71
|
-
const permission: PermissionCheckResponse = {
|
|
72
|
-
permission: data.permission,
|
|
73
|
-
role: data.role,
|
|
74
|
-
canAdmin: data.canAdmin,
|
|
75
|
-
canMaintain: data.canMaintain,
|
|
76
|
-
canWrite: data.canWrite,
|
|
77
|
-
canRead: data.canRead,
|
|
78
|
-
denied: data.denied,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// Cache permission
|
|
82
|
-
setPermissions((prev) => {
|
|
83
|
-
const newMap = new Map(prev);
|
|
84
|
-
newMap.set(cacheKey, permission);
|
|
85
|
-
return newMap;
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return permission;
|
|
89
|
-
} catch (err) {
|
|
90
|
-
const message = err instanceof Error ? err.message : 'Permission check failed';
|
|
91
|
-
setError(message);
|
|
92
|
-
return null;
|
|
93
|
-
} finally {
|
|
94
|
-
setIsLoading(false);
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
[permissions]
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Check if user can perform an action
|
|
102
|
-
*/
|
|
103
|
-
const canPerformAction = useCallback(
|
|
104
|
-
async (
|
|
105
|
-
sessionToken: string,
|
|
106
|
-
owner: string,
|
|
107
|
-
repo: string,
|
|
108
|
-
action: 'read' | 'write' | 'maintain' | 'admin'
|
|
109
|
-
): Promise<boolean> => {
|
|
110
|
-
try {
|
|
111
|
-
setIsLoading(true);
|
|
112
|
-
setError(null);
|
|
113
|
-
|
|
114
|
-
const response = await apiClient.post(
|
|
115
|
-
`/permissions/${owner}/${repo}/can-action`,
|
|
116
|
-
{ action }
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
if (!response.success) {
|
|
120
|
-
throw new Error(DASHBOARD_ERROR_MESSAGES.FAILED_TO_CHECK_ACTION_PERMISSION);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const data = response.data as any;
|
|
124
|
-
return data.can === true;
|
|
125
|
-
} catch (err) {
|
|
126
|
-
console.error('Action permission check error:', err);
|
|
127
|
-
return false;
|
|
128
|
-
} finally {
|
|
129
|
-
setIsLoading(false);
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
[]
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Invalidate permission cache for a repository
|
|
137
|
-
*/
|
|
138
|
-
const invalidatePermission = useCallback((owner: string, repo: string) => {
|
|
139
|
-
const cacheKey = getCacheKey(owner, repo);
|
|
140
|
-
setPermissions((prev) => {
|
|
141
|
-
const newMap = new Map(prev);
|
|
142
|
-
newMap.delete(cacheKey);
|
|
143
|
-
return newMap;
|
|
144
|
-
});
|
|
145
|
-
}, []);
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Clear all permission cache
|
|
149
|
-
*/
|
|
150
|
-
const invalidateAll = useCallback(() => {
|
|
151
|
-
setPermissions(new Map());
|
|
152
|
-
}, []);
|
|
153
|
-
|
|
154
|
-
const value: PermissionContextType = {
|
|
155
|
-
permissions,
|
|
156
|
-
isLoading,
|
|
157
|
-
error,
|
|
158
|
-
checkPermission,
|
|
159
|
-
canPerformAction,
|
|
160
|
-
invalidatePermission,
|
|
161
|
-
invalidateAll,
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
<PermissionContext.Provider value={value}>
|
|
166
|
-
{children}
|
|
167
|
-
</PermissionContext.Provider>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Hook to use permission context
|
|
173
|
-
*/
|
|
174
|
-
export function usePermission(): PermissionContextType {
|
|
175
|
-
const context = React.useContext(PermissionContext);
|
|
176
|
-
if (context === undefined) {
|
|
177
|
-
throw new Error(
|
|
178
|
-
'usePermission must be used within a PermissionProvider'
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
return context;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Re-export types for backward compatibility
|
|
185
|
-
export type {
|
|
186
|
-
RepositoryPermission,
|
|
187
|
-
MonoDogPermissionRole,
|
|
188
|
-
PermissionCheckResponse,
|
|
189
|
-
PermissionContextType,
|
|
190
|
-
PermissionProviderProps,
|
|
191
|
-
} from '../types/permission-context.types';
|
|
192
|
-
|
|
193
|
-
export default PermissionContext;
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
# Component Theme Integration Status
|
|
2
|
-
|
|
3
|
-
This document tracks the progress of updating components to use the centralized theme system.
|
|
4
|
-
|
|
5
|
-
## 🎯 Progress Overview
|
|
6
|
-
|
|
7
|
-
### **Completed Updates**
|
|
8
|
-
|
|
9
|
-
1. **Layout Component**
|
|
10
|
-
- File: `components/main-dashboard/Layout.tsx`
|
|
11
|
-
- Status: **Fully Updated**
|
|
12
|
-
- Changes: `bg-neutral-50`, `shadow-medium`, `text-heading`, `nav-link` classes
|
|
13
|
-
|
|
14
|
-
2. **CI Integration Header**
|
|
15
|
-
- File: `components/modules/ci-integration/components/CIIntegrationHeader.tsx`
|
|
16
|
-
- Status: **Fully Updated**
|
|
17
|
-
- Changes: `text-heading`, `text-body`, `btn-primary`, `btn-secondary`
|
|
18
|
-
|
|
19
|
-
3. **Build Overview**
|
|
20
|
-
- File: `components/modules/ci-integration/components/BuildOverview.tsx`
|
|
21
|
-
- Status: **Fully Updated**
|
|
22
|
-
- Changes: `card`, `text-heading`, `text-caption`, theme color classes
|
|
23
|
-
|
|
24
|
-
4. **Packages Overview**
|
|
25
|
-
- File: `components/modules/packages/PackagesOverview.tsx`
|
|
26
|
-
- Status: **Fully Updated**
|
|
27
|
-
- Changes: `text-heading`, `text-body`, `btn-primary`, theme colors
|
|
28
|
-
|
|
29
|
-
5. **Main Dashboard Header**
|
|
30
|
-
- File: `components/main-dashboard/components/Header.tsx`
|
|
31
|
-
- Status: **Fully Updated**
|
|
32
|
-
- Changes: `text-heading`, `text-body`, `btn-primary`, `btn-ghost`
|
|
33
|
-
|
|
34
|
-
6. **Stats Cards**
|
|
35
|
-
- File: `components/main-dashboard/components/StatsCards.tsx`
|
|
36
|
-
- Status: **Fully Updated**
|
|
37
|
-
- Changes: `card`, `text-heading`, `text-caption`, semantic colors
|
|
38
|
-
|
|
39
|
-
## **Theme Class Migration Patterns**
|
|
40
|
-
|
|
41
|
-
### Button Conversions
|
|
42
|
-
|
|
43
|
-
```tsx
|
|
44
|
-
// Before
|
|
45
|
-
className = 'bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700';
|
|
46
|
-
|
|
47
|
-
// After
|
|
48
|
-
className = 'btn-primary';
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Typography Conversions
|
|
52
|
-
|
|
53
|
-
```tsx
|
|
54
|
-
// Before
|
|
55
|
-
className = 'text-2xl font-bold text-gray-900';
|
|
56
|
-
className = 'text-gray-600';
|
|
57
|
-
className = 'text-sm text-gray-500';
|
|
58
|
-
|
|
59
|
-
// After
|
|
60
|
-
className = 'text-heading text-2xl';
|
|
61
|
-
className = 'text-body';
|
|
62
|
-
className = 'text-caption';
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Card Conversions
|
|
66
|
-
|
|
67
|
-
```tsx
|
|
68
|
-
// Before
|
|
69
|
-
className = 'bg-white p-6 rounded-lg shadow border';
|
|
70
|
-
|
|
71
|
-
// After
|
|
72
|
-
className = 'card p-6';
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Color Conversions
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
// Before
|
|
79
|
-
className = 'bg-green-100 text-green-600';
|
|
80
|
-
className = 'bg-red-100 text-red-600';
|
|
81
|
-
className = 'bg-yellow-100 text-yellow-600';
|
|
82
|
-
|
|
83
|
-
// After
|
|
84
|
-
className = 'bg-success-100 text-success-600';
|
|
85
|
-
className = 'bg-error-100 text-error-600';
|
|
86
|
-
className = 'bg-warning-100 text-warning-600';
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## **Automated Migration Patterns**
|
|
90
|
-
|
|
91
|
-
### Search & Replace Patterns
|
|
92
|
-
|
|
93
|
-
1. **Button Patterns**
|
|
94
|
-
|
|
95
|
-
```regex
|
|
96
|
-
Find: bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700
|
|
97
|
-
Replace: btn-primary
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
2. **Green Buttons**
|
|
101
|
-
|
|
102
|
-
```regex
|
|
103
|
-
Find: bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700
|
|
104
|
-
Replace: btn-secondary
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
3. **Typography Patterns**
|
|
108
|
-
|
|
109
|
-
```regex
|
|
110
|
-
Find: text-2xl font-bold text-gray-900
|
|
111
|
-
Replace: text-heading text-2xl
|
|
112
|
-
|
|
113
|
-
Find: text-gray-600
|
|
114
|
-
Replace: text-body
|
|
115
|
-
|
|
116
|
-
Find: text-sm text-gray-500
|
|
117
|
-
Replace: text-caption
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
4. **Card Patterns**
|
|
121
|
-
```regex
|
|
122
|
-
Find: bg-white p-([0-9]+) rounded-lg shadow border
|
|
123
|
-
Replace: card p-$1
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## 📋 **Pending Component Updates**
|
|
127
|
-
|
|
128
|
-
### **High Priority (Core Components)**
|
|
129
|
-
|
|
130
|
-
1. **Publish Control Module**
|
|
131
|
-
- `components/publish-control/PublishControl.tsx`
|
|
132
|
-
- `components/publish-control/components/PublishHeader.tsx`
|
|
133
|
-
- `components/publish-control/components/QuickActionCards.tsx`
|
|
134
|
-
- Expected: Button classes, typography updates
|
|
135
|
-
|
|
136
|
-
2. **Health Status Module**
|
|
137
|
-
- `components/modules/health-status/HealthStatus.tsx`
|
|
138
|
-
- `components/modules/health-status/components/HealthStatusHeader.tsx`
|
|
139
|
-
- `components/modules/health-status/components/OverallHealthScore.tsx`
|
|
140
|
-
- Expected: Status colors, card classes, metrics styling
|
|
141
|
-
|
|
142
|
-
3. **Configuration Module**
|
|
143
|
-
- `components/configuration/Configuration.tsx`
|
|
144
|
-
- `components/configuration/components/ConfigurationModal.tsx`
|
|
145
|
-
- `components/configuration/components/ConfigurationHeader.tsx`
|
|
146
|
-
- Expected: Modal styling, button classes, form inputs
|
|
147
|
-
|
|
148
|
-
### **Medium Priority (Feature Components)**
|
|
149
|
-
|
|
150
|
-
4. **Config Inspector Module**
|
|
151
|
-
- `components/modules/config-inspector/ConfigInspector.tsx`
|
|
152
|
-
- `components/modules/config-inspector/components/ConfigInspectorHeader.tsx`
|
|
153
|
-
- `components/modules/config-inspector/components/ConfigEditor.tsx`
|
|
154
|
-
- Expected: Editor styling, toolbar buttons, syntax highlighting
|
|
155
|
-
|
|
156
|
-
5. **Dependency Graph Module**
|
|
157
|
-
- `components/modules/dependency-graph/DependencyGraph.tsx`
|
|
158
|
-
- `components/modules/dependency-graph/components/DependencyGraphHeader.tsx`
|
|
159
|
-
- `components/modules/dependency-graph/components/GraphToolbar.tsx`
|
|
160
|
-
- Expected: Graph controls, filter buttons, legend styling
|
|
161
|
-
|
|
162
|
-
6. **Setup Guide Module**
|
|
163
|
-
- `components/setup-guide/SetupGuide.tsx`
|
|
164
|
-
- `components/setup-guide/components/SetupModal.tsx`
|
|
165
|
-
- `components/setup-guide/components/StepContent.tsx`
|
|
166
|
-
- Expected: Modal styling, step indicators, progress bars
|
|
167
|
-
|
|
168
|
-
### **Sub-components (Detailed Updates)**
|
|
169
|
-
|
|
170
|
-
7. **Package Detail Components**
|
|
171
|
-
- `components/modules/packages/components/PackageDetailHeader.tsx`
|
|
172
|
-
- `components/modules/packages/components/PackagesTable.tsx`
|
|
173
|
-
- `components/modules/packages/components/SearchAndFilter.tsx`
|
|
174
|
-
- Expected: Table styling, search inputs, filter dropdowns
|
|
175
|
-
|
|
176
|
-
8. **CI Integration Sub-components**
|
|
177
|
-
- `components/modules/ci-integration/components/BuildList.tsx`
|
|
178
|
-
- `components/modules/ci-integration/components/BuildDetails.tsx`
|
|
179
|
-
- `components/modules/ci-integration/components/PipelineStatus.tsx`
|
|
180
|
-
- Expected: List items, modal content, status badges
|
|
181
|
-
|
|
182
|
-
## 🎨 **Theme Integration Examples**
|
|
183
|
-
|
|
184
|
-
### Before/After Component Examples
|
|
185
|
-
|
|
186
|
-
#### Example 1: Button Updates
|
|
187
|
-
|
|
188
|
-
```tsx
|
|
189
|
-
// Before
|
|
190
|
-
<button className="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 flex items-center space-x-2">
|
|
191
|
-
<Icon className="w-5 h-5" />
|
|
192
|
-
<span>Action</span>
|
|
193
|
-
</button>
|
|
194
|
-
|
|
195
|
-
// After
|
|
196
|
-
<button className="btn-primary flex items-center space-x-2">
|
|
197
|
-
<Icon className="w-5 h-5" />
|
|
198
|
-
<span>Action</span>
|
|
199
|
-
</button>
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
#### Example 2: Card Updates
|
|
203
|
-
|
|
204
|
-
```tsx
|
|
205
|
-
// Before
|
|
206
|
-
<div className="bg-white p-6 rounded-lg shadow border">
|
|
207
|
-
<h3 className="text-lg font-medium text-gray-900">Title</h3>
|
|
208
|
-
<p className="text-gray-600">Content</p>
|
|
209
|
-
</div>
|
|
210
|
-
|
|
211
|
-
// After
|
|
212
|
-
<div className="card p-6">
|
|
213
|
-
<h3 className="text-heading text-lg">Title</h3>
|
|
214
|
-
<p className="text-body">Content</p>
|
|
215
|
-
</div>
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
#### Example 3: Status Badge Updates
|
|
219
|
-
|
|
220
|
-
```tsx
|
|
221
|
-
// Before
|
|
222
|
-
<span className="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
|
223
|
-
Success
|
|
224
|
-
</span>
|
|
225
|
-
|
|
226
|
-
// After
|
|
227
|
-
<span className="badge-success">
|
|
228
|
-
Success
|
|
229
|
-
</span>
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## **Component Update Checklist**
|
|
233
|
-
|
|
234
|
-
For each component update, verify:
|
|
235
|
-
|
|
236
|
-
- [ ] **Buttons**: Use `btn-primary`, `btn-secondary`, `btn-outline`, `btn-ghost`
|
|
237
|
-
- [ ] **Typography**: Use `text-heading`, `text-subheading`, `text-body`, `text-caption`
|
|
238
|
-
- [ ] **Cards**: Use `card`, `card-elevated`, `card-interactive`
|
|
239
|
-
- [ ] **Colors**: Use semantic colors (`success`, `warning`, `error`, `info`)
|
|
240
|
-
- [ ] **Status Badges**: Use `badge-success`, `badge-warning`, `badge-error`
|
|
241
|
-
- [ ] **Inputs**: Use `input-base`, `input-error`, `input-success`
|
|
242
|
-
- [ ] **Navigation**: Use `nav-link`, `nav-link-active`, `nav-link-inactive`
|
|
243
|
-
- [ ] **Spacing**: Use consistent spacing scale
|
|
244
|
-
- [ ] **Shadows**: Use `shadow-soft`, `shadow-medium`, `shadow-large`
|
|
245
|
-
|
|
246
|
-
## **Progress Tracking**
|
|
247
|
-
|
|
248
|
-
- **Total Components**: ~50+ components
|
|
249
|
-
- **Updated**: 6 components
|
|
250
|
-
- **Remaining**: ~44 components
|
|
251
|
-
- **Completion**: ~12%
|
|
252
|
-
|
|
253
|
-
## **Next Steps**
|
|
254
|
-
|
|
255
|
-
1. **Publish Control Module** - High impact, user-facing
|
|
256
|
-
2. **Health Status Module** - Critical dashboard functionality
|
|
257
|
-
3. **Configuration Module** - Settings and customization
|
|
258
|
-
4. **Remaining CI Integration Sub-components** - Complete the module
|
|
259
|
-
5. **Package Detail Components** - Core package management
|
|
260
|
-
6. **Other modules in priority order**
|
|
261
|
-
|
|
262
|
-
## 🎯 **Benefits After Full Migration**
|
|
263
|
-
|
|
264
|
-
- **Consistent Design**: All components follow the same design language
|
|
265
|
-
- **Easy Maintenance**: Global theme updates affect all components
|
|
266
|
-
- **Better Performance**: Fewer CSS classes, better caching
|
|
267
|
-
- **Type Safety**: TypeScript ensures correct theme usage
|
|
268
|
-
- **Developer Experience**: Semantic class names, clear patterns
|
|
269
|
-
- **Brand Flexibility**: Easy to create theme variants
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
This migration represents a significant improvement in maintainability and consistency across the entire monodog dashboard application.
|