Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resign the policy tab #4232

Merged

Conversation

Ankit-Keshari-Vituity
Copy link
Contributor

"Redesign the Policies tab

  • Change the complete UI of policies Tab
  • Added a paragraph under Manage Policies --> Manage access for users & groups of DataHub using Policies
  • Add a Table instead of a list to show the data
  • Add columns Name, Type, Description, Actors, State, and Actions
  • Table Columns:
  • Name --> Clicking on name opens the details modal
  • Type --> "Platform" or "Metadata"
  • Description
  • Actors
  • State -> Active vs Inactive
  • Actions: Edit Policy, Deactivate / Activate Policy, Delete Policy

policy

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

@github-actions
Copy link

github-actions bot commented Feb 23, 2022

Unit Test Results (build & test)

  71 files  ±0    71 suites  ±0   11m 58s ⏱️ - 8m 40s
618 tests ±0  559 ✔️ +1  59 💤 ±0  0  - 1 

Results for commit 65b85cd. ± Comparison against base commit 77a2735.

♻️ This comment has been updated with latest results.

@Ankit-Keshari-Vituity
Copy link
Contributor Author

Fixed the CSS issue.

  • Border fix for state column
  • Tags for "All Users" and "All Groups" on the right side of AvatarGroup (if fields allUsers / allGroups are true)

policies_css

onClose={onCancelViewPolicy}
onRemove={onRemovePolicy}
onToggleActive={onToggleActive}
privileges={privileges}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we had a prop called

"getPrivilegeDisplayName(type: string) => string"

onClose: () => void;
onRemove: () => void;
onToggleActive: (value: boolean) => void;
privileges: any;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this type to Array

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Mar 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed and committed

/>
))}
</Col>
<Col flex={1} style={{ display: 'flex', justifyContent: 'end' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bring the "All Users" tag to the left at the end of the avatar row (same column)

/>
))}
</Col>
<Col flex={1} style={{ display: 'flex', justifyContent: 'end' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use styled components any time there is inline styling overrides

<ActionButtonContainer>
<Button
disabled={!record?.editable}
style={{ marginRight: 16 }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to styled components

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed and committed

/>
))}
</Col>
<Col flex={1} style={{ display: 'flex', justifyContent: 'end' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove inline styling

onClose={onCancelViewPolicy}
onRemove={onRemovePolicy}
onToggleActive={onToggleActive}
privileges={privileges}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

privileges={getPrivileges(focusPolicy)}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And remove the state

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed and committed

@@ -139,10 +173,31 @@ export const PoliciesPage = () => {
setShowPolicyBuilderModal(false);
};

const getPrivileges = (policy: Policy) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to "getPrivilegeNames"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed and committed


const tableData = policies?.map((policy) => ({
urn: policy?.urn,
policy,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this here? Or can we remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and committed

<PoliciesHeaderContainer>
<PoliciesTitle level={2}>Manage Policies</PoliciesTitle>
<Typography.Paragraph type="secondary">
Manage access for users & groups of DataHub using Policies.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Manage access for Users & Groups of DataHub using Policies."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed and committed

@shirshanka shirshanka merged commit d96241c into datahub-project:master Mar 4, 2022
maggiehays pushed a commit to maggiehays/datahub that referenced this pull request Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants