Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/ui-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
yarn --cwd quickwit-ui cypress run
- name: Lint
command: yarn --cwd quickwit-ui lint
- name: Check formatting
command: yarn --cwd quickwit-ui check-formatting
- name: Check type consistency
command: yarn --cwd quickwit-ui type
- name: Unit Test
command: yarn --cwd quickwit-ui test
services:
Expand Down
2 changes: 1 addition & 1 deletion quickwit/quickwit-serve/src/ui_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::rest::recover_fn;

/// Regular expression to identify which path should serve an asset file.
/// If not matched, the server serves the `index.html` file.
const PATH_PATTERN: &str = r"(^static|\.(png|json|txt|ico|js|map)$)";
const PATH_PATTERN: &str = r"(^static|\.(png|json|txt|ico|js|map|css|woff2|ttf)$)";

const UI_INDEX_FILE_NAME: &str = "index.html";

Expand Down
2 changes: 0 additions & 2 deletions quickwit/quickwit-ui/.eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions quickwit/quickwit-ui/.eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion quickwit/quickwit-ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build:
yarn build

install:
yarn install
yarn install --frozen-lockfile

start:
yarn start
34 changes: 10 additions & 24 deletions quickwit/quickwit-ui/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Getting Started with Create React App
# quickwit-ui


This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Prerequisites

`node` and `npm` need to be installed on your system.
`node` and `yarn` need to be installed on your system.
The project then relies on misc nodejs tools that can be installed locally by
running `npm install`.
running `yarn`.

## Available Scripts

Expand All @@ -24,36 +24,22 @@ You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
Launches the test runner.

### `yarn e2e-test`

Launches the e2e test runner with [cypress](https://www.cypress.io/). To make them work, you need to start a
searcher beforehand with `cargo r run --service searcher --config config/quickwit.yaml`.

### `yarn format`

Re-writes files with the correct formatting if needed.\
You might want to configure your IDE to do that [automatically](https://biomejs.dev/guides/editors/first-party-extensions/).

### `yarn build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
19 changes: 18 additions & 1 deletion quickwit/quickwit-ui/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,22 @@
"indentStyle": "space",
"includes": ["**", "!**/build"]
},
"linter": { "enabled": false }
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": "off",
"complexity": "off",
"correctness": {
"useExhaustiveDependencies": "off"
},
"suspicious": {
"noTsIgnore": "off",
"useIterableCallbackReturn": "off",
"noExplicitAny": "off",
"noArrayIndexKey": "off"
}
},
"includes": ["**", "!**/build"]
}
}
24 changes: 0 additions & 24 deletions quickwit/quickwit-ui/config-overrides.js

This file was deleted.

1 change: 0 additions & 1 deletion quickwit/quickwit-ui/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
Expand Down
32 changes: 32 additions & 0 deletions quickwit/quickwit-ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Sub-second search & analytics engine on cloud storage"
/>
<link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="manifest.json" />
<!--
TODO: remove and replace with Quickwit fonts.
-->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
<title>Quickwit UI</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="src/index.tsx"></script>
</body>
</html>
33 changes: 33 additions & 0 deletions quickwit/quickwit-ui/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
setupFiles: [
"react-app-polyfill/jsdom", // polyfill jsdom api (such as fetch)
"<rootDir>/jest/setup.js", // polyfill textEncode
],

setupFilesAfterEnv: ["@testing-library/jest-dom"],

testEnvironment: "jsdom",

transform: {
// transform js file (typescript and es6 import)
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": [
"babel-jest",
{
presets: [["babel-preset-react-app", { runtime: "automatic" }]],
plugins: [
["babel-plugin-transform-assets", { extensions: ["svg", "woff2"] }],
],
babelrc: false,
configFile: false,
},
],
},

moduleNameMapper: {
"@monaco-editor/react": "<rootDir>/mocks/monacoMock.js",
"swagger-ui-react": "<rootDir>/mocks/swaggerUIMock.js",
"@mui/x-charts": "<rootDir>/mocks/x-charts.js",
},

resetMocks: true,
};
1 change: 1 addition & 0 deletions quickwit/quickwit-ui/jest/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global.TextEncoder = require("util").TextEncoder;
4 changes: 2 additions & 2 deletions quickwit/quickwit-ui/mocks/monacoMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ import * as React from "react";

// Mock MonocoEditor as the current jest setup does not work when Monaco JS files
// are loaded.
export default function MonacoEditor(props) {
export const Editor = (props) => {
return <div>{props.value}</div>;
}
};
114 changes: 45 additions & 69 deletions quickwit/quickwit-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,63 @@
"version": "0.8.0",
"license": "Apache-2.0",
"private": true,
"proxy": "http://127.0.0.1:7280",
"homepage": "/ui/",
"dependencies": {
"@babel/core": "7.28.5",
"@babel/runtime": "7.28.4",
"@biomejs/biome": "2.3.5",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@mui/icons-material": "5.11.0",
"@mui/lab": "5.0.0-alpha.114",
"@mui/material": "5.11.2",
"@mui/system": "5.11.2",
"@mui/x-charts": "7.3.2",
"@mui/x-date-pickers": "5.0.12",
"@types/jest": "29.5.6",
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.1",
"@monaco-editor/react": "4.7.0",
"@mui/icons-material": "7.3.5",
"@mui/lab": "7.0.1-beta.19",
"@mui/material": "7.3.5",
"@mui/system": "7.3.5",
"@mui/x-charts": "8.18.0",
"@mui/x-date-pickers": "8.18.0",
"@testing-library/dom": "10.4.1",
"@testing-library/jest-dom": "6.9.1",
"@testing-library/react": "16.3.0",
"@testing-library/user-event": "14.6.1",
"@types/jest": "30.0.0",
"@types/node": "20.8.7",
"@types/react": "17.0.65",
"@types/react-dom": "17.0.18",
"@types/swagger-ui-react": "4.18.2",
"@typescript-eslint/eslint-plugin": "6.8.0",
"@typescript-eslint/parser": "6.8.0",
"@types/react": "19.2.6",
"@types/react-dom": "19.2.3",
"@types/swagger-ui-react": "5.18.0",
"babel-jest": "30.2.0",
"babel-plugin-transform-assets": "1.0.2",
"babel-preset-react-app": "10.1.0",
"cypress": "13.3.2",
"dayjs": "1.11.7",
"monaco-editor": "0.34.1",
"monaco-editor-webpack-plugin": "7.1.0",
"react": "17.0.2",
"react-app-rewired": "2.2.1",
"react-dom": "17.0.2",
"react-monaco-editor": "0.50.1",
"react-number-format": "4.9.4",
"jest": "30.2.0",
"jest-environment-jsdom": "30.2.0",
"jest-transform-stub": "2.0.0",
"monaco-editor": "0.54.0",
"react": "19.2.0",
"react-app-polyfill": "3.0.0",
"react-dom": "19.2.0",
"react-monaco-editor": "0.59.0",
"react-number-format": "5.4.4",
"react-router": "7.9.6",
"react-router-dom": "6.6.1",
"react-scripts": "5.0.1",
"styled-components": "5.3.6",
"styled-icons": "10.47.0",
"swagger-ui-react": "5.9.0",
"typescript": "4.9.5",
"styled-components": "6.1.19",
"styled-icons": "10.47.1",
"swagger-ui-react": "5.30.2",
"typescript": "5.9.3",
"vite": "7.2.2",
"web-vitals": "2.1.4"
},
"resolutions": {
"@types/react": "17.0.65",
"@types/react-dom": "17.0.18"
"@types/react": "19.2.6",
"@types/react-dom": "19.2.3"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject",
"start": "vite",
"build": "vite build --outDir build",
"test": "jest",
"postbuild": "cp .gitignore_for_build_directory build/.gitignore",
"lint": "eslint . --ext .ts",
"check-formatting": "biome check",
"lint": "biome check",
"format": "biome check --write",
"type": "tsc",
"e2e-test": "cypress run"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "14.5.1",
"cypress": "13.3.2",
"jest": "29.7.0",
"ts-jest": "29.1.1"
},
"jest": {
"moduleNameMapper": {
"monaco-editor": "<rootDir>/mocks/monacoMock.js",
"swagger-ui-react": "<rootDir>/mocks/swaggerUIMock.js",
"@mui/x-charts": "<rootDir>/mocks/x-charts.js"
}
}
}
Loading
Loading