fix: Fix policy template mapping and update credential labels in QuickStartWizard

- Fix 'Invalid template' error by correctly mapping policy types to template keys
  - 'readwrite' -> 'bucketFullAccess'
  - 'readonly' -> 'bucketReadOnly'
  - 'writeonly' -> 'bucketWriteOnly'
- Update user creation form labels to 'Username (Access Key)' and 'Password (Secret Key)'
- Update review section to show consistent MinIO credential terminology
- Add helpful text explaining these are MinIO credentials

This ensures the QuickStartWizard creates policies correctly and maintains
consistent credential terminology across all UI components.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-23 17:39:15 +02:00
parent a27b405392
commit 79a9977dbc
@@ -135,8 +135,16 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
// Step 3: Create policy // Step 3: Create policy
const policyName = `${setupData.bucketName}-${setupData.policyType}-policy`; const policyName = `${setupData.bucketName}-${setupData.policyType}-policy`;
// Map policy types to template keys
const templateKey = setupData.policyType === 'readwrite'
? 'bucketFullAccess'
: setupData.policyType === 'readonly'
? 'bucketReadOnly'
: 'bucketWriteOnly';
const policyJson = policyService.generatePolicyFromTemplate( const policyJson = policyService.generatePolicyFromTemplate(
`bucket${setupData.policyType.charAt(0).toUpperCase() + setupData.policyType.slice(1).replace('only', 'Only')}`, templateKey,
setupData.bucketName setupData.bucketName
); );
@@ -220,21 +228,22 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
<TextField <TextField
autoFocus autoFocus
margin="normal" margin="normal"
label="Username" label="Username (Access Key)"
fullWidth fullWidth
value={setupData.userName} value={setupData.userName}
onChange={(e) => setSetupData({ ...setupData, userName: e.target.value })} onChange={(e) => setSetupData({ ...setupData, userName: e.target.value })}
error={!!error && activeStep === 1} error={!!error && activeStep === 1}
helperText="This will be the user's Access Key for MinIO"
/> />
<TextField <TextField
margin="normal" margin="normal"
label="Password" label="Password (Secret Key)"
type={showPassword ? 'text' : 'password'} type={showPassword ? 'text' : 'password'}
fullWidth fullWidth
value={setupData.userPassword} value={setupData.userPassword}
onChange={(e) => setSetupData({ ...setupData, userPassword: e.target.value })} onChange={(e) => setSetupData({ ...setupData, userPassword: e.target.value })}
error={!!error && activeStep === 1} error={!!error && activeStep === 1}
helperText={error || "Min 8 chars, uppercase, lowercase, and number required"} helperText={error || "This will be the user's Secret Key - Min 8 chars, uppercase, lowercase, and number"}
InputProps={{ InputProps={{
endAdornment: ( endAdornment: (
<InputAdornment position="end"> <InputAdornment position="end">
@@ -317,7 +326,7 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
<Person color="primary" /> <Person color="primary" />
</ListItemIcon> </ListItemIcon>
<ListItemText <ListItemText
primary="User" primary="User (Access Key)"
secondary={setupData.userName} secondary={setupData.userName}
/> />
</ListItem> </ListItem>
@@ -326,7 +335,7 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
<VpnKey color="primary" /> <VpnKey color="primary" />
</ListItemIcon> </ListItemIcon>
<ListItemText <ListItemText
primary="Password" primary="Password (Secret Key)"
secondary="••••••••••••••••" secondary="••••••••••••••••"
/> />
</ListItem> </ListItem>