From c463efaced347f61fab82c08c0bf65be56b3c104 Mon Sep 17 00:00:00 2001 From: John Harvey <10814889+john681611@users.noreply.github.com> Date: Mon, 9 Oct 2023 08:44:17 +0100 Subject: [PATCH 1/2] GA fix bad links (#417) Fix bad links in GA (use standard function) --- .../frontend/src/pages/GapAnalysis/GapAnalysis.tsx | 8 +++----- application/frontend/src/utils/document.ts | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx b/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx index 87ef58a4f..10b3eff38 100644 --- a/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx +++ b/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx @@ -18,6 +18,7 @@ import { LoadingAndErrorIndicator } from '../../components/LoadingAndErrorIndica import { useEnvironment } from '../../hooks'; import { GapAnalysisPathStart } from '../../types'; import { getDocumentDisplayName } from '../../utils'; +import { getInternalUrl } from '../../utils/document'; const GetSegmentText = (segment, segmentID) => { let textPart = segment.end; @@ -66,7 +67,7 @@ const GetResultLine = (path, gapAnalysis, key) => { let segmentID = gapAnalysis[key].start.id; return (
- + { {Object.keys(gapAnalysis).map((key) => ( - +

{getDocumentDisplayName(gapAnalysis[key].start, true)}

diff --git a/application/frontend/src/utils/document.ts b/application/frontend/src/utils/document.ts index 1e01d2b35..efafd4c2e 100644 --- a/application/frontend/src/utils/document.ts +++ b/application/frontend/src/utils/document.ts @@ -47,7 +47,7 @@ export const groupBy = (list: T[], getKey: (item: T) => return previous; }, {} as Record); -export const getInternalUrl = (doc: Document): String => { +export const getInternalUrl = (doc: Document): string => { if (doc.doctype.toLowerCase() != 'cre') { var standardAPIPath = `/node/${doc.doctype.toLowerCase()}/${doc.name}/`; if (doc) { From 6807b40ceaf177043072e8ab627b58d2bcbadcd4 Mon Sep 17 00:00:00 2001 From: John Harvey <10814889+john681611@users.noreply.github.com> Date: Mon, 9 Oct 2023 09:28:14 +0100 Subject: [PATCH 2/2] Speed up CICD (#418) --- .github/workflows/e2e.yml | 6 +++++- .github/workflows/test.yml | 4 ++++ Makefile | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 91392fdce..4d167a4ed 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,7 +9,11 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: - python-version: '3.11.4' + python-version: '3.11.4' + cache: 'pip' + - uses: actions/setup-node@v3 + with: + cache: 'yarn' - name: Install python dependencies run: sudo apt-get update && sudo apt-get install -y python3-setuptools python3-pip chromium-browser libgbm1 && make install-deps - name: Test-e2e diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65d07220c..531b9b35b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,10 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.11.4' + cache: 'pip' + - uses: actions/setup-node@v3 + with: + cache: 'yarn' - name: Install python dependencies run: sudo apt-get update && sudo apt-get install -y python3-setuptools python3-pip && make install-deps - name: Test diff --git a/Makefile b/Makefile index 5da2b61ea..4d4ac9112 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ e2e: [ -d "./venv" ] && . ./venv/bin/activate export FLASK_APP=$(CURDIR)/cre.py export FLASK_CONFIG=development - fFLASK_CONFIG=development flask run& + FLASK_CONFIG=development flask run& yarn test:e2e killall yarn