@thepalaceproject/circulation-admin 0.0.0-post.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/.eslintrc +59 -0
  2. package/.node-version +1 -0
  3. package/.nvmrc +1 -0
  4. package/.prettierrc.json +10 -0
  5. package/.sass-lint.yml +37 -0
  6. package/CHANGELOG.md +946 -0
  7. package/README.md +155 -0
  8. package/dist/060b2710bdbbe3dfe48b58d59bd5f1fb.svg +288 -0
  9. package/dist/0db1520f47986b6c755a.svg +1 -0
  10. package/dist/1e59d2330b4c6deb84b3.ttf +0 -0
  11. package/dist/20fd1704ea223900efa9.woff2 +0 -0
  12. package/dist/4692b9ec53fd5972caa2.ttf +0 -0
  13. package/dist/5be1347c682810f199c7.eot +0 -0
  14. package/dist/6563aa3790be8329e4f2.svg +1 -0
  15. package/dist/82b1212e45a2bc35dd73.woff +0 -0
  16. package/dist/8b43027f47b20503057d.eot +0 -0
  17. package/dist/PalaceCollectionManagerLogo.svg +122 -0
  18. package/dist/be810be3a3e14c682a25.woff2 +0 -0
  19. package/dist/c1e38fd9e0e74ba58f7a2b77ef29fdd3.svg +2671 -0
  20. package/dist/circulation-admin.css +6841 -0
  21. package/dist/circulation-admin.js +2 -0
  22. package/dist/circulation-admin.js.LICENSE.txt +153 -0
  23. package/dist/f691f37e57f04c152e23.woff +0 -0
  24. package/jest.config.js +15 -0
  25. package/jest.polyfills.js +12 -0
  26. package/nightwatch.json +58 -0
  27. package/package.json +155 -0
  28. package/pull_request_template.md +22 -0
  29. package/requirements-ci.txt +1 -0
  30. package/testReporter.js +31 -0
  31. package/tests/__data__/statisticsApiResponseData.ts +327 -0
  32. package/tests/__mocks__/fileMock.js +1 -0
  33. package/tests/__mocks__/styleMock.js +1 -0
  34. package/tests/browser/README.md +19 -0
  35. package/tests/browser/assertions/noError.js +38 -0
  36. package/tests/browser/commands/goHome.js +13 -0
  37. package/tests/browser/commands/signIn.js +18 -0
  38. package/tests/browser/globals.js.sample +5 -0
  39. package/tests/browser/navigate.js +294 -0
  40. package/tests/browser/pages/book.js +21 -0
  41. package/tests/browser/pages/catalog.js +24 -0
  42. package/tests/browser/pages/login.js +11 -0
  43. package/tests/browser/redirect.js +104 -0
  44. package/tests/browser/signInFailure.js +22 -0
  45. package/tests/jest/README.md +6 -0
  46. package/tests/jest/api/admin.test.ts +60 -0
  47. package/tests/jest/businessRules/roleBasedAccess.test.ts +250 -0
  48. package/tests/jest/components/AdvancedSearchBuilder.test.tsx +38 -0
  49. package/tests/jest/components/BookEditor.test.tsx +240 -0
  50. package/tests/jest/components/CirculationEventsDownload.test.tsx +65 -0
  51. package/tests/jest/components/CustomLists.test.tsx +203 -0
  52. package/tests/jest/components/EditableInput.test.tsx +64 -0
  53. package/tests/jest/components/IndividualAdminEditForm.test.tsx +128 -0
  54. package/tests/jest/components/InventoryReportRequestModal.test.tsx +652 -0
  55. package/tests/jest/components/Lane.test.tsx +78 -0
  56. package/tests/jest/components/LaneEditor.test.tsx +148 -0
  57. package/tests/jest/components/ProtocolFormField.test.tsx +37 -0
  58. package/tests/jest/components/QuicksightDashboard.test.tsx +67 -0
  59. package/tests/jest/components/Stats.test.tsx +699 -0
  60. package/tests/jest/context/AppContext.test.tsx +113 -0
  61. package/tests/jest/features/book.test.ts +396 -0
  62. package/tests/jest/jest-setup.ts +1 -0
  63. package/tests/jest/sample/sample.test.js +3 -0
  64. package/tests/jest/testUtils/renderWithContext.tsx +38 -0
  65. package/tests/jest/testUtils/withProviders.tsx +92 -0
  66. package/tests/jest/utils/NoCacheDataFetcher.test.ts +75 -0
  67. package/tsconfig.json +25 -0
  68. package/tslint.json +56 -0
  69. package/webpack.common.js +72 -0
  70. package/webpack.dev-server.config.js +215 -0
  71. package/webpack.dev.config.js +9 -0
  72. package/webpack.prod.config.js +8 -0
@@ -0,0 +1,153 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*!
8
+ Copyright (c) 2018 Jed Watson.
9
+ Licensed under the MIT License (MIT), see
10
+ http://jedwatson.github.io/classnames
11
+ */
12
+
13
+ /*!
14
+ * JavaScript Cookie v2.2.1
15
+ * https://github.com/js-cookie/js-cookie
16
+ *
17
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
18
+ * Released under the MIT license
19
+ */
20
+
21
+ /*!
22
+ * Programatically add the following
23
+ */
24
+
25
+ /*!
26
+ * The buffer module from node.js, for the browser.
27
+ *
28
+ * @author Feross Aboukhadijeh <https://feross.org>
29
+ * @license MIT
30
+ */
31
+
32
+ /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
33
+
34
+ /*! @preserve
35
+ * numeral.js
36
+ * version : 2.0.6
37
+ * author : Adam Draper
38
+ * license : MIT
39
+ * http://adamwdraper.github.com/Numeral-js/
40
+ */
41
+
42
+ /*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */
43
+
44
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
45
+
46
+ /*! https://mths.be/punycode v1.4.1 by @mathias */
47
+
48
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
49
+
50
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
51
+
52
+ /**
53
+ * match-sorter-utils
54
+ *
55
+ * Copyright (c) TanStack
56
+ *
57
+ * This source code is licensed under the MIT license found in the
58
+ * LICENSE.md file in the root directory of this source tree.
59
+ *
60
+ * @license MIT
61
+ */
62
+
63
+ /**
64
+ * @license React
65
+ * use-sync-external-store-shim.production.min.js
66
+ *
67
+ * Copyright (c) Facebook, Inc. and its affiliates.
68
+ *
69
+ * This source code is licensed under the MIT license found in the
70
+ * LICENSE file in the root directory of this source tree.
71
+ */
72
+
73
+ /**
74
+ * @name match-sorter
75
+ * @license MIT license.
76
+ * @copyright (c) 2099 Kent C. Dodds
77
+ * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
78
+ */
79
+
80
+ /** @license React v0.19.1
81
+ * scheduler.production.min.js
82
+ *
83
+ * Copyright (c) Facebook, Inc. and its affiliates.
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE file in the root directory of this source tree.
87
+ */
88
+
89
+ /** @license React v16.13.1
90
+ * react-is.production.min.js
91
+ *
92
+ * Copyright (c) Facebook, Inc. and its affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ */
97
+
98
+ /** @license React v16.14.0
99
+ * react-dom-server.browser.production.min.js
100
+ *
101
+ * Copyright (c) Facebook, Inc. and its affiliates.
102
+ *
103
+ * This source code is licensed under the MIT license found in the
104
+ * LICENSE file in the root directory of this source tree.
105
+ */
106
+
107
+ /** @license React v16.14.0
108
+ * react-dom.production.min.js
109
+ *
110
+ * Copyright (c) Facebook, Inc. and its affiliates.
111
+ *
112
+ * This source code is licensed under the MIT license found in the
113
+ * LICENSE file in the root directory of this source tree.
114
+ */
115
+
116
+ /** @license React v16.14.0
117
+ * react-jsx-runtime.production.min.js
118
+ *
119
+ * Copyright (c) Facebook, Inc. and its affiliates.
120
+ *
121
+ * This source code is licensed under the MIT license found in the
122
+ * LICENSE file in the root directory of this source tree.
123
+ */
124
+
125
+ /** @license React v16.14.0
126
+ * react.production.min.js
127
+ *
128
+ * Copyright (c) Facebook, Inc. and its affiliates.
129
+ *
130
+ * This source code is licensed under the MIT license found in the
131
+ * LICENSE file in the root directory of this source tree.
132
+ */
133
+
134
+ /** @license React v17.0.2
135
+ * react-is.production.min.js
136
+ *
137
+ * Copyright (c) Facebook, Inc. and its affiliates.
138
+ *
139
+ * This source code is licensed under the MIT license found in the
140
+ * LICENSE file in the root directory of this source tree.
141
+ */
142
+
143
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
144
+
145
+ //! license : MIT
146
+
147
+ //! moment.js
148
+
149
+ //! moment.js locale configuration
150
+
151
+ //! momentjs.com
152
+
153
+ //! version : 2.30.1
Binary file
package/jest.config.js ADDED
@@ -0,0 +1,15 @@
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
+ module.exports = {
3
+ moduleNameMapper: {
4
+ "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
5
+ "<rootDir>/tests/__mocks__/fileMock.js",
6
+ "\\.(css|less)$": "<rootDir>/tests/__mocks__/styleMock.js",
7
+ },
8
+ preset: "ts-jest",
9
+ testEnvironment: "jest-fixed-jsdom",
10
+ testEnvironmentOptions: {
11
+ customExportConditions: [""],
12
+ },
13
+ setupFiles: ["./jest.polyfills.js"],
14
+ setupFilesAfterEnv: ["./tests/jest/jest-setup.ts"],
15
+ };
@@ -0,0 +1,12 @@
1
+ // jest.polyfills.js
2
+
3
+ const globalThis = window;
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
6
+ const { fetch, Headers, Request, Response } = require("fetch-ponyfill")();
7
+ Object.defineProperties(globalThis, {
8
+ fetch: { value: fetch, writable: true },
9
+ Headers: { value: Headers },
10
+ Request: { value: Request },
11
+ Response: { value: Response, writable: true },
12
+ });
@@ -0,0 +1,58 @@
1
+ {
2
+ "src_folders": ["tests/browser/"],
3
+ "output_folder": "tests/browser/reports",
4
+ "custom_assertions_path": "tests/browser/assertions",
5
+ "custom_commands_path": "tests/browser/commands",
6
+ "globals_path": "tests/browser/globals.js",
7
+ "page_objects_path": "tests/browser/pages",
8
+
9
+ "selenium": {
10
+ "start_process": true,
11
+ "server_path": "./node_modules/selenium-standalone/.selenium/selenium-server/3.141.59-server.jar",
12
+ "log_path": "",
13
+ "host": "127.0.0.1",
14
+ "port": 4444,
15
+ "cli_args": {
16
+ "webdriver.chrome.driver": "./node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver",
17
+ "webdriver.gecko.driver": "./node_modules/selenium-standalone/.selenium/geckodriver/latest-x64-geckodriver",
18
+ "webdriver.ie.driver": ""
19
+ }
20
+ },
21
+
22
+ "test_settings": {
23
+ "default": {
24
+ "launch_url": "http://localhost",
25
+ "selenium_port": 4444,
26
+ "selenium_host": "localhost",
27
+ "silent": true,
28
+ "screenshots": {
29
+ "enabled": true,
30
+ "path": "tests/browser/reports"
31
+ },
32
+ "exclude": [
33
+ "assertions/*.js",
34
+ "commands/*.js",
35
+ "pages/*.js",
36
+ "globals.js"
37
+ ],
38
+ "end_session_on_fail": false,
39
+ "loggingPrefs": {
40
+ "browser": "ALL"
41
+ }
42
+ },
43
+ "firefox": {
44
+ "desiredCapabilities": {
45
+ "browserName": "firefox",
46
+ "javascriptEnabled": true,
47
+ "acceptSslCerts": true
48
+ }
49
+ },
50
+ "chrome": {
51
+ "desiredCapabilities": {
52
+ "browserName": "chrome",
53
+ "javascriptEnabled": true,
54
+ "acceptSslCerts": true
55
+ }
56
+ }
57
+ }
58
+ }
package/package.json ADDED
@@ -0,0 +1,155 @@
1
+ {
2
+ "name": "@thepalaceproject/circulation-admin",
3
+ "description": "Admin Interface for The Palace Project Circulation Manager",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git://github.com/ThePalaceProject/circulation-admin.git"
7
+ },
8
+ "main": "dist/circulation-admin.js",
9
+ "author": "The Palace Project",
10
+ "license": "Apache-2.0",
11
+ "engines": {
12
+ "node": ">=20.0.0",
13
+ "npm": ">=10.0.0"
14
+ },
15
+ "scripts": {
16
+ "prepublish": "npm run prod",
17
+ "lint": "tslint -c tslint.json src/*.ts src/*.tsx src/**/*.ts src/**/*.tsx src/**/**/*.ts src/**/**/*.tsx && sass-lint -c .sass-lint.yml -v -q",
18
+ "test-js": "npm run lint && tsc && cp -r src/stylesheets lib && cp -r src/images lib && mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js",
19
+ "test-js-file": "npm run lint && tsc && cp -r src/stylesheets lib && cp -r src/images lib && mocha --require lib/testHelper.js",
20
+ "test-js-list": "mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js --reporter ./testReporter.js",
21
+ "test-ts": "npm run lint && mocha -r ts-node/register --require src/testHelper.ts src/__tests__/*.ts* src/**/__tests__/*.ts* src/**/**/__tests__/*.ts*",
22
+ "test-file-ts": "npm run lint && mocha -r ts-node/register --require src/testHelper.ts",
23
+ "test-file-ts-nolint": "mocha -r ts-node/register --require src/testHelper.ts",
24
+ "test": "npm run test-ts && npm run test-jest",
25
+ "test-file": "npm run test-file-ts",
26
+ "test-browser": "npm run test-chrome && npm run test-firefox",
27
+ "test-chrome": "node_modules/.bin/selenium-standalone install && nightwatch -e chrome",
28
+ "test-firefox": "node_modules/.bin/selenium-standalone install && nightwatch -e firefox",
29
+ "test-jest": "jest --verbose --roots tests/jest",
30
+ "test-jest-file": "jest --verbose",
31
+ "dev": "webpack --watch --progress --config webpack.dev.config",
32
+ "dev-server": "webpack serve --progress --hot --config webpack.dev-server.config",
33
+ "dev-test-axe": "TEST_AXE=true npm run dev",
34
+ "prod": "webpack --progress --config webpack.prod.config",
35
+ "build-docs": "typedoc --tsconfig tsconfig.json src"
36
+ },
37
+ "dependencies": {
38
+ "@nypl/dgx-svg-icons": "0.3.4",
39
+ "@reduxjs/toolkit": "^2.2.5",
40
+ "@tanstack/react-query": "^4.36.1",
41
+ "@thepalaceproject/web-opds-client": "^1.1.0",
42
+ "bootstrap": "^3.3.6",
43
+ "classnames": "^2.3.1",
44
+ "draft-convert": "^2.1.5",
45
+ "draft-js": "0.11.7",
46
+ "font-awesome": "^4.6.3",
47
+ "immer": "^9.0.15",
48
+ "isomorphic-fetch": "^3.0.0",
49
+ "library-simplified-reusable-components": "1.3.18",
50
+ "numeral": "^2.0.6",
51
+ "opds-feed-parser": "0.0.17",
52
+ "prop-types": "^15.7.2",
53
+ "qs": "^6.2.0",
54
+ "react": "^16.8.6",
55
+ "react-beautiful-dnd": "^2.3.1",
56
+ "react-bootstrap": "^0.32.4",
57
+ "react-color": "^2.14.1",
58
+ "react-dnd": "^14.0.5",
59
+ "react-dnd-html5-backend": "^14.0.5",
60
+ "react-dom": "^16.8.6",
61
+ "react-redux": "^7.2.9",
62
+ "react-router": "^3.2.0",
63
+ "recharts": "^2.12.7",
64
+ "redux": "^4.2.1",
65
+ "redux-thunk": "^2.4.2",
66
+ "request": "^2.85.0",
67
+ "stream-browserify": "^3.0.0",
68
+ "timers-browserify": "^2.0.12",
69
+ "url": "^0.11.0"
70
+ },
71
+ "devDependencies": {
72
+ "@tanstack/react-query-devtools": "^4.36.1",
73
+ "@testing-library/jest-dom": "^5.16.5",
74
+ "@testing-library/react": "^12.1.5",
75
+ "@testing-library/react-hooks": "^8.0.1",
76
+ "@testing-library/user-event": "^14.4.3",
77
+ "@types/jest": "^29.2.6",
78
+ "@types/mocha": "^10.0.1",
79
+ "@types/node": "^20.17.19",
80
+ "@types/numeral": "^2.0.5",
81
+ "@types/prop-types": "^15.7.3",
82
+ "@types/react": "^16.14.6",
83
+ "@types/react-dom": "^16.9.8",
84
+ "@types/react-redux": "^7.1.33",
85
+ "@types/react-router": "^3.0.28",
86
+ "@types/recharts": "^1.8.28",
87
+ "@types/redux-mock-store": "^1.0.3",
88
+ "@typescript-eslint/eslint-plugin": "^5.46.0",
89
+ "@typescript-eslint/parser": "^5.46.0",
90
+ "chai": "4.2.0",
91
+ "clean-webpack-plugin": "^2.0.1",
92
+ "colors-cli": "^1.0.27",
93
+ "copy-webpack-plugin": "6.4.0",
94
+ "css-loader": "^6.7.2",
95
+ "enzyme": "^3.11.0",
96
+ "enzyme-adapter-react-16": "^1.15.6",
97
+ "eslint": "^7.0.0",
98
+ "eslint-config-prettier": "^6.11.0",
99
+ "eslint-plugin-jsx-a11y": "^6.2.3",
100
+ "eslint-plugin-prettier": "^3.1.3",
101
+ "eslint-plugin-react": "^7.19.0",
102
+ "eslint-plugin-react-hooks": "^4.0.0",
103
+ "fetch-mock": "^10.0.7",
104
+ "fetch-mock-jest": "^1.5.1",
105
+ "fetch-ponyfill": "^7.1.0",
106
+ "file-loader": "^6.2.0",
107
+ "follow-redirects": "^1.15.6",
108
+ "husky": "^4.3.0",
109
+ "jest": "^29.3.1",
110
+ "jest-environment-jsdom": "^29.3.1",
111
+ "jest-fixed-jsdom": "^0.0.9",
112
+ "jsdom": "^20.0.3",
113
+ "json-loader": "^0.5.4",
114
+ "lint-staged": "^10.4.0",
115
+ "mini-css-extract-plugin": "1.6.0",
116
+ "mocha": "^10.2.0",
117
+ "msw": "^2.7.3",
118
+ "nightwatch": "^3.2.0",
119
+ "prettier": "2.1.2",
120
+ "react-axe": "^3.3.0",
121
+ "react-test-renderer": "^16.14.0",
122
+ "redux-mock-store": "^1.5.4",
123
+ "resize-observer-polyfill": "^1.5.1",
124
+ "sass": "^1.64.2",
125
+ "sass-lint": "^1.13.1",
126
+ "sass-loader": "^13.2.0",
127
+ "selenium-standalone": "^6.16.0",
128
+ "sinon": "7.5.0",
129
+ "style-loader": "^0.13.1",
130
+ "terser-webpack-plugin": "^5.3.6",
131
+ "ts-jest": "^29.2.6",
132
+ "ts-loader": "^9.5.2",
133
+ "ts-node": "^10.9.2",
134
+ "tslint": "^6.1.3",
135
+ "tslint-react-a11y": "^1.1.0",
136
+ "typedoc": "^0.27.9",
137
+ "typescript": "^5.7.3",
138
+ "url-loader": "^4.1.1",
139
+ "webpack": "^5.94.0",
140
+ "webpack-cli": "^5.0.1",
141
+ "webpack-dev-server": "^5.2.2",
142
+ "webpack-merge": "^5.8.0"
143
+ },
144
+ "husky": {
145
+ "hooks": {
146
+ "pre-commit": "lint-staged"
147
+ }
148
+ },
149
+ "lint-staged": {
150
+ "*.{js,jsx,ts,tsx}": "eslint --cache --fix",
151
+ "*.{js,jsx,ts,tsx,css,md}": "prettier --write",
152
+ "*.{js,css,md}": "prettier --write"
153
+ },
154
+ "version": "0.0.0-post.1"
155
+ }
@@ -0,0 +1,22 @@
1
+ ## Description
2
+
3
+ <!--- Describe your changes -->
4
+
5
+ ## Motivation and Context
6
+
7
+ <!--- Why is this change required? What problem does it solve? -->
8
+ <!--- If it fixes an open issue, please link to the issue here. -->
9
+
10
+ ## How Has This Been Tested?
11
+
12
+ <!--- Please describe in detail how you tested your changes. -->
13
+ <!--- Include details of your testing environment, and the tests you ran to -->
14
+ <!--- see how your change affects other areas of the code, etc. -->
15
+
16
+ ## Checklist:
17
+
18
+ <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
19
+ <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
20
+
21
+ - [ ] I have updated the documentation accordingly.
22
+ - [ ] All new and existing tests passed.
@@ -0,0 +1 @@
1
+ dunamai==1.19.0
@@ -0,0 +1,31 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+
3
+ const mocha = require("mocha");
4
+ const sinon = require("sinon");
5
+ const color = require("colors-cli/safe");
6
+
7
+ function TestReporter(runner) {
8
+ // This isn't the place for warnings about soon-to-be-deprecated React methods, etc; we just want a clean list.
9
+ console.warn = sinon.stub();
10
+ console.error = sinon.stub();
11
+
12
+ const {
13
+ EVENT_SUITE_BEGIN,
14
+ EVENT_TEST_BEGIN,
15
+ EVENT_SUITE_END,
16
+ } = mocha.Runner.constants;
17
+
18
+ mocha.reporters.Base.call(this, runner);
19
+
20
+ runner.on(EVENT_SUITE_BEGIN, function (suite) {
21
+ console.group(color.x25.bold(suite.title));
22
+ });
23
+ runner.on(EVENT_TEST_BEGIN, function (test) {
24
+ console.log(test.title);
25
+ });
26
+ runner.on(EVENT_SUITE_END, function () {
27
+ console.groupEnd();
28
+ });
29
+ }
30
+
31
+ module.exports = TestReporter;