@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,342 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Release Manager Component
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive UI-driven version control and package publishing for monorepos using Changesets.
|
|
5
|
-
* Allows users to:
|
|
6
|
-
* - Select packages and version bumps
|
|
7
|
-
* - Generate changesets
|
|
8
|
-
* - Preview releases
|
|
9
|
-
* - Trigger publishing pipeline
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import React, { useState, useEffect } from 'react';
|
|
13
|
-
import { useAuth } from '../../services/auth-context';
|
|
14
|
-
import apiClient from '../../services/api';
|
|
15
|
-
import PackageSelector from './components/PackageSelector';
|
|
16
|
-
import VersionBumpSelector from './components/VersionBumpSelector';
|
|
17
|
-
import ChangesetPreview from './components/ChangesetPreview';
|
|
18
|
-
import ReleaseValidation from './components/ReleaseValidation';
|
|
19
|
-
import PublishConfirmation from './components/PublishConfirmation';
|
|
20
|
-
import LoadingState from './components/LoadingState';
|
|
21
|
-
import ErrorState from './components/ErrorState';
|
|
22
|
-
import { DASHBOARD_ERROR_MESSAGES } from '../../constants/messages';
|
|
23
|
-
import { DASHBOARD_API_ENDPOINTS } from '../../constants/api-config';
|
|
24
|
-
import type { SelectedPackage, ChangesetData, ValidationResult } from './types';
|
|
25
|
-
|
|
26
|
-
// Re-export types for backward compatibility
|
|
27
|
-
export type { SelectedPackage, ChangesetData, ValidationResult };
|
|
28
|
-
|
|
29
|
-
export default function ReleaseManager() {
|
|
30
|
-
const { isAuthenticated, hasPermission } = useAuth();
|
|
31
|
-
const [currentStep, setCurrentStep] = useState<'select' | 'bump' | 'preview' | 'validate' | 'confirm'>('select');
|
|
32
|
-
const [selectedPackages, setSelectedPackages] = useState<SelectedPackage[]>([]);
|
|
33
|
-
const [changesetSummary, setChangesetSummary] = useState('');
|
|
34
|
-
const [loading, setLoading] = useState(false);
|
|
35
|
-
const [error, setError] = useState<string | null>(null);
|
|
36
|
-
const [validationResult, setValidationResult] = useState<ValidationResult | null>(null);
|
|
37
|
-
const [allPackages, setAllPackages] = useState<Array<{ name: string; version: string; dependents?: string[] }>>([]);
|
|
38
|
-
const [existingChangesets, setExistingChangesets] = useState<Array<{ id: string; summary: string }>>([]);
|
|
39
|
-
|
|
40
|
-
// Fetch workspace packages on mount
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
fetchWorkspaceData();
|
|
43
|
-
}, []);
|
|
44
|
-
|
|
45
|
-
const fetchWorkspaceData = async () => {
|
|
46
|
-
try {
|
|
47
|
-
setLoading(true);
|
|
48
|
-
|
|
49
|
-
// Fetch packages
|
|
50
|
-
const packagesRes = await apiClient.get(DASHBOARD_API_ENDPOINTS.PUBLISH.PACKAGES);
|
|
51
|
-
if (packagesRes.success) {
|
|
52
|
-
setAllPackages(packagesRes.data.packages || []);
|
|
53
|
-
} else {
|
|
54
|
-
console.warn('Failed to fetch packages:', packagesRes.error?.message);
|
|
55
|
-
// Fallback to regular packages endpoint
|
|
56
|
-
const fallbackRes = await apiClient.get(DASHBOARD_API_ENDPOINTS.PACKAGES.LIST);
|
|
57
|
-
if (fallbackRes.success) {
|
|
58
|
-
setAllPackages(fallbackRes.data || []);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Fetch existing changesets
|
|
63
|
-
const changesetsRes = await apiClient.get(DASHBOARD_API_ENDPOINTS.PUBLISH.CHANGESETS);
|
|
64
|
-
if (changesetsRes.success) {
|
|
65
|
-
setExistingChangesets(changesetsRes.data.changesets || []);
|
|
66
|
-
} else {
|
|
67
|
-
if (changesetsRes.error?.status === 401 || changesetsRes.error?.status === 403) {
|
|
68
|
-
window.location.href = '/login';
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
setError(null);
|
|
73
|
-
} catch (err) {
|
|
74
|
-
const message = err instanceof Error ? err.message : DASHBOARD_ERROR_MESSAGES.FAILED_TO_FETCH_PACKAGES;
|
|
75
|
-
setError(message);
|
|
76
|
-
console.error('Error fetching workspace data:', err);
|
|
77
|
-
} finally {
|
|
78
|
-
setLoading(false);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const handlePackagesSelected = (packages: Array<{ name: string; version: string; dependents?: string[] }>) => {
|
|
83
|
-
const selected: SelectedPackage[] = packages.map(pkg => ({
|
|
84
|
-
name: pkg.name,
|
|
85
|
-
currentVersion: pkg.version,
|
|
86
|
-
newVersion: pkg.version, // Will be updated in bump step
|
|
87
|
-
bumpType: 'patch',
|
|
88
|
-
affectedDependencies: pkg.dependents || [],
|
|
89
|
-
}));
|
|
90
|
-
setSelectedPackages(selected);
|
|
91
|
-
setCurrentStep('bump');
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const handleVersionBumpsConfirmed = (updatedPackages: SelectedPackage[]) => {
|
|
95
|
-
setSelectedPackages(updatedPackages);
|
|
96
|
-
setCurrentStep('preview');
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const handlePreviewConfirmed = (summary: string) => {
|
|
100
|
-
setChangesetSummary(summary);
|
|
101
|
-
validateRelease(selectedPackages, summary);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const validateRelease = async (packages: SelectedPackage[], summary: string) => {
|
|
105
|
-
try {
|
|
106
|
-
setLoading(true);
|
|
107
|
-
|
|
108
|
-
const response = await apiClient.post(DASHBOARD_API_ENDPOINTS.PUBLISH.PREVIEW, {
|
|
109
|
-
packages: packages.map(p => p.name),
|
|
110
|
-
bumps: packages.map(p => ({
|
|
111
|
-
package: p.name,
|
|
112
|
-
bumpType: p.bumpType,
|
|
113
|
-
})),
|
|
114
|
-
summary,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
if (!response.success) {
|
|
118
|
-
throw new Error(DASHBOARD_ERROR_MESSAGES.VALIDATION_FAILED);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const result = response.data;
|
|
122
|
-
|
|
123
|
-
// Ensure the result has the expected structure
|
|
124
|
-
const validationData: ValidationResult = {
|
|
125
|
-
isValid: result.isValid ?? true,
|
|
126
|
-
errors: result.errors ?? [],
|
|
127
|
-
warnings: result.warnings ?? [],
|
|
128
|
-
checks: result.checks ?? {
|
|
129
|
-
permissions: true,
|
|
130
|
-
workingTreeClean: true,
|
|
131
|
-
ciPassing: true,
|
|
132
|
-
versionAvailable: true,
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
setValidationResult(validationData);
|
|
137
|
-
setCurrentStep('validate');
|
|
138
|
-
setError(null);
|
|
139
|
-
} catch (err) {
|
|
140
|
-
const message = err instanceof Error ? err.message : 'Validation error';
|
|
141
|
-
setError(message);
|
|
142
|
-
console.error('Validation error:', err);
|
|
143
|
-
} finally {
|
|
144
|
-
setLoading(false);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const handlePublishConfirmed = async () => {
|
|
149
|
-
try {
|
|
150
|
-
// Check permission before publishing
|
|
151
|
-
if (!hasPermission('maintain')) {
|
|
152
|
-
setError(DASHBOARD_ERROR_MESSAGES.PERMISSION_ERROR);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
setLoading(true);
|
|
157
|
-
|
|
158
|
-
// Create changeset
|
|
159
|
-
const changesetRes = await apiClient.post(DASHBOARD_API_ENDPOINTS.PUBLISH.CHANGESETS, {
|
|
160
|
-
packages: selectedPackages.map(p => p.name),
|
|
161
|
-
bumps: selectedPackages.map(p => ({
|
|
162
|
-
package: p.name,
|
|
163
|
-
bumpType: p.bumpType,
|
|
164
|
-
})),
|
|
165
|
-
summary: changesetSummary,
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
if (!changesetRes.success) {
|
|
169
|
-
throw new Error(DASHBOARD_ERROR_MESSAGES.FAILED_TO_CREATE_CHANGESET);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Trigger publish
|
|
173
|
-
const publishRes = await apiClient.post(DASHBOARD_API_ENDPOINTS.PUBLISH.TRIGGER, {
|
|
174
|
-
packages: selectedPackages,
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
if (!publishRes.success) {
|
|
178
|
-
throw new Error(DASHBOARD_ERROR_MESSAGES.FAILED_TO_TRIGGER_PUBLISH);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
setCurrentStep('confirm');
|
|
182
|
-
setError(null);
|
|
183
|
-
} catch (err) {
|
|
184
|
-
const message = err instanceof Error ? err.message : 'Publishing error';
|
|
185
|
-
setError(message);
|
|
186
|
-
} finally {
|
|
187
|
-
setLoading(false);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const handleReset = () => {
|
|
192
|
-
setCurrentStep('select');
|
|
193
|
-
setSelectedPackages([]);
|
|
194
|
-
setChangesetSummary('');
|
|
195
|
-
setValidationResult(null);
|
|
196
|
-
setError(null);
|
|
197
|
-
fetchWorkspaceData();
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
if (!isAuthenticated) {
|
|
201
|
-
return (
|
|
202
|
-
<div className="p-6 bg-yellow-50 border border-yellow-200 rounded-lg">
|
|
203
|
-
<p className="text-yellow-800">Please log in to access release management.</p>
|
|
204
|
-
</div>
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (loading && currentStep === 'select' && allPackages.length === 0) {
|
|
209
|
-
return <LoadingState message="Loading workspace packages..." />;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (error && currentStep === 'select') {
|
|
213
|
-
return <ErrorState error={error} onRetry={fetchWorkspaceData} />;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Check if user has required permissions
|
|
217
|
-
const canCreateChangeset = hasPermission('write');
|
|
218
|
-
const canPublish = hasPermission('maintain');
|
|
219
|
-
|
|
220
|
-
return (
|
|
221
|
-
<div className="space-y-6">
|
|
222
|
-
{/* Header */}
|
|
223
|
-
<div className="flex items-center justify-between">
|
|
224
|
-
<div>
|
|
225
|
-
<h1 className="text-3xl font-bold text-gray-900">Release Manager</h1>
|
|
226
|
-
<p className="text-gray-600 mt-1">
|
|
227
|
-
Manage package versions and publish releases with Changesets
|
|
228
|
-
</p>
|
|
229
|
-
</div>
|
|
230
|
-
<div className="text-sm text-gray-500">
|
|
231
|
-
Step {['select', 'bump', 'preview', 'validate', 'confirm'].indexOf(currentStep) + 1} of 5
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
|
|
235
|
-
{/* Permission Check */}
|
|
236
|
-
{!canCreateChangeset && (
|
|
237
|
-
<div className="p-4 bg-yellow-50 border border-yellow-200 rounded-lg">
|
|
238
|
-
<p className="text-yellow-700 font-medium"> Limited Access</p>
|
|
239
|
-
<p className="text-yellow-600 text-sm mt-1">
|
|
240
|
-
You do not have write permission to create and publish changesets. Contact your repository administrator to request access.
|
|
241
|
-
</p>
|
|
242
|
-
</div>
|
|
243
|
-
)}
|
|
244
|
-
|
|
245
|
-
{/* Error Alert */}
|
|
246
|
-
{error && (
|
|
247
|
-
<div className="p-4 bg-red-50 border border-red-200 rounded-lg">
|
|
248
|
-
<p className="text-red-700 font-medium">Error</p>
|
|
249
|
-
<p className="text-red-600 text-sm mt-1">{error}</p>
|
|
250
|
-
</div>
|
|
251
|
-
)}
|
|
252
|
-
|
|
253
|
-
{/* Existing Changesets Warning */}
|
|
254
|
-
{existingChangesets.length > 0 && currentStep === 'select' && (
|
|
255
|
-
<div className="p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
|
256
|
-
<p className="text-blue-700 font-medium">
|
|
257
|
-
{existingChangesets.length} unpublished changeset(s) detected
|
|
258
|
-
</p>
|
|
259
|
-
<p className="text-blue-600 text-sm mt-1">
|
|
260
|
-
Review existing changesets or pull the latest changes and refresh the dashboard before creating a new one.
|
|
261
|
-
</p>
|
|
262
|
-
</div>
|
|
263
|
-
)}
|
|
264
|
-
|
|
265
|
-
{/* Step Content */}
|
|
266
|
-
{currentStep === 'select' && !canCreateChangeset && (
|
|
267
|
-
<div className="p-4 bg-red-50 border border-red-200 rounded-lg">
|
|
268
|
-
<p className="text-red-700 font-medium">Access Denied</p>
|
|
269
|
-
<p className="text-red-600 text-sm mt-1">
|
|
270
|
-
You do not have write permission to create changesets. Contact your repository administrator.
|
|
271
|
-
</p>
|
|
272
|
-
</div>
|
|
273
|
-
)}
|
|
274
|
-
|
|
275
|
-
{currentStep === 'select' && canCreateChangeset && (
|
|
276
|
-
<PackageSelector
|
|
277
|
-
packages={allPackages}
|
|
278
|
-
onConfirm={handlePackagesSelected}
|
|
279
|
-
loading={loading}
|
|
280
|
-
/>
|
|
281
|
-
)}
|
|
282
|
-
|
|
283
|
-
{currentStep === 'bump' && canCreateChangeset && (
|
|
284
|
-
<VersionBumpSelector
|
|
285
|
-
packages={selectedPackages}
|
|
286
|
-
onConfirm={handleVersionBumpsConfirmed}
|
|
287
|
-
onBack={() => setCurrentStep('select')}
|
|
288
|
-
/>
|
|
289
|
-
)}
|
|
290
|
-
|
|
291
|
-
{currentStep === 'preview' && canCreateChangeset && (
|
|
292
|
-
<ChangesetPreview
|
|
293
|
-
packages={selectedPackages}
|
|
294
|
-
existingChangesets={existingChangesets}
|
|
295
|
-
onConfirm={handlePreviewConfirmed}
|
|
296
|
-
onBack={() => setCurrentStep('bump')}
|
|
297
|
-
loading={loading}
|
|
298
|
-
/>
|
|
299
|
-
)}
|
|
300
|
-
|
|
301
|
-
{currentStep === 'validate' && !canPublish && (
|
|
302
|
-
<div className="p-4 bg-red-50 border border-red-200 rounded-lg">
|
|
303
|
-
<p className="text-red-700 font-medium">Access Denied</p>
|
|
304
|
-
<p className="text-red-600 text-sm mt-1">
|
|
305
|
-
You do not have maintain permission to publish changesets. Contact your repository administrator.
|
|
306
|
-
</p>
|
|
307
|
-
</div>
|
|
308
|
-
)}
|
|
309
|
-
{currentStep === 'validate' && canPublish && validationResult && (
|
|
310
|
-
<ReleaseValidation
|
|
311
|
-
validation={validationResult}
|
|
312
|
-
packages={selectedPackages}
|
|
313
|
-
onConfirm={handlePublishConfirmed}
|
|
314
|
-
onBack={() => setCurrentStep('preview')}
|
|
315
|
-
loading={loading}
|
|
316
|
-
/>
|
|
317
|
-
)}
|
|
318
|
-
|
|
319
|
-
{currentStep === 'confirm' && (
|
|
320
|
-
<PublishConfirmation
|
|
321
|
-
packages={selectedPackages}
|
|
322
|
-
summary={changesetSummary}
|
|
323
|
-
onReset={handleReset}
|
|
324
|
-
/>
|
|
325
|
-
)}
|
|
326
|
-
|
|
327
|
-
{/* Progress Indicator */}
|
|
328
|
-
<div className="flex gap-2 justify-center">
|
|
329
|
-
{['select', 'bump', 'preview', 'validate', 'confirm'].map((step, index) => (
|
|
330
|
-
<div
|
|
331
|
-
key={step}
|
|
332
|
-
className={`h-2 flex-1 rounded-full transition-colors ${
|
|
333
|
-
['select', 'bump', 'preview', 'validate', 'confirm'].indexOf(currentStep) >= index
|
|
334
|
-
? 'bg-primary-500'
|
|
335
|
-
: 'bg-gray-300'
|
|
336
|
-
}`}
|
|
337
|
-
/>
|
|
338
|
-
))}
|
|
339
|
-
</div>
|
|
340
|
-
</div>
|
|
341
|
-
);
|
|
342
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Changeset Preview Component
|
|
3
|
-
* Allows users to review and create changesets
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useState } from 'react';
|
|
7
|
-
import { ArrowLongRightIcon } from '../../../icons';
|
|
8
|
-
import { CHANGESET_SUMMARY, SUMMARY_LIMIT } from '../../../constants/messages'
|
|
9
|
-
import type { ChangesetPreviewProps } from '../../../types';
|
|
10
|
-
|
|
11
|
-
export default function ChangesetPreview({
|
|
12
|
-
packages,
|
|
13
|
-
existingChangesets,
|
|
14
|
-
onConfirm,
|
|
15
|
-
onBack,
|
|
16
|
-
loading,
|
|
17
|
-
}: ChangesetPreviewProps) {
|
|
18
|
-
const [summary, setSummary] = useState('');
|
|
19
|
-
const [errors, setErrors] = useState<string[]>([]);
|
|
20
|
-
|
|
21
|
-
const validateSummary = () => {
|
|
22
|
-
const newErrors: string[] = [];
|
|
23
|
-
if (!summary.trim()) {
|
|
24
|
-
newErrors.push('Please enter a changelog summary');
|
|
25
|
-
}
|
|
26
|
-
if (summary.trim().length < 10) {
|
|
27
|
-
newErrors.push(SUMMARY_LIMIT);
|
|
28
|
-
}
|
|
29
|
-
setErrors(newErrors);
|
|
30
|
-
return newErrors.length === 0;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const handleConfirm = () => {
|
|
34
|
-
if (validateSummary()) {
|
|
35
|
-
onConfirm(summary);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div className="bg-white rounded-lg shadow p-6 space-y-6">
|
|
41
|
-
<div>
|
|
42
|
-
<h2 className="text-2xl font-bold text-gray-900 mb-2">Step 3: Preview Changeset</h2>
|
|
43
|
-
<p className="text-gray-600">
|
|
44
|
-
Review the changeset that will be created. Enter a summary of the changes.
|
|
45
|
-
</p>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
{/* Changeset Summary */}
|
|
49
|
-
<div>
|
|
50
|
-
<label className="block text-sm font-medium text-gray-700 mb-2">
|
|
51
|
-
Changelog Summary
|
|
52
|
-
</label>
|
|
53
|
-
<textarea
|
|
54
|
-
value={summary}
|
|
55
|
-
onChange={e => {setSummary(e.target.value); validateSummary();}}
|
|
56
|
-
placeholder={CHANGESET_SUMMARY}
|
|
57
|
-
rows={4}
|
|
58
|
-
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent font-mono text-sm"
|
|
59
|
-
/>
|
|
60
|
-
{errors.length > 0 && (
|
|
61
|
-
<div className="mt-2 space-y-1">
|
|
62
|
-
{errors.map((error, idx) => (
|
|
63
|
-
<p key={idx} className="text-sm text-red-600">
|
|
64
|
-
{error}
|
|
65
|
-
</p>
|
|
66
|
-
))}
|
|
67
|
-
</div>
|
|
68
|
-
)}
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
{/* Packages Overview */}
|
|
72
|
-
<div className="border-t pt-6">
|
|
73
|
-
<h3 className="text-lg font-bold text-gray-900 mb-4">Packages to Release</h3>
|
|
74
|
-
<div className="space-y-3">
|
|
75
|
-
{packages.map(pkg => (
|
|
76
|
-
<div key={pkg.name} className="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
|
|
77
|
-
<div>
|
|
78
|
-
<p className="font-medium text-gray-900">{pkg.name}</p>
|
|
79
|
-
<p className="flex items-center gap-2 text-sm text-gray-500">
|
|
80
|
-
{pkg.currentVersion} <ArrowLongRightIcon></ArrowLongRightIcon> {pkg.newVersion}
|
|
81
|
-
</p>
|
|
82
|
-
</div>
|
|
83
|
-
<div className="text-right">
|
|
84
|
-
<span className="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-primary-100 text-primary-800">
|
|
85
|
-
{pkg.bumpType.charAt(0).toUpperCase() + pkg.bumpType.slice(1)}
|
|
86
|
-
</span>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
))}
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
{/* Conflict Warning */}
|
|
94
|
-
{existingChangesets.length > 0 && (
|
|
95
|
-
<div className="p-4 bg-yellow-50 border border-yellow-200 rounded-lg">
|
|
96
|
-
<p className="text-yellow-800 font-medium">Unpublished Changesets</p>
|
|
97
|
-
<p className="text-yellow-700 text-sm mt-1">
|
|
98
|
-
There are {existingChangesets.length} existing unpublished changeset(s).
|
|
99
|
-
Creating new ones will accumulate until published.
|
|
100
|
-
</p>
|
|
101
|
-
</div>
|
|
102
|
-
)}
|
|
103
|
-
|
|
104
|
-
{/* Actions */}
|
|
105
|
-
<div className="flex gap-3 justify-end">
|
|
106
|
-
<button
|
|
107
|
-
onClick={onBack}
|
|
108
|
-
className="px-6 py-2 border border-gray-300 text-gray-700 rounded-lg font-medium hover:bg-gray-50 transition"
|
|
109
|
-
disabled={loading}
|
|
110
|
-
>
|
|
111
|
-
Back
|
|
112
|
-
</button>
|
|
113
|
-
<button
|
|
114
|
-
onClick={handleConfirm}
|
|
115
|
-
disabled={loading || errors.length > 0}
|
|
116
|
-
className="px-6 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition"
|
|
117
|
-
>
|
|
118
|
-
{loading ? 'Processing...' : 'Continue to Validation'}
|
|
119
|
-
</button>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error State Component
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
interface ErrorStateProps {
|
|
8
|
-
error: string;
|
|
9
|
-
onRetry: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function ErrorState({ error, onRetry }: ErrorStateProps) {
|
|
13
|
-
return (
|
|
14
|
-
<div className="bg-red-50 border border-red-200 rounded-lg p-6">
|
|
15
|
-
<div className="flex items-start">
|
|
16
|
-
<div className="flex-shrink-0">
|
|
17
|
-
<svg className="w-6 h-6 text-red-600" fill="currentColor" viewBox="0 0 20 20">
|
|
18
|
-
<path
|
|
19
|
-
fillRule="evenodd"
|
|
20
|
-
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"
|
|
21
|
-
clipRule="evenodd"
|
|
22
|
-
/>
|
|
23
|
-
</svg>
|
|
24
|
-
</div>
|
|
25
|
-
<div className="ml-3 flex-1">
|
|
26
|
-
<h3 className="text-lg font-medium text-red-800">Error</h3>
|
|
27
|
-
<p className="mt-2 text-sm text-red-700">{error}</p>
|
|
28
|
-
<button
|
|
29
|
-
onClick={onRetry}
|
|
30
|
-
className="mt-4 px-4 py-2 bg-red-600 text-white rounded-lg font-medium hover:bg-red-700 transition"
|
|
31
|
-
>
|
|
32
|
-
Try Again
|
|
33
|
-
</button>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Loading State Component
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
interface LoadingStateProps {
|
|
8
|
-
message?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default function LoadingState({ message = 'Loading...' }: LoadingStateProps) {
|
|
12
|
-
return (
|
|
13
|
-
<div className="flex flex-col items-center justify-center py-12">
|
|
14
|
-
<div className="w-12 h-12 rounded-full border-4 border-gray-200 border-t-primary-500 animate-spin mb-4"></div>
|
|
15
|
-
<p className="text-gray-600">{message}</p>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package Selector Component
|
|
3
|
-
* Allows users to select packages for release
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useState, useMemo } from 'react';
|
|
7
|
-
import type { PackageSelectorProps } from '../../../types';
|
|
8
|
-
|
|
9
|
-
interface Package {
|
|
10
|
-
name: string;
|
|
11
|
-
version: string;
|
|
12
|
-
private?: boolean;
|
|
13
|
-
dependencies?: string[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default function PackageSelector({ packages, onConfirm, loading }: PackageSelectorProps) {
|
|
17
|
-
const [selectedNames, setSelectedNames] = useState<Set<string>>(new Set());
|
|
18
|
-
const [searchTerm, setSearchTerm] = useState('');
|
|
19
|
-
|
|
20
|
-
const filteredPackages = useMemo(
|
|
21
|
-
() =>
|
|
22
|
-
packages.filter(
|
|
23
|
-
pkg =>
|
|
24
|
-
!pkg.private &&
|
|
25
|
-
pkg.name.toLowerCase().includes(searchTerm.toLowerCase())
|
|
26
|
-
),
|
|
27
|
-
[packages, searchTerm]
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const togglePackage = (name: string) => {
|
|
31
|
-
const newSelected = new Set(selectedNames);
|
|
32
|
-
if (newSelected.has(name)) {
|
|
33
|
-
newSelected.delete(name);
|
|
34
|
-
} else {
|
|
35
|
-
newSelected.add(name);
|
|
36
|
-
}
|
|
37
|
-
setSelectedNames(newSelected);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const toggleAll = () => {
|
|
41
|
-
if (selectedNames.size === filteredPackages.length) {
|
|
42
|
-
setSelectedNames(new Set());
|
|
43
|
-
} else {
|
|
44
|
-
setSelectedNames(new Set(filteredPackages.map(p => p.name)));
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const handleConfirm = () => {
|
|
49
|
-
const selected = packages.filter(p => selectedNames.has(p.name));
|
|
50
|
-
onConfirm(selected);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div className="bg-white rounded-lg shadow p-6 space-y-6">
|
|
55
|
-
<div>
|
|
56
|
-
<h2 className="text-2xl font-bold text-gray-900 mb-2">Step 1: Select Packages</h2>
|
|
57
|
-
<p className="text-gray-600">
|
|
58
|
-
Choose which packages you want to release. You can select multiple packages.
|
|
59
|
-
</p>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
{/* Search */}
|
|
63
|
-
<div>
|
|
64
|
-
<label className="block text-sm font-medium text-gray-700 mb-2">Search Packages</label>
|
|
65
|
-
<input
|
|
66
|
-
type="text"
|
|
67
|
-
value={searchTerm}
|
|
68
|
-
onChange={e => setSearchTerm(e.target.value)}
|
|
69
|
-
placeholder="Search by package name..."
|
|
70
|
-
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
{/* Package List */}
|
|
75
|
-
<div>
|
|
76
|
-
<div className="flex items-center justify-between mb-4">
|
|
77
|
-
<label className="text-sm font-medium text-gray-700">
|
|
78
|
-
Available Packages ({filteredPackages.length})
|
|
79
|
-
</label>
|
|
80
|
-
{filteredPackages.length > 0 && (
|
|
81
|
-
<button
|
|
82
|
-
onClick={toggleAll}
|
|
83
|
-
className="text-sm text-primary-600 hover:text-primary-700 font-medium"
|
|
84
|
-
>
|
|
85
|
-
{selectedNames.size === filteredPackages.length ? 'Deselect All' : 'Select All'}
|
|
86
|
-
</button>
|
|
87
|
-
)}
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<div className="border border-gray-200 rounded-lg divide-y max-h-96 overflow-y-auto">
|
|
91
|
-
{filteredPackages.length === 0 ? (
|
|
92
|
-
<div className="p-4 text-center text-gray-500">
|
|
93
|
-
No packages found
|
|
94
|
-
</div>
|
|
95
|
-
) : (
|
|
96
|
-
filteredPackages.map(pkg => (
|
|
97
|
-
<div
|
|
98
|
-
key={pkg.name}
|
|
99
|
-
className="p-4 hover:bg-gray-50 cursor-pointer transition"
|
|
100
|
-
onClick={() => togglePackage(pkg.name)}
|
|
101
|
-
>
|
|
102
|
-
<div className="flex items-center space-x-3">
|
|
103
|
-
<input
|
|
104
|
-
type="checkbox"
|
|
105
|
-
checked={selectedNames.has(pkg.name)}
|
|
106
|
-
onChange={() => togglePackage(pkg.name)}
|
|
107
|
-
className="w-4 h-4 text-primary-600 rounded focus:ring-2 focus:ring-primary-500"
|
|
108
|
-
/>
|
|
109
|
-
<div className="flex-1">
|
|
110
|
-
<p className="font-medium text-gray-900">{pkg.name}</p>
|
|
111
|
-
<p className="text-sm text-gray-500">Current: v{pkg.version}</p>
|
|
112
|
-
</div>
|
|
113
|
-
{pkg.dependencies && pkg.dependencies.length > 0 && (
|
|
114
|
-
<span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
|
115
|
-
{pkg.dependencies.length} deps
|
|
116
|
-
</span>
|
|
117
|
-
)}
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
))
|
|
121
|
-
)}
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
|
|
125
|
-
{/* Actions */}
|
|
126
|
-
<div className="flex gap-3 justify-end">
|
|
127
|
-
<button
|
|
128
|
-
onClick={handleConfirm}
|
|
129
|
-
disabled={selectedNames.size === 0 || loading}
|
|
130
|
-
className="px-6 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition"
|
|
131
|
-
>
|
|
132
|
-
Continue ({selectedNames.size} selected)
|
|
133
|
-
</button>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
}
|