From 9002e6cb331b0136963723d577c79ccf5adcaded Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:00:03 +0100 Subject: [PATCH] Fix: Format entire frontend properly --- .../utilities/telemetry/Telemetry.ts | 14 +- .../v2/Accordion/Accordion.stories.tsx | 2 +- .../src/components/v2/Accordion/Accordion.tsx | 10 +- .../src/components/v2/Accordion/index.tsx | 2 +- frontend/src/components/v2/Card/Card.tsx | 2 +- .../src/components/v2/Checkbox/Checkbox.tsx | 4 +- .../DeleteActionModal/DeleteActionModal.tsx | 8 +- frontend/src/components/v2/Drawer/Drawer.tsx | 2 +- frontend/src/components/v2/Drawer/index.tsx | 2 +- .../v2/Dropdown/Dropdown.stories.tsx | 8 +- .../src/components/v2/Dropdown/Dropdown.tsx | 22 +- .../EmailServiceSetupModal.tsx | 5 +- .../components/v2/FormControl/FormControl.tsx | 2 +- .../src/components/v2/HoverCard/HoverCard.tsx | 12 +- .../src/components/v2/HoverCardv2/index.tsx | 2 +- frontend/src/components/v2/Modal/Modal.tsx | 2 +- .../components/v2/Pagination/Pagination.tsx | 2 +- .../src/components/v2/Popover/Popover.tsx | 25 +- .../src/components/v2/Popoverv2/index.tsx | 2 +- .../components/v2/RadioGroup/RadioGroup.tsx | 20 +- frontend/src/components/v2/Select/Select.tsx | 4 +- .../src/components/v2/Spinner/Spinner.tsx | 2 +- .../src/components/v2/Stepper/Stepper.tsx | 12 +- frontend/src/components/v2/Stepper/index.tsx | 4 +- frontend/src/components/v2/Table/index.tsx | 5 +- frontend/src/components/v2/Tabs/Tabs.tsx | 6 +- frontend/src/components/v2/Tabs/index.tsx | 2 +- .../src/context/AuthContext/AuthContext.tsx | 2 +- .../ProjectPermissionContext/index.tsx | 2 +- .../ServerConfigContext.tsx | 21 +- .../src/context/ServerConfigContext/index.tsx | 2 +- frontend/src/context/index.tsx | 2 +- .../UpdateUserProjectPermission.ts | 2 +- frontend/src/ee/utilities/timeSince.ts | 16 +- frontend/src/helpers/key.ts | 126 +++--- .../src/hoc/withPermission/withPermission.tsx | 6 +- frontend/src/hooks/api/apiKeys/index.ts | 5 +- frontend/src/hooks/api/apiKeys/queries.tsx | 26 +- .../src/hooks/api/auditLogs/constants.tsx | 102 ++--- frontend/src/hooks/api/auditLogs/enums.tsx | 4 +- frontend/src/hooks/api/auditLogs/index.tsx | 2 +- frontend/src/hooks/api/auth/types.ts | 36 +- frontend/src/hooks/api/bots/queries.tsx | 4 +- .../src/hooks/api/identities/constants.tsx | 4 +- frontend/src/hooks/api/identities/index.tsx | 20 +- .../src/hooks/api/identities/mutations.tsx | 277 +++++++------- frontend/src/hooks/api/identities/queries.tsx | 62 +-- frontend/src/hooks/api/index.tsx | 4 +- .../src/hooks/api/integrationAuth/index.tsx | 2 +- .../src/hooks/api/integrationAuth/queries.tsx | 10 +- frontend/src/hooks/api/integrations/index.tsx | 6 +- .../src/hooks/api/integrations/queries.tsx | 8 +- frontend/src/hooks/api/ldapConfig/index.tsx | 6 +- frontend/src/hooks/api/ldapConfig/queries.tsx | 94 +++-- frontend/src/hooks/api/organization/index.ts | 40 +- frontend/src/hooks/api/scim/index.tsx | 7 +- frontend/src/hooks/api/scim/mutations.tsx | 62 ++- frontend/src/hooks/api/scim/queries.tsx | 34 +- frontend/src/hooks/api/scim/types.ts | 32 +- frontend/src/hooks/api/serverDetails/index.ts | 2 +- .../src/hooks/api/serverDetails/queries.tsx | 8 +- frontend/src/hooks/api/serverDetails/types.ts | 4 +- frontend/src/hooks/api/serviceTokens/enums.ts | 6 +- frontend/src/hooks/api/serviceTokens/index.ts | 6 +- frontend/src/hooks/api/ssoConfig/index.tsx | 6 +- frontend/src/hooks/api/ssoConfig/queries.tsx | 2 +- frontend/src/hooks/api/trustedIps/index.ts | 9 +- frontend/src/hooks/api/trustedIps/queries.ts | 173 +++++---- frontend/src/hooks/api/workspace/queries.tsx | 14 +- frontend/src/hooks/api/workspace/types.ts | 36 +- frontend/src/i18n.ts | 2 +- frontend/src/lib/fn/array.ts | 16 +- frontend/src/pages/404.tsx | 25 +- frontend/src/pages/admin/signup.tsx | 2 +- frontend/src/pages/api/auth/CheckAuth.ts | 2 +- .../linkGitAppInstallationWithOrganization.ts | 4 +- .../api/secret-scanning/updateRiskStatus.ts | 27 +- frontend/src/pages/cli-redirect.tsx | 12 +- frontend/src/pages/email-not-verified.tsx | 6 +- frontend/src/pages/index.tsx | 2 +- .../cloudflare-pages/authorize.tsx | 147 ++++--- .../cloudflare-workers/create.tsx | 10 +- .../src/pages/integrations/heroku/create.tsx | 69 ++-- .../src/pages/integrations/railway/create.tsx | 20 +- .../src/pages/integrations/render/create.tsx | 27 +- frontend/src/pages/login/index.tsx | 4 +- frontend/src/pages/login/provider/error.tsx | 10 +- frontend/src/pages/login/provider/success.tsx | 16 +- frontend/src/pages/login/sso/index.tsx | 42 +- frontend/src/pages/org/[id]/members/index.tsx | 2 +- .../src/pages/org/[id]/overview/index.tsx | 7 +- frontend/src/pages/org/none/index.tsx | 22 +- frontend/src/pages/password-reset.tsx | 88 ++--- frontend/src/pages/personal-settings.tsx | 2 +- .../pages/project/[id]/allowlist/index.tsx | 24 +- .../pages/project/[id]/audit-logs/index.tsx | 24 +- frontend/src/pages/requestnewinvite.tsx | 17 +- frontend/src/pages/secret-scanning.tsx | 17 +- frontend/src/pages/signup/sso/index.tsx | 40 +- frontend/src/pages/verify-email.tsx | 13 +- frontend/src/services/KeyService.ts | 195 +++++----- frontend/src/services/index.ts | 5 +- .../IntegrationsSection.tsx | 6 +- frontend/src/views/Login/LoginSSO.tsx | 90 ++--- .../Login/components/InitialStep/index.tsx | 2 +- .../Login/components/LDAPStep/LDAPStep.tsx | 242 ++++++------ .../views/Login/components/LDAPStep/index.tsx | 2 +- .../views/Login/components/MFAStep/index.tsx | 2 +- .../Login/components/PasswordStep/index.tsx | 2 +- .../components/SAMLSSOStep/SAMLSSOStep.tsx | 122 +++--- .../Login/components/SAMLSSOStep/index.tsx | 2 +- frontend/src/views/Login/components/index.tsx | 2 +- .../OrgIdentityTab/OrgIdentityTab.tsx | 28 +- .../IdentityAuthMethodModal.tsx | 171 ++++----- .../components/IdentitySection/index.tsx | 2 +- .../OrgIdentityTab/components/index.tsx | 2 +- .../components/OrgIdentityTab/index.tsx | 2 +- .../OrgMembersTab/OrgMembersTab.tsx | 24 +- .../OrgMembersSection/OrgMembersSection.tsx | 2 +- .../OrgMembersSection/OrgMembersTable.tsx | 5 +- .../components/OrgMembersSection/index.tsx | 2 +- .../OrgMembersTab/components/index.tsx | 2 +- .../components/OrgMembersTab/index.tsx | 2 +- .../SimpleLevelPermissionOptions.tsx | 10 +- .../WorkspacePermission.tsx | 8 +- .../Org/MembersPage/components/index.tsx | 2 +- frontend/src/views/Org/NonePage/NonePage.tsx | 4 +- frontend/src/views/Org/NonePage/index.tsx | 2 +- .../Project/AuditLogsPage/AuditLogsPage.tsx | 6 +- .../AuditLogsPage/components/index.tsx | 2 +- .../AuditLogsPage/components/types.tsx | 22 +- .../src/views/Project/AuditLogsPage/index.tsx | 2 +- .../IPAllowListPage/IPAllowlistPage.tsx | 4 +- .../IPAllowListPage/components/index.tsx | 2 +- .../views/Project/IPAllowListPage/index.tsx | 2 +- .../components/IdentityTab/IdentityTab.tsx | 28 +- .../IdentitySection/IdentityRoles.tsx | 18 +- .../components/IdentitySection/index.tsx | 2 +- .../IdentityTab/components/index.tsx | 2 +- .../components/IdentityTab/index.tsx | 2 +- .../MemberListTab/MemberListTab.tsx | 21 +- .../components/MemberListTab/MemberRoles.tsx | 22 +- .../SecretRollbackPermission.tsx | 8 +- .../SingleProjectPermission.tsx | 8 +- .../WsProjectPermission.tsx | 8 +- .../ServiceTokenTab/ServiceTokenTab.tsx | 28 +- .../AddServiceTokenModal.tsx | 2 +- .../ServiceTokenSection.tsx | 4 +- .../components/ServiceTokenSection/index.tsx | 2 +- .../ServiceTokenTab/components/index.tsx | 2 +- .../components/ServiceTokenTab/index.tsx | 2 +- .../Project/MembersPage/components/index.tsx | 2 +- .../SecretApprovalRequestChangeItem.tsx | 2 +- .../components/CreateSecretForm/index.tsx | 2 +- .../ProjectIndexSecretsSection/index.tsx | 2 +- .../SecretOverviewTableRow/SecretEditRow.tsx | 2 +- .../CreateRotationForm/CreateRotationForm.tsx | 2 +- .../steps/RotationInputForm.tsx | 2 +- .../components/RiskStatusSelection.tsx | 2 +- .../views/SecretScanning/components/index.tsx | 2 +- .../BillingSettingsPage.tsx | 26 +- .../BillingCloudTab/BillingCloudTab.tsx | 14 +- .../BillingCloudTab/ManagePlansModal.tsx | 104 +++-- .../components/BillingCloudTab/index.tsx | 2 +- .../BillingDetailsTab/BillingDetailsTab.tsx | 18 +- .../BillingDetailsTab/TaxIDSection.tsx | 6 +- .../components/BillingDetailsTab/index.tsx | 2 +- .../BillingReceiptsTab/BillingReceiptsTab.tsx | 14 +- .../components/BillingReceiptsTab/index.tsx | 2 +- .../BillingSelfHostedTab.tsx | 12 +- .../components/BillingSelfHostedTab/index.tsx | 2 +- .../BillingTabGroup/BillingTabGroup.tsx | 2 +- .../components/BillingTabGroup/index.tsx | 2 +- .../BillingSettingsPage/components/index.tsx | 2 +- .../Settings/BillingSettingsPage/index.tsx | 2 +- .../OrgSettingsPage/OrgSettingsPage.tsx | 14 +- .../components/OrgAuthTab/LDAPModal.tsx | 359 ++++++++---------- .../OrgAuthTab/OrgGeneralAuthSection.tsx | 152 ++++---- .../components/OrgAuthTab/OrgLDAPSection.tsx | 70 ++-- .../components/OrgAuthTab/OrgSCIMSection.tsx | 205 +++++----- .../components/OrgAuthTab/OrgSSOSection.tsx | 50 ++- .../components/OrgAuthTab/ScimTokenModal.tsx | 241 ++++++------ .../components/OrgAuthTab/index.tsx | 2 +- .../OrgDeleteSection/OrgDeleteSection.tsx | 2 +- .../components/OrgDeleteSection/index.tsx | 2 +- .../OrgGeneralTab/OrgGeneralTab.tsx | 2 +- .../components/OrgGeneralTab/index.tsx | 2 +- .../OrgIncidentContactsSection/index.tsx | 4 +- .../OrgNameChangeSection.tsx | 28 +- .../components/OrgTabGroup/OrgTabGroup.tsx | 4 +- .../components/OrgTabGroup/index.tsx | 2 +- .../OrgSettingsPage/components/index.tsx | 2 +- .../APIKeySection/AddAPIKeyModal.tsx | 296 +++++++-------- .../APIKeySection/index.tsx | 3 +- .../AuthMethodSection/index.tsx | 2 +- .../ChangeLanguageSection.tsx | 48 +-- .../ChangeLanguageSection/index.tsx | 2 +- .../ChangePasswordSection/index.tsx | 2 +- .../DeleteAccountSection.tsx | 101 +++-- .../DeleteAccountSection/index.tsx | 2 +- .../EmergencyKitSection.tsx | 144 ++++--- .../EmergencyKitSection/index.tsx | 2 +- .../PersonalAPIKeyTab/index.tsx | 2 +- .../PersonalAuthTab/PersonalAuthTab.tsx | 30 +- .../PersonalAuthTab/index.tsx | 2 +- .../PersonalGeneralTab/PersonalGeneralTab.tsx | 18 +- .../PersonalGeneralTab/index.tsx | 2 +- .../PersonalSettingsPage.tsx | 24 +- .../PersonalTabGroup/index.tsx | 2 +- .../SecuritySection/MFASection.tsx | 72 ++-- .../SecuritySection/index.tsx | 2 +- .../SessionsSection/SessionsSection.tsx | 67 ++-- .../SessionsSection/index.tsx | 2 +- .../UserNameSection/index.tsx | 2 +- .../Settings/PersonalSettingsPage/index.tsx | 2 +- .../ProjectSettingsPage.tsx | 6 +- .../AutoCapitalizationSection/index.tsx | 2 +- .../components/DeleteProjectSection/index.tsx | 2 +- .../components/E2EESection/index.tsx | 4 +- .../components/ProjectGeneralTab/index.tsx | 2 +- .../ProjectNameChangeSection.tsx | 6 +- .../components/SecretTagsSection/index.tsx | 2 +- .../ProjectSettingsPage/components/index.tsx | 2 +- frontend/src/views/Signup/SignupSSO.tsx | 81 ++-- .../BackupPDFStep/BackupPDFStep.tsx | 50 +-- .../Signup/components/BackupPDFStep/index.tsx | 2 +- .../components/UserInfoSSOStep/index.tsx | 2 +- .../src/views/Signup/components/index.tsx | 2 +- frontend/src/views/Signup/index.tsx | 2 +- .../DownloadBackupKeys/DownloadBackupKeys.tsx | 17 +- 230 files changed, 2752 insertions(+), 2941 deletions(-) diff --git a/frontend/src/components/utilities/telemetry/Telemetry.ts b/frontend/src/components/utilities/telemetry/Telemetry.ts index 76e86fa37..6f6fc2367 100644 --- a/frontend/src/components/utilities/telemetry/Telemetry.ts +++ b/frontend/src/components/utilities/telemetry/Telemetry.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { PostHog } from 'posthog-js'; -import { initPostHog } from '@app/components/analytics/posthog'; -import { ENV } from '@app/components/utilities/config'; +import { PostHog } from "posthog-js"; +import { initPostHog } from "@app/components/analytics/posthog"; +import { ENV } from "@app/components/utilities/config"; declare let TELEMETRY_CAPTURING_ENABLED: any; @@ -13,23 +13,23 @@ class Capturer { } capture(item: string) { - if (ENV === 'production' && TELEMETRY_CAPTURING_ENABLED === "true") { + if (ENV === "production" && TELEMETRY_CAPTURING_ENABLED === "true") { try { this.api.capture(item); } catch (error) { - console.error('PostHog', error); + console.error("PostHog", error); } } } identify(id: string, email?: string) { - if (ENV === 'production' && TELEMETRY_CAPTURING_ENABLED === "true") { + if (ENV === "production" && TELEMETRY_CAPTURING_ENABLED === "true") { try { this.api.identify(id, { email: email }); } catch (error) { - console.error('PostHog', error); + console.error("PostHog", error); } } } diff --git a/frontend/src/components/v2/Accordion/Accordion.stories.tsx b/frontend/src/components/v2/Accordion/Accordion.stories.tsx index bd17c8743..d49f2b62b 100644 --- a/frontend/src/components/v2/Accordion/Accordion.stories.tsx +++ b/frontend/src/components/v2/Accordion/Accordion.stories.tsx @@ -14,7 +14,7 @@ type Story = StoryObj; export const Basic: Story = { render: (args) => ( -
+
Section 1 diff --git a/frontend/src/components/v2/Accordion/Accordion.tsx b/frontend/src/components/v2/Accordion/Accordion.tsx index 9188b873e..dc7edd05e 100644 --- a/frontend/src/components/v2/Accordion/Accordion.tsx +++ b/frontend/src/components/v2/Accordion/Accordion.tsx @@ -8,7 +8,7 @@ export const AccordionItem = forwardRef ( @@ -51,13 +51,13 @@ export const AccordionContent = forwardRef< >(({ children, className, ...props }, forwardedRef) => ( -
{children}
+
{children}
)); diff --git a/frontend/src/components/v2/Accordion/index.tsx b/frontend/src/components/v2/Accordion/index.tsx index 831904d54..fd2e2ddd3 100644 --- a/frontend/src/components/v2/Accordion/index.tsx +++ b/frontend/src/components/v2/Accordion/index.tsx @@ -1 +1 @@ -export { Accordion, AccordionContent, AccordionItem,AccordionTrigger } from "./Accordion"; +export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./Accordion"; diff --git a/frontend/src/components/v2/Card/Card.tsx b/frontend/src/components/v2/Card/Card.tsx index 4d7c134a0..0e86d0357 100644 --- a/frontend/src/components/v2/Card/Card.tsx +++ b/frontend/src/components/v2/Card/Card.tsx @@ -10,7 +10,7 @@ export type CardTitleProps = { export const CardTitle = ({ children, className, subTitle }: CardTitleProps) => (
diff --git a/frontend/src/components/v2/Checkbox/Checkbox.tsx b/frontend/src/components/v2/Checkbox/Checkbox.tsx index dc0e1a491..0e4581372 100644 --- a/frontend/src/components/v2/Checkbox/Checkbox.tsx +++ b/frontend/src/components/v2/Checkbox/Checkbox.tsx @@ -30,7 +30,7 @@ export const Checkbox = ({
-