diff --git a/.eslintrc b/.eslintrc
index c5de904..bc7d25d 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,6 +1,6 @@
{
- "extends": "@folio/eslint-config-stripes",
"parser": "@babel/eslint-parser",
+ "extends": "@folio/eslint-config-stripes",
"overrides": [
{
"files": [ "src/**/tests/*", "**/*.test.js", "test/**/*" ],
@@ -12,5 +12,16 @@
],
"env": {
"jest": true
+ },
+ "settings": {
+ "import/resolver": {
+ "alias": {
+ "map": [
+ ["__mock__", "./test/jest/__mock__"],
+ ["fixtures", "./test/jest/fixtures"],
+ ["helpers", "./test/jest/helpers"]
+ ]
+ }
+ }
}
}
diff --git a/.github/workflows/build-npm-release.yml b/.github/workflows/build-npm-release.yml
index a00f634..e86c53e 100644
--- a/.github/workflows/build-npm-release.yml
+++ b/.github/workflows/build-npm-release.yml
@@ -1,18 +1,15 @@
# This workflow will do a clean install of node dependencies, build the source code,
-# run unit tests, and perform a SonarCloud scan ONLY on a `release`.
+# run unit tests, perform a SonarCloud scan and publish NPM package ONLY on a tagged release.
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# Common FOLIO configurable env:
# - YARN_TEST_OPTIONS (options to pass to 'yarn test')
-# - SQ_ROOT_DIR (where to scan relative to top-level directory)
-# - FOLIO_NAME
+# - SQ_ROOT_DIR (root SQ directory to scan relative to top-level directory)
# - PUBLISH_MOD_DESCRIPTOR (boolean 'true' or 'false')
# - COMPILE_TRANSLATION_FILES (boolean 'true' or 'false')
-
-
name: buildNPM Release
on:
push:
@@ -21,26 +18,28 @@ on:
workflow_dispatch:
jobs:
- build-npm-release:
+ github-actions-ci:
if : ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
- YARN_TEST_OPTIONS: '--ci --coverage --colors'
+ YARN_TEST_OPTIONS: ''
SQ_ROOT_DIR: './src'
- PUBLISH_MOD_DESCRIPTOR: 'false'
- COMPILE_TRANSLATION_FILES: 'false'
+ COMPILE_TRANSLATION_FILES: 'true'
+ PUBLISH_MOD_DESCRIPTOR: 'true'
FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folio/'
FOLIO_NPM_REGISTRY_AUTH: '//repository.folio.org/repository/npm-folio/'
FOLIO_MD_REGISTRY: 'https://folio-registry.dev.folio.org'
NODEJS_VERSION: '18'
JEST_JUNIT_OUTPUT_DIR: 'artifacts/jest-junit'
JEST_COVERAGE_REPORT_DIR: 'artifacts/coverage-jest/lcov-report/'
+ BIGTEST_JUNIT_OUTPUT_DIR: 'artifacts/runTest'
+ BIGTEST_COVERAGE_REPORT_DIR: 'artifacts/coverage/lcov-report/'
OKAPI_PULL: '{ "urls" : [ "https://folio-registry.dev.folio.org" ] }'
SQ_LCOV_REPORT: 'artifacts/coverage-jest/lcov.info'
SQ_EXCLUSIONS: '**/platform/alias-service.js,**/docs/**,**/node_modules/**,**/examples/**,**/artifacts/**,**/ci/**,Jenkinsfile,**/LICENSE,**/*.css,**/*.md,**/*.json,**/tests/**,**/stories/*.js,**/test/**,**/.stories.js,**/resources/bigtest/interactors/**,**/resources/bigtest/network/**,**/*-test.js,**/*.test.js,**/*-spec.js,**/karma.conf.js,**/jest.config.js'
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: folio-org/checkout@v2
with:
fetch-depth: 0
@@ -88,12 +87,8 @@ jobs:
run: yarn lint
continue-on-error: true
- - name: Get number of CPU cores
- id: cpu-cores
- uses: SimenB/github-actions-cpu-cores@v1
-
- name: Run yarn test
- run: xvfb-run --server-args="-screen 0 1024x768x24" yarn test $YARN_TEST_OPTIONS --max-workers ${{ steps.cpu-cores.outputs.count }}
+ run: xvfb-run --server-args="-screen 0 1024x768x24" yarn test $YARN_TEST_OPTIONS
- name: Run yarn formatjs-compile
if : ${{ env.COMPILE_TRANSLATION_FILES == 'true' }}
@@ -146,20 +141,15 @@ jobs:
customHeaders: '{ "Accept": "application/json; charset=utf-8" }'
data: ${{ steps.moduleDescriptor.outputs.content }}
- - name: Upload event file
- uses: actions/upload-artifact@v3
- with:
- name: Event File
- path: ${{ github.event_path }}
- retention-days: 30
-
- - name: Upload Jest results
+ - name: Publish Jest unit test results
+ uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1
if: always()
- uses: actions/upload-artifact@v3
with:
- name: jest-test-results
- path: ${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml
- retention-days: 30
+ github_token: ${{ github.token }}
+ files: "${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml"
+ check_name: Jest Unit Test Results
+ comment_mode: update last
+ comment_title: Jest Unit Test Statistics
- name: Publish Jest coverage report
uses: actions/upload-artifact@v2
@@ -169,6 +159,32 @@ jobs:
path: ${{ env.JEST_COVERAGE_REPORT_DIR }}
retention-days: 30
+ - name: Publish BigTest unit test results
+ uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1
+ if: always()
+ with:
+ github_token: ${{ github.token }}
+ files: "${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml"
+ check_name: BigTest Unit Test Results
+ comment_mode: update last
+ comment_title: BigTest Unit Test Statistics
+
+ - name: Publish BigTest coverage report
+ uses: actions/upload-artifact@v2
+ if: always()
+ with:
+ name: bigtest-coverage-report
+ path: ${{ env.BIGTEST_COVERAGE_REPORT_DIR }}
+ retention-days: 30
+
+ - name: Publish yarn.lock
+ uses: actions/upload-artifact@v2
+ if: failure()
+ with:
+ name: yarn.lock
+ path: yarn.lock
+ retention-days: 5
+
- name: Set default branch as env variable
run: echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV
diff --git a/.github/workflows/build-npm.yml b/.github/workflows/build-npm.yml
index ae235dd..8997a5e 100644
--- a/.github/workflows/build-npm.yml
+++ b/.github/workflows/build-npm.yml
@@ -1,13 +1,12 @@
# This workflow will do a clean install of node dependencies, build the source code,
-# run unit tests, and perform a SonarCloud scan.
+# run unit tests, perform a Sonarqube scan, and publish NPM artifacts from master/main.
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
-# Common FOLIO configurable env:
+# Common FOLIO configurable environment variables to set:
# - YARN_TEST_OPTIONS (options to pass to 'yarn test')
-# - SQ_ROOT_DIR (where to scan relative to top-level directory)
-# - FOLIO_NAME
+# - SQ_ROOT_DIR (root SQ directory to scan relative to top-level directory)
# - PUBLISH_MOD_DESCRIPTOR (boolean 'true' or 'false')
# - COMPILE_TRANSLATION_FILES (boolean 'true' or 'false')
@@ -15,25 +14,28 @@
name: buildNPM Snapshot
on: [push, pull_request]
+
jobs:
- build-npm:
+ github-actions-ci:
env:
- YARN_TEST_OPTIONS: '--ci --coverage --colors'
+ YARN_TEST_OPTIONS: ''
SQ_ROOT_DIR: './src'
- PUBLISH_MOD_DESCRIPTOR: 'false'
- COMPILE_TRANSLATION_FILES: 'false'
+ COMPILE_TRANSLATION_FILES: 'true'
+ PUBLISH_MOD_DESCRIPTOR: 'true'
FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folioci/'
FOLIO_NPM_REGISTRY_AUTH: '//repository.folio.org/repository/npm-folioci/'
FOLIO_MD_REGISTRY: 'https://folio-registry.dev.folio.org'
NODEJS_VERSION: '18'
JEST_JUNIT_OUTPUT_DIR: 'artifacts/jest-junit'
JEST_COVERAGE_REPORT_DIR: 'artifacts/coverage-jest/lcov-report/'
+ BIGTEST_JUNIT_OUTPUT_DIR: 'artifacts/runTest'
+ BIGTEST_COVERAGE_REPORT_DIR: 'artifacts/coverage/lcov-report/'
SQ_LCOV_REPORT: 'artifacts/coverage-jest/lcov.info'
SQ_EXCLUSIONS: '**/platform/alias-service.js,**/docs/**,**/node_modules/**,**/examples/**,**/artifacts/**,**/ci/**,Jenkinsfile,**/LICENSE,**/*.css,**/*.md,**/*.json,**/tests/**,**/stories/*.js,**/test/**,**/.stories.js,**/resources/bigtest/interactors/**,**/resources/bigtest/network/**,**/*-test.js,**/*.test.js,**/*-spec.js,**/karma.conf.js,**/jest.config.js'
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: folio-org/checkout@v2
with:
fetch-depth: 0
@@ -67,39 +69,30 @@ jobs:
run: yarn lint
continue-on-error: true
- - name: Get number of CPU cores
- id: cpu-cores
- uses: SimenB/github-actions-cpu-cores@v1
-
- name: Run yarn test
- run: xvfb-run --server-args="-screen 0 1024x768x24" yarn test $YARN_TEST_OPTIONS --max-workers ${{ steps.cpu-cores.outputs.count }}
+ run: xvfb-run --server-args="-screen 0 1024x768x24" yarn test $YARN_TEST_OPTIONS
- name: Run yarn formatjs-compile
- if : ${{ env.COMPILE_TRANSLATION_FILES == 'true' }}
+ if: ${{ env.COMPILE_TRANSLATION_FILES == 'true' }}
run: yarn formatjs-compile
- - name: Generate Module descriptor
+ - name: Generate FOLIO module descriptor
if: ${{ env.PUBLISH_MOD_DESCRIPTOR == 'true' }}
run: yarn build-mod-descriptor
- - name: debug mod descriptor
+ - name: Print FOLIO module descriptor
if: ${{ env.PUBLISH_MOD_DESCRIPTOR == 'true' }}
run: cat module-descriptor.json
- - name: Upload event file
- uses: actions/upload-artifact@v3
- with:
- name: Event File
- path: ${{ github.event_path }}
- retention-days: 30
-
- - name: Upload Jest results
+ - name: Publish Jest unit test results
+ uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1
if: always()
- uses: actions/upload-artifact@v3
with:
- name: jest-test-results
- path: ${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml
- retention-days: 30
+ github_token: ${{ github.token }}
+ files: "${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml"
+ check_name: Jest Unit Test Results
+ comment_mode: update last
+ comment_title: Jest Unit Test Statistics
- name: Publish Jest coverage report
uses: actions/upload-artifact@v2
@@ -109,6 +102,32 @@ jobs:
path: ${{ env.JEST_COVERAGE_REPORT_DIR }}
retention-days: 30
+ - name: Publish BigTest unit test results
+ uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1
+ if: always()
+ with:
+ github_token: ${{ github.token }}
+ files: "${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml"
+ check_name: BigTest Unit Test Results
+ comment_mode: update last
+ comment_title: BigTest Unit Test Statistics
+
+ - name: Publish BigTest coverage report
+ uses: actions/upload-artifact@v2
+ if: always()
+ with:
+ name: bigtest-coverage-report
+ path: ${{ env.BIGTEST_COVERAGE_REPORT_DIR }}
+ retention-days: 30
+
+ - name: Publish yarn.lock
+ uses: actions/upload-artifact@v2
+ if: failure()
+ with:
+ name: yarn.lock
+ path: yarn.lock
+ retention-days: 5
+
- name: Set default branch as env variable
run: echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV
@@ -139,6 +158,7 @@ jobs:
always-auth: true
- name: Set _auth in .npmrc
+ if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
run: |
npm config set @folio:registry $FOLIO_NPM_REGISTRY
npm config set $FOLIO_NPM_REGISTRY_AUTH:_auth $NODE_AUTH_TOKEN
@@ -146,6 +166,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Exclude some CI-generated artifacts in package
+ if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
run: |
echo "artifacts" >> .npmignore
echo ".github" >> .npmignore
@@ -178,19 +199,3 @@ jobs:
username: ${{ secrets.FOLIO_REGISTRY_USERNAME }}
password: ${{ secrets.FOLIO_REGISTRY_PASSWORD }}
- # restoring "github-actions-ci" with some dummy steps
- # to maybe allow PR #14 to succeed, where it is stuck
- # in "Waiting for status to be reported" ATM.
- github-actions-ci:
- runs-on: ubuntu-latest
- steps:
- - uses: folio-org/checkout@v2
- with:
- fetch-depth: 0
-
- - name: Use Node.js
- uses: actions/setup-node@v2
- with:
- node-version: ${{ env.NODEJS_VERSION }}
- check-latest: true
- always-auth: true
diff --git a/.gitignore b/.gitignore
index 92ff27e..b2b1cf6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,7 @@ artifacts
npm-debug.log
yarn.lock
package-lock.json
-junit.xml
\ No newline at end of file
+yarn-error.log
+.vscode
+.idea
+junit.xml
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..e8ace87
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.swp
+*.swo
+node_modules
+yarn.lock
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 298fb2f..4b0d1c9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,4 +5,4 @@
## 1.0.0
-* New app created with stripes-cli
+* New app created with stripes-cli. Updated module after created with stripes-cli. Refs UIREQMED-1.
diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..9f3470f
--- /dev/null
+++ b/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,90 @@
+
+
+
+
+## Purpose
+
+
+## Approach
+
+
+## Refs
+
+
+## Screenshots
+
+
+
+
+
+
+## Pre-Merge Checklist
+Before merging this PR, please go through the following list and take appropriate actions.
+- [ ] I've added appropriate record to the CHANGELOG.md
+- Does this PR meet or exceed the expected quality standards?
+ - [ ] Code coverage on new code is 80% or greater
+ - [ ] Duplications on new code is 3% or less
+ - [ ] There are no major code smells or security issues
+- Does this introduce breaking changes?
+ - [ ] If any API-related changes - okapi interfaces and permissions are reviewed/changed correspondingly
+ - [ ] There are no breaking changes in this PR.
+
+If there are breaking changes, please **STOP** and consider the following:
+
+- What other modules will these changes impact?
+- Do JIRAs exist to update the impacted modules?
+ - [ ] If not, please create them
+ - [ ] Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
+ - [ ] Do they have all they appropriate links to blocked/related issues?
+- Are the JIRAs under active development?
+ - [ ] If not, contact the project's PO and make sure they're aware of the urgency.
+- Do PRs exist for these changes?
+ - [ ] If so, have they been approved?
+
+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.
diff --git a/icons/app.png b/icons/app.png
new file mode 100644
index 0000000..41a908c
Binary files /dev/null and b/icons/app.png differ
diff --git a/icons/app.svg b/icons/app.svg
new file mode 100644
index 0000000..d88d980
--- /dev/null
+++ b/icons/app.svg
@@ -0,0 +1,22 @@
+
+
\ No newline at end of file
diff --git a/jest.config.js b/jest.config.js
index 63dc069..f314d3b 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -8,4 +8,3 @@ module.exports = {
path.join(__dirname, './test/jest/setupFiles.js'),
],
};
-
diff --git a/package.json b/package.json
index 302c08a..9fb11aa 100644
--- a/package.json
+++ b/package.json
@@ -1,17 +1,22 @@
{
"name": "@folio/requests-mediated",
"version": "1.1.0",
- "description": "requests-mediated",
+ "description": "Mediated requests",
"main": "src/index.js",
- "repository": "",
+ "repository": "folio-org/ui-requests-mediated",
+ "publishConfig": {
+ "registry": "https://repository.folio.org/repository/npm-folio/"
+ },
"license": "Apache-2.0",
"scripts": {
"start": "stripes serve",
+ "lint": "eslint .",
+ "lintfix": "eslint . --fix",
+ "test": "yarn run test:jest",
+ "test:jest": "jest --ci --coverage --colors",
"build": "stripes build --output ./output",
"build-mod-descriptor": "stripes mod descriptor --full --strict | jq '.[]' > module-descriptor.json ",
- "formatjs-compile": "stripes translate compile",
- "lint": "eslint .",
- "test": "jest"
+ "formatjs-compile": "formatjs compile-folder --ast --format simple ./translations/ui-requests-mediated ./translations/ui-requests-mediated/compiled"
},
"devDependencies": {
"@babel/core": "^7.21.0",
@@ -24,18 +29,16 @@
"@folio/eslint-config-stripes": "^7.0.0",
"@folio/jest-config-stripes": "^2.0.0",
"@folio/stripes": "^9.1.0",
- "@folio/stripes-cli": "^2.6.0 || ^3.0.0",
+ "@folio/stripes-cli": "^3.0.0",
"@folio/stripes-core": "^10.1.0",
"core-js": "^3.6.4",
"eslint": "^7.32.0",
- "history": "^4.10.1",
+ "history": "^5.0.0",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^6.4.4",
- "react-redux": "^8.0.5",
"react-router-dom": "^5.2.0",
- "redux": "^4.0.5",
"regenerator-runtime": "^0.13.3"
},
"dependencies": {
@@ -54,17 +57,24 @@
"settings"
],
"displayName": "ui-requests-mediated.meta.title",
- "route": "/requestsmediated",
+ "route": "/requests-mediated",
+ "icons": [
+ {
+ "name": "app",
+ "alt": "Mediated requests",
+ "title": "Mediated requests manager"
+ }
+ ],
"okapiInterfaces": {},
"permissionSets": [
{
"permissionName": "module.requests-mediated.enabled",
- "displayName": "UI: requests-mediated module is enabled",
+ "displayName": "UI: Mediated requests module is enabled",
"visible": true
},
{
"permissionName": "settings.requests-mediated.enabled",
- "displayName": "Settings (requests-mediated): display list of settings pages",
+ "displayName": "Settings (Mediated requests): display list of settings pages",
"subPermissions": [
"settings.enabled"
],
diff --git a/src/components/greeting-modal/greeting-modal.css b/src/components/greeting-modal/greeting-modal.css
deleted file mode 100644
index e69de29..0000000
diff --git a/src/components/greeting-modal/greeting-modal.js b/src/components/greeting-modal/greeting-modal.js
deleted file mode 100644
index 0e6bf60..0000000
--- a/src/components/greeting-modal/greeting-modal.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import { FormattedMessage } from 'react-intl';
-import React from 'react';
-import PropTypes from 'prop-types';
-import { Modal } from '@folio/stripes/components';
-import NewAppGreeting from '../new-app-greeting';
-
-export default class GreetingModal extends React.Component {
- static propTypes = {
- open: PropTypes.bool,
- onClose: PropTypes.func,
- };
-
- render() {
- return (
-