Move delete button from table to edit modal
- Delete button now appears in the edit modal footer (left side) - Cleaner table layout with just Test and Edit buttons - Delete button only shows when editing existing sources
This commit is contained in:
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Clicking red dot shows error details in a modal (#107)
|
||||
- Source name column no longer wraps text for better table layout (#107)
|
||||
- Renamed "Cache Management" page to "Upstream Sources" (#107)
|
||||
- Moved Delete button from table row to edit modal for cleaner table layout (#107)
|
||||
|
||||
### Removed
|
||||
- Removed `is_public` field from upstream sources - all sources are now treated as internal/private (#107)
|
||||
|
||||
@@ -340,9 +340,14 @@
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.5rem;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 1.5rem;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.form-actions-right {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -324,18 +324,9 @@ function AdminCachePage() {
|
||||
Test
|
||||
</button>
|
||||
{source.source !== 'env' && (
|
||||
<>
|
||||
<button className="btn btn-sm" onClick={() => openEditForm(source)}>
|
||||
Edit
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-sm btn-danger"
|
||||
onClick={() => handleDelete(source)}
|
||||
disabled={deletingId === source.id}
|
||||
>
|
||||
{deletingId === source.id ? 'Deleting...' : 'Delete'}
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -471,6 +462,20 @@ function AdminCachePage() {
|
||||
)}
|
||||
|
||||
<div className="form-actions">
|
||||
{editingSource && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-danger"
|
||||
onClick={() => {
|
||||
handleDelete(editingSource);
|
||||
setShowForm(false);
|
||||
}}
|
||||
disabled={deletingId === editingSource.id}
|
||||
>
|
||||
{deletingId === editingSource.id ? 'Deleting...' : 'Delete'}
|
||||
</button>
|
||||
)}
|
||||
<div className="form-actions-right">
|
||||
<button type="button" className="btn" onClick={() => setShowForm(false)}>
|
||||
Cancel
|
||||
</button>
|
||||
@@ -478,6 +483,7 @@ function AdminCachePage() {
|
||||
{isSaving ? 'Saving...' : editingSource ? 'Update' : 'Create'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user