Skip to content

Commit

Permalink
Merge pull request #3563 from uselagoon/group_org_update
Browse files Browse the repository at this point in the history
Change: Updates Organization Groups
  • Loading branch information
tobybellwood authored Oct 11, 2023
2 parents 06f6da1 + 9a3b073 commit 3873114
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
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

0 comments on commit 3873114

Please sign in to comment.