mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
refactor: clean up legacy templates and js (#39808)
* Remove unused `"root"` data attributes from templates * Use our "confirmModal" as much as possible (partially for #39643) * Use "data-global-init" to refactor a lot of legacy code * Refactor and clearify initRepoIssueCommentDelete's behavior to help #36862 * Remove dead code `common-organization.ts`
This commit is contained in:
1 parent
a25d1d77eb
commit
2fe74d3cdd
17 files changed
+89
-101
No files matched your search
@@ -10,6 +10,7 @@ import type {ActionsJob, ActionsRunAttempt} from '../modules/gitea-actions.ts';
|
||||
import {buildJobsByParentJobID, createActionRunViewStore} from './ActionRunView.ts';
|
||||
import {buildArtifactTooltipHtml} from './ActionRunArtifacts.ts';
|
||||
import {trString} from '../modules/i18n.ts';
|
||||
import {confirmModal} from '../features/comp/ConfirmModal.ts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RepoActionView',
|
||||
@@ -142,8 +143,9 @@ function approveRun() {
|
||||
}
|
||||
|
||||
async function deleteArtifact(name: string) {
|
||||
if (!window.confirm(trString(locale.confirmDeleteArtifact, name))) return;
|
||||
await DELETE(buildArtifactLink(name));
|
||||
const artifactLink = buildArtifactLink(name);
|
||||
if (!await confirmModal({content: trString(locale.confirmDeleteArtifact, name), confirmButtonColor: 'red'})) return;
|
||||
await DELETE(artifactLink);
|
||||
await store.forceReloadCurrentRun();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user