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

UXPROD-3903: Create new UI for new bursar export feature (#107) #108

Merged
merged 93 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
3328808
UXPROD-3903: Create new UI for new bursar export feature (#107)
nhanaa Jan 12, 2024
16fb25b
Update package version, remove resolutions, and sort dependencies
danetsao Jan 19, 2024
0823171
Update CHANGELOG
danetsao Jan 22, 2024
6fd427b
Refactor dropdown element selectors to use RTL's getByRole
danetsao Jan 22, 2024
cd28a85
Merge WeekdayUtils tests into one file
danetsao Jan 22, 2024
5049622
Rename WeekdayUtils file and update imports
danetsao Jan 22, 2024
23f2764
Align jest config with ts-jest and update devDependencies
danetsao Jan 22, 2024
2a12fd0
Fix formatting
danetsao Jan 23, 2024
f7aa178
Remove dependencies listed in other packages, update a mock
danetsao Jan 23, 2024
ab1c1f3
Remove getIntervalLabel function and update translations
danetsao Jan 24, 2024
b3e1a6e
Implement SchedulingFrequency and simplify parameter logic
danetsao Jan 24, 2024
b5058f7
Use SchedulingFrequency and simplify logic
danetsao Jan 24, 2024
20276f0
Add translation for ConditionalCard header
danetsao Jan 25, 2024
cbc5751
Update formatting
danetsao Jan 26, 2024
c65e99c
Add '@folio/stripes-core' to devDependencies
danetsao Jan 30, 2024
f6e0f11
Add 'data-testid' to ConfigurationForm
danetsao Jan 30, 2024
f885dea
Refactor onClick handling from props
danetsao Jan 30, 2024
fc959fb
Separated 3rd-party imports
danetsao Jan 30, 2024
f9ef7e9
Removed '@folio/stripes-core' from devDependencies
danetsao Jan 30, 2024
9adff3e
Create AndOrOperation enum
danetsao Jan 30, 2024
aa1a095
Change amountDollars to amountCurrency
danetsao Jan 30, 2024
d097a55
Remove unused dependencies and add interfaces
danetsao Jan 31, 2024
9b0f232
Refactor 'CriteriaCardSelect' and update 'criteriaOptions' generation
danetsao Jan 31, 2024
67a39fb
Change 'mutateAsync' to 'mutate'
danetsao Jan 31, 2024
9c1e171
Changes names to clarify usage
danetsao Jan 31, 2024
f9fd729
Rename mutations to sound like actions
danetsao Feb 5, 2024
542a5b3
Replace string literal with enum
danetsao Feb 5, 2024
61c9408
Move 'useLocaleWeekdays' to hooks and move a few constructions to con…
danetsao Feb 5, 2024
593a81c
Revert 'Remove 'requireActual' from jest mocks'
danetsao Feb 5, 2024
0a89507
Rename 'HeaderFooterCard' to 'HeaderFooterCreator'
danetsao Feb 5, 2024
3f8538c
fix casing
ncovercash Feb 6, 2024
7306297
fix weird object structuring
ncovercash Feb 6, 2024
11fdc0e
Add back 'requireActual' from jest mocks
danetsao Feb 6, 2024
8c2c4d0
Added translation and EOF
danetsao Feb 6, 2024
c767241
Require data-export-spring interface 2.0
ncovercash Feb 7, 2024
8878a33
Remove 'requireActual' from 'stripes-core.mock'
danetsao Feb 7, 2024
e4935bc
Remove 'requireActual' from a few tests
danetsao Feb 7, 2024
bbb31d6
Remove 'requireActual' and mock 'CalloutContext'
danetsao Feb 7, 2024
f45e6c1
Fix code smells
danetsao Feb 7, 2024
a564427
Simplify async/await logic
danetsao Feb 7, 2024
45db672
Fix lint errors
danetsao Feb 8, 2024
edc0ecd
Rewrite 'stripes-core' 'useStripes' mock
danetsao Feb 8, 2024
69e80a9
Merge branch 'master' into UXPROD-3903
ncovercash Feb 8, 2024
dbf29b7
denser formatting
ncovercash Feb 8, 2024
4fe63b7
Add constant for 'FORM_ID'
danetsao Feb 8, 2024
229cc86
Change props to 'Readonly'
danetsao Feb 9, 2024
41cb75e
Remove construction surrounding 'mutation.mutate'
danetsao Feb 13, 2024
78c4a21
Remove code duplication with footer
danetsao Feb 14, 2024
25428fe
Remove mocked 'console.error'
danetsao Feb 14, 2024
d578dcd
Fix code smells
danetsao Feb 14, 2024
7df8212
Implement usage of '@folio/jest-config-stripes/testing-library/react'
danetsao Feb 15, 2024
f1d280c
Change 'SavedJobDTO' to 'SaveJobConfiguration'
danetsao Feb 15, 2024
6339c72
Fix code smells
danetsao Feb 15, 2024
00e8d4c
Import 'timezones' from 'stripes-components'
danetsao Feb 15, 2024
6338e09
Remove 'blur' usage
danetsao Feb 15, 2024
f07ac99
Dynamically import '@ngneat/falso'
danetsao Feb 15, 2024
d2bb74f
Update 'amountDollars' currency formatting and associated functions
danetsao Feb 15, 2024
64ccdd4
Pass stripes correctly in tests
danetsao Feb 15, 2024
94dbd6a
Fix some lint errors
danetsao Feb 16, 2024
d3d01f6
Add tests for 'stripes.currency' with 'EUR'
danetsao Feb 16, 2024
cef95d7
Fix issues
danetsao Feb 16, 2024
fdf72ac
Fix lint errors
danetsao Feb 19, 2024
20f39ce
Add enum 'CriteriaTokenType'
danetsao Feb 19, 2024
3c8c090
Move 'test' folder to outside 'src'
danetsao Feb 21, 2024
d2b7cd1
Remove extra line
danetsao Feb 21, 2024
6e0babb
Fix lint errors
danetsao Feb 21, 2024
5d6d351
Remove unused import 'faker'
danetsao Feb 21, 2024
f585002
Fix lint errors
danetsao Feb 21, 2024
327b743
Fix lint errors and folder structure
danetsao Feb 21, 2024
da5f505
Refactor nest functions
danetsao Feb 21, 2024
225cb31
Update form submit logic
danetsao Feb 22, 2024
d866321
Refactor nest functions
danetsao Feb 23, 2024
c092775
Rename 'form' components from 'section' to 'menu'
danetsao Feb 23, 2024
4447419
Add 'Section' to names of 'form' components
danetsao Feb 24, 2024
e8fcaa9
Redecorate (fix lint errors)
ncovercash Feb 26, 2024
24d079d
More lint fixes
ncovercash Feb 26, 2024
d6ec604
Fix form component naming
ncovercash Feb 26, 2024
0e03fd2
Fix imports
ncovercash Feb 26, 2024
26d181d
Fix final lint issue
ncovercash Feb 26, 2024
48eaa02
Rename WeekdayUtils
ncovercash Feb 26, 2024
5e68ad7
Add missing translations for LengthControlDrawer
ncovercash Feb 26, 2024
4e97c88
Move .sort calls and array creation inside useMemo caching
ncovercash Feb 26, 2024
3a2a72d
Add indexes for api directory
ncovercash Feb 26, 2024
2387f80
Add indexes for components
ncovercash Feb 26, 2024
6a67e7a
Use index for src/types; rename dto types
ncovercash Feb 26, 2024
d53243e
Fix memoization invalidation
ncovercash Feb 28, 2024
13af4cb
Move useCriteriaCardOptions to be with other hooks
ncovercash Feb 28, 2024
817cdcb
Rename HandleInvisible to RenderInvisibles
ncovercash Feb 28, 2024
0422476
Move utils from src/components/ExportPreview
ncovercash Feb 28, 2024
91ca5d0
Extract inline styles
ncovercash Feb 28, 2024
f6a58bd
Fix lint style issues
ncovercash Feb 29, 2024
5fdebd5
Fix test error
ncovercash Feb 29, 2024
114d4fd
Fix test, for real this time?
ncovercash Feb 29, 2024
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
18 changes: 16 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{
"parser": "babel-eslint",
"extends": ["@folio/eslint-config-stripes/acquisitions"]
"extends": ["@folio/eslint-config-stripes", "plugin:import/typescript"],
"env": {
"jest": true
},
"rules": {
"import/no-named-as-default": "off"
},
"overrides": [
{
"files": ["src/test/**/*", "src/**/*.test.ts", "src/**/*.test.tsx"],
"env": { "jest": true },
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
]
}
15 changes: 7 additions & 8 deletions .github/workflows/build-npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ on:

jobs:
github-actions-ci:
if : ${{ startsWith(github.ref, 'refs/tags/v') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
YARN_TEST_OPTIONS: ''
YARN_TEST_OPTIONS: '--coverage'
SQ_ROOT_DIR: './src'
COMPILE_TRANSLATION_FILES: 'true'
PUBLISH_MOD_DESCRIPTOR: 'true'
Expand All @@ -35,7 +35,7 @@ jobs:
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'
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,**/*.test.ts,**/*.test.tsx,**/*-spec.js,**/karma.conf.js,**/jest.config.js'

runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -88,10 +88,10 @@ jobs:
continue-on-error: true

- name: Run yarn test
run: xvfb-run --server-args="-screen 0 1024x768x24" yarn test $YARN_TEST_OPTIONS
run: yarn node --expose-gc $(yarn bin jest) --runInBand --logHeapUsage $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 FOLIO module descriptor
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
if: always()
with:
github_token: ${{ github.token }}
files: "${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml"
files: '${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml'
check_name: Jest Unit Test Results
comment_mode: update last
comment_title: Jest Unit Test Statistics
Expand All @@ -164,7 +164,7 @@ jobs:
if: always()
with:
github_token: ${{ github.token }}
files: "${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml"
files: '${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml'
check_name: BigTest Unit Test Results
comment_mode: update last
comment_title: BigTest Unit Test Statistics
Expand Down Expand Up @@ -244,4 +244,3 @@ jobs:
data: ${{ steps.moduleDescriptor.outputs.content }}
username: ${{ secrets.FOLIO_REGISTRY_USERNAME }}
password: ${{ secrets.FOLIO_REGISTRY_PASSWORD }}

13 changes: 5 additions & 8 deletions .github/workflows/build-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
# - PUBLISH_MOD_DESCRIPTOR (boolean 'true' or 'false')
# - COMPILE_TRANSLATION_FILES (boolean 'true' or 'false')



name: buildNPM Snapshot
on: [push, pull_request]

jobs:
github-actions-ci:
env:
YARN_TEST_OPTIONS: ''
YARN_TEST_OPTIONS: '--coverage'
SQ_ROOT_DIR: './src'
COMPILE_TRANSLATION_FILES: 'true'
PUBLISH_MOD_DESCRIPTOR: 'true'
Expand All @@ -31,7 +29,7 @@ jobs:
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'
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,**/*.test.ts,**/*.test.tsx,**/*-spec.js,**/karma.conf.js,**/jest.config.js'

runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -70,7 +68,7 @@ jobs:
continue-on-error: true

- name: Run yarn test
run: xvfb-run --server-args="-screen 0 1024x768x24" yarn test $YARN_TEST_OPTIONS
run: yarn node --expose-gc $(yarn bin jest) --runInBand --logHeapUsage $YARN_TEST_OPTIONS

- name: Run yarn formatjs-compile
if: ${{ env.COMPILE_TRANSLATION_FILES == 'true' }}
Expand All @@ -89,7 +87,7 @@ jobs:
if: always()
with:
github_token: ${{ github.token }}
files: "${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml"
files: '${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml'
check_name: Jest Unit Test Results
comment_mode: update last
comment_title: Jest Unit Test Statistics
Expand All @@ -107,7 +105,7 @@ jobs:
if: always()
with:
github_token: ${{ github.token }}
files: "${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml"
files: '${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml'
check_name: BigTest Unit Test Results
comment_mode: update last
comment_title: BigTest Unit Test Statistics
Expand Down Expand Up @@ -198,4 +196,3 @@ jobs:
data: ${{ steps.moduleDescriptor.outputs.content }}
username: ${{ secrets.FOLIO_REGISTRY_USERNAME }}
password: ${{ secrets.FOLIO_REGISTRY_PASSWORD }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ stripes.config.js.local
# tests
/artifacts
junit.xml

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Change history for ui-plugin-bursar-export

## 3.1.0 (IN PROGRESS)
## 4.0.0 (IN PROGRESS)
* Support the new bursar export configuration feature and revamped UI. Refs UXPROD-3603.
* Also support `feesfines` interface version `19.0`. Refs UIPBEX-55.
* Support `data-export-spring` interface `v2.0`. Refs UXPROD-3903.

## [3.0.0](https://github.com/folio-org/ui-plugin-bursar-export/tree/v3.0.0) (2023-10-16)
[Full Changelog](https://github.com/folio-org/ui-plugin-bursar-export/compare/v2.4.0...v3.0.0)
Expand Down
1 change: 0 additions & 1 deletion index.js

This file was deleted.

1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './src/index';
47 changes: 40 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
const path = require('path');
const stripesConfig = require('@folio/jest-config-stripes');
const acqConfig = require('@folio/stripes-acq-components/jest.config');
const { join } = require('path');
const config = require('@folio/jest-config-stripes');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
...stripesConfig,
...config,

coverageProvider: 'v8',

moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],

testMatch: ['**/src/**/?(*.)test.{js,jsx,ts,tsx}'],

coverageReporters: ['lcov', 'text'],
collectCoverageFrom: [
'<rootDir>/index.ts',
'<rootDir>/src/**/*.{ts,tsx}',
'!<rootDir>/src/**/*.d.ts',
'!<rootDir>/src/**/*.test.{ts,tsx}',
'!<rootDir>/src/test/**',
'!**/node_modules/**',
],

setupFiles: [
...stripesConfig.setupFiles,
...acqConfig.setupFiles,
path.join(__dirname, './test/jest/setupFiles.js'),
...config.setupFiles,
join(__dirname, './test/setupTests.ts')
],
setupFilesAfterEnv: [join(__dirname, './test/jest.setup.ts')],

preset: 'ts-jest',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
...config.transform
},

moduleNameMapper: {
'^.+\\.(css|svg)$': 'identity-obj-proxy',

// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
uuid: require.resolve('uuid'),
},

slowTestThreshold: 10,
testTimeout: 20000,
};
68 changes: 44 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@folio/plugin-bursar-export",
"version": "3.1.0",
"version": "4.0.0",
"description": "Bursar export",
"main": "index.js",
"main": "src/index.js",
"repository": "",
"license": "Apache-2.0",
"engines": {
Expand All @@ -17,25 +17,47 @@
"okapiInterfaces": {
"users": "15.0 16.0",
"feesfines": "16.0 17.0 18.0 19.0",
"data-export-spring": "1.0 2.0"
"data-export-spring": "2.0",
"service-points": "3.0",
"location-units": "2.0",
"locations": "3.0"
},
"stripesDeps": [
danetsao marked this conversation as resolved.
Show resolved Hide resolved
"@folio/stripes-acq-components"
],
"permissionSets": [
{
"permissionName": "ui-plugin-bursar-export.bursar-exports.all",
"displayName": "Bursar exports: Bursar admin",
"displayName": "Transfer exports: Modify configuration and start jobs",
"subPermissions": [
"ui-plugin-bursar-export.bursar-exports.manual",
"data-export.config.item.post",
"data-export.config.item.put"
],
"visible": true
},
{
"permissionName": "ui-plugin-bursar-export.bursar-exports.manual",
"displayName": "Transfer exports: Start manual jobs",
"subPermissions": [
"ui-plugin-bursar-export.bursar-exports.view",
"data-export.job.item.post"
],
"visible": true
},
{
"permissionName": "ui-plugin-bursar-export.bursar-exports.view",
"displayName": "Transfer exports: View configuration",
"subPermissions": [
"settings.tenant-settings.enabled",
"usergroups.collection.get",
"owners.collection.get",
"transfers.collection.get",
"feefines.collection.get",
"data-export.config.collection.get",
"data-export.config.item.post",
"data-export.config.item.put",
"data-export.job.item.post"
"inventory-storage.service-points.collection.get",
danetsao marked this conversation as resolved.
Show resolved Hide resolved
"inventory-storage.location-units.institutions.collection.get",
"inventory-storage.location-units.campuses.collection.get",
"inventory-storage.location-units.campuses.collection.get",
"inventory-storage.location-units.libraries.collection.get",
"inventory-storage.locations.collection.get",
"data-export.config.collection.get"
],
"visible": true
}
Expand All @@ -47,15 +69,10 @@
"lint": "eslint .",
"build-mod-descriptor": "stripes mod descriptor --full --strict | jq '.[]' > module-descriptor.json ",
"start": "yarn stripes serve",
"test:unit": "jest --ci --coverage && yarn run test:unit:report",
"test:unit:watch": "jest --ci --coverage --watch",
"test:unit:report": "cp -r ./artifacts/coverage-jest ./artifacts/coverage",
"test:e2e": "echo Not implemented",
"test": "yarn run test:unit && yarn run test:e2e"
"test": "jest",
"coverage": "jest --coverage"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
Expand All @@ -65,22 +82,24 @@
"@folio/jest-config-stripes": "^2.0.0",
"@folio/stripes": "^9.0.0",
"@folio/stripes-cli": "^3.0.0",
"@formatjs/cli": "^6.1.3",
"@formatjs/cli": "^6.2.0",
"@types/react": "^18.2.0",
"core-js": "^3.6.1",
"eslint": "^6.2.1",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-jest": "^23.0.4",
"faker": "^4.1.0",
"identity-obj-proxy": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^6.4.4",
"react-query": "^3.6.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"regenerator-runtime": "^0.13.3"
"regenerator-runtime": "^0.13.3",
"ts-jest": "^29.1.1",
"typescript": "^4.7.4"
},
"dependencies": {
"@folio/stripes-acq-components": "~5.0.0",
"@ngneat/falso": "^6.4.0",
danetsao marked this conversation as resolved.
Show resolved Hide resolved
danetsao marked this conversation as resolved.
Show resolved Hide resolved
"classnames": "^2.3.2",
"lodash": "^4.17.5",
"prop-types": "^15.5.10",
"react-final-form": "^6.3.0",
Expand All @@ -90,6 +109,7 @@
},
"peerDependencies": {
"@folio/stripes": "^9.0.0",
"@types/react": "^18.2.0",
"final-form": "^4.18.2",
"final-form-arrays": "^3.0.1",
"react": "^18.2.0",
Expand Down
Loading
Loading