Skip to content

Commit

Permalink
fix(ui) Misc UI fixes & styling improvements. (#4311)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 authored Mar 4, 2022
1 parent 92b0e1c commit 9029292
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
public class EntityTypeMapper {

static final Map<EntityType, String> ENTITY_TYPE_TO_NAME =
ImmutableMap.<EntityType, String>builder().put(EntityType.DATASET, "dataset")
ImmutableMap.<EntityType, String>builder()
.put(EntityType.DATASET, "dataset")
.put(EntityType.CORP_USER, "corpuser")
.put(EntityType.CORP_GROUP, "corpGroup")
.put(EntityType.DATA_PLATFORM, "dataPlatform")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ private EntityType mapResourceTypeToEntityType(final String resourceType) {
return EntityType.DOMAIN;
} else if (com.linkedin.metadata.authorization.PoliciesConfig.CONTAINER_PRIVILEGES.getResourceType().equals(resourceType)) {
return EntityType.CONTAINER;
} else if (com.linkedin.metadata.authorization.PoliciesConfig.CORP_GROUP_PRIVILEGES.getResourceType().equals(resourceType)) {
return EntityType.CORP_GROUP;
} else if (com.linkedin.metadata.authorization.PoliciesConfig.CORP_USER_PRIVILEGES.getResourceType().equals(resourceType)) {
return EntityType.CORP_USER;
} else {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const TITLE = 'Owners';

const SectionWrapper = styled.div``;

const AddOwnerButton = styled(Button)`
padding-left: 0px;
`;
const AddOwnerButton = styled(Button)``;

type Props = {
ownership: Ownership;
Expand All @@ -39,10 +37,18 @@ export default function GroupOwnerSideBarSection({ urn, ownership, refetch }: Pr
{ownersEmpty && (
<Typography.Paragraph type="secondary">No group owners added yet.</Typography.Paragraph>
)}
<AddOwnerButton type={ownersEmpty ? 'default' : 'text'} onClick={() => setShowAddModal(true)}>
<PlusOutlined />
Add Owner
</AddOwnerButton>
{ownersEmpty && (
<AddOwnerButton onClick={() => setShowAddModal(true)}>
<PlusOutlined />
Add Owner
</AddOwnerButton>
)}
{!ownersEmpty && (
<AddOwnerButton type="text" style={{ padding: 0 }} onClick={() => setShowAddModal(true)}>
<PlusOutlined />
Add Owner
</AddOwnerButton>
)}
</SectionWrapper>
<AddOwnerModal
urn={urn}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const AddOwnerModal = ({ urn, type, visible, onClose, refetch }: Props) =
});
return (
<Modal
title="Add owner"
title="Add Owner"
visible={visible}
onCancel={onClose}
footer={
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/app/home/HomePageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const HeaderContainer = styled.div`
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 20px;
margin-bottom: 20px;
`;

Expand Down
12 changes: 9 additions & 3 deletions datahub-web-react/src/app/policy/PolicyActorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Props = {
};

const SearchResultContainer = styled.div`
display: flex;
display: flex;f
justify-content: space-between;
align-items: center;
padding: 12px;
Expand All @@ -29,6 +29,10 @@ const ActorFormHeader = styled.div`
margin-bottom: 28px;
`;

const ActorName = styled.div`
margin-right: 8px;
`;

/**
* Component used to construct the "actors" portion of a DataHub
* access Policy by populating an ActorFilter object.
Expand Down Expand Up @@ -142,14 +146,14 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
const renderSearchResult = (result: SearchResult) => {
return (
<SearchResultContainer>
{entityRegistry.getDisplayName(result.entity.type, result.entity)}
<ActorName>{entityRegistry.getDisplayName(result.entity.type, result.entity)}</ActorName>
<Link
target="_blank"
rel="noopener noreferrer"
to={() => `/${entityRegistry.getPathName(result.entity.type)}/${result.entity.urn}`}
>
View
</Link>{' '}
</Link>
</SearchResultContainer>
);
};
Expand Down Expand Up @@ -189,6 +193,7 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
<Select
value={usersSelectValue}
mode="multiple"
filterOption={false}
placeholder="Search for users..."
onSelect={(asset: any) => onSelectUserActor(asset)}
onDeselect={(asset: any) => onDeselectUserActor(asset)}
Expand Down Expand Up @@ -217,6 +222,7 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
onSelect={(asset: any) => onSelectGroupActor(asset)}
onDeselect={(asset: any) => onDeselectGroupActor(asset)}
onSearch={handleGroupSearch}
filterOption={false}
tagRender={(tagProps) => (
<Tag closable={tagProps.closable} onClose={tagProps.onClose}>
{tagProps.value}
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/app/policy/PolicyPrivilegeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export default function PolicyPrivilegeForm({
<Select
value={resourceSelectValue}
mode="multiple"
filterOption={false}
placeholder={`Search for ${selectedResourceDisplayName}...`}
onSelect={(asset: any) => onSelectResource(asset)}
onDeselect={(asset: any) => onDeselectResource(asset)}
Expand Down
4 changes: 2 additions & 2 deletions datahub-web-react/src/app/shared/ManageAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const MenuItem = styled(Menu.Item)`
`;

const DownArrow = styled(CaretDownOutlined)`
vertical-align: -5px;
font-size: 16px;
vertical-align: -3px;
font-size: 12px;
color: ${ANTD_GRAY[7]};
`;

Expand Down
22 changes: 11 additions & 11 deletions datahub-web-react/src/app/shared/admin/AdminHeaderLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ export function AdminHeaderLinks() {
</Link>
</AdminLink>
)}
{showPolicyBuilder && (
<AdminLink>
<Link to="/policies">
<Button type="text">
<BankOutlined /> Policies
</Button>
</Link>
</AdminLink>
)}
{showDomains && (
<AdminLink>
<Link to="/domains">
Expand Down Expand Up @@ -82,11 +73,20 @@ export function AdminHeaderLinks() {
</Link>
</AdminLink>
)}
{showSettings && (
{showPolicyBuilder && (
<AdminLink>
<Link to="/policies">
<Button type="text">
<BankOutlined /> Policies
</Button>
</Link>
</AdminLink>
)}
{showSettings && (
<AdminLink style={{ marginRight: 16 }}>
<Link to="/settings">
<Button type="text">
<SettingOutlined /> Settings
<SettingOutlined />
</Button>
</Link>
</AdminLink>
Expand Down
7 changes: 5 additions & 2 deletions metadata-service/war/src/main/resources/boot/policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@
"allGroups":false
},
"privileges":[
"VIEW_ANALYTICS",
"MANAGE_POLICIES",
"MANAGE_INGESTION",
"MANAGE_SECRETS",
"MANAGE_USERS_AND_GROUPS",
"GENERATE_PERSONAL_ACCESS_TOKENS"
"VIEW_ANALYTICS",
"GENERATE_PERSONAL_ACCESS_TOKENS",
"MANAGE_DOMAINS"
],
"displayName":"All Users - All Platform Privileges",
"description":"Grants full platform privileges to ALL users of DataHub. Change this policy to alter that behavior.",
Expand Down

0 comments on commit 9029292

Please sign in to comment.