Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: uktrade/data-hub-frontend
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v15.29.0
Choose a base ref
...
head repository: uktrade/data-hub-frontend
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 359 changed files with 11,010 additions and 13,131 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

128 changes: 0 additions & 128 deletions .eslintrc

This file was deleted.

39 changes: 19 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -10,24 +10,16 @@ updates:
open-pull-requests-limit: 10
ignore:
# When updating this list please ensure that a ticket for unblocking the update has been added to the TechEx/ backlog.
- dependency-name: jsdom # TET-371

# Add dependencies with ticket numbers here (and delete this comment if one is added)

# We can't upgrade to the latest chai version without rebuilding the whole app
- dependency-name: chai
versions:
- '> 20.0.3'
- dependency-name: eslint # Waiting for related dependencies to add support
- '>= 5.0.0'
- dependency-name: sinon-chai
versions:
- '> 8.57.0'
- dependency-name: http-proxy-middleware # TET-698
versions:
- '> 2.0.6'
- dependency-name: chai-as-promised # TET-757
versions:
- '> 7.1.2'
- dependency-name: history # TET-758
versions:
- '> 4.10.1'
- dependency-name: nivo/core # CPS-639
versions:
- '> 0.87.0'
- '>= 3.7.0'

# These are part of dependency groups and should be updated via the relevant script.
- dependency-name: '@storybook/addon-a11y'
@@ -45,6 +37,9 @@ updates:
- dependency-name: '@storybook/manager-api'
versions:
- '>= 0'
- dependency-name: '@storybook/test'
versions:
- '>= 0'
- dependency-name: 'storybook'
versions:
- '>= 0'
@@ -78,7 +73,11 @@ updates:
time: '02:00'
timezone: Europe/London
open-pull-requests-limit: 10
ignore:
- dependency-name: eslint # See above
versions:
- '> 8.57.0'
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
time: '03:00'
timezone: Europe/London
open-pull-requests-limit: 10
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -21,18 +21,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ jobs:
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.2
uses: cirrus-actions/rebase@1.8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.community/t5/GitHub-Actions/Workflow-is-failing-if-no-job-can-be-ran-due-to-condition/m-p/38186#M3250
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcr.io/sre-docker-registry/data-hub-frontend-dependencies:4.3.8
FROM gcr.io/sre-docker-registry/data-hub-frontend-dependencies:4.3.11

ARG CURRENT_UID
ARG CURRENT_GID
2 changes: 1 addition & 1 deletion Dockerfile.dependencies
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ COPY --chown=node:node package*.json "$HOME/"
WORKDIR $HOME

# Install specific version of cypress
RUN npm install -g cypress@13.16.1 \
RUN npm install -g cypress@14.0.3 \
&& npx cypress verify \
&& npx cypress cache path \
&& npx cypress cache list \
3 changes: 2 additions & 1 deletion assets/javascripts/lib/xhr.js
Original file line number Diff line number Diff line change
@@ -39,10 +39,11 @@ const XHR = {
updateOutlet(res, params, win = window) {
this.injectResponseInHtml(res.data)

if (params) {
if (params && Object.keys(params).length > 0) {
const url = `?${queryString.stringify(params)}`
try {
history.replace(url, { data: res.data })
// eslint-disable-next-line no-unused-vars
} catch (err) {
// state was too large for browser to handle. Do full page load.
win.location.assign(url)
3 changes: 1 addition & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@ module.exports = defineConfig({
supportFile: 'test/cypress/support/index.js',
},
retries: {
runMode: 2, // number of retries when running `cypress run`
openMode: 2, // number of retries when running `cypress open`
runMode: 2,
},
})
2 changes: 1 addition & 1 deletion docs/Docker.md
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ Ensure you have [gcloud CLI installed](https://cloud.google.com/sdk/docs/install
> If you have issues when building the dependencies image, especially if you are using a Mac with an Apple chip, this is most likely due to incompatibility with the `arm` architecture; instead you need to build on `amd` architecture. Please refer to [troubleshooting guide](./Troubleshooting.md) and follow the steps under the Building dependency images section, before retrying the build command below.
```bash
export VERSION=4.3.8 # Increment this version each time when you edit Dockerfile.
export VERSION=4.3.11 # Increment this version each time when you edit Dockerfile.

docker build -f Dockerfile.dependencies -t data-hub-frontend-dependencies . --platform linux/amd64

6 changes: 3 additions & 3 deletions docs/Writing tests.md
Original file line number Diff line number Diff line change
@@ -40,9 +40,9 @@ One approach to TDD is first writing a minimal happy path in your feature spec a

**framework:** cypress

**what:** These tests can be used to render and test one component in isolation, so that the code around the entire app and data setup needed doesn't need to run, and only the logic under test is run. It also avoids duplicating tests for shared components across functional tests. E.g. for the `AventriAttendee` component we can pass in the different mock data needed to test different cases, so then in any functional tests where that component appears we only need to check that we pass data into the component.
**what:** These tests can be used to render and test one component in isolation, so that the code around the entire app and data setup needed doesn't need to run, and only the logic under test is run. It also avoids duplicating tests for shared components across functional tests. E.g. for the `CompanyLists` component we can pass in the different mock data needed to test different cases, so then in any functional tests where that component appears we only need to check that we pass data into the component.

**examples:** [ActivityFeed/AventriAttendee.test.jsx](https://github.com/uktrade/data-hub-frontend/blob/main/test/component/cypress/specs/ActivityFeed/AventriAttendee.test.jsx), [CompanyLists/Table.test.jsx](https://github.com/uktrade/data-hub-frontend/blob/main/test/component/cypress/specs/CompanyLists/Table.test.jsx)
**examples:** [CompanyLists/Table.test.jsx](https://github.com/uktrade/data-hub-frontend/blob/618c6db10ab0745ffb59f7356c9390ca1b11e93a/test/component/cypress/specs/components/CompanyLists/Table.cy.jsx)

**how to run:** [component unit tests](https://github.com/uktrade/data-hub-frontend/blob/main/docs/Running%20tests.md#component-unit-tests)

@@ -54,7 +54,7 @@ One approach to TDD is first writing a minimal happy path in your feature spec a

**where:** As close to what's being under test as possible. e.g. in a __test__ folder on the same level.

**examples:** date.test.js, src/client/components/ActivityFeed/activities/__test__/AventriAttendee.test.js (shows how to stub a function that isn't needed)
**examples:** date.test.js

**how to run:** [unit tests](https://github.com/uktrade/data-hub-frontend/blob/main/docs/Running%20tests.md#unit-tests)

Loading