Skip to content

Commit dbfb21e

Browse files
authored
refactor (core, react, examples, docs): rename org to organization
For better consistency across the apps, renamed org to organisation
2 parents 633fc4e + 47a2644 commit dbfb21e

266 files changed

Lines changed: 2296 additions & 2031 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This project uses a **monorepo architecture** designed for multi-framework suppo
2424

2525
**What it provides:**
2626

27-
- 📦 **Internal Services**: Handles all API logic for "My Account" and "My Org" components, using the "My Account" and "My Org" SDKs.
27+
- 📦 **Internal Services**: Handles all API logic for "My Account" and "My Organization" components, using the "My Account" and "My Organization" SDKs.
2828
- 🌐 **Internationalization (i18n)**: Contains all translation files for multi-language support and utils.
2929
- 🛡️ **Schema Validation**: Defines and maintains types for schema validation.
3030
- 🛠️ **Shared Utilities**: Provides shared functions, TypeScript types, and theme management utilities.
@@ -35,7 +35,7 @@ This project uses a **monorepo architecture** designed for multi-framework suppo
3535

3636
**What it provides:**
3737

38-
- ⚛️ **React Components**: Pre-built UI components for Auth0 features (MFA management, user profiles, ,org management etc.)
38+
- ⚛️ **React Components**: Pre-built UI components for Auth0 features (MFA management, user profiles, ,organization management etc.)
3939
- 🎣 **Custom Hooks**: React hooks for component state management and API interactions
4040
- 🎨 **UI Elements**: Beautiful, accessible components built with Radix UI and Tailwind CSS, following shadcn design patterns.
4141
- 🔄 **Providers**: React context providers for managing authentication, theme, and internationalization.
@@ -104,7 +104,7 @@ pnpm run test:core
104104
To run a specific test, go to the relevant package folder and run:
105105
106106
```bash
107-
pnpm run test org-details-edit
107+
pnpm run test organization-details-edit
108108
```
109109
110110
#### Shadcn Local Development
@@ -129,7 +129,7 @@ pnpm run dev
129129
130130
```bash
131131
npx shadcn@latest add http://localhost:5173/r/my-account/user-mfa-management.json --overwrite
132-
npx shadcn@latest add http://localhost:5173/r/my-org/org-details-edit.json --overwrite
132+
npx shadcn@latest add http://localhost:5173/r/my-organization/organization-details-edit.json --overwrite
133133
# ... other components
134134
```
135135

docs-site/public/img/my-org/domain-management/domain-table.png renamed to docs-site/public/img/my-organization/domain-management/domain-table.png

File renamed without changes.

docs-site/public/img/my-org/idp-management/sso-provider-create.png renamed to docs-site/public/img/my-organization/idp-management/sso-provider-create.png

File renamed without changes.

docs-site/public/img/my-org/idp-management/sso-provider-edit.png renamed to docs-site/public/img/my-organization/idp-management/sso-provider-edit.png

File renamed without changes.

docs-site/public/img/my-org/idp-management/sso-provider-table.png renamed to docs-site/public/img/my-organization/idp-management/sso-provider-table.png

File renamed without changes.

docs-site/public/img/my-org/org-management/org-details-edit.png renamed to docs-site/public/img/my-organization/organization-management/organization-details-edit.png

File renamed without changes.

docs-site/public/r/index.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@
99
"description": "A block for managing Multi-Factor Authentication (MFA) factors, including enrollment and deletion."
1010
},
1111
{
12-
"name": "my-org/org-details-edit",
12+
"name": "my-organization/organization-details-edit",
1313
"type": "registry:block",
1414
"title": "Organization Management",
1515
"description": "A block for managing organization details, including editing organization settings and branding, with delete functionality."
1616
},
1717
{
18-
"name": "my-org/domain-table",
18+
"name": "my-organization/domain-table",
1919
"type": "registry:block",
2020
"title": "Domain Management Table",
2121
"description": "A block for managing organization domains, including creating, verifying, configuring identity providers, and deleting domains."
2222
},
2323
{
24-
"name": "my-org/sso-provider-table",
24+
"name": "my-organization/sso-provider-table",
2525
"type": "registry:block",
2626
"title": "SSO Provider Table",
2727
"description": "A block for managing SSO identity providers in a table format, including create, edit, delete, enable/disable, and remove from organization capabilities."
2828
},
2929
{
30-
"name": "my-org/sso-provider-create",
30+
"name": "my-organization/sso-provider-create",
3131
"type": "registry:block",
3232
"title": "SSO Provider Creation Wizard",
3333
"description": "A multi-step wizard for creating SSO identity providers with support for multiple strategies including SAMLP, OIDC, ADFS, Okta, Google Workspace, Azure AD, and PingFederate."
3434
},
3535
{
36-
"name": "my-org/sso-provider-edit",
36+
"name": "my-organization/sso-provider-edit",
3737
"type": "registry:block",
3838
"title": "SSO Provider Edit",
3939
"description": "A comprehensive block for editing SSO identity providers with tabs for provider configuration, SCIM provisioning settings, and domain management. Includes token management, field mappings, and domain verification capabilities."

docs-site/public/r/my-account/user-mfa-management.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
},
254254
{
255255
"path": "src/hooks/index.ts",
256-
"content": "export { useCoreClient, CoreClientContext } from './use-core-client';\nexport { useTranslator } from './use-translator';\nexport { useTheme } from './use-theme';\nexport { useCoreClientInitialization } from './use-core-client-initialization';\nexport { useScopeManager } from './use-scope-manager';\nexport { useErrorHandler } from './use-error-handler';\nexport {\n useContactEnrollment,\n useOtpConfirmation,\n useOtpEnrollment,\n useMFA,\n} from './my-account/mfa';\nexport { useOrgDetailsEdit } from './my-org/org-management/use-org-details-edit';\n",
256+
"content": "export { useCoreClient, CoreClientContext } from './use-core-client';\nexport { useTranslator } from './use-translator';\nexport { useTheme } from './use-theme';\nexport { useCoreClientInitialization } from './use-core-client-initialization';\nexport { useScopeManager } from './use-scope-manager';\nexport { useErrorHandler } from './use-error-handler';\nexport {\n useContactEnrollment,\n useOtpConfirmation,\n useOtpEnrollment,\n useMFA,\n} from './my-account/mfa';\nexport { useOrganizationDetailsEdit } from './my-organization/organization-management/use-organization-details-edit';\n",
257257
"type": "registry:file",
258258
"target": "auth0-ui-components/hooks/index.ts"
259259
},
@@ -337,7 +337,7 @@
337337
},
338338
{
339339
"path": "src/hoc/with-services.tsx",
340-
"content": "import * as React from 'react';\n\nimport { Spinner } from '../components/ui/spinner';\nimport { useScopeManager } from '../hooks/use-scope-manager';\nimport { useTheme } from '../hooks/use-theme';\n\nexport interface ServiceRequirements {\n myAccountApiScopes?: string;\n myOrgApiScopes?: string;\n}\n\nfunction scopesSatisfied(required: string, ensured: string) {\n if (!required) return true;\n const requiredSet = required.split(' ').filter(Boolean);\n const ensuredSet = new Set(ensured.split(' ').filter(Boolean));\n return requiredSet.every((scope) => ensuredSet.has(scope));\n}\n\nfunction normalizeScopes(scopes?: string) {\n return scopes\n ? scopes\n .split(' ')\n .map((s) => s.trim())\n .filter(Boolean)\n .sort()\n .join(' ')\n : '';\n}\n\nexport function withServices<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n requirements: ServiceRequirements = {},\n): React.ComponentType<P> {\n const WithServicesComponent = (props: P) => {\n const { loader } = useTheme();\n const { registerScopes, ensured } = useScopeManager();\n const defaultLoader = (\n <div className=\"fixed inset-0 flex items-center justify-center\">\n <Spinner className=\"h-8 w-8\" />\n </div>\n );\n\n const requiredMe = normalizeScopes(requirements.myAccountApiScopes);\n const requiredOrg = normalizeScopes(requirements.myOrgApiScopes);\n\n const meEnsured = scopesSatisfied(requiredMe, ensured.me);\n const orgEnsured = scopesSatisfied(requiredOrg, ensured['my-org']);\n\n React.useEffect(() => {\n if (requirements.myAccountApiScopes) {\n registerScopes('me', requirements.myAccountApiScopes);\n }\n if (requirements.myOrgApiScopes) {\n registerScopes('my-org', requirements.myOrgApiScopes);\n }\n }, [requirements.myAccountApiScopes, requirements.myOrgApiScopes, registerScopes]);\n\n if (\n (requirements.myAccountApiScopes && !meEnsured) ||\n (requirements.myOrgApiScopes && !orgEnsured)\n ) {\n return <>{loader || defaultLoader}</>;\n }\n\n return <WrappedComponent {...props} />;\n };\n\n return WithServicesComponent;\n}\n\nexport function withMyOrgService<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n scopes: string,\n): React.ComponentType<P> {\n return withServices(WrappedComponent, { myOrgApiScopes: scopes });\n}\n\nexport function withMyAccountService<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n scopes: string,\n): React.ComponentType<P> {\n return withServices(WrappedComponent, { myAccountApiScopes: scopes });\n}\n",
340+
"content": "import * as React from 'react';\n\nimport { Spinner } from '../components/ui/spinner';\nimport { useScopeManager } from '../hooks/use-scope-manager';\nimport { useTheme } from '../hooks/use-theme';\n\nexport interface ServiceRequirements {\n myAccountApiScopes?: string;\n myOrganizationApiScopes?: string;\n}\n\nfunction scopesSatisfied(required: string, ensured: string) {\n if (!required) return true;\n const requiredSet = required.split(' ').filter(Boolean);\n const ensuredSet = new Set(ensured.split(' ').filter(Boolean));\n return requiredSet.every((scope) => ensuredSet.has(scope));\n}\n\nfunction normalizeScopes(scopes?: string) {\n return scopes\n ? scopes\n .split(' ')\n .map((s) => s.trim())\n .filter(Boolean)\n .sort()\n .join(' ')\n : '';\n}\n\nexport function withServices<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n requirements: ServiceRequirements = {},\n): React.ComponentType<P> {\n const WithServicesComponent = (props: P) => {\n const { loader } = useTheme();\n const { registerScopes, ensured } = useScopeManager();\n const defaultLoader = (\n <div className=\"fixed inset-0 flex items-center justify-center\">\n <Spinner className=\"h-8 w-8\" />\n </div>\n );\n\n const requiredMe = normalizeScopes(requirements.myAccountApiScopes);\n const requiredOrganization = normalizeScopes(requirements.myOrganizationApiScopes);\n\n const meEnsured = scopesSatisfied(requiredMe, ensured.me);\n const organizationEnsured = scopesSatisfied(requiredOrganization, ensured['my-org']);\n\n React.useEffect(() => {\n if (requirements.myAccountApiScopes) {\n registerScopes('me', requirements.myAccountApiScopes);\n }\n if (requirements.myOrganizationApiScopes) {\n registerScopes('my-org', requirements.myOrganizationApiScopes);\n }\n }, [requirements.myAccountApiScopes, requirements.myOrganizationApiScopes, registerScopes]);\n\n if (\n (requirements.myAccountApiScopes && !meEnsured) ||\n (requirements.myOrganizationApiScopes && !organizationEnsured)\n ) {\n return <>{loader || defaultLoader}</>;\n }\n\n return <WrappedComponent {...props} />;\n };\n\n return WithServicesComponent;\n}\n\nexport function withMyOrganizationService<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n scopes: string,\n): React.ComponentType<P> {\n return withServices(WrappedComponent, { myOrganizationApiScopes: scopes });\n}\n\nexport function withMyAccountService<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n scopes: string,\n): React.ComponentType<P> {\n return withServices(WrappedComponent, { myAccountApiScopes: scopes });\n}\n",
341341
"type": "registry:file",
342342
"target": "auth0-ui-components/hoc/with-services.tsx"
343343
},

0 commit comments

Comments
 (0)