fix(ui): Reload policies on activate / deactivate (#5107)

This commit is contained in:
Ankit keshari 2022-06-08 00:09:26 +05:30 committed by GitHub
parent 51854a768d
commit 68e74f292f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 14 deletions

View File

@ -256,7 +256,7 @@ export const ManagePolicies = () => {
deletePolicy({ variables: { urn: policy?.urn as string } }); // There must be a focus policy urn.
setTimeout(function () {
policiesRefetch();
}, 2000);
}, 3000);
onCancelViewPolicy();
},
onCancel() {},
@ -283,6 +283,9 @@ export const ManagePolicies = () => {
input: toPolicyInput(newPolicy),
},
});
setTimeout(function () {
policiesRefetch();
}, 3000);
setShowViewPolicyModal(false);
};
@ -297,7 +300,7 @@ export const ManagePolicies = () => {
message.success('Successfully saved policy.');
setTimeout(function () {
policiesRefetch();
}, 2000);
}, 3000);
onClosePolicyBuilder();
};
@ -461,7 +464,7 @@ export const ManagePolicies = () => {
dataSource={tableData}
rowKey="urn"
locale={{
emptyText: <Empty description="No Ingestion Sources!" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
emptyText: <Empty description="No Policies!" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
}}
pagination={false}
/>

View File

@ -36,10 +36,6 @@ const SearchResultContent = styled.div`
align-items: center;
`;
const SearchResultDisplayName = styled.div`
margin-right: 8px;
`;
/**
* Component used to construct the "actors" portion of a DataHub
* access Policy by populating an ActorFilter object.
@ -160,14 +156,12 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
<SearchResultContainer>
<SearchResultContent>
<CustomAvatar
size={18}
size={24}
name={displayName}
photoUrl={avatarUrl}
isGroup={result.entity.type === EntityType.CorpGroup}
/>
<SearchResultDisplayName>
<div>{displayName}</div>
</SearchResultDisplayName>
<div>{displayName}</div>
</SearchResultContent>
</SearchResultContainer>
);
@ -186,7 +180,7 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
const tagRender = (props) => {
// eslint-disable-next-line react/prop-types
const { label, closable, onClose } = props;
const { label, closable, onClose, value } = props;
const onPreventMouseDown = (event) => {
event.preventDefault();
event.stopPropagation();
@ -197,7 +191,7 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
closable={closable}
onClose={onClose}
style={{
padding: '0px 7px 0px 0px',
padding: value === 'All' ? '0px 7px 0px 7px' : '0px 7px 0px 0px',
marginRight: 3,
display: 'flex',
justifyContent: 'start',

View File

@ -246,7 +246,7 @@ export const AccessTokens = () => {
dataSource={tableData}
rowKey="urn"
locale={{
emptyText: <Empty description="No Ingestion Sources!" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
emptyText: <Empty description="No Access Tokens!" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
}}
pagination={false}
/>