Skip to content

Commit

Permalink
Patch/JSONSchema (#19)
Browse files Browse the repository at this point in the history
* Update README.md

* fix issue on JSON array
  • Loading branch information
danieleguido authored Mar 19, 2021
1 parent 6d763be commit 2f259ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ This is the visual companion of Miller for our the digital exibition websites.
Build a specific version for a project is as easy as:

- get your project name, e.g. `histjust`
- get the git tag in `master` branch with `git tag`, e.g. `v1.1.0`
- get the git tag in `master` branch with `git tag`, e.g. `v1.1.2`
- copy `cp .env.example .env` and edit `REACT_APP_MILLER_CLIENT_ID` according to the target Miller instance
- verify the values of `REACT_APP_DOCUMENT_SCHEMA`
- build using `make` and contcatenate project name and version number in the `BUILD_TAG`: env variable
- build using `make` and concatenate project name and version number in the `BUILD_TAG`: env variable

```
BUILD_TAG=histjust-v1.1.0 make build-docker-image
BUILD_TAG=histjust-v1.1.2 make build-docker-image
```
## Additional Notes
The env variable `REACT_APP_EDITOR_BASENAME` is generated form the `PUBLIC_URL`
so it cannot be changed in the .env file
In the source code we usually refer to the env variable `REACT_APP_EDITOR_BASENAME`.
This is generated from the `PUBLIC_URL` that is not integrated in the react app as such.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@
},
"browserslist": {
"production": [
">0.2%",
">0.3%",
"not ie 11",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
">0.3%",
"not ie 11",
"not dead",
"not op_mini all"
]
}
}
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const getSchemaInitialValue = (properties = {}) => {
// Recursively remove null, undefined, '', {}, [] values from object
const isBlank = value => (_.isEmpty(value) && !_.isNumber(value) && !_.isBoolean(value)) || _.isNaN(value);
export const cleanJSON = obj =>
_.isObject(obj) ? _(obj).mapValues(cleanJSON).omitBy(isBlank).value() : obj;
_.isObject(obj) && !_.isArray(obj) ? _(obj).mapValues(cleanJSON).omitBy(isBlank).value() : obj;


export * from "./modules";

0 comments on commit 2f259ab

Please sign in to comment.