fix(ui) Misc UI fixes & styling improvements. (#4311)

This commit is contained in:
John Joyce 2022-03-04 12:19:37 -08:00 committed by GitHub
parent 92b0e1c7c7
commit 902929293d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 49 additions and 27 deletions

View File

@ -13,7 +13,8 @@ import javax.annotation.Nonnull;
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")

View File

@ -114,6 +114,10 @@ public class AppConfigResolver implements DataFetcher<CompletableFuture<AppConfi
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;
}

View File

@ -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;
@ -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}

View File

@ -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={

View File

@ -43,6 +43,7 @@ const HeaderContainer = styled.div`
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 20px;
margin-bottom: 20px;
`;

View File

@ -13,7 +13,7 @@ type Props = {
};
const SearchResultContainer = styled.div`
display: flex;
display: flex;f
justify-content: space-between;
align-items: center;
padding: 12px;
@ -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.
@ -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>
);
};
@ -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)}
@ -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}

View File

@ -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)}

View File

@ -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]};
`;

View File

@ -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">
@ -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>

View File

@ -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.",