Skip to content

Commit

Permalink
chore: rename lookupSecret to lookup_secret
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 18, 2023
1 parent c159a41 commit 540c64b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions src/markup-components/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
DividerProps,
InputField as inputField,
InputFieldProps,
LookupSecretSettingsProps,
LookupSecretSettingsSection as lookupSecretSettingsSection,
lookup_secretSettingsProps,
lookup_secretSettingsSection as lookup_secretSettingsSection,
MenuLink as menuLink,
MenuLinkProps,
Message as message,
Expand Down Expand Up @@ -205,11 +205,11 @@ export const TOTPSettingsSection = (
return ComponentWrapper(totpSettingsSection, props, context)
}

export const LookupSecretSettingsSection = (
props: LookupSecretSettingsProps,
export const lookup_secretSettingsSection = (
props: lookup_secretSettingsProps,
context: Context = {},
) => {
return ComponentWrapper(lookupSecretSettingsSection, props, context)
return ComponentWrapper(lookup_secretSettingsSection, props, context)
}

export const UserConsentCard = (
Expand All @@ -231,7 +231,7 @@ export type {
CodeBoxProps,
DividerProps,
InputFieldProps,
LookupSecretSettingsProps,
lookup_secretSettingsProps,
MenuLinkProps,
MessageProps,
NavProps,
Expand Down
2 changes: 1 addition & 1 deletion src/markup-components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

export {
hasHiddenIdentifier,
hasLookupSecret,
haslookup_secret,
hasOidc,
hasPassword,
hasTotp,
Expand Down
2 changes: 1 addition & 1 deletion src/react-components/ory/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const hasPassword = (nodes: UiNode[]) =>
export const hasWebauthn = (nodes: UiNode[]) =>
nodes.some(({ group }) => group === "webauthn")

export const hasLookupSecret = (nodes: UiNode[]) =>
export const haslookup_secret = (nodes: UiNode[]) =>
nodes.some(({ group }) => group === "lookup_secret")

export const hasTotp = (nodes: UiNode[]) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import { JSX } from "react"

import { gridStyle } from "../../../theme"
import { FilterFlowNodes } from "../helpers/filter-flow-nodes"
import { hasLookupSecret } from "../helpers/utils"
import { haslookup_secret } from "../helpers/utils"

export interface LookupSecretSettingsProps {
export interface lookup_secretSettingsProps {
flow: SettingsFlow
}

export const LookupSecretSettingsSection = ({
export const lookup_secretSettingsSection = ({
flow,
}: LookupSecretSettingsProps): JSX.Element | null => {
}: lookup_secretSettingsProps): JSX.Element | null => {
const filter = {
nodes: flow.ui.nodes,
groups: "lookup_secret",
withoutDefaultGroup: true,
}

return hasLookupSecret(flow.ui.nodes) ? (
return haslookup_secret(flow.ui.nodes) ? (
<div className={gridStyle({ gap: 32 })}>
<FilterFlowNodes
filter={{ ...filter, excludeAttributes: "submit,button" }}
Expand Down
10 changes: 5 additions & 5 deletions src/react-components/ory/sections/lookup-secrets-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { JSX } from "react"

import { gridStyle } from "../../../theme"
import { FilterFlowNodes } from "../helpers/filter-flow-nodes"
import { hasLookupSecret } from "../helpers/utils"
import { haslookup_secret } from "../helpers/utils"

export interface LookupSecretsSectionProps {
export interface lookup_secretsSectionProps {
nodes: UiNode[]
}

export const LookupSecretsSection = ({
export const lookup_secretsSection = ({
nodes,
}: LookupSecretsSectionProps): JSX.Element | null => {
return hasLookupSecret(nodes) ? (
}: lookup_secretsSectionProps): JSX.Element | null => {
return haslookup_secret(nodes) ? (
<div className={gridStyle({ gap: 32 })}>
<FilterFlowNodes
filter={{
Expand Down
6 changes: 3 additions & 3 deletions src/react-components/ory/user-auth-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
} from "./helpers/user-auth-form"
import {
hasHiddenIdentifier,
hasLookupSecret,
haslookup_secret,
hasPassword,
hasTotp,
hasWebauthn,
Expand Down Expand Up @@ -219,7 +219,7 @@ export const UserAuthCard = ({
isLoggedIn(flow) &&
(hasTotp(flow.ui.nodes) ||
hasWebauthn(flow.ui.nodes) ||
hasLookupSecret(flow.ui.nodes))
haslookup_secret(flow.ui.nodes))

// we check if nodes have hidden identifier, so we can display "you're looged in as" information
const showLoggedAccount = hasHiddenIdentifier(flow.ui.nodes)
Expand Down Expand Up @@ -278,7 +278,7 @@ export const UserAuthCard = ({
</div>
</UserAuthForm>
),
hasLookupSecret(flow.ui.nodes) && (
haslookup_secret(flow.ui.nodes) && (
<UserAuthForm
flow={flow}
data-testid="lookup-secret-flow"
Expand Down
12 changes: 6 additions & 6 deletions src/react-components/ory/user-settings-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
UserAuthFormAdditionalProps,
} from "./helpers/user-auth-form"
import {
hasLookupSecret,
haslookup_secret,
hasOidc,
hasPassword,
hasTotp,
hasWebauthn,
} from "./helpers/utils"
import { LookupSecretSettingsSection } from "./sections/lookup-secret-settings-section"
import { lookup_secretSettingsSection } from "./sections/lookup-secret-settings-section"
import { OIDCSettingsSection } from "./sections/oidc-settings-section"
import { PasswordSettingsSection } from "./sections/password-settings-section"
import { ProfileSettingsSection } from "./sections/profile-settings-section"
Expand All @@ -29,7 +29,7 @@ export type UserSettingsFlowType =
| "totp"
| "webauthn"
| "oidc"
| "lookupSecret"
| "lookup_secret"

export type UserSettingsCardProps = {
flow: SettingsFlow
Expand Down Expand Up @@ -92,16 +92,16 @@ export const UserSettingsCard = ({
$flow = <WebAuthnSettingsSection flow={flow} />
}
break
case "lookupSecret":
if (hasLookupSecret(flow.ui.nodes)) {
case "lookup_secret":
if (haslookup_secret(flow.ui.nodes)) {
hasFlow = true
cardTitle =
title ??
intl.formatMessage({
id: "settings.title-lookup-secret",
defaultMessage: "Manage 2FA Backup Recovery Codes",
})
$flow = <LookupSecretSettingsSection flow={flow} />
$flow = <lookup_secretSettingsSection flow={flow} />
}
break
case "oidc":
Expand Down
10 changes: 5 additions & 5 deletions src/react-components/ory/user-settings-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { NavSectionLinks } from "../nav"
import {
hasOidc,
hasPassword,
hasLookupSecret,
haslookup_secret,
hasTotp,
hasWebauthn,
} from "./helpers/utils"
Expand Down Expand Up @@ -75,12 +75,12 @@ const nav = ({
iconLeft: "comments",
testId: "oidc",
},
hasLookupSecret(flow.ui.nodes) && {
haslookup_secret(flow.ui.nodes) && {
name: intl.formatMessage({
id: "settings.navigation-backup-codes",
defaultMessage: "2FA Backup Codes",
}),
href: "#lookupSecret",
href: "#lookup_secret",
iconLeft: "shield",
testId: "backup-codes",
},
Expand Down Expand Up @@ -139,7 +139,7 @@ const body = ({
<Typography color="foregroundMuted" size="small">
<FormattedMessage
id="settings.subtitle-instructions"
defaultMessage="Here you can manage settings related to your account. Keep in mind that certain actions require you to re-authenticate."
defaultMessage="Manage settings related to your account. Sensitive actions may require you to re-authenticate."
/>
</Typography>
<NodeMessages uiMessages={flow.ui.messages} textPosition="start" />
Expand All @@ -151,7 +151,7 @@ const body = ({
"profile",
"password",
"oidc",
"lookupSecret",
"lookup_secret",
"webauthn",
"totp",
] as UserSettingsFlowType[]
Expand Down

0 comments on commit 540c64b

Please sign in to comment.