)}
type="email"
/>
diff --git a/apps/console/src/components/form/MeasureSelectField.tsx b/apps/console/src/components/form/MeasureSelectField.tsx
index 39e7456cb..60a7b9c18 100644
--- a/apps/console/src/components/form/MeasureSelectField.tsx
+++ b/apps/console/src/components/form/MeasureSelectField.tsx
@@ -1,30 +1,30 @@
import { Field, Combobox, ComboboxItem } from "@probo/ui";
import { Suspense, useMemo, useState, type ComponentProps } from "react";
import { useTranslate } from "@probo/i18n";
-import { type Control, Controller } from "react-hook-form";
+import { type Control, Controller, type FieldPath, type FieldValues } from "react-hook-form";
import { usePaginatedMeasures } from "/hooks/graph/usePaginatedMeasures";
-type Props = {
+type Props
= FieldPath> = {
organizationId: string;
- control: Control;
- name: string;
+ control: Control;
+ name: TName;
label?: string;
error?: string;
disabled?: boolean;
} & ComponentProps;
-export function MeasureSelectField({
+export function MeasureSelectField({
organizationId,
control,
disabled,
...props
-}: Props) {
+}: Props) {
return (
{}} placeholder="Loading..." disabled>}
>
-
organizationId={organizationId}
control={control}
name={props.name}
@@ -35,8 +35,8 @@ export function MeasureSelectField({
);
}
-function MeasureSelectWithQuery(
- props: Pick
+function MeasureSelectWithQuery(
+ props: Pick, "organizationId" | "control" | "name" | "disabled">
) {
const { __ } = useTranslate();
const { name, organizationId, control, disabled } = props;
diff --git a/apps/console/src/components/form/PeopleSelectField.tsx b/apps/console/src/components/form/PeopleSelectField.tsx
index a116312b8..da3c9201b 100644
--- a/apps/console/src/components/form/PeopleSelectField.tsx
+++ b/apps/console/src/components/form/PeopleSelectField.tsx
@@ -1,29 +1,29 @@
import { Avatar, Field, Option, Select } from "@probo/ui";
import { Suspense, type ComponentProps } from "react";
import { useTranslate } from "@probo/i18n";
-import { type Control, Controller } from "react-hook-form";
+import { type Control, Controller, type FieldPath, type FieldValues } from "react-hook-form";
import { usePeople } from "/hooks/graph/PeopleGraph.ts";
-type Props = {
+type Props = FieldPath> = {
organizationId: string;
- control: Control;
- name: string;
+ control: Control;
+ name: TName;
label?: string;
error?: string;
optional?: boolean;
} & ComponentProps;
-export function PeopleSelectField({
+export function PeopleSelectField({
organizationId,
control,
...props
-}: Props) {
+}: Props) {
return (
}
>
-
organizationId={organizationId}
control={control}
name={props.name}
@@ -35,9 +35,9 @@ export function PeopleSelectField({
);
}
-function PeopleSelectWithQuery(
+function PeopleSelectWithQuery(
props: Pick<
- Props,
+ Props,
"organizationId" | "control" | "name" | "disabled" | "optional"
>,
) {
diff --git a/apps/console/src/pages/organizations/assets/AssetDetailsPage.tsx b/apps/console/src/pages/organizations/assets/AssetDetailsPage.tsx
index ffbde4506..74dafdcce 100644
--- a/apps/console/src/pages/organizations/assets/AssetDetailsPage.tsx
+++ b/apps/console/src/pages/organizations/assets/AssetDetailsPage.tsx
@@ -53,9 +53,6 @@ export default function AssetDetailsPage(props: Props) {
const { snapshotId } = useParams<{ snapshotId?: string }>();
const isSnapshotMode = Boolean(snapshotId);
const { isAuthorized } = use(PermissionsContext);
- if (!assetEntry || !assetEntry.id) {
- return {__("Asset not found")}
;
- }
validateSnapshotConsistency(assetEntry, snapshotId);
@@ -82,6 +79,10 @@ export default function AssetDetailsPage(props: Props) {
const updateAsset = useUpdateAsset();
+ if (!assetEntry || !assetEntry.id) {
+ return {__("Asset not found")}
;
+ }
+
const onSubmit = handleSubmit(async (formData) => {
await updateAsset({
id: assetEntry.id!,