From 2f259ab6c783f6a156eb063e4c298b993897b04c Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Fri, 19 Mar 2021 09:11:11 +0100 Subject: [PATCH] Patch/JSONSchema (#19) * Update README.md * fix issue on JSON array --- README.md | 10 +++++----- package.json | 10 ++++++---- src/utils/index.js | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 32aeff5..618fd51 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json index 15270b4..edc680c 100644 --- a/package.json +++ b/package.json @@ -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" ] } } diff --git a/src/utils/index.js b/src/utils/index.js index 451704d..dd08c24 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -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";