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

Bring Multi-Tenancy capabilities to the new Console #6962

Merged
merged 49 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
251b465
Refactor `server` api file
brionmario Oct 7, 2024
398d03e
Refactor `server` model
brionmario Oct 7, 2024
bc0bfe9
Move `RemoteLoggingConfigForm` to organization settings
brionmario Oct 7, 2024
8fea75b
Move admin advisory and remote logging pages
brionmario Oct 7, 2024
df76464
Update `DefaultLayout`
brionmario Oct 7, 2024
f41bea1
Add root organization api functions
brionmario Oct 7, 2024
02b7009
Introduce `composeValidators` util to `@wso2is/form`
brionmario Oct 15, 2024
e761eea
Expose `FormProps` from `@wso2is/form`
brionmario Oct 15, 2024
11890db
Refactor the `composeValidators` import
brionmario Oct 15, 2024
7466a44
Move `getUsertoreUsernameValidationPattern` out to a util
brionmario Oct 15, 2024
2d8ef06
Increase tenant name max-width
brionmario Oct 16, 2024
3ac24b2
Refactor missing `getUsertoreUsernameValidationPattern` usage
brionmario Oct 16, 2024
edaabf9
Remove TODO block
brionmario Oct 16, 2024
5c305d2
Fix invalid type
brionmario Oct 16, 2024
31a8f4c
Move `apis` again
brionmario Oct 16, 2024
3663c2f
Create `addTenant` api function
brionmario Oct 16, 2024
1b0c17f
Refactor components
brionmario Oct 16, 2024
fdd7348
Implement basic tenant functionality
brionmario Oct 17, 2024
c4adb2a
Implement feature provider wrapper HOC
brionmario Oct 18, 2024
21b363a
Wrap App with `WithFeatureProviders`
brionmario Oct 18, 2024
7696033
Implement basic lazy loading functionalities
brionmario Oct 18, 2024
9affd2a
Add update capability
brionmario Oct 21, 2024
d12fa89
Update imports
brionmario Oct 21, 2024
b6a0f39
Fix TS issues
brionmario Oct 22, 2024
66e20b3
Revert`DISABLE_ESLINT_PLUGIN`
brionmario Oct 22, 2024
e94ce59
Remove un-used `DefaultLayout`
brionmario Oct 22, 2024
5d83a0a
Remove redundant stylesheet in `CustomTextFields` component
brionmario Oct 22, 2024
16056d1
Update `create` scope
brionmario Oct 22, 2024
ca263a2
Take `CloneIcon` from oxygen
brionmario Oct 22, 2024
38b9018
Add `Accept` header
brionmario Oct 22, 2024
fa2d337
Fix self review comments
brionmario Oct 22, 2024
795d70f
Remove `WithFeatureProviders`
brionmario Oct 22, 2024
5d96137
Move `TenantProvider` in to listing page
brionmario Oct 22, 2024
48bd3c3
Navigate back on deleted inside edit
brionmario Oct 22, 2024
3985078
Fix wording issues
brionmario Oct 22, 2024
7110b13
Move delete tenant to provider level
brionmario Oct 22, 2024
d50476e
Move disable tenant to provider level
brionmario Oct 22, 2024
ca0263f
Fix loading state
brionmario Oct 22, 2024
ae3219e
Fix tenant dropdown trigger issues
brionmario Oct 22, 2024
f587fc4
Update lock
brionmario Oct 22, 2024
6297ed7
Fix lint issues
brionmario Oct 22, 2024
a180671
Fix i18n
brionmario Oct 22, 2024
ff50eae
Add null checks
brionmario Oct 22, 2024
3633467
Fix placeholder issue
brionmario Oct 22, 2024
e9303e0
FIx lazy load
brionmario Oct 22, 2024
d54b53e
🦋 Add changeset
brionmario Oct 22, 2024
52a7fab
Fix empty placeholder showing during loading
brionmario Oct 22, 2024
4ab73d1
Fix ESLint issues
brionmario Oct 23, 2024
acfdd3c
Fix self review comments
brionmario Oct 23, 2024
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
77 changes: 77 additions & 0 deletions .changeset/dull-apricots-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
"@wso2is/admin.identity-verification-providers.v1": minor
"@wso2is/admin.remote-repository-configuration.v1": minor
"@wso2is/admin.alternative-login-identifier.v1": minor
"@wso2is/admin.authentication-flow-builder.v1": minor
"@wso2is/admin.organization-discovery.v1": minor
"@wso2is/admin.application-templates.v1": minor
"@wso2is/admin.server-configurations.v1": minor
"@wso2is/admin.saml2-configuration.v1": minor
"@wso2is/admin.username-validation.v1": minor
"@wso2is/admin.wsfed-configuration.v1": minor
"@wso2is/admin.identity-providers.v1": minor
"@wso2is/admin.session-management.v1": minor
"@wso2is/admin.workflow-approvals.v1": minor
"@wso2is/admin.application-roles.v1": minor
"@wso2is/admin.remote-userstores.v1": minor
"@wso2is/admin.console-settings.v1": minor
"@wso2is/admin.email-management.v1": minor
"@wso2is/admin.email-providers.v1": minor
"@wso2is/admin.email-templates.v1": minor
"@wso2is/admin.private-key-jwt.v1": minor
"@wso2is/admin.administrators.v1": minor
"@wso2is/admin.authentication.v1": minor
"@wso2is/admin.api-resources.v1": minor
"@wso2is/admin.api-resources.v2": minor
"@wso2is/admin.authorization.v1": minor
"@wso2is/admin.email-and-sms.v1": minor
"@wso2is/admin.impersonation.v1": minor
"@wso2is/admin.login-flow.ai.v1": minor
"@wso2is/admin.organizations.v1": minor
"@wso2is/admin.sms-providers.v1": minor
"@wso2is/admin.template-core.v1": minor
"@wso2is/admin.applications.v1": minor
"@wso2is/admin.certificates.v1": minor
"@wso2is/admin.feature-gate.v1": minor
"@wso2is/admin.org-insights.v1": minor
"@wso2is/admin.provisioning.v1": minor
"@wso2is/admin.subscription.v1": minor
"@wso2is/admin.branding.ai.v1": minor
"@wso2is/admin.connections.v1": minor
"@wso2is/admin.oidc-scopes.v1": minor
"@wso2is/admin.extensions.v1": minor
"@wso2is/admin.userstores.v1": minor
"@wso2is/admin.validation.v1": minor
"@wso2is/common.branding.v1": minor
"@wso2is/admin.branding.v1": minor
"@wso2is/admin.actions.v1": minor
"@wso2is/admin.secrets.v1": minor
"@wso2is/admin.tenants.v1": minor
"@wso2is/admin.claims.v1": minor
"@wso2is/admin.groups.v1": minor
"@wso2is/admin.server.v1": minor
"@wso2is/react-components": minor
"@wso2is/admin.roles.v1": minor
"@wso2is/admin.roles.v2": minor
"@wso2is/admin.users.v1": minor
"@wso2is/admin.administration.v1": minor
"@wso2is/admin.core.v1": minor
"@wso2is/admin.home.v1": minor
"@wso2is/admin.logs.v1": minor
"@wso2is/access-control": minor
"@wso2is/common.ai.v1": minor
"@wso2is/dynamic-forms": minor
"@wso2is/unit-testing": minor
"@wso2is/identity-apps-core": minor
"@wso2is/validation": minor
"@wso2is/myaccount": minor
"@wso2is/forms": minor
"@wso2is/theme": minor
"@wso2is/console": minor
"@wso2is/core": minor
"@wso2is/form": minor
"@wso2is/i18n": minor
"@wso2is/features": minor
---

Introduce Multi-Tenancy feature
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,36 @@
}
},
{% endif %}
{% if console.tenants is defined %}
"tenants": {
"disabledFeatures": [
{% if console.tenants.disabled_features is defined %}
{% for feature in console.tenants.disabled_features %}
"{{ feature }}"{{ "," if not loop.last }}
{% endfor %}
{% endif %}
],
"enabled": {% if console.tenants.enabled is defined %} {{ console.tenants.enabled }},
{% else %} true,
{% endif %}
"scopes": {
{% if console.tenants.scopes is defined %}
{% for operation, scopes in console.tenants.scopes.items() %}
"{{ operation }}": [
{% for scope in scopes %}
"{{ scope }}"{{ "," if not loop.last }}
{% endfor %}
]{{ "," if not loop.last }}
{% endfor %}
{% else %}
"create": [],
"read": [],
"update": [],
"delete": []
{% endif %}
}
},
{% endif %}
{% if console.try_it is defined %}
"tryIt": {
"disabledFeatures": [
Expand Down
31 changes: 31 additions & 0 deletions apps/console/src/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

:root {
// TODO: Move this to `@oxygen` and set the values from MUI theme spacing.
--oxygen-spacing: 8px;
--oxygen-spacing-1: calc(var(--oxygen-spacing) * 1);
--oxygen-spacing-2: calc(var(--oxygen-spacing) * 2);
--oxygen-spacing-3: calc(var(--oxygen-spacing) * 3);
--oxygen-spacing-4: calc(var(--oxygen-spacing) * 4);
--oxygen-spacing-5: calc(var(--oxygen-spacing) * 5);
--oxygen-spacing-6: calc(var(--oxygen-spacing) * 6);

--wso2is-admin-modal-form-max-width: 600px;
--wso2is-admin-form-max-width: 750px;
}
1 change: 1 addition & 0 deletions apps/console/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { Dispatch } from "redux";
import "moment/locale/si";
import "moment/locale/fr";
import { getBaseRoutes } from "./configs/routes";
import "./app.scss";

/**
* Main App component.
Expand Down
113 changes: 64 additions & 49 deletions apps/console/src/configs/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1056,34 +1056,6 @@ export const getAppViewRoutes = (): RouteInterface[] => {
{
category: "extensions:manage.sidePanel.categories.settings",
children: [
{
component: lazy(() =>
import("@wso2is/admin.server.v1/pages/admin-session-advisory-banner-page")
),
exact: true,
icon: {
icon: getSidePanelIcons().childIcon
},
id: "admin-session-advisory-banner-edit",
name: "Admin Session Advisory Banner",
path: AppConstants.getPaths().get("ADMIN_ADVISORY_BANNER_EDIT"),
protected: true,
showOnSidePanel: false
},
{
component: lazy(() =>
import("@wso2is/admin.server.v1/pages/remote-logging-page")
),
exact: true,
icon: {
icon: getSidePanelIcons().childIcon
},
id: "remote-logging",
name: "Remote Logging",
path: AppConstants.getPaths().get("REMOTE_LOGGING"),
protected: true,
showOnSidePanel: false
},
{
component: lazy(() =>
import("@wso2is/admin.server.v1/pages/internal-notification-sending-page")
Expand Down Expand Up @@ -1421,19 +1393,52 @@ export const getFullScreenViewRoutes = (): RouteInterface[] => {
* @returns
*/
export const getDefaultLayoutRoutes = (): RouteInterface[] => {
const routes: RouteInterface[] = [];

routes.push({
component: lazy(() => import("@wso2is/admin.core.v1/pages/privacy")),
icon: null,
id: "privacy",
name: "console:common.sidePanel.privacy",
path: AppConstants.getPaths().get("PRIVACY"),
protected: true,
showOnSidePanel: false
});

return routes;
return [
{
component: lazy(() => import("@wso2is/admin.core.v1/pages/privacy")),
icon: null,
id: "privacy",
name: "console:common.sidePanel.privacy",
path: AppConstants.getPaths().get("PRIVACY"),
protected: true,
showOnSidePanel: false
},
{
children: [
{
component: lazy(() => import("@wso2is/admin.tenants.v1/pages/system-settings-page")),
exact: true,
icon: null,
id: "systemSettings",
order: 2,
path: AppConstants.getPaths().get("SYSTEM_SETTINGS"),
protected: true,
showOnSidePanel: true
},
{
component: lazy(() => import("@wso2is/admin.tenants.v1/pages/edit-tenant-page")),
exact: true,
icon: null,
id: "editRootOrganization",
order: 1,
path: AppConstants.getPaths().get("EDIT_TENANT"),
protected: true,
showOnSidePanel: false
}
],
component: lazy(() => import("@wso2is/admin.tenants.v1/pages/tenants-page")),
exact: true,
icon: {
icon: getSidePanelIcons().administrators
},
id: "tenants",
name: "console:common.sidePanel.tenants",
order: 1,
path: AppConstants.getPaths().get("TENANTS"),
protected: true,
showOnSidePanel: false
}
];
};

/**
Expand Down Expand Up @@ -1530,17 +1535,19 @@ export const getAuthLayoutRoutes = (): RouteInterface[] => {
*
* @returns
*/
const getLayoutAssignedToRoutes = (routes: RouteInterface[], layout: FunctionComponent) => {
let modifiedRoutes: RouteInterface[] = [ ...routes ];

modifiedRoutes = modifiedRoutes.map((route: RouteInterface) => {
return {
const getLayoutAssignedToRoutes = (routes: RouteInterface[], layout: FunctionComponent): RouteInterface[] => {
return routes.map((route: RouteInterface) => {
const modifiedRoute: RouteInterface = {
...route,
component: layout
};
});

return modifiedRoutes;
if (route.children) {
modifiedRoute.children = getLayoutAssignedToRoutes(route.children, layout);
}

return modifiedRoute;
});
};

/**
Expand All @@ -1551,7 +1558,6 @@ const getLayoutAssignedToRoutes = (routes: RouteInterface[], layout: FunctionCom
export const getAppLayoutRoutes = (): RouteInterface[] => {
return [
...getLayoutAssignedToRoutes(getAuthLayoutRoutes(), AuthLayout),
...getLayoutAssignedToRoutes(getDefaultLayoutRoutes(), DefaultLayout),
...getLayoutAssignedToRoutes(getErrorLayoutRoutes(), ErrorLayout),
{
component: FullScreenLayout,
Expand All @@ -1562,6 +1568,15 @@ export const getAppLayoutRoutes = (): RouteInterface[] => {
protected: false,
showOnSidePanel: false
},
{
component: DefaultLayout,
icon: null,
id: "default",
name: "Default",
path: AppConstants.getDefaultLayoutBasePath(),
protected: false,
showOnSidePanel: false
},
{
component: DashboardLayout,
icon: null,
Expand Down
21 changes: 21 additions & 0 deletions apps/console/src/layouts/default-layout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.default-layout-content {
padding: 2% 5%;
}
Loading
Loading