fix(config-profiles): synchronize shared mount working copies
Use canonical profile files and writable Git working copies so editor and container changes share one source. Require confirmation before destructive Git refreshes and overlay profile files without composite snapshots.
This commit is contained in:
@@ -15,6 +15,7 @@ interface Props {
|
||||
previewData: ResolvedProfile | null;
|
||||
previewingId: string | null;
|
||||
isRefreshingGitMounts: boolean;
|
||||
isReloadingWorkingCopy: boolean;
|
||||
projects: ProjectWithRepos[];
|
||||
toolTypes: ToolType[];
|
||||
availableProfiles: ConfigProfile[];
|
||||
@@ -24,6 +25,7 @@ interface Props {
|
||||
onSubmit: (e?: React.FormEvent) => void;
|
||||
onReset: () => void;
|
||||
onPreview: () => void;
|
||||
onReloadWorkingCopy: () => void;
|
||||
onRefreshGitMounts: () => void;
|
||||
onAddInclude: (id: string) => void;
|
||||
onRemoveInclude: (index: number) => void;
|
||||
@@ -57,6 +59,7 @@ export const ConfigProfileEditorPanel = ({
|
||||
previewData,
|
||||
previewingId,
|
||||
isRefreshingGitMounts,
|
||||
isReloadingWorkingCopy,
|
||||
projects,
|
||||
toolTypes,
|
||||
availableProfiles,
|
||||
@@ -66,6 +69,7 @@ export const ConfigProfileEditorPanel = ({
|
||||
onSubmit,
|
||||
onReset,
|
||||
onPreview,
|
||||
onReloadWorkingCopy,
|
||||
onRefreshGitMounts,
|
||||
onAddInclude,
|
||||
onRemoveInclude,
|
||||
@@ -118,6 +122,9 @@ export const ConfigProfileEditorPanel = ({
|
||||
</div>
|
||||
{!isCreating && selectedProfile && (
|
||||
<div className="row row-sm">
|
||||
<button className="btn btn-secondary" onClick={onReloadWorkingCopy} disabled={isReloadingWorkingCopy}>
|
||||
{isReloadingWorkingCopy ? <><Icon name="loading" size="sm" /> Reloading...</> : <><Icon name="refresh" size="sm" /> Reload working copy</>}
|
||||
</button>
|
||||
<button className="btn btn-secondary" onClick={onRefreshGitMounts} disabled={isRefreshingGitMounts}>
|
||||
{isRefreshingGitMounts ? (
|
||||
<>
|
||||
|
||||
@@ -29,6 +29,7 @@ interface Props {
|
||||
previewData: ResolvedProfile | null;
|
||||
previewingId: string | null;
|
||||
isRefreshingGitMounts: boolean;
|
||||
isReloadingWorkingCopy: boolean;
|
||||
saveStatus: "idle" | "saving" | "saved" | "error";
|
||||
error: string | null;
|
||||
onViewChange: (view: MobileView) => void;
|
||||
@@ -65,6 +66,7 @@ interface Props {
|
||||
) => void;
|
||||
onRemoveMountFile: (mountIndex: number, path: string) => void;
|
||||
onPreview: (id: string) => void;
|
||||
onReloadWorkingCopy: () => void;
|
||||
onRefreshGitMounts: (id: string) => void;
|
||||
onClosePreview: () => void;
|
||||
}
|
||||
@@ -82,6 +84,7 @@ export const ConfigProfilesMobileView = ({
|
||||
previewData,
|
||||
previewingId,
|
||||
isRefreshingGitMounts,
|
||||
isReloadingWorkingCopy,
|
||||
saveStatus,
|
||||
error,
|
||||
onViewChange,
|
||||
@@ -107,6 +110,7 @@ export const ConfigProfilesMobileView = ({
|
||||
onUpdateMountFile,
|
||||
onRemoveMountFile,
|
||||
onPreview,
|
||||
onReloadWorkingCopy,
|
||||
onRefreshGitMounts,
|
||||
onClosePreview,
|
||||
}: Props) => {
|
||||
@@ -367,6 +371,9 @@ export const ConfigProfilesMobileView = ({
|
||||
onDelete={handleDeleteClick}
|
||||
>
|
||||
<div className="mobile-detail-actions-extra">
|
||||
<button type="button" className="secondary-button" disabled={isReloadingWorkingCopy} onClick={onReloadWorkingCopy}>
|
||||
{isReloadingWorkingCopy ? <><Icon name="loading" size="sm" /> Reloading...</> : <><Icon name="refresh" size="sm" /> Reload working copy</>}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="secondary-button"
|
||||
|
||||
Reference in New Issue
Block a user