Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename lookupSecret to lookup_secret #172

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you caught a few too many occurrences

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops

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
Loading