Skip to content

Commit

Permalink
Merge pull request #464 from folio-org/release/2.0.2
Browse files Browse the repository at this point in the history
chore: Release 2.0.2
  • Loading branch information
Jack-Golding authored Sep 12, 2024
2 parents 21db125 + a85a5a9 commit b7f8f1e
Show file tree
Hide file tree
Showing 18 changed files with 188 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ jobs:
comment_title: Jest Unit Test Statistics

- name: Publish Jest coverage report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: always()
with:
name: jest-coverage-report
path: ${{ env.JEST_COVERAGE_REPORT_DIR }}
retention-days: 30

- name: Publish yarn.lock
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: yarn.lock
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ jobs:
comment_title: Jest Unit Test Statistics

- name: Publish Jest coverage report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: always()
with:
name: jest-coverage-report
path: ${{ env.JEST_COVERAGE_REPORT_DIR }}
retention-days: 30

- name: Publish yarn.lock
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: yarn.lock
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change history for ui-oa

## 2.0.2 2024-09-12
* UIOA-229 UI uses non-existent permission oa.work.manage
* Payers' amounts lose decimal separator with non-English locale

## 2.0.1 2024-04-26
* UIOA-222 Charges - Decimal separator ignored when saving with non-english locale
* UIOA-215 Calculations on OA charges can result in invalid values
Expand Down
151 changes: 128 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/oa",
"version": "2.0.1",
"version": "2.0.2",
"description": "FOLIO app for Open Access management",
"main": "src/index.js",
"repository": "folio/ui-oa",
Expand Down Expand Up @@ -58,7 +58,11 @@
{
"permissionName": "module.oa.enabled",
"displayName": "UI: ui-oa module is enabled",
"visible": false
"visible": false,
"subPermissions": [
"oa.refdata.read",
"oa.settings.read"
]
},
{
"permissionName": "settings.oa.enabled",
Expand All @@ -81,41 +85,142 @@
"visible": true
},
{
"permissionName": "ui-oa.oa.view",
"displayName": "Open Access Requests: Search & view all",
"description": "A user with this permission can search and view existing Open Access publication requests and related information including checklists. This includes the permission to see and access the OA app in the Folio interface",
"permissionName": "ui-oa.publicationRequest.view",
"displayName": "Open Access: Search & view publication requests",
"description": "A user with this permission can search and view existing publication requests. This includes the permission to see and access the Open Access app in the Folio interface",
"visible": false,
"subPermissions": [
"module.oa.enabled",
"oa.publicationRequest.view",
"oa.scholarlyWork.view",
"oa.works.view",
"oa.titleInstances.view",
"oa.correspondence.view",
"oa.party.view",
"oa.charges.view",
"oa.checklistItems.view",
"oa.refdata.read",
"oa.reports.get"
"oa.reports.item.get"
]
},
{
"permissionName": "ui-oa.publicationRequest.edit",
"displayName": "Open Access: Edit publication requests",
"description": "Grants all permissions included in 'Open Access: Search & view publication requests' plus the ability to edit publication requests",
"visible": false,
"subPermissions": [
"ui-oa.publicationRequest.view",
"oa.publicationRequest.edit",
"oa.correspondence.edit",
"oa.charges.edit"
]
},
{
"permissionName": "ui-oa.publicationRequest.manage",
"displayName": "Open Access: Manage publication requests",
"description": "Grants all permissions included in 'Open Access: Edit publication requests' plus the ability to delete publication requests",
"visible": false,
"subPermissions": [
"ui-oa.publicationRequest.edit",
"oa.publicationRequest.manage",
"oa.correspondence.manage",
"oa.charges.manage"
]
},
{
"permissionName": "ui-oa.party.view",
"displayName": "Open Access: Search & view people",
"description": "A user with this permission can search and view existing people. This includes the permission to see and access the Open Access app in the Folio interface",
"visible": false,
"subPermissions": [
"module.oa.enabled",
"oa.party.view"
]
},
{
"permissionName": "ui-oa.party.edit",
"displayName": "Open Access: Edit people",
"description": "Grants all permissions included in 'Open Access: Search & view people' plus the ability to edit people",
"visible": false,
"subPermissions": [
"ui-oa.party.view",
"oa.party.edit"
]
},
{
"permissionName": "ui-oa.party.manage",
"displayName": "Open Access: Manage people",
"description": "Grants all permissions included in 'Open Access: Edit people' plus the ability to delete people records",
"visible": false,
"subPermissions": [
"ui-oa.party.edit",
"oa.party.manage"
]
},
{
"permissionName": "ui-oa.journal.view",
"displayName": "Open Access: Search & view journals",
"description": "A user with this permission can search and view existing journals. This includes the permission to see and access the Open Access app in the Folio interface",
"visible": false,
"subPermissions": [
"module.oa.enabled",
"oa.works.view"
]
},
{
"permissionName": "ui-oa.checklist.view",
"displayName": "Open Access: View checklists",
"description": "A user with this permission can view checklist items",
"visible": false,
"subPermissions": [
"oa.checklistItems.view"
]
},
{
"permissionName": "ui-oa.journal.edit",
"displayName": "Open Access: Edit journals",
"description": "Grants all permissions included in 'Open Access: Search & view journals' plus the ability to edit journals",
"visible": false,
"subPermissions": [
"ui-oa.journal.view",
"oa.works.edit"
]
},
{
"permissionName": "ui-oa.view",
"displayName": "Open Access Requests: Search & view all",
"description": "A user with this permission can search and view existing Open Access publication requests and related information including checklists. This includes the permission to see and access the OA app in the Folio interface",
"subPermissions": [
"module.oa.enabled",
"ui-oa.publicationRequest.view",
"ui-oa.party.view",
"ui-oa.journal.view",
"ui-oa.checklist.view"
],
"replaces": [
"ui-oa.oa.view"
],
"visible": true
},
{
"permissionName": "ui-oa.oa.manage",
"permissionName": "ui-oa.edit",
"displayName": "Open Access Requests: Edit all",
"description": "A user with this permission can search, view and edit Open Access publication requests and related information including checklists. This includes the permission to create and edit new requests, parties (people), works, charges as well as to change the status and visibility of checklist items on a request",
"subPermissions": [
"oa.publicationRequest.manage",
"oa.scholarlyWork.manage",
"oa.works.manage",
"oa.titleInstances.manage",
"oa.correspondence.manage",
"oa.party.manage",
"oa.charges.manage",
"oa.checklistItems.manage",
"oa.refdata.read",
"oa.reports.get"
"ui-oa.view",
"ui-oa.publicationRequest.edit",
"ui-oa.party.edit",
"ui-oa.journal.edit"
],
"replaces": [
"ui-oa.oa.manage"
],
"visible": true
},
{
"permissionName": "ui-oa.manage",
"displayName": "Open Access Requests: Manage all",
"description": "A user with this permission can search, view, edit and delete Open Access publication requests and related information with the exception of journal records.",
"subPermissions": [
"ui-oa.edit",
"ui-oa.publicationRequest.manage",
"ui-oa.party.manage"
],
"visible": false
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ const PayersField = ({ fields: { name } }) => {
<Button
disabled={items?.length >= payerNameValues?.length}
onClick={() => onAddField({
payerAmount: parseFloat(
estimatedInvoicePrice - totalPayersAmount
)?.toFixed(2),
payerAmount: Number(
parseFloat(estimatedInvoicePrice - totalPayersAmount)?.toFixed(2)
),
})
}
>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Checklist/ChecklistItem/ChecklistItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const ChecklistItem = ({
{([ariaLabel]) => (
<IconSelect
ariaLabel={ariaLabel}
disabled={!stripes.hasPerm('oa.checklistItems.manage')}
disabled={!stripes.hasPerm('ui-oa.publicationRequest.edit')}
id={`${item?.definition?.name}-icon-select`}
input={{
name: 'outcome',
Expand Down Expand Up @@ -160,7 +160,7 @@ const ChecklistItem = ({
ariaLabel={ariaLabel}
badgeCount={item?.notes?.length || 0}
disabled={
!stripes.hasPerm('oa.checklistItems.manage') &&
!stripes.hasPerm('ui-oa.publicationRequest.edit') &&
!item?.notes?.length
}
icon="document"
Expand Down Expand Up @@ -189,7 +189,7 @@ const ChecklistItem = ({
ref={ref}
aria-describedby={ariaIds.sub}
aria-labelledby={ariaIds.text}
disabled={!stripes.hasPerm('oa.checklistItems.manage')}
disabled={!stripes.hasPerm('ui-oa.publicationRequest.edit')}
icon={
item?.status?.value === 'hidden'
? 'eye-open'
Expand Down
6 changes: 3 additions & 3 deletions src/components/Checklist/ChecklistNotes/ChecklistNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ChecklistNotes = ({ notes, submitNotes, handleDelete }) => {
<div className={css.notesButton}>
<Button
buttonStyle="primary"
disabled={editing || !stripes.hasPerm('oa.checklistItems.manage')}
disabled={editing || !stripes.hasPerm('ui-oa.publicationRequest.edit')}
onClick={() => {
setEditing('NEW_NOTE');
notes.unshift({});
Expand Down Expand Up @@ -119,15 +119,15 @@ const ChecklistNotes = ({ notes, submitNotes, handleDelete }) => {
<IconButton
disabled={
editing ||
!stripes.hasPerm('oa.checklistItems.manage')
!stripes.hasPerm('ui-oa.publicationRequest.edit')
}
icon="edit"
onClick={() => setEditing(note.id)}
/>
<IconButton
disabled={
editing ||
!stripes.hasPerm('oa.checklistItems.manage')
!stripes.hasPerm('ui-oa.publicationRequest.edit')
}
icon="trash"
onClick={() => handleDelete(note)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
generateKiwtQuery,
QueryTypedown,
} from '@k-int/stripes-kint-components';
import { AppIcon } from '@folio/stripes/core';
import { AppIcon, useStripes } from '@folio/stripes/core';
import { requiredValidator } from '@folio/stripes-erm-components';
import PartyInfo from '../../PartySections/PartyInfo';
import urls from '../../../util/urls';
Expand All @@ -37,10 +37,13 @@ const propTypes = {
};

const PartyTypedownForm = ({ formName }) => {
const stripes = useStripes();
const { values } = useFormState();
const { change } = useForm();
const [showPartyModal, setShowPartyModal] = useState(false);
const institutionLevel1Refdata = selectifyRefdata(useOARefdata('Party.InstitutionLevel1'));
const institutionLevel1Refdata = selectifyRefdata(
useOARefdata('Party.InstitutionLevel1')
);

const pathMutator = (input, path) => {
const query = generateKiwtQuery(
Expand Down Expand Up @@ -142,22 +145,18 @@ const PartyTypedownForm = ({ formName }) => {
</Row>
{(!values.useCorrespondingAuthor ||
formName === 'correspondingAuthor') && (
<>
<Field
component={QueryTypedown}
endOfList={renderEndOFList()}
id={`${formName}-typedown`}
label={
<FormattedMessage id="ui-oa.publicationRequest.addPerson" />
}
name={`${formName}.partyOwner`}
onChange={(e) => handlePartyChange(e)}
path={PARTIES_ENDPOINT}
pathMutator={pathMutator}
renderFooter={renderFooter}
renderListItem={renderListItem}
/>
</>
<Field
component={QueryTypedown}
endOfList={renderEndOFList()}
id={`${formName}-typedown`}
label={<FormattedMessage id="ui-oa.publicationRequest.addPerson" />}
name={`${formName}.partyOwner`}
onChange={(e) => handlePartyChange(e)}
path={PARTIES_ENDPOINT}
pathMutator={pathMutator}
renderFooter={stripes.hasPerm('ui-oa.party.edit') && renderFooter}
renderListItem={renderListItem}
/>
)}

{values[formName]?.partyOwner && (
Expand Down Expand Up @@ -201,7 +200,10 @@ const PartyTypedownForm = ({ formName }) => {
<Col xs={3}>
<Field
component={Select}
dataOptions={[{ value: '', label: '' }, ...institutionLevel1Refdata]}
dataOptions={[
{ value: '', label: '' },
...institutionLevel1Refdata,
]}
id="publication-request-corresponding-institution-level-1"
label={
<FormattedMessage id="ui-oa.party.institutionLevelOne" />
Expand Down
Loading

0 comments on commit b7f8f1e

Please sign in to comment.