Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 305b97b

Browse files
committed
fixup! chore: replace todos with issues
1 parent 68aedf7 commit 305b97b

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

site/e2e/util.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ interface WaitForClientSideNavigationOpts {
5757
* @remark This is necessary in a client-side SPA world since playwright
5858
* waitForNavigation waits for load events on the DOM (ex: after a page load
5959
* from the server).
60-
*
61-
* @todo Better logging for this.
6260
*/
6361
export const waitForClientSideNavigation = async (page: Page, opts: WaitForClientSideNavigationOpts): Promise<void> => {
62+
console.info(`--- waitForClientSideNavigation: start`)
63+
6464
await Promise.all([
6565
waitFor(() => {
6666
const conditions: boolean[] = []
@@ -74,9 +74,12 @@ export const waitForClientSideNavigation = async (page: Page, opts: WaitForClien
7474
}
7575

7676
const unmetConditions = conditions.filter((condition) => !condition)
77+
console.info(`--- waitForClientSideNavigation: ${unmetConditions.length} conditions not met`)
7778

7879
return Promise.resolve(unmetConditions.length === 0)
7980
}),
8081
page.waitForLoadState("networkidle"),
8182
])
83+
84+
console.info(`--- waitForClientSideNavigation: done`)
8285
}

site/embed.go

-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ func secureHeaders(next http.Handler) http.Handler {
270270

271271
// Only scripts can manipulate the dom. This prevents someone from
272272
// naming themselves something like '<svg onload="alert(/cross-site-scripting/)" />'.
273-
// TODO: @emyrk we need to make FE changes to enable this. We get 'TrustedHTML' and 'TrustedURL' errors
274-
// that require FE changes to work.
275273
// "require-trusted-types-for" : []string{"'script'"},
276274
}
277275

site/src/components/Form/FormTextField.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface FormTextFieldProps<T>
6262
* }}
6363
* />
6464
*/
65-
eventTransform?: (value: string) => unknown
65+
eventTransform?: (value: string) => string
6666
/**
6767
* isPassword uses a PasswordField component when `true`; otherwise a
6868
* TextField component is used.
@@ -145,13 +145,8 @@ export const FormTextField = <T,>({
145145
}
146146

147147
const event = e
148-
if (typeof eventTransform !== "undefined") {
149-
// TODO(Grey): Asserting the type as a string here is not quite
150-
// right in that when an input is of type="number", the value will
151-
// be a number. Type asserting is better than conversion for this
152-
// reason, but perhaps there's a better way to do this without any
153-
// assertions.
154-
event.target.value = eventTransform(e.target.value) as string
148+
if (typeof eventTransform !== "undefined" && typeof event.target.value === "string") {
149+
event.target.value = eventTransform(e.target.value)
155150
}
156151
form.handleChange(event)
157152
}}

site/src/pages/templates/[organization]/[template]/index.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ export const TemplatePage: React.FC = () => {
2525
() => `/api/v2/organizations/${unsafeSWRArgument(organizationInfo).id}/templates/${templateName}`,
2626
)
2727

28-
// TODO: The workspaces endpoint was recently changed, so that we can't get
29-
// workspaces per-template. This just grabs all workspaces... and then
30-
// later filters them to match the current template.
28+
// This just grabs all workspaces... and then later filters them to match the
29+
// current template.
3130
const { data: workspaces, error: workspacesError } = useSWR<Workspace[], Error>(() => `/api/v2/users/me/workspaces`)
3231

3332
if (organizationError) {

0 commit comments

Comments
 (0)