mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-08 09:19:53 +00:00
♻️ mark forms as readonly
This commit is contained in:
@@ -242,7 +242,7 @@ export function EditPolicyAuthMethodsSectionForm({
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
{!readonly && (
|
||||
{!readonly ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
@@ -251,6 +251,10 @@ export function EditPolicyAuthMethodsSectionForm({
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
{t("resourcePolicyAuthMethodAdd")}
|
||||
</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>
|
||||
</SettingsSection>
|
||||
|
||||
@@ -144,7 +144,7 @@ export function EditPolicyOtpEmailSectionForm({
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
{!readonly && (
|
||||
{!readonly ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
@@ -153,6 +153,10 @@ export function EditPolicyOtpEmailSectionForm({
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
{t("resourcePolicyOtpEmailAdd")}
|
||||
</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>
|
||||
</SettingsSection>
|
||||
|
||||
@@ -701,7 +701,7 @@ export function EditPolicyRulesSectionForm({
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
{!readonly && (
|
||||
{!readonly ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
@@ -710,6 +710,10 @@ export function EditPolicyRulesSectionForm({
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
{t("resourcePolicyRulesAdd")}
|
||||
</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>
|
||||
</SettingsSection>
|
||||
@@ -757,7 +761,10 @@ export function EditPolicyRulesSectionForm({
|
||||
<FormControl>
|
||||
<Select
|
||||
value={field.value}
|
||||
disabled={readonly || !rulesEnabled}
|
||||
disabled={
|
||||
readonly ||
|
||||
!rulesEnabled
|
||||
}
|
||||
onValueChange={
|
||||
field.onChange
|
||||
}
|
||||
@@ -793,7 +800,10 @@ export function EditPolicyRulesSectionForm({
|
||||
<FormControl>
|
||||
<Select
|
||||
value={field.value}
|
||||
disabled={readonly || !rulesEnabled}
|
||||
disabled={
|
||||
readonly ||
|
||||
!rulesEnabled
|
||||
}
|
||||
onValueChange={
|
||||
field.onChange
|
||||
}
|
||||
@@ -860,7 +870,10 @@ export function EditPolicyRulesSectionForm({
|
||||
<Button
|
||||
variant="outline"
|
||||
role="combobox"
|
||||
disabled={readonly || !rulesEnabled}
|
||||
disabled={
|
||||
readonly ||
|
||||
!rulesEnabled
|
||||
}
|
||||
aria-expanded={
|
||||
openAddRuleCountrySelect
|
||||
}
|
||||
@@ -950,7 +963,10 @@ export function EditPolicyRulesSectionForm({
|
||||
<Button
|
||||
variant="outline"
|
||||
role="combobox"
|
||||
disabled={readonly || !rulesEnabled}
|
||||
disabled={
|
||||
readonly ||
|
||||
!rulesEnabled
|
||||
}
|
||||
aria-expanded={
|
||||
openAddRuleAsnSelect
|
||||
}
|
||||
@@ -1063,7 +1079,13 @@ export function EditPolicyRulesSectionForm({
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
) : (
|
||||
<Input {...field} disabled={readonly || !rulesEnabled} />
|
||||
<Input
|
||||
{...field}
|
||||
disabled={
|
||||
readonly ||
|
||||
!rulesEnabled
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
|
||||
Reference in New Issue
Block a user