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

Change: Updates Organization Groups #3563

Merged
merged 6 commits into from
Oct 11, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mutation PopulateApi {
id
}

UIOrganizationGroup: addGroup(
UIOrganizationGroup: addGroupToOrganization(
input: { name: "organization-group1", organization: 1}
) {
id
Expand Down
5 changes: 3 additions & 2 deletions services/api/src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const {
getProjectsByOrganizationId,
addProjectToOrganization,
removeProjectFromOrganization,
addGroupToOrganization,
addExistingGroupToOrganization,
getGroupsByOrganizationsProject,
getGroupCountByOrganizationProject,
getProjectGroupOrganizationAssociation, // WIP resolver
Expand Down Expand Up @@ -706,7 +706,8 @@ const resolvers = {
addOrganization,
updateOrganization,
deleteOrganization,
addGroupToOrganization,
addGroupToOrganization: addGroup,
addExistingGroupToOrganization,
addProjectToOrganization,
removeProjectFromOrganization,
addDeployTargetToOrganization,
Expand Down
2 changes: 1 addition & 1 deletion services/api/src/resources/organization/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ export const getGroupProjectOrganizationAssociation: ResolverFn = async (
// add an existing group to an organization
// this function will return errors if there are projects in the group that are not in the organization
// if there are no projects in the organization, and no projects in the group then it will succeed
export const addGroupToOrganization: ResolverFn = async (
export const addExistingGroupToOrganization: ResolverFn = async (
_root,
{ input },
{ models, sqlClientPool, hasPermission, userActivityLogger }
Expand Down
19 changes: 14 additions & 5 deletions services/api/src/typeDefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ const typeDefs = gql`
deployTargets: [Openshift]
projects: [OrgProject]
environments: [OrgEnvironment]
groups: [GroupInterface]
groups: [OrgGroupInterface]
owners: [OrgUser]
notifications(type: NotificationType): [Notification]
}
Expand Down Expand Up @@ -1121,7 +1121,7 @@ const typeDefs = gql`
id: Int
name: String
organization: Int
groups: [GroupInterface]
groups: [OrgGroupInterface]
groupCount: Int
notifications: [OrganizationNotification]
}
Expand Down Expand Up @@ -1417,7 +1417,7 @@ const typeDefs = gql`
"""
organizationById(id: Int!): Organization
organizationByName(name: String!): Organization
getGroupProjectOrganizationAssociation(input: AddGroupInput!): String
getGroupProjectOrganizationAssociation(input: AddGroupToOrganizationInput!): String
getProjectGroupOrganizationAssociation(input: ProjectOrgGroupsInput!): String
getEnvVariablesByProjectEnvironmentName(input: EnvVariableByProjectEnvironmentNameInput!): [EnvKeyValue]
}
Expand Down Expand Up @@ -2176,7 +2176,12 @@ const typeDefs = gql`
input AddGroupInput {
name: String!
parentGroup: GroupInput
organization: Int
}

input AddGroupToOrganizationInput {
name: String!
organization: Int!
parentGroup: GroupInput
addOrgOwner: Boolean
}

Expand Down Expand Up @@ -2420,7 +2425,11 @@ const typeDefs = gql`
"""
Add a group to an organization
"""
addGroupToOrganization(input: AddGroupInput!): GroupInterface
addGroupToOrganization(input: AddGroupToOrganizationInput!): OrgGroupInterface
"""
Add an existing group to an organization
"""
addExistingGroupToOrganization(input: AddGroupToOrganizationInput!): OrgGroupInterface
"""
Add a project to an organization, will return an error if it can't easily do it
"""
Expand Down