- Install a AUR helper, such as yay
- Be up to date
$ yay $ yay -S archlinux-keyring
yay -S git firefox visual-studio-code-bin nvm google-chrome
Get the following installed:
- Homebrew
- Node Version Manager
- Firefox
- Google Chrome
- Visual Studio Code
You can then ask for the .env
file from a co-worker, and then...
cd app/
nvm use
npm install
npm run start
Unfortunately, UKSBS provided Windows laptops are very restrictive in terms of permissions; you will need to work around these restrictions with a series of intricate bodges.
- Ensure you have obtained administrator credentials for your laptop.
This is usually your standard credentials, suffixed with
-la
for local administrator access. - Be prepared to type in your password a few dozen times.
These set of instructions sets up a folder where executables are allowed to be executed. Without this step, you are not able to run programs in your home directory, even as an administrator.
- Create a folder in
C:\Program Files
, namedIFSPA
- Right click and edit the Security properties of the folder. Give Users or Everyone "Full control" permissions for the folder.
- Create a folder within the
IFSPA
folder namedDownloads
.- You will be downloading all installers into this folder.
- Create a folder within the
IFSPA
folder namedpath
.- You will be installing global binaries into this folder.
- Add
C:\Program Files\IFSPA\path
to the System Environment variablesPATH
variable.
Top tip!
The following instructions will require the constant use of your administrator credentials. Open up an administrator terminal prompt without closing it.
You can then move to the downloads folder.
In an administrator command prompt (preferably not PowerShell), go to the C:\Program Files\IFSPA\Downloads
folder.
cd %ProgramFiles%\IFSPA
To edit your environment variables, run the following command in your Administrator Terminal
rundll32 sysdm.cpl,EditEnvironmentVariables
Restart instances of Visual Studio Code/terminals to re-initialise the env-vars within those programs.
This section will install the following programs. Skip non-required sections as necessary.
Name | Required to code | Description | Note |
---|---|---|---|
Windows Terminal | [ ] | Good riddance to cmd.exe |
|
Visual Studio Code | [x] | A text editor by Microsoft | You must download the System Installer. Do not use the User Installer. |
Git | [x] | Version control software | SSH is not supported whilst in Polaris House. See more info in install section |
Node Version Switcher | [x] | A Windows equivalent of Node Version Manager | |
Google Chrome | [x] | Web browser | Some extensions may be blocked. See more info in install section |
Firefox | [x] | Web browser | Some extensions may be blocked. See more info in install section |
ShareX | [ ] | Screenshot/Screen video recorder | |
GraphQL Playground | [ ] | A place to try out GraphQL queries | |
Cypress | [x] | Automated browser regression testing |
(N.B. It is not possible to download some of these from the Microsoft Store, as it has been disabled by UKRI.)
Download Link | Note |
---|---|
https://github.com/microsoft/terminal/releases | Don't accidentally install the Windows 11 version. Do not attempt to install the Microsoft Store version. The store has been disabled by UKRI. |
Double click the .msixbundle
file to install. You do not need to be an administrator.
Download Link | Note |
---|---|
https://code.visualstudio.com/download | Use the System Installer. Do not use the User Installer |
Within your administrator terminal prompt, run the VSCodeSetup-x64-[version number here].exe
file.
VSCodeSetup-x64-0.00.0.exe
Download Link | Note |
---|---|
https://git-scm.com/download/win |
Within your administrator terminal prompt, run the Git-[version number here]-64-bit.exe
file.
Git-2.38.1-64-bit.exe
During the installation, set the following...
- The preferred default branch name is
develop
- Use the built in OpenSSH to Windows.
- You can set the default text editor to Visual Studio Code, or your other favourite editor like
neovim
ornano
.
You may need to restart your administrator terminal prompt.
Download Link | Note |
---|---|
Git clone - Read more below | The following instructions are based on the original NVS setup instructions. |
- Specify the installation path
set NVS_HOME=%ProgramFiles%\IFSPA\nvs
- Clone the NVS repo:
git clone https://github.com/jasongin/nvs "%NVS_HOME%"
- Run the
install
command:
"%NVS_HOME%\nvs.cmd" install
You may need to restart your administrator terminal prompt.
- Install the current version of Node.js, in a standard (non-administrator) terminal prompt, and set the version as default
nvs use 14.15.4
nvs link 14.15.4
Download Link | Note |
---|---|
Chrome should already be pre-installed | |
https://www.mozilla.org/en-GB/firefox/new/ | Do not attempt to install the Microsoft Store version. The store has been disabled by UKRI. |
Within your administrator terminal prompt, run the Firefox Installer.exe
file.
"Firefox Installer.exe"
Some extensions may be disabled on UKRI laptops. To temporarily remove this block...
-
Open
regedit.exe
as an administrator -
Delete the following record that currently has the following value...
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallBlocklist\1
*
- Set the following key with the following value...
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\ExtensionSettings
{}
- You can now install extensions. We recommend the following extensions...
Name | Required to develop | Description | Mozilla Firefox | Google Chrome |
---|---|---|---|---|
React Developer Tools | [x] | Tools to help debug React websites | https://addons.mozilla.org/en-GB/firefox/addon/react-devtools/ | https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi |
Redux DevTools | [x] | Tools to help debug the Redux store | https://addons.mozilla.org/en-GB/firefox/addon/reduxdevtools/ | https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd |
uBlock Origin | [ ] | Ad blocker, but mainly used for testing for JavaScript disabled environments | https://addons.mozilla.org/en-GB/firefox/addon/ublock-origin/ | https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm |
ShareX is an open source screenshot, screen-capture and general productivity tool.
Download Link | Note |
---|---|
https://getsharex.com/ | Do not attempt to install the Microsoft Store version. The store has been disabled by UKRI. |
https://ffmpeg.org/download.html | Required to create screen captures in both video and .gif format. |
- Within your administrator terminal prompt, run the
ShareX-[version number here]-setup.exe
file.
ShareX-00.0.0-setup.exe
- Extract the ffmpeg binaries from the zip file (inside
ffmpeg-[date]-git-[hash]-essentials_build.zip\ffmpeg-[date]-git-[hash]-essentials_build\bin\
) into theC:\Program Files\IFSPA\path
folder. - Open the ShareX Task Settings by right-clicking the tray icon, or within the ShareX window, if it is opened.
- Under Screen Recorder, press on the Screen recording options... button.
- Press Install Recorder Devices
- Close ShareX completely, by right clicking the system tray and pressing Exit
- Re-open ShareX. ShareX should now be running under a non-administrator account.
- Open the ShareX Task Settings by right-clicking the tray icon, or within the ShareX window, if it is opened.
- Enter the following under FFmpeg path
C:\Program Files\IFSPA\path\ffmpeg.exe
- Optionally, you can now configure ShareX to however you like it. The following are recommended.
- Autostart, under Application Settings > Integration > Run ShareX when Windows starts
- Hotkey settings, under Hotkey Settings...
Download Link | Notes |
---|---|
https://github.com/graphql/graphql-playground/releases | Don't try to find this on Apollo's website. |
Within your administrator terminal prompt, run the graphql-playground-electron-setup-[version number here].exe
file.
graphql-playground-electron-setup-1.8.10.exe
Point your GraphQL playground to one of the following, depending on what you need...
http://localhost:8080/graphql
http://127.0.0.1:8080/graphql
https://www-acc-dev.apps.ocp4.innovateuk.ukri.org/graphql
Note. This step depends on you having cloned the repository.
Before running npm i
within the /cypress-test
folder, set the following environment variable as...
CYPRESS_CACHE_FOLDER=C:\Program Files\IFSPA\cypress
Note. This step depends on you having Git for Windows or Git on your Linux/Mac computer.
Unfortunately, SSH is blocked within Polaris House. This means you must use HTTPS for your Git needs.
-
Click on the Clone button - Copy this link, but don't run the command yet!
- You will need this link later.
- It should be in the form...
git clone https://user-[weird chars]@bitbucket.org/ukri-ddat/acc-ui.git
-
Create an app password.
-
Copy and paste the app password into the previously copied link, such that it now reads...
git clone https://user-[weird chars]:[password]@bitbucket.org/ukri-ddat/acc-ui.git
Note the
:
added between your username part; this is very very necessary.
In order to build the Node.js service, you'll need to get a secret created on your Openshift project. You will need to do this manually and once only. You run it as follows:
oc create secret generic shibsigningkey --from-file=signing.key=[path-to-shib-signing-key.key]
oc create secret generic sfsigningkey --from-file=signing.key=[path-to-sf-signing-key.key]
The path is to the file containing your key so will need to change accordingly. Leave the rest as it is.
Note. This step depends on you having cloned the repository
To develop locally without SSO...
- Move your command prompt to the
/app
folder. - Ask a co-worker for their
.env
file. This.env
file should have been passed through generations of developers. Keep it safe, by placing it in the/app
folder. - Run
npm i
- Run
npm start
to startesbuild
. The webserver should be ready at https://localhost:8080/
Developing locally for single sign-on (SSO) requires a HTTPS server to be run on local host.
You will need the certificate and private key stored under /security
as AccLocalDevCert.crt
and AccLocalDevKey.key
respectively.
The following key-values will need to be set in your .env file.
USE_SSO=true
SERVER_URL=http://localhost:8080
SSO_PROVIDER_URL=https://auth-acc-ifsdev.apps.org-env-0.org.innovateuk.ukri.org/idp/profile/SAML2/Redirect/SSO
SSO_SIGNOUT_URL=https://acc-ifsdev.apps.org-env-0.org.innovateuk.ukri.org/Logout
IFS_ROOT=https://acc-ifsdev.apps.org-env-0.org.innovateuk.ukri.org
Then run npm run start:dev -- --secure
. The site will be available on https://localhost:8080
with SSO enabled.
- Ensure the server is running with
npm run serve
from the/app
directory - Run
npm run test
- After the tests complete will give you the output location of your report
- Ensure the server is running with
npm run serve
from the/app
directory - Navigate to
test-framework
from repository root - Run
npm install
to install dependencies - Run
npm run build
- Run
npm run test
- After tests have completed the process will give you output location of the report
When running npm run start
, the server process is available to be attached to and debugged.
To enable automatically attaching in Visual Studio Code...
-
In the command palette, run...
> Debug: Toggle Auto Attach
-
Select Only With Flag
To help aid debug client-side code...
- The build commit name, branch name and time is found within the top of the HTML document as a HTML comment.
- Many elements include
data-qa=
tags, which you can use toCTRL+F
your way to the correct file - A
<div />
at the top of the page includes adata-page-qa=
tag to tell you what page is currently being rendered, which you can also use toCTRL+F
your way to the correct file. - Use your debugger in your web browser; all sourcemaps are available to you to add breakpoints.
- Use the aptly named IFS PA Developer & Testing Tools at the bottom of the page to switch between Salesforce accounts.
Please note there is further documentation about the application in relevant subfolders, such as /testframework.