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

Fix some circular dependencies #7236

Merged
merged 4 commits into from
Jan 10, 2025
Merged
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
11 changes: 11 additions & 0 deletions .changeset/bright-rings-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@wso2is/admin.applications.v1": patch
"@wso2is/admin.validation.v1": patch
"@wso2is/admin.groups.v1": patch
"@wso2is/admin.roles.v2": patch
"@wso2is/admin.users.v1": patch
"@wso2is/admin.core.v1": patch
"@wso2is/forms": patch
---

Fix some circular dependencies
2 changes: 1 addition & 1 deletion features/admin.applications.v1/models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import { FeatureStatusLabel } from "@wso2is/admin.feature-gate.v1/models/feature-status";
import { GenericAuthenticatorInterface } from "@wso2is/admin.identity-providers.v1/models/identity-provider";
import { AssociatedRolesInterface } from "@wso2is/admin.roles.v2/models";
import { AssociatedRolesInterface } from "@wso2is/admin.roles.v2/models/roles";
import { LinkInterface } from "@wso2is/core/models";
import {
OIDCDataInterface,
Expand Down
2 changes: 1 addition & 1 deletion features/admin.core.v1/components/groups/assign-groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import { GroupsInterface } from "@wso2is/admin.groups.v1";
import { GroupsInterface } from "@wso2is/admin.groups.v1/models/groups";
import { PRIMARY_USERSTORE } from "@wso2is/admin.userstores.v1/constants";
import { RolesInterface } from "@wso2is/core/models";
import { StringUtils } from "@wso2is/core/utils";
Expand Down
2 changes: 1 addition & 1 deletion features/admin.core.v1/configs/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { getConnectionResourceEndpoints } from "@wso2is/admin.connections.v1";
import { getEmailTemplatesResourceEndpoints } from "@wso2is/admin.email-templates.v1";
import { getExtendedFeatureResourceEndpoints } from "@wso2is/admin.extensions.v1/configs/endpoints";
import { getFeatureGateResourceEndpoints } from "@wso2is/admin.feature-gate.v1/configs/endpoints";
import { getGroupsResourceEndpoints } from "@wso2is/admin.groups.v1";
import { getGroupsResourceEndpoints } from "@wso2is/admin.groups.v1/configs/endpoints";
import { getIDVPResourceEndpoints } from "@wso2is/admin.identity-verification-providers.v1/configs/endpoints";
import { getScopesResourceEndpoints } from "@wso2is/admin.oidc-scopes.v1";
import { getInsightsResourceEndpoints } from "@wso2is/admin.org-insights.v1/config/org-insights";
Expand Down
2 changes: 1 addition & 1 deletion features/admin.core.v1/models/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { BrandingPreferenceResourceEndpointsInterface } from "@wso2is/admin.bran
import { CertificatesResourceEndpointsInterface } from "@wso2is/admin.certificates.v1";
import { ClaimResourceEndpointsInterface } from "@wso2is/admin.claims.v1/models/endpoints";
import { ConnectionResourceEndpointsInterface } from "@wso2is/admin.connections.v1";
import { GroupsResourceEndpointsInterface } from "@wso2is/admin.groups.v1";
import { GroupsResourceEndpointsInterface } from "@wso2is/admin.groups.v1/models/endpoints";
import { ScopesResourceEndpointsInterface } from "@wso2is/admin.oidc-scopes.v1";
import { OrganizationResourceEndpointsInterface } from "@wso2is/admin.organizations.v1/models";
import { RolesResourceEndpointsInterface } from "@wso2is/admin.roles.v2/models/endpoints";
Expand Down
2 changes: 1 addition & 1 deletion features/admin.groups.v1/api/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
GroupsInterface,
PatchGroupDataInterface,
SearchGroupInterface
} from "../models";
} from "../models/groups";

/**
* Initialize an axios Http client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { Dispatch } from "redux";
import { Grid, Modal } from "semantic-ui-react";
import { GroupsInterface } from "../../models";
import { GroupsInterface } from "../../models/groups";

/**
* Proptypes for the group users list component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { useDispatch } from "react-redux";
import { Dispatch } from "redux";
import { Button, Divider, Form, Grid } from "semantic-ui-react";
import { deleteGroupById, searchGroupList, updateGroupDetails } from "../../api";
import { GroupsInterface, PatchGroupDataInterface, SearchGroupInterface } from "../../models";
import { GroupsInterface, PatchGroupDataInterface, SearchGroupInterface } from "../../models/groups";

/**
* Interface to contain props needed for component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import React, {
} from "react";
import { useTranslation } from "react-i18next";
import { Divider } from "semantic-ui-react";
import { GroupsInterface } from "../../models";
import { GroupsInterface } from "../../models/groups";
import "./edit-group-roles.scss";

interface EditGroupRolesPropsInterface extends IdentifiableComponentInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { Dispatch } from "redux";
import { Divider, DropdownProps, Header, Icon, PaginationProps, SemanticICONS } from "semantic-ui-react";
import { AddGroupUserModal } from "./add-group-user-modal";
import { updateGroupDetails } from "../../api";
import { CreateGroupMemberInterface, GroupsInterface, PatchGroupDataInterface } from "../../models";
import { CreateGroupMemberInterface, GroupsInterface, PatchGroupDataInterface } from "../../models/groups";
import "./edit-group-users.scss";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { EditGroupRoles } from "./edit-group-roles";
import { GroupUsersList } from "./edit-group-users";
import { GroupConstants } from "../../constants";
import useGroupManagement from "../../hooks/use-group-management";
import { GroupsInterface } from "../../models";
import { GroupsInterface } from "../../models/groups";

/**
* Captures props needed for edit group component
Expand Down
2 changes: 1 addition & 1 deletion features/admin.groups.v1/components/group-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { useTranslation } from "react-i18next";
import { useSelector } from "react-redux";
import { Header, Icon, Label, SemanticICONS } from "semantic-ui-react";
import { GroupConstants } from "../constants";
import { GroupsInterface } from "../models";
import { GroupsInterface } from "../models/groups";

interface GroupListProps extends SBACInterface<FeatureConfigInterface>,
LoadableComponentInterface, TestableComponentInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
BasicRoleInterface,
PatchRoleDataInterface,
RolesV2Interface
} from "@wso2is/admin.roles.v2/models";
} from "@wso2is/admin.roles.v2/models/roles";
import { UserBasicInterface } from "@wso2is/admin.users.v1/models";
import { CONSUMER_USERSTORE, PRIMARY_USERSTORE } from "@wso2is/admin.userstores.v1/constants";
import { isFeatureEnabled } from "@wso2is/core/helpers";
Expand Down Expand Up @@ -59,7 +59,7 @@ import {
WizardStateInterface,
WizardStepInterface,
WizardStepsFormTypes
} from "../../models";
} from "../../models/groups";

/**
* Interface which captures create group props.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { useDispatch } from "react-redux";
import { Dispatch as ReduxDispatch } from "redux";
import { Header, Segment } from "semantic-ui-react";
import { GroupBasics } from "./group-basics";
import { GroupsMemberInterface } from "../../models";
import { GroupsMemberInterface } from "../../models/groups";

/**
* Proptypes for the application consents list component.
Expand Down
3 changes: 2 additions & 1 deletion features/admin.groups.v1/components/wizard/group-basics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import { useTranslation } from "react-i18next";
import { useDispatch, useSelector } from "react-redux";
import { Dispatch } from "redux";
import { DropdownItemProps, Grid, GridColumn, GridRow } from "semantic-ui-react";
import { CreateGroupFormData, SearchGroupInterface, searchGroupList } from "../..";
import { searchGroupList } from "../../api";
import { CreateGroupFormData, SearchGroupInterface } from "../../models/groups";

/**
* Interface to capture group basics props.
Expand Down
8 changes: 4 additions & 4 deletions features/admin.groups.v1/configs/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2020-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
Expand All @@ -16,13 +16,13 @@
* under the License.
*/

import { GroupsResourceEndpointsInterface } from "../models";
import { GroupsResourceEndpointsInterface } from "../models/endpoints";

/**
* Get the resource endpoints for the Group Management feature.
*
* @param {string} serverHost - Server Host.
* @return {GroupsResourceEndpointsInterface}
* @param serverHost - Server Host.
* @returns the resource endpoints
*/
export const getGroupsResourceEndpoints = (serverHost: string): GroupsResourceEndpointsInterface => {
return {
Expand Down
22 changes: 0 additions & 22 deletions features/admin.groups.v1/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion features/admin.groups.v1/models/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import { BasicRoleInterface } from "@wso2is/admin.roles.v2/models";
import { BasicRoleInterface } from "@wso2is/admin.roles.v2/models/roles";
import { UserBasicInterface } from "@wso2is/admin.users.v1/models";
import { RolesMemberInterface } from "@wso2is/core/models";
import { GenericIconProps } from "@wso2is/react-components";
Expand Down
20 changes: 0 additions & 20 deletions features/admin.groups.v1/models/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion features/admin.groups.v1/pages/group-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import React, { FunctionComponent, ReactElement, useEffect, useState } from "rea
import { useTranslation } from "react-i18next";
import { getGroupById } from "../api";
import { EditGroup } from "../components";
import { GroupsInterface } from "../models";
import { GroupsInterface } from "../models/groups";
import GroupManagementProvider from "../providers/group-management-provider";

const GroupEditPage: FunctionComponent<any> = (): ReactElement => {
Expand Down
2 changes: 1 addition & 1 deletion features/admin.groups.v1/pages/groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import { Dropdown, DropdownItemProps, DropdownProps, Icon, PaginationProps } fro
import { deleteGroupById, useGroupList } from "../api";
import { GroupList } from "../components";
import { CreateGroupWizard } from "../components/wizard/create-group-wizard";
import { GroupsInterface, WizardStepsFormTypes } from "../models";
import { GroupsInterface, WizardStepsFormTypes } from "../models/groups";

const GROUPS_SORTING_OPTIONS: DropdownItemProps[] = [
{
Expand Down
4 changes: 2 additions & 2 deletions features/admin.roles.v2/api/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import { IdentityAppsApiException } from "@wso2is/core/exceptions";
import { HttpMethods, RoleListInterface, RolesInterface } from "@wso2is/core/models";
import { AxiosError, AxiosResponse } from "axios";
import { RoleAudienceTypes } from "../constants/role-constants";
import { APIResourceInterface, APIResourceListInterface, AuthorizedAPIListItemInterface } from "../models/apiResources";
import {
CreateRoleInterface,
PatchRoleDataInterface,
RolesV2ResponseInterface,
SearchRoleInterface
} from "../models";
import { APIResourceInterface, APIResourceListInterface, AuthorizedAPIListItemInterface } from "../models/apiResources";
} from "../models/roles";

/**
* Initialize an axios Http client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import {
PatchGroupAddOpInterface,
PatchGroupRemoveOpInterface
} from "@wso2is/admin.groups.v1";
} from "@wso2is/admin.groups.v1/models/groups";
import { useIdentityProviderList } from "@wso2is/admin.identity-providers.v1/api/identity-provider";
import { IdentityProviderInterface, StrictIdentityProviderInterface } from "@wso2is/admin.identity-providers.v1/models";
import { AlertLevels, IdentifiableComponentInterface, RoleGroupsInterface } from "@wso2is/core/models";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ import { RenderChip } from "./edit-role-common/render-chip";
import { RoleAPIResourcesListItem } from "./edit-role-common/role-api-resources-list-item";
import { getAPIResourceDetailsBulk, updateRoleDetails, useAPIResourceDetails } from "../../api";
import { RoleAudienceTypes } from "../../constants/role-constants";
import { PatchRoleDataInterface, PermissionUpdateInterface, SelectedPermissionsInterface } from "../../models";
import { APIResourceInterface, AuthorizedAPIListItemInterface, ScopeInterface } from "../../models/apiResources";
import { PatchRoleDataInterface, PermissionUpdateInterface, SelectedPermissionsInterface } from "../../models/roles";

/**
* Interface to capture permission edit props.
Expand Down
18 changes: 9 additions & 9 deletions features/admin.roles.v2/components/role-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2020-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
Expand All @@ -16,22 +16,22 @@
* under the License.
*/

import { PermissionObject, TreeNode } from "../models";
import { PermissionObject, TreeNode } from "../models/permission";

/**
* A Util method to create an array of permission object with heirarchy.
*
*
* @param permissioObject - Permission Object
* @param pathComponents - Permission Path Array
* @param permissionTreeArray - Permission Tree array for reference
*
* @returns {TreeNode[]} - Permission array with tree structure
*
* @returns Permission array with tree structure
*/
export const generatePermissionTree = (permissioObject: PermissionObject, pathComponents: string[],
permissionTreeArray: TreeNode[]): TreeNode[] => {

const component = pathComponents.shift();
let permissionComponent = permissionTreeArray.find((permission: TreeNode) => {
const component: string = pathComponents.shift();
let permissionComponent: TreeNode = permissionTreeArray.find((permission: TreeNode) => {
return permission.name === component;
});

Expand All @@ -44,8 +44,8 @@ export const generatePermissionTree = (permissioObject: PermissionObject, pathCo
permissionTreeArray.push(permissionComponent);
}

if (pathComponents.length) {
generatePermissionTree(permissioObject, pathComponents,
if (pathComponents.length) {
generatePermissionTree(permissioObject, pathComponents,
permissionComponent.children || (permissionComponent.children = []));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { Trans, useTranslation } from "react-i18next";
import { DropdownProps } from "semantic-ui-react";
import useGetRolesList from "../../api/use-get-roles-list";
import { RoleAudienceTypes, RoleConstants } from "../../constants";
import { CreateRoleFormData } from "../../models";
import { CreateRoleFormData } from "../../models/roles";

const FORM_ID: string = "add-role-basics-form";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import React, { FunctionComponent, ReactElement, useEffect, useState } from "rea
import { useTranslation } from "react-i18next";
import { Button, Divider, Grid } from "semantic-ui-react";
import { RoleConstants } from "../../constants";
import { TreeNode } from "../../models";
import { TreeNode } from "../../models/permission";
import { RoleManagementUtils } from "../../utils";

/**
Expand Down
2 changes: 1 addition & 1 deletion features/admin.roles.v2/configs/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import { RolesResourceEndpointsInterface } from "../models";
import { RolesResourceEndpointsInterface } from "../models/endpoints";

/**
* Get the resource endpoints for the Role Management feature.
Expand Down
21 changes: 0 additions & 21 deletions features/admin.roles.v2/models/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion features/admin.roles.v2/models/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import { CreateGroupMemberInterface } from "@wso2is/admin.groups.v1/models";
import { CreateGroupMemberInterface } from "@wso2is/admin.groups.v1/models/groups";
import { SchemaAttributeValueInterface } from "@wso2is/admin.users.v1/models";
import { RolesInterface } from "@wso2is/core/models";
import { ScopeInterface } from "./apiResources";
Expand Down
Loading
Loading