fix: add unsaved changes banners to edit mode forms
Adds amber edit-mode banners to AppConfigDetailPage and both DefaultResourcesSection/JarRetentionSection in EnvironmentsPage, matching the existing ConfigSubTab pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -90,3 +90,13 @@
|
||||
color: var(--text-muted);
|
||||
font-family: var(--font-body);
|
||||
}
|
||||
|
||||
.editBanner {
|
||||
padding: 8px 16px;
|
||||
background: color-mix(in srgb, var(--amber) 8%, transparent);
|
||||
border: 1px solid var(--amber);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 13px;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@@ -317,6 +317,12 @@ export default function AppConfigDetailPage() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{editing && (
|
||||
<div className={styles.editBanner}>
|
||||
Editing configuration. Changes are not saved until you click Save.
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={styles.header}>
|
||||
<h2 className={styles.title}><MonoText size="md">{appId}</MonoText></h2>
|
||||
<div className={styles.meta}>
|
||||
|
||||
@@ -392,6 +392,11 @@ function DefaultResourcesSection({ environment, onSave, saving }: {
|
||||
return (
|
||||
<div className={sectionStyles.section}>
|
||||
<SectionHeader>Default Resource Limits</SectionHeader>
|
||||
{editing && (
|
||||
<div className={styles.editBanner}>
|
||||
Editing resource defaults. Changes are not saved until you click Save.
|
||||
</div>
|
||||
)}
|
||||
<p className={styles.inheritedNote}>
|
||||
These defaults apply to new apps in this environment unless overridden per-app.
|
||||
</p>
|
||||
@@ -485,6 +490,11 @@ function JarRetentionSection({ environment, onSave, saving }: {
|
||||
return (
|
||||
<div className={sectionStyles.section}>
|
||||
<SectionHeader>JAR Retention</SectionHeader>
|
||||
{editing && (
|
||||
<div className={styles.editBanner}>
|
||||
Editing resource defaults. Changes are not saved until you click Save.
|
||||
</div>
|
||||
)}
|
||||
<p className={styles.inheritedNote}>
|
||||
Old JAR versions are cleaned up nightly. Currently deployed versions are never deleted.
|
||||
</p>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Eye, EyeOff } from 'lucide-react';
|
||||
import {
|
||||
Button, Input, Toggle, FormField, SectionHeader, Tag, ConfirmDialog,
|
||||
} from '@cameleer/design-system';
|
||||
@@ -41,6 +42,7 @@ export default function OidcConfigPage() {
|
||||
const [editing, setEditing] = useState(false);
|
||||
const [formDraft, setFormDraft] = useState<OidcFormData | null>(null);
|
||||
const [newRole, setNewRole] = useState('');
|
||||
const [showSecret, setShowSecret] = useState(false);
|
||||
const [deleteOpen, setDeleteOpen] = useState(false);
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [testing, setTesting] = useState(false);
|
||||
@@ -200,13 +202,25 @@ export default function OidcConfigPage() {
|
||||
/>
|
||||
</FormField>
|
||||
<FormField label="Client Secret" htmlFor="client-secret">
|
||||
<Input
|
||||
id="client-secret"
|
||||
type="password"
|
||||
value={current?.clientSecret ?? ''}
|
||||
onChange={(e) => updateDraft('clientSecret', e.target.value)}
|
||||
disabled={!editing}
|
||||
/>
|
||||
<div style={{ position: 'relative' }}>
|
||||
<Input
|
||||
id="client-secret"
|
||||
type={showSecret ? 'text' : 'password'}
|
||||
value={current?.clientSecret ?? ''}
|
||||
onChange={(e) => updateDraft('clientSecret', e.target.value)}
|
||||
disabled={!editing}
|
||||
/>
|
||||
{editing && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
style={{ position: 'absolute', right: 4, top: '50%', transform: 'translateY(-50%)' }}
|
||||
onClick={() => setShowSecret(!showSecret)}
|
||||
>
|
||||
{showSecret ? <EyeOff size={14} /> : <Eye size={14} />}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</FormField>
|
||||
<FormField label="Audience / API Resource" htmlFor="audience" hint="RFC 8707 resource indicator sent in the authorization request">
|
||||
<Input
|
||||
|
||||
@@ -161,3 +161,13 @@
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.editBanner {
|
||||
padding: 8px 16px;
|
||||
background: color-mix(in srgb, var(--amber) 8%, transparent);
|
||||
border: 1px solid var(--amber);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 13px;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user