mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-28 02:17:53 +00:00
fix(ui) Misc UI fixes & styling improvements. (#4311)
This commit is contained in:
parent
92b0e1c7c7
commit
902929293d
@ -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")
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -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={
|
||||
|
||||
@ -43,6 +43,7 @@ const HeaderContainer = styled.div`
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
`;
|
||||
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -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)}
|
||||
|
||||
@ -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]};
|
||||
`;
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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.",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user