@natlibfi/ekirjasto-circulation-admin 0.0.0-post.1878
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.
- package/README.md +156 -0
- package/dist/060b2710bdbbe3dfe48b58d59bd5f1fb.svg +288 -0
- package/dist/0db1520f47986b6c755a.svg +1 -0
- package/dist/1e59d2330b4c6deb84b340635ed36249.ttf +0 -0
- package/dist/45eb1d236a736caa24dd.woff2 +1 -0
- package/dist/4c6f1cd9993ba8a53b8e.ttf +1 -0
- package/dist/5e9505a87e4d8ecb2017.eot +1 -0
- package/dist/6563aa3790be8329e4f2.svg +1 -0
- package/dist/7a065a1c0cb2d586cecb.woff +1 -0
- package/dist/7d6ec71e2466a9fd777f.woff2 +1 -0
- package/dist/8b43027f47b20503057dfbbaa9401fef.eot +0 -0
- package/dist/PalaceCollectionManagerLogo.svg +95 -0
- package/dist/c1e38fd9e0e74ba58f7a2b77ef29fdd3.svg +2671 -0
- package/dist/circulation-admin.css +6841 -0
- package/dist/circulation-admin.js +2 -0
- package/dist/circulation-admin.js.LICENSE.txt +125 -0
- package/dist/dec4ea00820558e24672.ttf +1 -0
- package/dist/e5c0c62d732823225aaa.eot +1 -0
- package/dist/f34ea237f268661e9d00.woff +1 -0
- package/package.json +152 -0
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Circulation Manager Administrative Interface
|
|
2
|
+
|
|
3
|
+
This is the E-kirjasto fork of the [The Palace Project](https://thepalaceproject.org) Palace Manager Administrative Interface (which is a fork of
|
|
4
|
+
[Library Simplified](http://www.librarysimplified.org/) Circulation Manager Administrative Interface).
|
|
5
|
+
|
|
6
|
+
## Set Up
|
|
7
|
+
|
|
8
|
+
This package may be used in a local build of the E-kirjasto [Circulation Manager](https://github.com/NatLibFi/ekirjasto-circulation), or it may be run against a remote Circulation Manager.
|
|
9
|
+
|
|
10
|
+
This project uses Node.js 18. We recommend the latest version of Node.js 18.
|
|
11
|
+
|
|
12
|
+
You have a number of options for installing Node.js. One convenient way on macOS is to use Homebrew and nvm to manage Node.js versions.
|
|
13
|
+
|
|
14
|
+
Install Homebrew if you have not already:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Install nvm using Homebrew:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
brew install nvm
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Install and use the latest version of Node.js 18, e.g. 18.14.2 with nvm:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
nvm install 18.14.2
|
|
30
|
+
nvm use 18.14.2
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Alternatively, you can use `nodenv` on macOS:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
brew install nodenv
|
|
37
|
+
nodenv install 18.14.2
|
|
38
|
+
nodenv global 18.14.2
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If you have different projects requiring different Node.js versions, you can use nodenv to set a local version for the project by navigating to the root directory of circulation-admin and executing `nodenv local 18.14.2`.
|
|
42
|
+
|
|
43
|
+
You can also use the `n` npm package to manage Node.js versions, or simply install the Node.js binary directly.
|
|
44
|
+
|
|
45
|
+
This project uses the latest version of npm. You can update npm with `npm update -g npm`. You can confirm the versions of Node.js and npm you are using with `node --version` and `npm --version`.
|
|
46
|
+
|
|
47
|
+
Once you have installed the correct versions of Node.js and npm, run `npm i` to install all dependencies.
|
|
48
|
+
|
|
49
|
+
#### Use npm-Published Version in a Local Circulation Manager
|
|
50
|
+
|
|
51
|
+
Suggested local folder setup:
|
|
52
|
+
|
|
53
|
+
- `/[path to project folder]/circulation`
|
|
54
|
+
|
|
55
|
+
To use the published version with your circulation manager, run `npm install` from `api/admin` in the `circulation` local installed repository.
|
|
56
|
+
|
|
57
|
+
#### Use Local Development Version in a Local Circulation Manager
|
|
58
|
+
|
|
59
|
+
Follow the Circulation Manager README instructions before setting up this repository.
|
|
60
|
+
|
|
61
|
+
Suggested local folder setup:
|
|
62
|
+
|
|
63
|
+
- `/[path to project folder]/circulation`
|
|
64
|
+
- `/[path to project folder]/circulation-admin`
|
|
65
|
+
|
|
66
|
+
If you're working on the administrative interface and want to test local changes, you can link your local clone of this repository to your local circulation manager. These steps will allow you to work on the front-end administrative interface and see updates while developing.
|
|
67
|
+
|
|
68
|
+
1. Run `npm link` in this `circulation-admin` repository,
|
|
69
|
+
2. run `npm link @thepalaceproject/circulation-admin` from `api/admin` in the `circulation` repository (which is where package.json is located),
|
|
70
|
+
3. run the circulation manager using `python app.py` at the root in the `circulation` repository,
|
|
71
|
+
4. run the web interface using `npm run dev` at the root of this `circulation-admin` repository,
|
|
72
|
+
5. run the Elasticsearch server using `./bin/elasticsearch` in the elasticsearch-[version] directory,
|
|
73
|
+
6. visit `localhost:6500/admin/`.
|
|
74
|
+
|
|
75
|
+
Webpack will take care of compiling and updating any new changes made locally for development. Just hard refresh the page (command + shift + R) to see updates without having to restart either the `circulation` or `circulation-admin` servers.
|
|
76
|
+
|
|
77
|
+
#### Use Local Development Version with a Remote Circulation Manager
|
|
78
|
+
|
|
79
|
+
This front-end may be run locally in development against a remote Circulation Manager back-end. This removes the need to build a local Circulation Manager from source in order to work on the front-end.
|
|
80
|
+
|
|
81
|
+
1. Run `npm run dev-server -- --env=backend=[url]` in this `circulation-admin` repository.
|
|
82
|
+
|
|
83
|
+
Example: `npm run dev-server -- --env=backend=https://gorgon.tpp-qa.lyrasistechnology.org`
|
|
84
|
+
|
|
85
|
+
Note: The tortured syntax here results from going through npm and webpack. The first `--` separates arguments intended for npm from arguments intended for the script that npm runs. In this case the script executes webpack, which allows an environment object to be supplied on the command line using `--env`. Properties of the environment object are specified using the `--env=[property]=[value]` syntax.
|
|
86
|
+
|
|
87
|
+
1. Visit `http://localhost:8080/admin/`.
|
|
88
|
+
1. Log in using credentials for the CM back-end. Content from that Circulation Manager should appear.
|
|
89
|
+
|
|
90
|
+
This works by running a local proxy server. HTML pages received from the Circulaton Manager that load assets from the `circulation-admin` package on jsdelivr are rewritten to load them from the local webpack build instead.
|
|
91
|
+
|
|
92
|
+
Webpack will take care of compiling and updating any new changes made locally for development. Hot module replacement and live reloading are enabled, so the browser will automatically update as changes are made.
|
|
93
|
+
|
|
94
|
+
## Web Catalog
|
|
95
|
+
|
|
96
|
+
The Circulation Manager administrative interface relies on the [OPDS Web Catalog](https://github.com/ThePalaceProject/web-opds-client) as its base React component and application. For more information, please check out that repository.
|
|
97
|
+
|
|
98
|
+
## Publishing a New Release
|
|
99
|
+
|
|
100
|
+
Before publishing a new release, update the version number in package.json and add the new version number + comments about what the new version includes to CHANGELOG.md. For new version numbers, you can refer to [Semantic Versioning](https://semver.org/) (major.minor.patch). Then, run `npm install` to update the package-lock.json file to include the new version.
|
|
101
|
+
|
|
102
|
+
Commit your changes, push them to Github, make a PR, and request your reviewer. Once approved, you may go back to your local repository, checkout the main branch, and `git pull`.
|
|
103
|
+
|
|
104
|
+
This package is [published to npm](https://www.npmjs.com/package/simplified-circulation-web). To publish a new version, you need to create an npm account and be a collaborator on the package.
|
|
105
|
+
|
|
106
|
+
If you're not already logged in to npm from your terminal, you'll have to do so at this point. Run `npm login` and enter your credentials when prompted.
|
|
107
|
+
|
|
108
|
+
Then, you can run `npm publish` from your local copy of the repository (ensure you are on the main branch before doing so).
|
|
109
|
+
|
|
110
|
+
Afterwards, you should tag the release and add comments to Github. On the main branch, run `git tag -a v[version number] -m '[commit message]'`. Then run `git push origin v[version number]`.
|
|
111
|
+
|
|
112
|
+
Go to the Github repository, click on "tags," find the tag you pushed, click on it and hit "edit." Add a release title, and a description. Then save by clicking, "Update Release."
|
|
113
|
+
|
|
114
|
+
## Accessibility
|
|
115
|
+
|
|
116
|
+
In order to develop user interfaces that are accessible to everyone, there are tools added to the workflow. Besides the Typescript `tslint-react-a11y` plugin, `react-axe` is also installed for local development. Using that module while running the app uses a lot of resources so it should be only when specifically testing for accessibility and not while actively developing new features or fixing bugs.
|
|
117
|
+
|
|
118
|
+
In order to run the app with `react-axe`, run `npm run dev-test-axe`. This will add a local global variable `process.env.TEST_AXE` (through webpack) that will trigger `react-axe` in `/src/index.tsx`. The output will be seen in the _browser's_ console terminal.
|
|
119
|
+
|
|
120
|
+
## Tests
|
|
121
|
+
|
|
122
|
+
### Unit Tests
|
|
123
|
+
|
|
124
|
+
Like the codebase, all the unit tests are written in Typescript. Tests are written for all React components as well as redux and utility functions. Older tests are run using mocha and these tests can be found in the `__tests__` folders littered throughout the `src` tree. All new tests should be written using jest and placed in the `tests/jest` directory. The directory structure in `tests/jest` should mirror the structure in `src`.
|
|
125
|
+
|
|
126
|
+
To run the tests, perform `npm test`.
|
|
127
|
+
|
|
128
|
+
We use GitHub Actions for continuous integration. Any pull requests submitted must have tests and those tests must pass on GitHub Actions.
|
|
129
|
+
|
|
130
|
+
### Nightwatch
|
|
131
|
+
|
|
132
|
+
There are end-to-end tests that run on Nightwatch. This selenium-based test runner allows us to include integration tests for logging into the admin and clicking through different pages.
|
|
133
|
+
|
|
134
|
+
To set up credentials and run the tests, check out the [README](/tests/README.md) in `/tests/.
|
|
135
|
+
|
|
136
|
+
## Debugging
|
|
137
|
+
|
|
138
|
+
The [Redux DevTools browser extension](https://github.com/reduxjs/redux-devtools/tree/main/extension) may be used to easily inspect app states and state transitions.
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
Copyright © 2021 The New York Public Library, Astor, Lenox, and Tilden Foundations
|
|
144
|
+
|
|
145
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
146
|
+
you may not use this file except in compliance with the License.
|
|
147
|
+
You may obtain a copy of the License at
|
|
148
|
+
|
|
149
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
150
|
+
|
|
151
|
+
Unless required by applicable law or agreed to in writing, software
|
|
152
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
153
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
154
|
+
See the License for the specific language governing permissions and
|
|
155
|
+
limitations under the License.
|
|
156
|
+
```
|