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

feat(ui): add option to add picture link for groups #9882

Merged
merged 16 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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 @@ -7,6 +7,7 @@
import com.datahub.authorization.DisjunctivePrivilegeGroup;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.linkedin.common.url.Url;
import com.linkedin.common.urn.Urn;
import com.linkedin.common.urn.UrnUtils;
import com.linkedin.data.template.RecordTemplate;
Expand Down Expand Up @@ -232,6 +233,9 @@ private RecordTemplate mapCorpGroupEditableInfo(
if (input.getEmail() != null) {
result.setEmail(input.getEmail());
}
if (input.getPictureLink() != null) {
result.setPictureLink(new Url(input.getPictureLink()));
}
return result;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.linkedin.datahub.graphql.types.corpgroup.mappers;

import com.linkedin.data.template.GetMode;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.datahub.graphql.generated.CorpGroupEditableProperties;
import com.linkedin.datahub.graphql.types.mappers.ModelMapper;
import java.util.Objects;
import javax.annotation.Nonnull;

/**
Expand All @@ -29,6 +31,9 @@ public CorpGroupEditableProperties apply(
result.setDescription(corpGroupEditableInfo.getDescription(GetMode.DEFAULT));
result.setSlack(corpGroupEditableInfo.getSlack(GetMode.DEFAULT));
result.setEmail(corpGroupEditableInfo.getEmail(GetMode.DEFAULT));
result.setPictureLink(
(Objects.requireNonNull(corpGroupEditableInfo.getPictureLink(GetMode.DEFAULT))).toString());

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens for existing cases where picture link might not be set? Have you tested opening the UI for an existing group?

return result;
}
}
10 changes: 10 additions & 0 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4072,6 +4072,11 @@ type CorpGroupEditableProperties {
Email address for the group
"""
email: String

"""
A URL which points to a picture which user wants to set as a profile photo
"""
pictureLink: String
}

"""
Expand All @@ -4092,6 +4097,11 @@ input CorpGroupUpdateInput {
Email address for the group
"""
email: String

"""
A URL which points to a picture which user wants to set as a profile photo
"""
pictureLink: String
}

"""
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/graphql/group.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ query getGroup($urn: String!, $membersCount: Int!) {
description
slack
email
pictureLink
}
properties {
displayName
Expand Down
13 changes: 6 additions & 7 deletions smoke-test/tests/cypress/cypress/e2e/settings/managing_groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ describe("create and manage group", () => {
});

it("update group info", () => {
var expected_name = Cypress.env('ADMIN_USERNAME');
cy.loginWithCredentials();
cy.visit("/settings/identities/groups");
cy.clickOptionWithText(group_name);
Expand All @@ -79,14 +78,14 @@ describe("create and manage group", () => {
cy.waitTextVisible("Changes saved.");
cy.contains("Test group description EDITED").should("be.visible");
cy.clickOptionWithText("Add Owners");
cy.contains("Search for users or groups...").click({ force: true });
cy.focused().type(expected_name);
cy.get(".ant-select-item-option").contains(expected_name, { matchCase: false }).click();
cy.get('[id="owner"]').click({ force: true });
cy.focused().type(username);
cy.get(".ant-select-item-option").contains(username, { matchCase: false }).click();
cy.focused().blur();
cy.contains(expected_name, { matchCase: false }).should("have.length", 1);
cy.contains(username, { matchCase: false }).should("have.length", 1);
cy.get('[role="dialog"] button').contains("Done").click();
cy.waitTextVisible("Owners Added");
cy.contains(expected_name, { matchCase: false }).should("be.visible");
cy.contains(username, { matchCase: false }).should("be.visible");
cy.clickOptionWithText("Edit Group");
cy.waitTextVisible("Edit Profile");
cy.get("#email").type(`${test_id}@testemail.com`);
Expand All @@ -97,7 +96,7 @@ describe("create and manage group", () => {
cy.waitTextVisible(`#${test_id}`);
});

it("test user verify group participation", () => {
it("test User verify group participation", () => {
cy.loginWithCredentials();
cy.visit("/settings/identities/groups");
cy.hideOnboardingTour();
Expand Down
Loading