Skip to content

Commit

Permalink
fix: Widgets tenant ID attribute (#879)
Browse files Browse the repository at this point in the history
## Related Issues

Fixes descope/etc#8808

## Related PRs

| branch       | PR         |
| ------------ | ---------- |
| service a PR | Link to PR |
| service b PR | Link to PR |

## Description

A few sentences describing the overall goals of the pull request's
commits.

## Must

- [ ] Tests
- [ ] Documentation (if applicable)
  • Loading branch information
tomerlichtash authored Jan 2, 2025
1 parent 9765056 commit 6b67f5e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions packages/sdks/react-sdk/src/components/AccessKeyManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const AccessKeyManagementWC = lazy(async () => {
return {
default: withPropsMapping(
React.forwardRef<HTMLElement>((props, ref) => (
<descope-access-key-management-widget ref={ref} {...props} />
<descope-access-key-management-widget ref={ref} {...props} />
)),
),
};
Expand All @@ -27,24 +27,24 @@ const AccessKeyManagement = React.forwardRef<
const { projectId, baseUrl, baseStaticUrl } = React.useContext(Context);

return (
<Suspense fallback={null}>
<AccessKeyManagementWC
<Suspense fallback={null}>
<AccessKeyManagementWC
projectId={projectId}
widgetId={widgetId}
tenant={tenant}
baseUrl={baseUrl}
baseStaticUrl={baseStaticUrl}
innerRef={setInnerRef}
{...{
// attributes
'tenant.attr': tenant,
'theme.attr': theme,
'debug.attr': debug,
'styleId.attr': styleId,
// props
'logger.prop': logger,
}}
/>
</Suspense>
</Suspense>
);
});

Expand Down
10 changes: 5 additions & 5 deletions packages/sdks/react-sdk/src/components/AuditManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const AuditManagementWC = lazy(async () => {
return {
default: withPropsMapping(
React.forwardRef<HTMLElement>((props, ref) => (
<descope-audit-management-widget ref={ref} {...props} />
<descope-audit-management-widget ref={ref} {...props} />
)),
),
};
Expand All @@ -25,24 +25,24 @@ const AuditManagement = React.forwardRef<HTMLElement, AuditManagementProps>(
const { projectId, baseUrl, baseStaticUrl } = React.useContext(Context);

return (
<Suspense fallback={null}>
<AuditManagementWC
<Suspense fallback={null}>
<AuditManagementWC
projectId={projectId}
widgetId={widgetId}
tenant={tenant}
baseUrl={baseUrl}
baseStaticUrl={baseStaticUrl}
innerRef={setInnerRef}
{...{
// attributes
'tenant.attr': tenant,
'theme.attr': theme,
'debug.attr': debug,
'styleId.attr': styleId,
// props
'logger.prop': logger,
}}
/>
</Suspense>
</Suspense>
);
},
);
Expand Down
10 changes: 5 additions & 5 deletions packages/sdks/react-sdk/src/components/RoleManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const RoleManagementWC = lazy(async () => {
return {
default: withPropsMapping(
React.forwardRef<HTMLElement>((props, ref) => (
<descope-role-management-widget ref={ref} {...props} />
<descope-role-management-widget ref={ref} {...props} />
)),
),
};
Expand All @@ -25,24 +25,24 @@ const RoleManagement = React.forwardRef<HTMLElement, RoleManagementProps>(
const { projectId, baseUrl, baseStaticUrl } = React.useContext(Context);

return (
<Suspense fallback={null}>
<RoleManagementWC
<Suspense fallback={null}>
<RoleManagementWC
projectId={projectId}
widgetId={widgetId}
tenant={tenant}
baseUrl={baseUrl}
baseStaticUrl={baseStaticUrl}
innerRef={setInnerRef}
{...{
// attributes
'tenant.attr': tenant,
'theme.attr': theme,
'debug.attr': debug,
'styleId.attr': styleId,
// props
'logger.prop': logger,
}}
/>
</Suspense>
</Suspense>
);
},
);
Expand Down
10 changes: 5 additions & 5 deletions packages/sdks/react-sdk/src/components/UserManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const UserManagementWC = lazy(async () => {
return {
default: withPropsMapping(
React.forwardRef<HTMLElement>((props, ref) => (
<descope-user-management-widget ref={ref} {...props} />
<descope-user-management-widget ref={ref} {...props} />
)),
),
};
Expand All @@ -25,24 +25,24 @@ const UserManagement = React.forwardRef<HTMLElement, UserManagementProps>(
const { projectId, baseUrl, baseStaticUrl } = React.useContext(Context);

return (
<Suspense fallback={null}>
<UserManagementWC
<Suspense fallback={null}>
<UserManagementWC
projectId={projectId}
widgetId={widgetId}
tenant={tenant}
baseUrl={baseUrl}
baseStaticUrl={baseStaticUrl}
ref={setInnerRef}
{...{
// attributes
'tenant.attr': tenant,
'theme.attr': theme,
'debug.attr': debug,
'styleId.attr': styleId,
// props
'logger.prop': logger,
}}
/>
</Suspense>
</Suspense>
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const apiMixin = createSingletonMixin(
this.logger.debug('creating an sdk instance');
this.#api = createSdk(
{ projectId: this.projectId, baseUrl: this.baseUrl },
this.tenant,
this.tenantId,
this.mock === 'true',
this.widgetId,
);
}

get tenant() {
get tenantId() {
return this.getAttribute('tenant');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const apiMixin = createSingletonMixin(
this.logger.debug('creating an sdk instance');
this.#api = createSdk(
{ projectId: this.projectId, baseUrl: this.baseUrl },
this.tenant,
this.tenantId,
this.mock === 'true',
this.widgetId,
);
}

get tenant() {
get tenantId() {
return this.getAttribute('tenant');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const apiMixin = createSingletonMixin(
this.logger.debug('creating an sdk instance');
this.#api = createSdk(
{ projectId: this.projectId, baseUrl: this.baseUrl },
this.tenant,
this.tenantId,
this.mock === 'true',
this.widgetId,
);
}

get tenant() {
get tenantId() {
return this.getAttribute('tenant');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const apiMixin = createSingletonMixin(
this.logger.debug('creating an sdk instance');
this.#api = createSdk(
{ projectId: this.projectId, baseUrl: this.baseUrl },
this.tenant,
this.tenantId,
this.mock === 'true',
this.widgetId,
);
}

get tenant() {
get tenantId() {
return this.getAttribute('tenant');
}

Expand Down

0 comments on commit 6b67f5e

Please sign in to comment.