Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirkan1/cypress #358

Open
wants to merge 77 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
a6a3b29
#309 | cypress test, I wasnt able to figure out how to create a data …
mirkan1 May 3, 2024
928f9e5
Merge branch 'develop' into mirkan1/cypress
mirkan1 May 3, 2024
34ab468
chore: Refactor ModelsList component and CreateModelDialog component
mirkan1 Aug 2, 2024
3dcf95b
Merge remote-tracking branch 'origin' into mirkan1/cypress
mirkan1 Aug 6, 2024
91eaa17
chore: Update redis connection and queue status retrieval in monitor.py
mirkan1 Aug 7, 2024
d1b017e
Refactor build scripts in package.json for consistency and update int…
mirkan1 Oct 3, 2024
68939fb
read error is fixed
mirkan1 Oct 17, 2024
13e56d1
Add base64-arraybuffer and randomstring packages; update tsconfig to …
mirkan1 Oct 17, 2024
1b7c887
previous turnilo version
mirkan1 Oct 17, 2024
96c2396
current turnilo hash
mirkan1 Oct 17, 2024
665a38b
Refactor defaults in line chart settings to ensure correct type casting
mirkan1 Oct 17, 2024
9e0bf2d
more packages d3 in
mirkan1 Oct 17, 2024
a64b305
Refactor wsgi_profiler_conf.py to remove profiling functionality
mirkan1 Oct 21, 2024
2f9b03a
Refactor @types/mocha to version 9.0.0
mirkan1 Oct 22, 2024
4a75713
Refactor d3 scale functions to use the correct type casting
mirkan1 Oct 22, 2024
61255a2
Refactor d3 imports to use named imports
mirkan1 Oct 22, 2024
bc6717d
Refactor tsconfig.json files in TurniloComponent
mirkan1 Oct 22, 2024
be0339e
Refactor OAuth related code
mirkan1 Oct 22, 2024
c4de958
Refactor preview-string-filter-query.ts to handle additional filter m…
mirkan1 Oct 30, 2024
84329a3
Refactor time.mocha.ts to use d3.ScaleTime for type consistency
mirkan1 Oct 31, 2024
ddd5af5
Refactor Dockerfile and setup scripts for improved user permissions a…
mirkan1 Oct 31, 2024
a543134
Refactor package.json clear script for improved clarity and efficiency
mirkan1 Oct 31, 2024
dc2da8a
Bump version to 0.24.0 and update dependencies in package.json and pa…
mirkan1 Oct 31, 2024
4da6c5f
Refactor package.json scripts for improved clarity and consistency
mirkan1 Oct 31, 2024
730c013
Refactor styles and type definitions for improved consistency and cla…
mirkan1 Nov 2, 2024
467d867
Refactor setup instructions for clarity and update LESS imports for c…
mirkan1 Nov 8, 2024
a995afe
Refactor setup instructions for improved clarity and conciseness
mirkan1 Nov 8, 2024
0b8b367
Refactor imports to use default React import and improve consistency …
mirkan1 Nov 11, 2024
1f9581d
Refactor imports and configuration for improved consistency and suppo…
mirkan1 Nov 11, 2024
a7fb966
Bump version to 0.1.2 and update lodash dependency to 4.17.21
mirkan1 Nov 11, 2024
bab5a99
Refactor time filter presets and add duration normalization function …
mirkan1 Nov 11, 2024
de5a61b
Bump version to 0.1.2, update dependencies, and refactor local storag…
mirkan1 Nov 22, 2024
0da17c4
Enhance TypeScript configuration, add source-map-loader, update react…
mirkan1 Nov 25, 2024
e4f18c9
Refactor FilterTile component, enhance time utility functions, and up…
mirkan1 Nov 25, 2024
ad38762
Refactor useReport and useSaveReport hooks to streamline report savin…
mirkan1 Nov 25, 2024
a5233da
Refactor React imports to use named imports and update Split model wi…
mirkan1 Nov 25, 2024
f882749
Update TypeScript and Mocha types, add new SCSS files for visualizati…
mirkan1 Nov 26, 2024
1c0e304
Refactor report fetching logic to use AbortController for improved er…
mirkan1 Nov 28, 2024
d9ec41a
Enhance styles for reading element in TurniloComponent by adding poin…
mirkan1 Nov 28, 2024
a3d9862
Refactor React imports to use default imports, update component types…
mirkan1 Dec 3, 2024
e620f80
Refactor Split model to remove unused limits parameter, update Filter…
mirkan1 Dec 3, 2024
4e82348
Fix syntax by replacing arrow functions with regular function declara…
mirkan1 Dec 10, 2024
5d0ce55
Merge branch 'develop' into mirkan1/cypress
mirkan1 Dec 10, 2024
b5d1e67
refactor: simplify viewport width handling in dashboard tests
mirkan1 Dec 15, 2024
e04d254
90% of the changes are made for client side
mirkan1 Dec 31, 2024
5cb3ed3
Merge remote-tracking branch 'origin' into mirkan1/cypress
mirkan1 Dec 31, 2024
cccfb71
Merge branch 'DR-61-integrate-latest-version-of-turnilo-into-data-rep…
mirkan1 Dec 31, 2024
b06cf2b
chore: remove obsolete network connection documentation and clean up …
mirkan1 Jan 4, 2025
25455df
refactor: clean up code and update package dependencies for plywood
mirkan1 Jan 8, 2025
831440c
chore: update cypress setup instructions and add restart script
mirkan1 Jan 8, 2025
9527cd1
chore: update Dockerfile for frontend build process and remove obsole…
mirkan1 Jan 8, 2025
e692cde
chore: update plywood service to use Node.js 16.20.0-alpine in Docker…
mirkan1 Jan 8, 2025
30ec17f
feat: add query formatting utilities and dropdown components for data…
mirkan1 Jan 8, 2025
01d500e
feat: add TypeScript configuration and update webpack for improved as…
mirkan1 Jan 8, 2025
6a55e60
feat: update Cypress configuration and tests for improved stability a…
mirkan1 Jan 8, 2025
421fb28
fix: reorder user imports in index.js for consistency and clarity
mirkan1 Jan 10, 2025
69e72ba
feat: update Cypress Dockerfile and tests for improved compatibility …
mirkan1 Jan 11, 2025
01f5304
feat: enhance widget handling and dashboard editing capabilities with…
mirkan1 Jan 12, 2025
5c09353
chore: update engine version constraints for Node.js and npm in packa…
mirkan1 Jan 18, 2025
11fe4a7
feat: implement session management for login command in Cypress tests
mirkan1 Jan 18, 2025
6562bef
fix: update widget height assertions in dashboard tests for accuracy
mirkan1 Jan 19, 2025
a49bdde
feat: streamline Counter visualization tests by removing redundant steps
mirkan1 Jan 19, 2025
07899b6
fix: update logout title assertion in dashboard sharing tests for con…
mirkan1 Jan 19, 2025
2210dc8
fix: update project name and version in pyproject.toml
mirkan1 Jan 19, 2025
225645d
feat: enhance table renderer styles for pagination item links
mirkan1 Jan 19, 2025
c345d2b
feat: add public_widget serializer for widget details in dashboards
mirkan1 Jan 19, 2025
d060e9e
feat: implement choropleth visualization enhancements and add GeoJSON…
mirkan1 Jan 28, 2025
b260f9c
feat: enhance chart editor with axis tick format changes and refactor…
mirkan1 Jan 28, 2025
4db0c82
fix: replace substr with substring for better compatibility and updat…
mirkan1 Jan 28, 2025
c1ed518
feat: enhance UI components with new styles and improve link handling
mirkan1 Jan 29, 2025
98e00aa
fix: update docker-compose.yml to use string values for rate limit an…
mirkan1 Feb 3, 2025
838e8ac
fix: update widget type check for turnilo widget and adjust widget he…
mirkan1 Feb 3, 2025
9a73739
feat: improve ParameterApplyButton accessibility and update Cypress t…
mirkan1 Feb 3, 2025
0c9c976
feat: add truncated field to query result data and enhance query edit…
mirkan1 Feb 3, 2025
085f0f6
feat: add test data model to seed data and improve styling for ModelC…
mirkan1 Feb 3, 2025
cadcf0a
feat: enhance chart visualizations with hover label adjustments and u…
mirkan1 Feb 6, 2025
ff12669
#DR-77 refactor: streamline query parser code and enhance readability…
mirkan1 Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 9 additions & 3 deletions .circleci/Dockerfile.cypress
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM cypress/browsers:chrome67
# FROM cypress/browsers:node16.13.0-chrome95-ff94

# Install libnss3
RUN apt-get update && apt-get install libgtk2.0-0t64 libgtk-3-0t64 libgbm-dev libnotify-dev libnss3 libxss1 libasound2t64 libxtst6 xauth xvfb \
&& rm -rf /var/lib/apt/lists/*

ENV APP /usr/src/app
WORKDIR $APP

COPY package.json $APP/package.json
RUN npm run cypress:install > /dev/null
COPY viz-lib $APP/viz-lib
COPY plywood $APP/plywood
COPY client $APP/client

COPY client/cypress $APP/client/cypress
COPY cypress.json $APP/cypress.json
COPY . $APP

RUN ./node_modules/.bin/cypress verify
36 changes: 20 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
FROM node:14.17 AS frontend-builder
FROM node:16.20 AS frontend-builder

# Controls whether to build the frontend assets
ARG skip_frontend_build

RUN useradd -m -d /frontend datareporter
USER datareporter

WORKDIR /frontend
COPY bin/build_frontend.sh .
COPY client/ /frontend/client
COPY viz-lib/ /frontend/viz-lib
COPY plywood/server/ /frontend/plywood/server/
RUN if [ "x$skip_frontend_build" = "x" ] ; then \
echo "Building frontend";\
./build_frontend.sh;\
COPY --chown=datareporter client /frontend/client
COPY --chown=datareporter viz-lib/ /frontend/viz-lib
COPY --chown=datareporter plywood/server /frontend/plywood/server/
COPY --chown=datareporter plywood/server/client /frontend/plywood/server/client

# install node dependencies
RUN if [ "x$skip_frontend_build" = "x" ]; then \
cd client && npm i && npm run build;\
else \
echo "Skipping frontend build" &&\
mkdir -p /frontend/client/dist &&\
touch /frontend/client/dist/multi_org.html &&\
touch /frontend/client/dist/index.html;\
Expand All @@ -22,7 +25,7 @@ FROM python:3.8-slim-buster

EXPOSE 5000

RUN useradd --create-home redash
RUN useradd --create-home datareporter

# Ubuntu packages
RUN apt-get update && \
Expand Down Expand Up @@ -80,14 +83,15 @@ ARG POETRY_OPTIONS="--no-root --no-interaction --no-ansi"
ARG install_groups="main,all_ds,dev"
RUN /etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS

COPY --chown=redash . /app
COPY --chown=redash --from=frontend-builder /frontend/client/dist /app/client/dist
RUN chown redash:redash -R /app
RUN find /app
USER redash
COPY --chown=datareporter . /app
COPY --chown=datareporter --from=frontend-builder /frontend/client/dist /app/client/dist
RUN chown datareporter:datareporter -R /app
USER datareporter

ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
# The version is being set arbitrarily by the builder
ARG version
ENV DATAREPORTER_VERSION=$version

ENTRYPOINT ["/app/bin/docker-entrypoint"]
CMD ["server"]
CMD ["server"]
29 changes: 16 additions & 13 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ nvm use v14 > /dev/null
```

* Build UI - Required to build ui for
* Enter project root directory
* `cd client`
* `npm install` Installs all node dependencies to for redash
* `npm run build` Builds front end to the folder `client/dist/`
* `cd client` Enter project root directory
* `npm install` Installs all node dependencies to for redash
* `npm run build` Builds front end to the folder `client/dist/`

* Build Plywood
* Enter project root directory
* `cd plywood/server`
* `npm install` Installs all node dependencies to for plywood
* `npm run build` Builds plywood server end to the folder `plywood/server/dist/`
* `cd plywood/server` Enter project root directory
* `npm install` Installs all node dependencies to for plywood
* `npm run build` Builds plywood server end to the folder `plywood/server/dist/`

* Setup docker compose
* `make up` or `docker compose up --build` to start required services like postgres app server
Expand All @@ -61,7 +59,7 @@ nvm use v14 > /dev/null

## Local Development

Consider using [pyenv](https://github.com/pyenv/pyenv#installation) for installing local Python pyenv app. Datareporter container images are shipped with Python 3.8.7, [ubuntu guide](https://www.dedicatedcore.com/blog/install-pyenv-ubuntu/)
Consider using [pyenv](https://github.com/pyenv/pyenv#installation) for installing local Python pyenv app. Data Reporter container images are shipped with Python 3.8.7, [ubuntu guide](https://www.dedicatedcore.com/blog/install-pyenv-ubuntu/)
```
# install necessary python version
pyenv install 3.8.7
Expand Down Expand Up @@ -94,17 +92,22 @@ Then run the tests:
docker compose run --rm server tests
```
In order to test viz-lib folder you need to install dependencies and run tests because you cant have 2 react versions in the same project. To do that run below commands in the viz-lib folder:
```sh
npm install antd@^4 react@^16.8 react-dom@^16.8 && npm run test
```
npm install antd@^3 react@^16.8 react-dom@^16.8 && npm run test

### Running cypress
```sh
bash bin/restart_cypress.sh
```

### Components
#### Datareporter server
#### Data Reporter server
* **directory**: `redash`
* **debug**: Please follow the instruction from [redash](https://redash.io/help/open-source/dev-guide/debugging)
* **changes:**
* All changes are immediately visible as the python application is interpreted and it's running directly from source code.
#### Datareporter frontend
#### Data Reporter frontend
* **submodules** - for debug and changes they follow root fronted app:
* Lib viz
* **directory:** `viz-lib`
Expand All @@ -114,7 +117,7 @@ npm install antd@^3 react@^16.8 react-dom@^16.8 && npm run test
* **debug:** Can be debugged from browser open application at `http://localhost:8080` || `5000` and use browser debugger.
* **changes:**
* By default, changes are not reflected. You need go into `client` directory and start `npm run watch`.
That will start watched for source code changes for Datareporter frontend and all submodules.
That will start watched for source code changes for Data Reporter frontend and all submodules.
* At liniux system you may face problem of too many file system watchers. That will result in error message
```Error: ENOSPC: System limit for number of file watchers reached, watch ```
To solve it you need to increase the number of available watches by :
Expand Down
8 changes: 0 additions & 8 deletions bin/build_frontend.sh

This file was deleted.

10 changes: 10 additions & 0 deletions bin/restart_cypress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# check if we are in client folder, use dirname
if [ "$(basename $(pwd))" != "client" ]; then
cd client
fi
if [ ! -d "node_modules" ]; then
npm install
fi
npm run cypress build
npm run cypress start
npm run cypress open
3 changes: 2 additions & 1 deletion bin/restart_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if [ "$state" = "yes" ] || [ "$state" = "first" ]; then
docker rm datareporter-server-1
docker rmi datareporter-server
docker-compose up -d
docker compose run --rm server create_db
docker-compose stop server && docker-compose run --rm --service-ports server debug && docker-compose start server

else
Expand All @@ -24,4 +25,4 @@ else
docker-compose up -d
docker-compose stop server && docker-compose run --rm --service-ports server debug && docker-compose start server

fi
fi
6 changes: 6 additions & 0 deletions bin/server_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# First lets ensure that the "tests" database is created:
docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests"

# Then run the tests:
docker-compose run --rm server tests
33 changes: 20 additions & 13 deletions client/.babelrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
{
"presets": [
["@babel/preset-env", {
"exclude": [
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-transform-arrow-functions"
],
"useBuiltIns": "usage"
}],
[
"@babel/preset-env",
{
"exclude": ["@babel/plugin-transform-async-to-generator", "@babel/plugin-transform-arrow-functions"],
"corejs": "2",
"useBuiltIns": "usage"
}
],
"@babel/preset-react",
"@babel/preset-typescript",
"@babel/preset-flow"
],
"plugins": [
"babel-plugin-flow-to-typescript",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-object-assign",
["babel-plugin-transform-builtin-extend", {
"globals": ["Error"]
}],
"@babel/plugin-transform-runtime"
]
[
"babel-plugin-transform-builtin-extend",
{
"globals": ["Error"]
}
]
],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
35 changes: 33 additions & 2 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ module.exports = {
"react-app",
"plugin:compat/recommended",
"prettier",
"plugin:jsx-a11y/recommended",
// Remove any typescript-eslint rules that would conflict with prettier
"prettier/@typescript-eslint",
],
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint"],
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint", "jsx-a11y"],
settings: {
"import/resolver": "webpack",
},
Expand All @@ -19,7 +20,35 @@ module.exports = {
rules: {
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/anchor-is-valid": [
// TMP
"off",
{
components: ["Link"],
aspects: ["noHref", "invalidHref", "preferButton"],
},
],
"jsx-a11y/no-redundant-roles": "error",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/click-events-have-key-events": "off", // TMP
"jsx-a11y/no-static-element-interactions": "off", // TMP
"jsx-a11y/no-noninteractive-element-interactions": "off", // TMP
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-restricted-imports": [
"error",
{
paths: [
{
name: "antd",
message: "Please use 'import XXX from antd/lib/XXX' import instead.",
},
{
name: "antd/lib",
message: "Please use 'import XXX from antd/lib/XXX' import instead.",
},
],
},
],
},
overrides: [
{
Expand All @@ -34,6 +63,8 @@ module.exports = {
// Do not complain about useless contructors in declaration files
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
// Many API fields and generated types use camelcase
"@typescript-eslint/camelcase": "off",
},
},
],
Expand Down
38 changes: 37 additions & 1 deletion client/app/assets/less/ant.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@import "~antd/lib/pagination/style/index";
@import "~antd/lib/table/style/index";
@import "~antd/lib/popover/style/index";
@import "~antd/lib/icon/style/index";
@import "~antd/lib/tag/style/index";
@import "~antd/lib/grid/style/index";
@import "~antd/lib/switch/style/index";
Expand Down Expand Up @@ -226,6 +225,16 @@
}
}

&-tbody > tr&-row {
&:hover,
&:focus,
&:focus-within {
& > td {
background: @table-row-hover-bg;
}
}
}

// Custom styles

&-headerless &-tbody > tr:first-child > td {
Expand Down Expand Up @@ -392,6 +401,18 @@
left: 0;
}
}

&:focus,
&:focus-within {
color: @menu-highlight-color;
}
}
}

.@{dropdown-prefix-cls}-menu-item {
&:focus,
&:focus-within {
background-color: @item-hover-bg;
}
}

Expand All @@ -402,3 +423,18 @@
.@{checkbox-prefix-cls} + span {
padding-right: 0;
}

// make sure Multiple select has room for icons
.@{select-prefix-cls}-multiple {
&.@{select-prefix-cls}-show-arrow,
&.@{select-prefix-cls}-show-search,
&.@{select-prefix-cls}-loading {
.@{select-prefix-cls}-selector {
padding-right: 30px;
}
}
}

.ant-btn-icon-only.ant-btn-sm {
width: auto!important;
}
1 change: 0 additions & 1 deletion client/app/assets/less/icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
Expand Down
Loading