Skip to content

Commit 504eb4a

Browse files
committed
refactor: use fa object type in config metadata
also add key to the object
1 parent 93b61c1 commit 504eb4a

3 files changed

Lines changed: 212 additions & 101 deletions

File tree

frontend/__tests__/commandline/util.spec.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ describe("CommandlineUtils", () => {
153153
},
154154
},
155155
configMeta: {
156-
icon: "icon",
156+
fa: {
157+
icon: "fa-keyboard",
158+
},
157159
},
158160
schema,
159161
});
@@ -173,8 +175,10 @@ describe("CommandlineUtils", () => {
173175
defaultValue: expect.anything(),
174176
alias: "alias",
175177
input: true,
176-
icon: "icon",
178+
icon: "fa-keyboard",
177179
exec: expect.anything(),
180+
hover: undefined,
181+
configValue: undefined,
178182
inputValueConvert: Number,
179183
validation: expect.anything(),
180184
});
@@ -198,7 +202,9 @@ describe("CommandlineUtils", () => {
198202
},
199203
},
200204
configMeta: {
201-
icon: "icon",
205+
fa: {
206+
icon: "fa-keyboard",
207+
},
202208
},
203209
schema,
204210
});
@@ -210,7 +216,7 @@ describe("CommandlineUtils", () => {
210216
display: "custom test...",
211217
alias: "alias",
212218
input: true,
213-
icon: "icon",
219+
icon: "fa-keyboard",
214220
}),
215221
);
216222
});

frontend/src/ts/commandline/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function buildCommandWithSubgroup<K extends keyof ConfigSchemas.Config>(
136136
return {
137137
id: `change${capitalizeFirstLetter(key)}`,
138138
display: display,
139-
icon: configMeta?.icon ?? "fa-cog",
139+
icon: configMeta?.fa?.icon ?? "fa-cog",
140140
subgroup: {
141141
title: display,
142142
configKey: key,
@@ -230,7 +230,7 @@ function buildInputCommand<K extends keyof ConfigSchemas.Config>({
230230
display: displayString,
231231
alias: inputProps?.alias ?? undefined,
232232
input: true,
233-
icon: configMeta.icon ?? "fa-cog",
233+
icon: configMeta?.fa?.icon ?? "fa-cog",
234234

235235
//@ts-expect-error this is fine
236236
exec: ({ input }): void => {

0 commit comments

Comments
 (0)