Restrict visibility of 'skipOrdine' field to admin users in FormNewServizioAcquisto
This commit is contained in:
parent
099773b161
commit
b0bbeba2bb
1 changed files with 27 additions and 25 deletions
|
|
@ -1460,31 +1460,33 @@ export const FormNewServizioAcquisto = ({
|
|||
</CardContent>
|
||||
</Card>
|
||||
<div className="flex w-full items-center justify-center gap-2 pb-8 sm:justify-end">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="skipOrdine"
|
||||
render={({ field }) => (
|
||||
<FormItem className="py-2">
|
||||
<div className="flex items-center justify-start gap-x-4">
|
||||
<FormLabel htmlFor="skipOrdine">
|
||||
Vuoi saltare la creazione dell'ordine e impostare il
|
||||
servizio come attivo?
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Switch
|
||||
checked={field.value}
|
||||
onCheckedChange={(v) => {
|
||||
field.onChange(v);
|
||||
}}
|
||||
id="skipOrdine"
|
||||
className="data-[state=checked]:bg-neutral-700"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</div>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
{isAdmin && (
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="skipOrdine"
|
||||
render={({ field }) => (
|
||||
<FormItem className="py-2">
|
||||
<div className="flex items-center justify-start gap-x-4">
|
||||
<FormLabel htmlFor="skipOrdine">
|
||||
Vuoi saltare la creazione dell'ordine e impostare il
|
||||
servizio come attivo?
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Switch
|
||||
checked={field.value}
|
||||
onCheckedChange={(v) => {
|
||||
field.onChange(v);
|
||||
}}
|
||||
id="skipOrdine"
|
||||
className="data-[state=checked]:bg-neutral-700"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</div>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
<Button type="submit" className="w-full sm:w-auto">
|
||||
Salva e Procedi
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue