mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-22 08:45:24 +00:00
♻️ mark forms as readonly
This commit is contained in:
@@ -242,7 +242,7 @@ export function EditPolicyAuthMethodsSectionForm({
|
|||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
{!readonly && (
|
{!readonly ? (
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -251,6 +251,10 @@ export function EditPolicyAuthMethodsSectionForm({
|
|||||||
<Plus className="mr-2 h-4 w-4" />
|
<Plus className="mr-2 h-4 w-4" />
|
||||||
{t("resourcePolicyAuthMethodAdd")}
|
{t("resourcePolicyAuthMethodAdd")}
|
||||||
</Button>
|
</Button>
|
||||||
|
) : (
|
||||||
|
<div className="text-muted-foreground flex items-center h-full size-full bg-muted rounded-md px-8 py-6 border-dashed text-sm">
|
||||||
|
<p>{t("resourcePolicyAuthMethodsEmpty")}</p>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</SettingsSectionBody>
|
</SettingsSectionBody>
|
||||||
</SettingsSection>
|
</SettingsSection>
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export function EditPolicyOtpEmailSectionForm({
|
|||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
{!readonly && (
|
{!readonly ? (
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -153,6 +153,10 @@ export function EditPolicyOtpEmailSectionForm({
|
|||||||
<Plus className="mr-2 h-4 w-4" />
|
<Plus className="mr-2 h-4 w-4" />
|
||||||
{t("resourcePolicyOtpEmailAdd")}
|
{t("resourcePolicyOtpEmailAdd")}
|
||||||
</Button>
|
</Button>
|
||||||
|
) : (
|
||||||
|
<div className="text-muted-foreground flex items-center h-full size-full bg-muted rounded-md px-8 py-6 border-dashed text-sm">
|
||||||
|
<p>{t("resourcePolicyOtpEmpty")}</p>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</SettingsSectionBody>
|
</SettingsSectionBody>
|
||||||
</SettingsSection>
|
</SettingsSection>
|
||||||
|
|||||||
@@ -701,7 +701,7 @@ export function EditPolicyRulesSectionForm({
|
|||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
{!readonly && (
|
{!readonly ? (
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -710,6 +710,10 @@ export function EditPolicyRulesSectionForm({
|
|||||||
<Plus className="mr-2 h-4 w-4" />
|
<Plus className="mr-2 h-4 w-4" />
|
||||||
{t("resourcePolicyRulesAdd")}
|
{t("resourcePolicyRulesAdd")}
|
||||||
</Button>
|
</Button>
|
||||||
|
) : (
|
||||||
|
<div className="text-muted-foreground flex items-center h-full size-full bg-muted rounded-md px-8 py-6 border-dashed text-sm">
|
||||||
|
<p>{t("resourcePolicyRulesEmpty")}</p>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</SettingsSectionBody>
|
</SettingsSectionBody>
|
||||||
</SettingsSection>
|
</SettingsSection>
|
||||||
@@ -757,7 +761,10 @@ export function EditPolicyRulesSectionForm({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<Select
|
<Select
|
||||||
value={field.value}
|
value={field.value}
|
||||||
disabled={readonly || !rulesEnabled}
|
disabled={
|
||||||
|
readonly ||
|
||||||
|
!rulesEnabled
|
||||||
|
}
|
||||||
onValueChange={
|
onValueChange={
|
||||||
field.onChange
|
field.onChange
|
||||||
}
|
}
|
||||||
@@ -793,7 +800,10 @@ export function EditPolicyRulesSectionForm({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<Select
|
<Select
|
||||||
value={field.value}
|
value={field.value}
|
||||||
disabled={readonly || !rulesEnabled}
|
disabled={
|
||||||
|
readonly ||
|
||||||
|
!rulesEnabled
|
||||||
|
}
|
||||||
onValueChange={
|
onValueChange={
|
||||||
field.onChange
|
field.onChange
|
||||||
}
|
}
|
||||||
@@ -860,7 +870,10 @@ export function EditPolicyRulesSectionForm({
|
|||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
disabled={readonly || !rulesEnabled}
|
disabled={
|
||||||
|
readonly ||
|
||||||
|
!rulesEnabled
|
||||||
|
}
|
||||||
aria-expanded={
|
aria-expanded={
|
||||||
openAddRuleCountrySelect
|
openAddRuleCountrySelect
|
||||||
}
|
}
|
||||||
@@ -950,7 +963,10 @@ export function EditPolicyRulesSectionForm({
|
|||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
disabled={readonly || !rulesEnabled}
|
disabled={
|
||||||
|
readonly ||
|
||||||
|
!rulesEnabled
|
||||||
|
}
|
||||||
aria-expanded={
|
aria-expanded={
|
||||||
openAddRuleAsnSelect
|
openAddRuleAsnSelect
|
||||||
}
|
}
|
||||||
@@ -1063,7 +1079,13 @@ export function EditPolicyRulesSectionForm({
|
|||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
) : (
|
) : (
|
||||||
<Input {...field} disabled={readonly || !rulesEnabled} />
|
<Input
|
||||||
|
{...field}
|
||||||
|
disabled={
|
||||||
|
readonly ||
|
||||||
|
!rulesEnabled
|
||||||
|
}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
Reference in New Issue
Block a user