mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-19 06:38:04 +00:00
fix(ui): Reload policies on activate / deactivate (#5107)
This commit is contained in:
parent
51854a768d
commit
68e74f292f
@ -256,7 +256,7 @@ export const ManagePolicies = () => {
|
|||||||
deletePolicy({ variables: { urn: policy?.urn as string } }); // There must be a focus policy urn.
|
deletePolicy({ variables: { urn: policy?.urn as string } }); // There must be a focus policy urn.
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
policiesRefetch();
|
policiesRefetch();
|
||||||
}, 2000);
|
}, 3000);
|
||||||
onCancelViewPolicy();
|
onCancelViewPolicy();
|
||||||
},
|
},
|
||||||
onCancel() {},
|
onCancel() {},
|
||||||
@ -283,6 +283,9 @@ export const ManagePolicies = () => {
|
|||||||
input: toPolicyInput(newPolicy),
|
input: toPolicyInput(newPolicy),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
setTimeout(function () {
|
||||||
|
policiesRefetch();
|
||||||
|
}, 3000);
|
||||||
setShowViewPolicyModal(false);
|
setShowViewPolicyModal(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -297,7 +300,7 @@ export const ManagePolicies = () => {
|
|||||||
message.success('Successfully saved policy.');
|
message.success('Successfully saved policy.');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
policiesRefetch();
|
policiesRefetch();
|
||||||
}, 2000);
|
}, 3000);
|
||||||
onClosePolicyBuilder();
|
onClosePolicyBuilder();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -461,7 +464,7 @@ export const ManagePolicies = () => {
|
|||||||
dataSource={tableData}
|
dataSource={tableData}
|
||||||
rowKey="urn"
|
rowKey="urn"
|
||||||
locale={{
|
locale={{
|
||||||
emptyText: <Empty description="No Ingestion Sources!" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
|
emptyText: <Empty description="No Policies!" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
|
||||||
}}
|
}}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
|
@ -36,10 +36,6 @@ const SearchResultContent = styled.div`
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const SearchResultDisplayName = styled.div`
|
|
||||||
margin-right: 8px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component used to construct the "actors" portion of a DataHub
|
* Component used to construct the "actors" portion of a DataHub
|
||||||
* access Policy by populating an ActorFilter object.
|
* access Policy by populating an ActorFilter object.
|
||||||
@ -160,14 +156,12 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
|
|||||||
<SearchResultContainer>
|
<SearchResultContainer>
|
||||||
<SearchResultContent>
|
<SearchResultContent>
|
||||||
<CustomAvatar
|
<CustomAvatar
|
||||||
size={18}
|
size={24}
|
||||||
name={displayName}
|
name={displayName}
|
||||||
photoUrl={avatarUrl}
|
photoUrl={avatarUrl}
|
||||||
isGroup={result.entity.type === EntityType.CorpGroup}
|
isGroup={result.entity.type === EntityType.CorpGroup}
|
||||||
/>
|
/>
|
||||||
<SearchResultDisplayName>
|
|
||||||
<div>{displayName}</div>
|
<div>{displayName}</div>
|
||||||
</SearchResultDisplayName>
|
|
||||||
</SearchResultContent>
|
</SearchResultContent>
|
||||||
</SearchResultContainer>
|
</SearchResultContainer>
|
||||||
);
|
);
|
||||||
@ -186,7 +180,7 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
|
|||||||
|
|
||||||
const tagRender = (props) => {
|
const tagRender = (props) => {
|
||||||
// eslint-disable-next-line react/prop-types
|
// eslint-disable-next-line react/prop-types
|
||||||
const { label, closable, onClose } = props;
|
const { label, closable, onClose, value } = props;
|
||||||
const onPreventMouseDown = (event) => {
|
const onPreventMouseDown = (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
@ -197,7 +191,7 @@ export default function PolicyActorForm({ policyType, actors, setActors }: Props
|
|||||||
closable={closable}
|
closable={closable}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
style={{
|
style={{
|
||||||
padding: '0px 7px 0px 0px',
|
padding: value === 'All' ? '0px 7px 0px 7px' : '0px 7px 0px 0px',
|
||||||
marginRight: 3,
|
marginRight: 3,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'start',
|
justifyContent: 'start',
|
||||||
|
@ -246,7 +246,7 @@ export const AccessTokens = () => {
|
|||||||
dataSource={tableData}
|
dataSource={tableData}
|
||||||
rowKey="urn"
|
rowKey="urn"
|
||||||
locale={{
|
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}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user