File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.test Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import { TestJobService } from "~/services/jobs/testJob.server";
35
35
import { requireUserId } from "~/services/session.server" ;
36
36
import { cn } from "~/utils/cn" ;
37
37
import { Handle } from "~/utils/handle" ;
38
+ import { isValidIcon } from "~/utils/icon" ;
38
39
import { JobParamsSchema , jobRunDashboardPath , trimTrailingSlash } from "~/utils/pathBuilder" ;
39
40
40
41
export const loader = async ( { request, params } : LoaderArgs ) => {
@@ -228,7 +229,7 @@ export default function Page() {
228
229
} }
229
230
>
230
231
< DetailCell
231
- leadingIcon = { example . icon ?? CodeBracketIcon }
232
+ leadingIcon = { isValidIcon ( example . icon ) ? example . icon : CodeBracketIcon }
232
233
leadingIconClassName = "text-blue-500"
233
234
label = { example . name }
234
235
trailingIcon = { example . id === selectedCodeSampleId ? "check" : "plus" }
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ export class RegisterJobService {
222
222
} ,
223
223
update : {
224
224
name : example . name ,
225
- icon : example . icon ,
225
+ icon : example . icon ?? null ,
226
226
payload : example . payload ,
227
227
} ,
228
228
} ) ;
Original file line number Diff line number Diff line change
1
+ import { hasIcon } from "@trigger.dev/companyicons" ;
2
+ import { iconNames as namedIcons } from "~/components/primitives/NamedIcon" ;
3
+
4
+ export const isValidIcon = ( icon ?: string ) : boolean => {
5
+ if ( ! icon ) {
6
+ return false ;
7
+ }
8
+ return namedIcons . includes ( icon ) || hasIcon ( icon ) ;
9
+ } ;
You can’t perform that action at this time.
0 commit comments