-
Notifications
You must be signed in to change notification settings - Fork 886
feat: add locked TTL field to template meta #8020
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -635,6 +635,7 @@ func TestPatchTemplateMeta(t *testing.T) { | |||
const ( | |||
failureTTL = 7 * 24 * time.Hour | |||
inactivityTTL = 180 * 24 * time.Hour | |||
lockedTTL = 360 * 24 * time.Hour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: I think I stuck my tests in the coderd
folder as well - I'm wondering if they should actually live in enterprise/coderd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably good to have tests in both
@@ -77,6 +77,7 @@ var auditableResourcesTypes = map[any]map[string]Action{ | |||
"max_ttl": ActionTrack, | |||
"failure_ttl": ActionTrack, | |||
"inactivity_ttl": ActionTrack, | |||
"locked_ttl": ActionTrack, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😸
...ages/TemplateSettingsPage/TemplateSchedulePage/TemplateScheduleForm/TemplateScheduleForm.tsx
Show resolved
Hide resolved
...ages/TemplateSettingsPage/TemplateSchedulePage/TemplateScheduleForm/TemplateScheduleForm.tsx
Show resolved
Hide resolved
@@ -158,6 +167,25 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({ | |||
} | |||
} | |||
|
|||
const handleToggleLockedCleanup = async (e: ChangeEvent) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Since we now have 3 toggling functions, we might be able to refactor into one function that takes two form values, e.g. locked_cleanup_enabled
and locked_ttl_ms
and appropriately toggles TTL.
ttl={form.values.locked_ttl_ms} | ||
/>, | ||
)} | ||
disabled={isSubmitting || !form.values.locked_cleanup_enabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that probably makes sense, we can fix it in a follow up PR.
No description provided.