feat(git): clarify dashboard release flow
This commit is contained in:
@@ -106,6 +106,15 @@
|
||||
|
||||
function handleBackdropClick(e) { if (e.target === e.currentTarget) closeModal(); }
|
||||
|
||||
function navigateToVersionSave(): void {
|
||||
model.activeTab = 'workspace';
|
||||
requestAnimationFrame(() => {
|
||||
const target = document.getElementById('git-workspace-save');
|
||||
target?.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
requestAnimationFrame(() => target?.querySelector<HTMLTextAreaElement>('#git-commit-message')?.focus());
|
||||
});
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
model.initialize();
|
||||
lastFocused = document.activeElement as HTMLElement | null;
|
||||
@@ -230,6 +239,7 @@
|
||||
deploymentStatus={model.deploymentStatus}
|
||||
currentVersionDate={model.workspaceStatus?.last_commit_date || null}
|
||||
currentVersionHash={model.workspaceStatus?.last_commit_hash || null}
|
||||
candidateCommit={model.environmentHistories.preprod?.find((commit) => commit.hash === model.deploymentStatus?.environments.find((environment) => environment.stage === 'preprod')?.commit_hash) || null}
|
||||
hasWorkspaceChanges={model.hasWorkspaceChanges}
|
||||
changedFilesCount={model.changedFilesCount}
|
||||
validatingPreprod={model.validatingPreprod}
|
||||
@@ -258,8 +268,8 @@
|
||||
<h3 class="text-sm font-semibold text-text">{$t.git?.workspace_pending_title || 'Есть несохранённые изменения'}</h3>
|
||||
<p class="mt-0.5 text-xs text-text-muted">{($t.git?.workspace_pending_hint || '{count} файлов изменены. Они не войдут в текущую публикацию, пока вы не сохраните новую версию.').replace('{count}', String(model.changedFilesCount))}</p>
|
||||
</div>
|
||||
<Button variant="secondary" size="sm" onclick={() => { model.activeTab = 'workspace'; }}>
|
||||
<Icon name="edit" size={14} class="mr-1" />{$t.git?.workspace_pending_action || 'Сохранить новую версию'}
|
||||
<Button variant="secondary" size="sm" onclick={navigateToVersionSave}>
|
||||
<Icon name="edit" size={14} class="mr-1" />{$t.git?.workspace_pending_action || 'Перейти к сохранению'}
|
||||
</Button>
|
||||
</section>
|
||||
{/if}
|
||||
@@ -342,7 +352,7 @@
|
||||
</div>
|
||||
<div id="git-tab-panel" role="tabpanel" aria-labelledby="git-tab-workspace" class="flex min-h-0 flex-1 flex-col">
|
||||
{#if model.activeTab === 'workspace'}
|
||||
<GitWorkspacePanel {dashboardId} envId={model.resolvedEnvId} commitHistoryKey={model.commitHistoryKey} hasWorkspaceChanges={model.hasWorkspaceChanges} changedFilesCount={model.changedFilesCount} workspaceStatus={model.workspaceStatus} workspaceLoading={model.workspaceLoading} workspaceDiff={model.workspaceDiff} committing={model.committing} generatingMessage={model.generatingMessage} bind:commitMessage={model.commitMessage} bind:autoPushAfterCommit={model.autoPushAfterCommit} loading={model.loading} pushProviderLabel={model.pushProviderLabel} onSync={() => model.handleSync()} onGenerateMessage={() => model.handleGenerateMessage()} onCommit={() => model.handleCommit()} />
|
||||
<GitWorkspacePanel {dashboardId} envId={model.resolvedEnvId} commitHistoryKey={model.commitHistoryKey} hasWorkspaceChanges={model.hasWorkspaceChanges} changedFilesCount={model.changedFilesCount} workspaceStatus={model.workspaceStatus} workspaceLoading={model.workspaceLoading} workspaceDiff={model.workspaceDiff} workspaceSummary={model.workspaceSummary} workspaceSummaryState={model.workspaceSummaryState} workspaceSummaryError={model.workspaceSummaryError} committing={model.committing} generatingMessage={model.generatingMessage} bind:commitMessage={model.commitMessage} bind:autoPushAfterCommit={model.autoPushAfterCommit} loading={model.loading} pushProviderLabel={model.pushProviderLabel} onSync={() => model.handleSync()} onGenerateMessage={() => model.handleGenerateMessage()} onGenerateSummary={() => model.handleGenerateWorkspaceSummary(true)} onCommit={() => model.handleCommit()} />
|
||||
{:else if model.activeTab === 'release'}
|
||||
<GitReleasePanel currentEnvStage={model.currentEnvStage} bind:promoteFromBranch={model.promoteFromBranch} bind:promoteToBranch={model.promoteToBranch} bind:promoteMode={model.promoteMode} bind:promoteReason={model.promoteReason} preferredDeployTargetStage={model.preferredDeployTargetStage} bind:showAdvancedPromote={model.showAdvancedPromote} promoting={model.promoting} onPromote={() => model.handlePromote()} onDeploy={() => model.openDeployModal()} onOpenHistory={() => (model.activeTab = 'workspace')} />
|
||||
{:else}
|
||||
|
||||
Reference in New Issue
Block a user