Skip to content

Commit

Permalink
issue #77: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
k-allagbe committed Feb 1, 2024
1 parent c84172d commit 48cf882
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 2,485 deletions.
8 changes: 0 additions & 8 deletions .env

This file was deleted.

12 changes: 6 additions & 6 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Backend API URL for the Finesse frontend application.
# Example: https://finesse-backend.com
REACT_APP_BACKEND_URL=<Backend-API-URL>
VITE_BACKEND_URL=

# Base path for the Finesse frontend application. Used for routing.
# Example: finesse-frontend
REACT_APP_BASENAME=<Frontend-Base-Path>
VITE_BASENAME=

# Boolean flag to enable or disable debug mode for the application.
# When set to True, the application provides a debug panel.
# Defaults to False when not set. Optional.
# Example: True or False
REACT_APP_DEBUG_MODE=<True/False>
VITE_DEBUG_MODE=

# GitHub API URL for accessing the Finesse data repository.
# This URL is used to fetch data from the specified GitHub repository.
# Example: https://api.github.com/repos/ai-cfia/finesse-data/contents
REACT_APP_GITHUB_API_URL=<GitHub-API-URL>
VITE_GITHUB_API_URL=

# Default search source. Options: 'ailab', 'azure' and 'static'.
# Default search source. Options: 'ailab', 'azure' and 'static'.
# Optional. Defaults to 'azure'.
# REACT_APP_SEARCH_SOURCE=azure
# VITE_SEARCH_SOURCE=
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ FROM node:18.16.0-alpine AS build

WORKDIR /code

ARG ARG_REACT_APP_BACKEND_URL
ARG ARG_REACT_APP_DEBUG_MODE
ARG ARG_REACT_APP_GITHUB_API_URL
ARG ARG_REACT_APP_SEARCH_SOURCE
ARG ARG_VITE_BACKEND_URL
ARG ARG_VITE_DEBUG_MODE
ARG ARG_VITE_GITHUB_API_URL
ARG ARG_VITE_SEARCH_SOURCE

ENV REACT_APP_BACKEND_URL=${ARG_REACT_APP_BACKEND_URL:-/api}
ENV REACT_APP_DEBUG_MODE=${ARG_REACT_APP_DEBUG_MODE:-True}
ENV REACT_APP_GITHUB_API_URL=${ARG_REACT_APP_GITHUB_API_URL:-https://api.github.com/repos/ai-cfia/finesse-data/contents}
ENV REACT_APP_SEARCH_SOURCE=${ARG_REACT_APP_SEARCH_SOURCE:-azure}
ENV VITE_BACKEND_URL=${ARG_VITE_BACKEND_URL:-/api}
ENV VITE_DEBUG_MODE=${ARG_VITE_DEBUG_MODE:-True}
ENV VITE_GITHUB_API_URL=${ARG_VITE_GITHUB_API_URL:-https://api.github.com/repos/ai-cfia/finesse-data/contents}
ENV VITE_SEARCH_SOURCE=${ARG_VITE_SEARCH_SOURCE:-azure}

COPY ./src ./src
COPY ./public ./public
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "finesse-frontend",
"private": true,
"version": "0.2.5",
"version": "1.0.0",
"type": "module",
"scripts": {
"prestart": "ts-appversion",
Expand Down
148 changes: 1 addition & 147 deletions src/__snapshots__/App.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -140,153 +140,7 @@ exports[`App Component > displays the version that matches the environment versi
<div
class="sc-jTQCzO IZJjs"
>
v0.2.5
</div>
</div>
</DocumentFragment>
`;

exports[`App Component displays the version that matches the environment version 1`] = `
<DocumentFragment>
<div
class="sc-bdfCDU loUhhx"
>
<header
class="header"
role="banner"
>
<div
class="sc-iBPTVF kFPLcx"
>
<nav>
<ul
class="headerNavList"
>
<li
class="headerNavLeftMargin"
>
<a
href="https://inspection.canada.ca/"
title="ACIA | CFIA"
>
<img
alt="CFIA logo"
aria-label="Link to CFIA | Lien à l'ACIA"
src="CFIA_Banner.png"
style="height: 50px;"
/>
</a>
</li>
<li
class="headerRightText"
>
Alpha Version
</li>
</ul>
</nav>
</div>
<svg
data-testid="debug-button"
fill="currentColor"
height="1em"
stroke="currentColor"
stroke-width="0"
style="color: black; cursor: pointer; z-index: 1001; position: absolute; margin: 10px;"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"
/>
</svg>
</header>
<div
class="sc-gsTDqH gVtqUL"
>
<div>
<a
data-testid="cfia-logo"
href="/"
title="ACIA | CFIA"
>
<img
alt="CFIA logo"
src="CFIA_SmartSearch_Logo.png"
style="height: 110px;"
/>
</a>
</div>
</div>
<div
class="sc-dlfmHC cwWZaV"
>
<form
class="sc-fubDmA kGDFDk"
>
<div
class="sc-pGaPU czysfp"
>
<svg
data-testid="search-icon"
fill="currentColor"
height="1em"
id="fa-arrow-right"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"
/>
</svg>
<input
data-testid="search-input"
placeholder="Type to search..."
value=""
/>
<button
class="sc-kstpWv fEZtjS button"
data-testid="submit-button"
type="submit"
>
<svg
fill="currentColor"
height="1em"
id="fa-arrow-right"
stroke="currentColor"
stroke-width="0"
style="color: rgb(5, 72, 108);"
viewBox="0 0 448 512"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"
/>
</svg>
</button>
</div>
</form>
</div>
<div
class="sc-eCstZk hTAfyD"
>
<text>
Empowering agency's users with precision search.
</text>
<text
style="margin-top: 10px;"
>
Équiper les utilisateurs de l'agence avec la recherche de précision.
</text>
</div>
<div
class="sc-jSguLX iAOjcb"
>
v0.2.5
v1.0.0
</div>
</div>
</DocumentFragment>
Expand Down
28 changes: 14 additions & 14 deletions src/_versions.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export interface TsAppVersion {
version: string;
name: string;
description?: string;
versionLong?: string;
versionDate: string;
gitCommitHash?: string;
gitCommitDate?: string;
gitTag?: string;
}
version: string;
name: string;
description?: string;
versionLong?: string;
versionDate: string;
gitCommitHash?: string;
gitCommitDate?: string;
gitTag?: string;
};
export const versions: TsAppVersion = {
version: "0.2.5",
name: "finesse-frontend",
versionDate: "2024-01-31T20:16:06.521Z",
gitCommitHash: "19bd919",
versionLong: "0.2.5-19bd919",
version: '1.0.0',
name: 'finesse-frontend',
versionDate: '2024-02-01T08:57:03.572Z',
gitCommitHash: '03e5cc4',
versionLong: '1.0.0-03e5cc4',
};
export default versions;
8 changes: 4 additions & 4 deletions src/components/debug_panel/DebugPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("DebugPanel Component Tests", () => {
});
});

test('selects the "AI Lab" radio button when REACT_APP_SEARCH_SOURCE is ailab', async () => {
test('selects the "AI Lab" radio button when VITE_SEARCH_SOURCE is ailab', async () => {
config.searchSource = "ailab";
const view = renderDebugPanel();

Expand All @@ -114,7 +114,7 @@ describe("DebugPanel Component Tests", () => {
expect(view).toMatchSnapshot();
});

test('selects the "Azure AI" radio button when REACT_APP_SEARCH_SOURCE is azure', async () => {
test('selects the "Azure AI" radio button when VITE_SEARCH_SOURCE is azure', async () => {
config.searchSource = "azure";
const view = renderDebugPanel();
const ailabRadioButton = screen.getByTestId("search-source-ailab");
Expand All @@ -129,7 +129,7 @@ describe("DebugPanel Component Tests", () => {
expect(view).toMatchSnapshot();
});

test('selects the "Simulated Data" radio button when REACT_APP_SEARCH_SOURCE is static', async () => {
test('selects the "Simulated Data" radio button when VITE_SEARCH_SOURCE is static', async () => {
config.searchSource = "static";
const view = renderDebugPanel();
const ailabRadioButton = screen.getByTestId("search-source-ailab");
Expand All @@ -144,7 +144,7 @@ describe("DebugPanel Component Tests", () => {
expect(view).toMatchSnapshot();
});

test("no radio button is selected when REACT_APP_SEARCH_SOURCE has a bad value", async () => {
test("no radio button is selected when VITE_SEARCH_SOURCE has a bad value", async () => {
config.searchSource = "bad";
const view = renderDebugPanel();
const ailabRadioButton = screen.getByTestId("search-source-ailab");
Expand Down
Loading

0 comments on commit 48cf882

Please sign in to comment.