From b0d06baf296981835d891bed13194b8a7716f6e6 Mon Sep 17 00:00:00 2001 From: biharck Date: Fri, 26 Apr 2019 22:20:17 -0300 Subject: [PATCH] adding more details at the getting-started readme and changing react index to use .js config files --- docs/latest/essentials/getting-started.md | 10 ++++------ src/index.js | 10 +++++----- src/routes/StandaloneRouting.js | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/latest/essentials/getting-started.md b/docs/latest/essentials/getting-started.md index f9e3d28b1..f43871cea 100644 --- a/docs/latest/essentials/getting-started.md +++ b/docs/latest/essentials/getting-started.md @@ -19,14 +19,13 @@ You can either spin up locally or run with Docker. 2. Open a new terminal tab, go under `ohif-viewer` directory and install all dependency packages via `yarn` ````bash - cd Packages-react/ohif-viewer - npm install + yarn install ```` 3. Run the application ````bash - yar start + yarn start ```` Note: This will connect to our public DICOMWeb server so you can verify your installation. Follow the next section to connect to your own local or remote DICOMWeb server. @@ -121,15 +120,14 @@ Once you have Orthanc running with docker either with temporary data storage or 3. After you load the data, open a new terminal tab in the `ohif-viewer` directory and install all dependency packages via NPM ````bash - cd Packages-react/ohif-viewer yarn install ```` 3. Run the application using one of the available configuration files. - **the following command assumes you are under `Packages-react/ohif-viewer` folder** + **the following command assumes you are under the `root` folder** ````bash - export REACT_APP_CONFIG=$(cat ../../config-react/local_orthanc.json) + export REACT_APP_CONFIG=$(cat ./config/local_orthanc.js) yarn start ```` diff --git a/src/index.js b/src/index.js index d387dff9b..77395e6c6 100644 --- a/src/index.js +++ b/src/index.js @@ -175,14 +175,14 @@ props.whiteLabelling = { // // If you change the JSON config, you need to re-run the command! const configString = process.env && process.env && process.env.REACT_APP_CONFIG; + if (configString) { - const configJSON = JSON.parse(configString); - if (configJSON.servers) { - props.servers = configJSON.servers; + if (configString.servers) { + props.servers = configString.servers; } - if (configJSON.oidc) { - props.oidc = configJSON.oidc; + if (configString.oidc) { + props.oidc = configString.oidc; } } diff --git a/src/routes/StandaloneRouting.js b/src/routes/StandaloneRouting.js index e190d1ab9..195d6feab 100644 --- a/src/routes/StandaloneRouting.js +++ b/src/routes/StandaloneRouting.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import qs from 'query-string'; +import qs from 'querystring'; import Viewer from '../connectedComponents/Viewer'; import OHIF from 'ohif-core';