Skip to content

Commit

Permalink
feat(ui) Make certain things disabled if read only mode is enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscollins3456 authored Sep 21, 2023
1 parent bf92092 commit ee7930b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const PageWrapper = styled.div`
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
`;

const Header = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default function UserEditProfileModal({ visible, onClose, onSave, editMod
placeholder="John Smith"
value={data.name}
onChange={(event) => setData({ ...data, name: event.target.value })}
disabled={readOnlyModeEnabled}
/>
</Form.Item>
<Form.Item
Expand All @@ -150,6 +151,7 @@ export default function UserEditProfileModal({ visible, onClose, onSave, editMod
placeholder="Data Analyst"
value={data.title}
onChange={(event) => setData({ ...data, title: event.target.value })}
disabled={readOnlyModeEnabled}
/>
</Form.Item>
<Tooltip
Expand Down Expand Up @@ -180,6 +182,7 @@ export default function UserEditProfileModal({ visible, onClose, onSave, editMod
placeholder="Product Engineering"
value={data.team}
onChange={(event) => setData({ ...data, team: event.target.value })}
disabled={readOnlyModeEnabled}
/>
</Form.Item>
<Form.Item
Expand All @@ -203,6 +206,7 @@ export default function UserEditProfileModal({ visible, onClose, onSave, editMod
placeholder="[email protected]"
value={data.email}
onChange={(event) => setData({ ...data, email: event.target.value })}
disabled={readOnlyModeEnabled}
/>
</Form.Item>
<Form.Item
Expand All @@ -215,6 +219,7 @@ export default function UserEditProfileModal({ visible, onClose, onSave, editMod
placeholder="john_smith"
value={data.slack}
onChange={(event) => setData({ ...data, slack: event.target.value })}
disabled={readOnlyModeEnabled}
/>
</Form.Item>
<Form.Item
Expand All @@ -236,6 +241,7 @@ export default function UserEditProfileModal({ visible, onClose, onSave, editMod
placeholder="444-999-9999"
value={data.phone}
onChange={(event) => setData({ ...data, phone: event.target.value })}
disabled={readOnlyModeEnabled}
/>
</Form.Item>
</Form>
Expand Down
3 changes: 2 additions & 1 deletion datahub-web-react/src/app/settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ export const SettingsPage = () => {
const isPoliciesEnabled = config?.policiesConfig.enabled;
const isIdentityManagementEnabled = config?.identityManagementConfig.enabled;
const isViewsEnabled = config?.viewsConfig.enabled;
const { readOnlyModeEnabled } = config.featureFlags;

const showPolicies = (isPoliciesEnabled && me && me?.platformPrivileges?.managePolicies) || false;
const showUsersGroups = (isIdentityManagementEnabled && me && me?.platformPrivileges?.manageIdentities) || false;
const showViews = isViewsEnabled || false;
const showOwnershipTypes = me && me?.platformPrivileges?.manageOwnershipTypes;
const showHomePagePosts = me && me?.platformPrivileges?.manageGlobalAnnouncements;
const showHomePagePosts = me && me?.platformPrivileges?.manageGlobalAnnouncements && !readOnlyModeEnabled;

return (
<PageContainer>
Expand Down

0 comments on commit ee7930b

Please sign in to comment.