-
Notifications
You must be signed in to change notification settings - Fork 0
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-1: Move reusable components from UIROLES #2
Conversation
Jest Unit Test Statistics 1 files ± 0 36 suites +29 1m 27s ⏱️ +48s Results for commit 62e839d. ± Comparison against base commit 12d5592. This pull request removes 4 and adds 84 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
35a5f1d
to
0027de7
Compare
@folio-org/fe-tl-reviewers review it please |
@usavkov-epam @BogdanDenis please check the PR when you are available |
I'm not sure you need to create empty translation files, except |
I suppose it came from a branch update from the |
Before merging, please make sure one of the approvals belongs to developers from the Eureka team. |
lib/Capabilities/CapabilitiesAccordion/CapabilitiesAccordion.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a Capabilities-specific component, or can it be reused in other entities? If it's common, it makes sense to move it outside of Capabilities/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it is used with Capabilities
lib/hooks/useApplicationCapabilities/useApplicationCapabilities.js
Outdated
Show resolved
Hide resolved
lib/hooks/useApplicationCapabilities/useApplicationCapabilities.js
Outdated
Show resolved
Hide resolved
lib/RoleDetails/RoleDetailsAssignUsers/RoleDetailsAssignUsers.test.js
Outdated
Show resolved
Hide resolved
lib/RoleDetails/RoleDetailsAssignUsers/RoleDetailsAssignUsers.test.js
Outdated
Show resolved
Hide resolved
lib/RoleDetails/RoleDetailsCapabilitiesAccordion/RoleDetailsCapabilitiesAccordion.test.js
Outdated
Show resolved
Hide resolved
lib/RoleDetails/RoleDetailsCapabilitiesAccordion/RoleDetailsCapabilitiesAccordion.test.js
Outdated
Show resolved
Hide resolved
lib/RoleDetails/RoleDetailsCapabilitiesAccordion/RoleDetailsCapabilitiesAccordion.test.js
Outdated
Show resolved
Hide resolved
863f980
to
cefad2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides comments below, I don't see a reason to add compiled
translations
|
||
const columnMapping = useMemo(() => { | ||
return getColumnMapping(formatMessage); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependency missed
useApplicationCapabilities.mockReturnValue({ capabilities: { data:[{ id:'6e59c367-888a-4561-a3f3-3ca677de437f', | ||
applicationId:'app-platform-complete-0.0.5', | ||
resource:'Erm Agreements Collection', | ||
actions:{ view:'6e59c367-888a-4561-a3f3-3ca677de437f' } }, | ||
], | ||
procedural:[], | ||
settings:[{ id:'DDD-888a-4561-a3f3-3ca677de437f', | ||
applicationId:'app-platform-complete-0.0.5', | ||
resource:'Erm Agreements Collection', | ||
actions:{ view:'DDD-888a-4561-a3f3-3ca677de437f' } }] }, | ||
roleCapabilitiesListIds: ['5c5198f9-de27-4349-9537-dc0b2b41c8c3'], | ||
selectedCapabilitiesMap: { }, | ||
setSelectedCapabilitiesMap:mockSetSelectedCapabilitiesMap, | ||
isLoading: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useApplicationCapabilities.mockReturnValue({ capabilities: { data:[{ id:'6e59c367-888a-4561-a3f3-3ca677de437f', | |
applicationId:'app-platform-complete-0.0.5', | |
resource:'Erm Agreements Collection', | |
actions:{ view:'6e59c367-888a-4561-a3f3-3ca677de437f' } }, | |
], | |
procedural:[], | |
settings:[{ id:'DDD-888a-4561-a3f3-3ca677de437f', | |
applicationId:'app-platform-complete-0.0.5', | |
resource:'Erm Agreements Collection', | |
actions:{ view:'DDD-888a-4561-a3f3-3ca677de437f' } }] }, | |
roleCapabilitiesListIds: ['5c5198f9-de27-4349-9537-dc0b2b41c8c3'], | |
selectedCapabilitiesMap: { }, | |
setSelectedCapabilitiesMap:mockSetSelectedCapabilitiesMap, | |
isLoading: false }); | |
useApplicationCapabilities.mockReturnValue({ | |
capabilities: { | |
data: [{ | |
id: '6e59c367-888a-4561-a3f3-3ca677de437f', | |
applicationId: 'app-platform-complete-0.0.5', | |
resource: 'Erm Agreements Collection', | |
actions: { view: '6e59c367-888a-4561-a3f3-3ca677de437f' } | |
}], | |
procedural: [], | |
settings: [{ | |
id: 'DDD-888a-4561-a3f3-3ca677de437f', | |
applicationId: 'app-platform-complete-0.0.5', | |
resource: 'Erm Agreements Collection', | |
actions: { view: 'DDD-888a-4561-a3f3-3ca677de437f' } | |
}], | |
}, | |
roleCapabilitiesListIds: ['5c5198f9-de27-4349-9537-dc0b2b41c8c3'], | |
selectedCapabilitiesMap: {}, | |
setSelectedCapabilitiesMap: mockSetSelectedCapabilitiesMap, | |
isLoading: false, | |
}); |
lib/Role/RoleForm/RoleForm.js
Outdated
const paneFooterRenderStart = <Button | ||
marginBottom0 | ||
buttonStyle="default mega" | ||
onClick={onClose} | ||
><FormattedMessage id="stripes-authorization-components.crud.cancel" /> | ||
</Button>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const paneFooterRenderStart = <Button | |
marginBottom0 | |
buttonStyle="default mega" | |
onClick={onClose} | |
><FormattedMessage id="stripes-authorization-components.crud.cancel" /> | |
</Button>; | |
const paneFooterRenderStart = ( | |
<Button | |
marginBottom0 | |
buttonStyle="default mega" | |
onClick={onClose} | |
> | |
<FormattedMessage id="stripes-authorization-components.crud.cancel" /> | |
</Button>; | |
); |
lib/Role/RoleForm/RoleForm.js
Outdated
const paneFooterRenderEnd = <Button | ||
marginBottom0 | ||
buttonStyle="primary mega" | ||
disabled={!roleName || isLoading} | ||
type="submit" | ||
onClick={onSubmit} | ||
><FormattedMessage id="stripes-components.saveAndClose" /></Button>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const paneFooterRenderEnd = <Button | |
marginBottom0 | |
buttonStyle="primary mega" | |
disabled={!roleName || isLoading} | |
type="submit" | |
onClick={onSubmit} | |
><FormattedMessage id="stripes-components.saveAndClose" /></Button>; | |
const paneFooterRenderEnd = ( | |
<Button | |
marginBottom0 | |
buttonStyle="primary mega" | |
disabled={!roleName || isLoading} | |
type="submit" | |
onClick={onSubmit} | |
> | |
<FormattedMessage id="stripes-components.saveAndClose" /> | |
</Button> | |
); |
lib/Role/RoleForm/RoleForm.js
Outdated
const intl = useIntl(); | ||
|
||
return <form onSubmit={onSubmit} data-testid="create-role-form"> | ||
<Layer isOpen inRootSet contentLabel={intl.formatMessage({ id: title })}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Layer isOpen inRootSet contentLabel={intl.formatMessage({ id: title })}> | |
<Layer | |
isOpen | |
inRootSet | |
contentLabel={intl.formatMessage({ id: title })} | |
> |
const { data, isLoading, isSuccess } = useQuery( | ||
namespace, | ||
() => ky.get(`groups?limit=${stripes.config.maxUnpagedResourceCount}&query=cql.allRecords=1 sortby desc`).json(), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { data, isLoading, isSuccess } = useQuery( | |
namespace, | |
() => ky.get(`groups?limit=${stripes.config.maxUnpagedResourceCount}&query=cql.allRecords=1 sortby desc`).json(), | |
); | |
const { data, isLoading, isSuccess } = useQuery({ | |
queryKey: [namespace], | |
queryFn: ({ signal }) => ky.get(`groups?limit=${stripes.config.maxUnpagedResourceCount}&query=cql.allRecords=1 sortby desc`, { signal }).json(), | |
}); |
@@ -0,0 +1,20 @@ | |||
import { useQuery } from 'react-query'; | |||
|
|||
import { useNamespace, useOkapiKy, useStripes } from '@folio/stripes/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { useNamespace, useOkapiKy, useStripes } from '@folio/stripes/core'; | |
import { | |
useNamespace, | |
useOkapiKy, | |
useStripes, | |
} from '@folio/stripes/core'; |
lib/hooks/useUsers/useUsers.js
Outdated
import { keyBy } from 'lodash'; | ||
import { | ||
useChunkedCQLFetch, | ||
useNamespace, | ||
} from '@folio/stripes/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { keyBy } from 'lodash'; | |
import { | |
useChunkedCQLFetch, | |
useNamespace, | |
} from '@folio/stripes/core'; | |
import keyBy from 'lodash/keyBy'; | |
import { | |
useChunkedCQLFetch, | |
useNamespace, | |
} from '@folio/stripes/core'; |
test/jest/helpers/renderWithIntl.js
Outdated
import React from 'react'; | ||
import { render } from '@folio/jest-config-stripes/testing-library/react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import React from 'react'; | |
import { render } from '@folio/jest-config-stripes/testing-library/react'; | |
import { render } from '@folio/jest-config-stripes/testing-library/react'; |
@@ -0,0 +1,12 @@ | |||
import React from 'react'; | |||
import { Router } from 'react-router-dom'; | |||
import { createMemoryHistory } from 'history'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linter error: not listed dependency
3d457e4
to
ad3ffe6
Compare
Quality Gate passedIssues Measures |
@usavkov-epam thank you for the feedback. I have fixed the codebase based on your comments. |
Purpose
UISAUTHCOM-1: Move reusable components from UIROLES
Approach
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.