Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(site): log deletion of workspace in audit log#8494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 1 commit intomainfrom8025-deleted
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,14 +10,25 @@ export const BuildAuditDescription: FC<{ auditLog: AuditLog }> = ({
const { t } = useTranslation("auditLog")

const workspaceName = auditLog.additional_fields?.workspace_name?.trim()
// workspaces can be started/stopped by a user, or kicked off automatically by Coder
// workspaces can be started/stopped/deleted by a user, or kicked off automatically by Coder
const user =
auditLog.additional_fields?.build_reason &&
auditLog.additional_fields?.build_reason !== "initiator"
? "Coder automatically"
: auditLog.user?.username.trim()

const action = auditLog.action === "start" ? "started" : "stopped"
const action: string = (() => {
switch (auditLog.action) {
case "start":
return "started"
case "stop":
return "stopped"
case "delete":
return "deleted"
default:
return auditLog.action
}
})()

if (auditLog.resource_link) {
return (
Expand Down
26 changes: 23 additions & 3 deletionssite/src/components/AuditLogRow/AuditLogRow.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,9 +64,29 @@ WithLongDiffRow.args = {
defaultIsDiffOpen: true,
}

export const WithWorkspaceBuild = Template.bind({})
WithWorkspaceBuild.args = {
auditLog: MockAuditLogWithWorkspaceBuild,
export const WithStoppedWorkspaceBuild = Template.bind({})
WithStoppedWorkspaceBuild.args = {
auditLog: {
...MockAuditLogWithWorkspaceBuild,
action: "stop",
},
}

export const WithStartedWorkspaceBuild = Template.bind({})
WithStartedWorkspaceBuild.args = {
auditLog: {
...MockAuditLogWithWorkspaceBuild,
action: "start",
},
}

export const WithDeletedWorkspaceBuild = Template.bind({})
WithDeletedWorkspaceBuild.args = {
auditLog: {
...MockAuditLogWithWorkspaceBuild,
action: "delete",
is_deleted: true,
},
}

export const DeletedResource = Template.bind({})
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp