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

[UISAUTHCOM-42] Disable hyperlinks for user names in role details page if user doesn't have access to Users module #64

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [UISAUTHCOM-39](https://folio-org.atlassian.net/browse/UISAUTHCOM-39) Enforce new "manage" permission set and hide action menu if no actions are available.
* [UISAUTHCOM-40](https://folio-org.atlassian.net/browse/UISAUTHCOM-40) Add ability to select entire columns of capabilities in each capability/capabilitySet grid/accordion.
* [UISAUTHCOM-41](https://folio-org.atlassian.net/browse/UISAUTHCOM-41) Fix disabled the issue with capabilities included in capability set are not deselected when deselecting a set.
* [UISAUTHCOM-42](https://folio-org.atlassian.net/browse/UISAUTHCOM-42) Disable hyperlinks for user names in role details page if user doesn't have access to Users module.

## [1.0.0](https://github.com/folio-org/stripes-authorization-components/tree/v1.0.0) (2024-11-01)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import keyBy from 'lodash/keyBy';
import PropTypes from 'prop-types';
import { useMemo } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';

import {
Accordion,
Badge,
Loading,
MultiColumnList,
NoValue,
TextLink,
ConfirmationModal,
} from '@folio/stripes/components';

import { FormattedMessage, useIntl } from 'react-intl';

import { LinkedUser } from '@folio/stripes/smart-components';
import { getFullName } from '@folio/stripes/util';

import { useMemo } from 'react';
import {
useUserGroups,
useAssignUsersFlow, useUsersByRoleId
Expand Down Expand Up @@ -46,12 +44,7 @@ export const RoleDetailsUsersAccordion = ({ roleId, tenantId }) => {
});

const usersData = sortedUsers.map(i => {
const fullName = (
<TextLink to={`/users/preview/${i.id}?query=${i.username}`}>
{getFullName(i)}
</TextLink>
);

const fullName = (<LinkedUser user={i} />);
const patronGroup = groupHash[i.patronGroup]?.group || <NoValue />;

return {
Expand Down
1 change: 1 addition & 0 deletions test/jest/__mock__/stripesSmartComponents.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';

jest.mock('@folio/stripes/smart-components', () => ({
...jest.requireActual('@folio/stripes/smart-components'),
LinkedUser: (user) => <a href="/">{JSON.stringify(user)}</a>,
LocationLookup: () => <div>LocationLookup</div>,
ViewMetaData: () => <div>ViewMetaData</div>,
ControlledVocab: jest.fn(() => <div>ControlledVocab</div>),
Expand Down
Loading