mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-11 09:37:37 +03:00
Always show ID field when editing a trigger
This commit is contained in:
parent
4638c22c16
commit
b1b7153e2c
@ -25,6 +25,7 @@ type NameAndIdFieldsProps<T extends FieldValues = FieldValues> = {
|
||||
processId?: (name: string) => string;
|
||||
placeholderName?: string;
|
||||
placeholderId?: string;
|
||||
idVisible?: boolean;
|
||||
};
|
||||
|
||||
export default function NameAndIdFields<T extends FieldValues = FieldValues>({
|
||||
@ -39,10 +40,11 @@ export default function NameAndIdFields<T extends FieldValues = FieldValues>({
|
||||
processId,
|
||||
placeholderName,
|
||||
placeholderId,
|
||||
idVisible,
|
||||
}: NameAndIdFieldsProps<T>) {
|
||||
const { t } = useTranslation(["common"]);
|
||||
const { watch, setValue, trigger, formState } = useFormContext<T>();
|
||||
const [isIdVisible, setIsIdVisible] = useState(false);
|
||||
const [isIdVisible, setIsIdVisible] = useState(idVisible ?? false);
|
||||
const hasUserTypedRef = useRef(false);
|
||||
|
||||
const defaultProcessId = (name: string) => {
|
||||
|
||||
@ -258,6 +258,7 @@ export default function CreateTriggerDialog({
|
||||
nameLabel={t("triggers.dialog.form.name.title")}
|
||||
nameDescription={t("triggers.dialog.form.name.description")}
|
||||
placeholderName={t("triggers.dialog.form.name.placeholder")}
|
||||
idVisible={!!trigger}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
|
||||
Loading…
Reference in New Issue
Block a user