Fix blocing enum on user config page
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chrome": "^0.0.193",
|
"@types/chrome": "^0.0.193",
|
||||||
"@types/geodesy": "^2.2.3",
|
"@types/geodesy": "^2.2.3",
|
||||||
"@types/node": "^18.6.3",
|
"@types/node": "^18.6.4",
|
||||||
"@types/react": "^18.0.15",
|
"@types/react": "^18.0.15",
|
||||||
"@types/react-dom": "^18.0.6",
|
"@types/react-dom": "^18.0.6",
|
||||||
"@types/w3c-web-serial": "^1.0.2",
|
"@types/w3c-web-serial": "^1.0.2",
|
||||||
|
|||||||
Generated
+311
-251
File diff suppressed because it is too large
Load Diff
@@ -51,14 +51,6 @@ export const User = (): JSX.Element => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form loading={loading} dirty={isDirty} onSubmit={onSubmit}>
|
<Form loading={loading} dirty={isDirty} onSubmit={onSubmit}>
|
||||||
{JSON.stringify(errors.antAzimuth?.message)}
|
|
||||||
{JSON.stringify(errors.antGainDbi?.message)}
|
|
||||||
{JSON.stringify(errors.hwModel?.message)}
|
|
||||||
{JSON.stringify(errors.id?.message)}
|
|
||||||
{JSON.stringify(errors.isLicensed?.message)}
|
|
||||||
{JSON.stringify(errors.longName?.message)}
|
|
||||||
{JSON.stringify(errors.shortName?.message)}
|
|
||||||
{JSON.stringify(errors.txPowerDbm?.message)}
|
|
||||||
<TextInputField
|
<TextInputField
|
||||||
label="Device ID"
|
label="Device ID"
|
||||||
description="Preset unique identifier for this device."
|
description="Preset unique identifier for this device."
|
||||||
@@ -88,16 +80,12 @@ export const User = (): JSX.Element => {
|
|||||||
.match(/.{1,2}/g)
|
.match(/.{1,2}/g)
|
||||||
?.join(":") ?? ""
|
?.join(":") ?? ""
|
||||||
}
|
}
|
||||||
readOnly
|
|
||||||
/>
|
/>
|
||||||
<SelectField
|
<SelectField
|
||||||
label="Hardware"
|
label="Hardware"
|
||||||
description="This is a description."
|
description="This is a description."
|
||||||
disabled
|
disabled
|
||||||
isInvalid={!!errors.hwModel?.message}
|
value={myNode?.data.user?.hwModel}
|
||||||
validationMessage={errors.hwModel?.message}
|
|
||||||
{...register("hwModel", { valueAsNumber: true })}
|
|
||||||
// readOnly
|
|
||||||
>
|
>
|
||||||
{renderOptions(Protobuf.HardwareModel)}
|
{renderOptions(Protobuf.HardwareModel)}
|
||||||
</SelectField>
|
</SelectField>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
|
import { IsBoolean, IsInt, Length } from "class-validator";
|
||||||
|
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
|
|
||||||
export class UserValidation implements Omit<Protobuf.User, "macaddr"> {
|
export class UserValidation
|
||||||
|
implements Omit<Protobuf.User, "macaddr" | "hwModel">
|
||||||
|
{
|
||||||
@Length(2, 30)
|
@Length(2, 30)
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@@ -12,9 +14,6 @@ export class UserValidation implements Omit<Protobuf.User, "macaddr"> {
|
|||||||
@Length(1, 4)
|
@Length(1, 4)
|
||||||
shortName: string;
|
shortName: string;
|
||||||
|
|
||||||
@IsEnum(Protobuf.HardwareModel)
|
|
||||||
hwModel: Protobuf.HardwareModel;
|
|
||||||
|
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
isLicensed: boolean;
|
isLicensed: boolean;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user