Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ limitations under the License.
- Open `.env` files and set `REACT_APP_API_URL` to point to services:
- local: [http://localhost:{PORT}](http://localhost:{PORT})

<h3>💻 UI Customization</h3>

The default description on each of the three main application pages can be customized by setting the following environment variables:

- `DESCRIPTION_RETRIEVAL`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, we agreed on exposing description for each collection via flowing that information through APIs rather than environment variables?

Did we decide to not experiment with that approach?

- `DESCRIPTION_READING`
- `DESCRIPTION_QA`


<h3>💻 Run Locally</h3>

- Run the app in the _*development mode*_: `yarn start`
Expand Down
5 changes: 4 additions & 1 deletion deployment.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/sh

sed -i 's#__API_URL__#'"$API_URL"'#g' /usr/share/nginx/html/env.js;
sed -i 's#__API_URL__#'"$API_URL"'#g' /usr/share/nginx/html/env.js;
sed -i 's#__DESCRIPTION_RETRIEVAL__#'"$DESCRIPTION_RETRIEVAL"'#g' /usr/share/nginx/html/env.js;
sed -i 's#__DESCRIPTION_READING__#'"$DESCRIPTION_READING"'#g' /usr/share/nginx/html/env.js;
sed -i 's#__DESCRIPTION_QA__#'"$DESCRIPTION_QA"'#g' /usr/share/nginx/html/env.js;
7 changes: 6 additions & 1 deletion public/env.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
window.env = { API_URL: "__API_URL__" };
window.env = {
API_URL: "__API_URL__",
DESCRIPTION_RETRIEVAL: "__DESCRIPTION_RETRIEVAL__",
DESCRIPTION_READING: "__DESCRIPTION_READING__",
DESCRIPTION_QA: "__DESCRIPTION_QA__"
};
17 changes: 17 additions & 0 deletions src/api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,20 @@ export const BASE_URL =
process.env.NODE_ENV === "production"
? window.env.API_URL
: process.env.REACT_APP_API_URL;

export const DESCRIPTION_RETRIEVAL =
process.env.NODE_ENV === "production"
? window.env.DESCRIPTION_RETRIEVAL
: process.env.REACT_APP_DESCRIPTION_RETRIEVAL;

export const DESCRIPTION_READING =
process.env.NODE_ENV === "production"
? window.env.DESCRIPTION_READING
: process.env.REACT_APP_DESCRIPTION_READING;

export const DESCRIPTION_QA =
process.env.NODE_ENV === "production"
? window.env.DESCRIPTION_QA
: process.env.REACT_APP_DESCRIPTION_QA;


13 changes: 10 additions & 3 deletions src/components/applications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ import _ from "lodash";

import { Search, Book, SearchLocate, Application } from "@carbon/react/icons";

import {
DESCRIPTION_RETRIEVAL,
DESCRIPTION_READING,
DESCRIPTION_QA,
} from "../../api/config";

import HeaderContent from "../header/index";
import Notifications from "../notifications";
import Navigation from "../navigation";
Expand Down Expand Up @@ -52,15 +58,16 @@ export async function listApplicationsIfRequired(applications, dispatch) {
applicationId: "retrieval",
name: "Retrieval",
description:
"Search a document collection using dense and sparse information retrieval techniques",
DESCRIPTION_RETRIEVAL || "Search a document collection using dense and sparse information retrieval techniques",
githubLink: "https://github.com/primeqa/primeqa",
feedbackLink: "https://github.com/primeqa/primeqa/issues/new",
settings: settings,
},
{
applicationId: "reading",
name: "Reading",
description: "Find answer to questions based on a given context",
description:
DESCRIPTION_READING || "Find answer to questions based on a given context",
githubLink: "https://github.com/primeqa/primeqa",
feedbackLink: "https://github.com/primeqa/primeqa/issues/new",
settings: settings,
Expand All @@ -69,7 +76,7 @@ export async function listApplicationsIfRequired(applications, dispatch) {
applicationId: "qa",
name: "Question Answering",
description:
"Find answers to question from retrieved evidence blocks",
DESCRIPTION_QA || "Find answers to question from retrieved evidence blocks",
githubLink: "https://github.com/primeqa/primeqa",
feedbackLink: "https://github.com/primeqa/primeqa/issues/new",
settings: settings,
Expand Down