🚧 org settings form

This commit is contained in:
Fred KISSIE
2025-12-15 23:18:28 +01:00
parent 5a0a8893e8
commit 9125a7bccb
2 changed files with 261 additions and 243 deletions

View File

@@ -1853,6 +1853,8 @@
"enableTwoFactorAuthentication": "Enable two-factor authentication", "enableTwoFactorAuthentication": "Enable two-factor authentication",
"completeSecuritySteps": "Complete Security Steps", "completeSecuritySteps": "Complete Security Steps",
"securitySettings": "Security Settings", "securitySettings": "Security Settings",
"dangerSection": "Danger section",
"dangerSectionDescription": "Delete organization alongside all its sites, clients, resources, etc...",
"securitySettingsDescription": "Configure security policies for the organization", "securitySettingsDescription": "Configure security policies for the organization",
"requireTwoFactorForAllUsers": "Require Two-Factor Authentication for All Users", "requireTwoFactorForAllUsers": "Require Two-Factor Authentication for All Users",
"requireTwoFactorDescription": "When enabled, all internal users in this organization must have two-factor authentication enabled to access the organization.", "requireTwoFactorDescription": "When enabled, all internal users in this organization must have two-factor authentication enabled to access the organization.",
@@ -2063,7 +2065,7 @@
"request": "Request", "request": "Request",
"requests": "Requests", "requests": "Requests",
"logs": "Logs", "logs": "Logs",
"logsSettingsDescription": "Monitor logs collected from this orginization", "logsSettingsDescription": "Monitor logs collected from this organization",
"searchLogs": "Search logs...", "searchLogs": "Search logs...",
"action": "Action", "action": "Action",
"actor": "Actor", "actor": "Actor",

View File

@@ -368,9 +368,9 @@ export default function GeneralPage() {
/> />
</SettingsSectionForm> </SettingsSectionForm>
</SettingsSectionBody> </SettingsSectionBody>
</SettingsSection>
<SettingsSection> <hr className="my-12 max-w-xl" />
<SettingsSectionHeader> <SettingsSectionHeader>
<SettingsSectionTitle> <SettingsSectionTitle>
{t("logRetention")} {t("logRetention")}
@@ -587,10 +587,10 @@ export default function GeneralPage() {
)} )}
</SettingsSectionForm> </SettingsSectionForm>
</SettingsSectionBody> </SettingsSectionBody>
</SettingsSection>
{build !== "oss" && ( {build !== "oss" && (
<SettingsSection> <>
<hr className="my-12 max-w-xl" />
<SettingsSectionHeader> <SettingsSectionHeader>
<SettingsSectionTitle> <SettingsSectionTitle>
{t("securitySettings")} {t("securitySettings")}
@@ -600,7 +600,7 @@ export default function GeneralPage() {
</SettingsSectionDescription> </SettingsSectionDescription>
</SettingsSectionHeader> </SettingsSectionHeader>
<SettingsSectionBody> <SettingsSectionBody>
<SettingsSectionForm> <SettingsSectionForm className="mb-4">
<SecurityFeaturesAlert /> <SecurityFeaturesAlert />
<FormField <FormField
control={form.control} control={form.control}
@@ -660,7 +660,9 @@ export default function GeneralPage() {
return ( return (
<FormItem className="col-span-2"> <FormItem className="col-span-2">
<FormLabel> <FormLabel>
{t("maxSessionLength")} {t(
"maxSessionLength"
)}
</FormLabel> </FormLabel>
<FormControl> <FormControl>
<Select <Select
@@ -828,25 +830,15 @@ export default function GeneralPage() {
/> />
</SettingsSectionForm> </SettingsSectionForm>
</SettingsSectionBody> </SettingsSectionBody>
</SettingsSection> </>
)} )}
</SettingsSection>
</form> </form>
</Form> </Form>
{build === "saas" && <AuthPageSettings ref={authPageSettingsRef} />} {build === "saas" && <AuthPageSettings ref={authPageSettingsRef} />}
<div className="flex justify-end gap-2"> <div className="flex justify-end gap-2">
{build !== "saas" && (
<Button
variant="destructive"
onClick={() => setIsDeleteModalOpen(true)}
className="flex items-center gap-2"
loading={loadingDelete}
disabled={loadingDelete}
>
{t("orgDelete")}
</Button>
)}
<Button <Button
type="submit" type="submit"
form="org-settings-form" form="org-settings-form"
@@ -856,6 +848,30 @@ export default function GeneralPage() {
{t("saveSettings")} {t("saveSettings")}
</Button> </Button>
</div> </div>
{build !== "saas" && (
<SettingsSection>
<SettingsSectionHeader>
<SettingsSectionTitle>
{t("dangerSection")}
</SettingsSectionTitle>
<SettingsSectionDescription>
{t("dangerSectionDescription")}
</SettingsSectionDescription>
</SettingsSectionHeader>
<div className="flex justify-start gap-2">
<Button
variant="destructive"
onClick={() => setIsDeleteModalOpen(true)}
className="flex items-center gap-2"
loading={loadingDelete}
disabled={loadingDelete}
>
{t("orgDelete")}
</Button>
</div>
</SettingsSection>
)}
</SettingsContainer> </SettingsContainer>
); );
} }