Skip to content

Conversation

Kira-Pilot
Copy link
Member

@Kira-Pilot Kira-Pilot commented Nov 1, 2022

resolves #4769
Screen Shot 2022-11-01 at 3 37 52 PM

Down the road I would like to add UI selects for date, but we need to explore date pickers as a FE team.

If someone could help me out with the test that is failing, I would appreciate it. It seems the Time param I am passing when generating test audit logs isn't actually being saved. Thanks Dean!

@Kira-Pilot Kira-Pilot requested a review from coadler November 1, 2022 19:53
@Kira-Pilot Kira-Pilot requested a review from a team as a code owner November 2, 2022 14:45
@Kira-Pilot Kira-Pilot requested review from code-asher and removed request for a team November 2, 2022 14:45
@@ -2995,6 +2995,16 @@ func (q *fakeQuerier) GetAuditLogsOffset(ctx context.Context, arg database.GetAu
continue
}
}
if arg.DateFrom != (time.Time{}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of these could be if !arg.DateFrom.IsZero()

coderd/audit.go Outdated
Comment on lines 302 to 312
var (
filter = database.GetAuditLogsOffsetParams{
ResourceType: resourceTypeFromString(parser.String(searchParams, "", "resource_type")),
ResourceID: parser.UUID(searchParams, uuid.Nil, "resource_id"),
Action: actionFromString(parser.String(searchParams, "", "action")),
Username: parser.String(searchParams, "", "username"),
Email: parser.String(searchParams, "", "email"),
DateFrom: parsedDateFrom,
DateTo: parsedDateTo,
}
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this could probably just use := instead of var ()

@Kira-Pilot Kira-Pilot merged commit a73dd4f into main Nov 3, 2022
@Kira-Pilot Kira-Pilot deleted the audit-date-filter/kira-pilot branch November 3, 2022 15:04
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

audit: add a date filter
3 participants