You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To start the development environment, you need a Docker runtime, e.g. [Docker Desktop](https://www.docker.com/products/docker-desktop) and [Nix](https://nixos.org).
42
44
43
-
### Setting up the dev environment
45
+
### 2.1. <aname='Settingupthedevenvironment'></a>Setting up the dev environment
44
46
45
47
1. Make sure that Docker is running
46
48
2. Start the Postgres database with `docker-compose up`
@@ -50,7 +52,7 @@ To start the development environment, you need a Docker runtime, e.g. [Docker De
50
52
yarn setup:dev
51
53
```
52
54
53
-
### Dev server
55
+
### 2.2. <aname='Devserver'></a>Dev server
54
56
55
57
Once the application's set up, you can start the development server with
56
58
@@ -68,15 +70,15 @@ yarn dev:ssl # If you are working with the login process
68
70
69
71
To run the application with debugging enabled through VSCode, make sure the dev server is running and the click the "Run and Debug" button in the sidebar (CMD-SHIFT-D). Then select the "Launch Chrome" configuration. This will open a new Chrome window with the dev tools open. You can now set breakpoints in the code and they will be hit.
### 2.4. <aname='BuildingtheEmbedscriptdistembed.js'></a>Building the Embed script `/dist/embed.js`
80
82
81
83
Currently, the embed script is not automatically built when the dev server starts.
82
84
@@ -88,7 +90,7 @@ yarn dev:rollup
88
90
89
91
> Currently, this only bundles and initializes [iframe-resizer](https://github.com/davidjbradshaw/iframe-resizer) but could be used to render charts without iframes (using [custom elements](https://developers.google.com/web/fundamentals/web-components/customelements) or render to a generic DOM element) in the future.
Several checks are run on different types of events that happen within the repository, including E2E or GraphQL performance tests. In order to be able to build and test the actions locally, we use [act](https://github.com/nektos/act), with example mocked event payloads defined in [this folder](https://github.com/visualize-admin/visualization-tool/tree/main/act).
192
194
193
195
After [installing](https://nektosact.com/installation/index.html) the library, you can run a given action like e.g. `act deployment_status -W ".github/workflows/performance-tests-pr.yml" -e act/deployment_status.json`, modifying the event payload or adding a new one as needed.
194
196
195
-
## E2E tests
197
+
## 6. <a name='E2Etests'></a>E2E tests
196
198
197
199
Playwright is run on every successful deployment of a branch. Screenshots are made with Percy and sent directly to their cloud service for diffing.
198
200
199
201
A special [test page](http://localhost:3000/en/__test) shows all the charts that are screenshotted.
200
202
Those charts configurations are kept in the repository.
The project uses a combination of [k6](https://k6.io) and [Grafana](https://grafana.com) with [Prometheus](https://k6.io/docs/results-output/real-time/prometheus-remote-write/) for GraphQL performance testing.
205
207
206
-
### Automation
208
+
### 7.1. <a name='Automation'></a>Automation
207
209
208
210
To ensure constant monitoring of the performance of selected GraphQL queries, the performance tests are run [once an hour](https://github.com/visualize-admin/visualization-tool/blob/main/.github/workflows/performance-tests.yml) against each environment of the application. The results are then sent to the governmental Grafana dashboards.
209
211
210
-
### How to add or modify the tests
212
+
### 7.2. <a name='Howtoaddormodifythetests'></a>How to add or modify the tests
211
213
212
214
To add or modify the performance tests, go to the [k6/performance-tests](https://github.com/visualize-admin/visualization-tool/tree/main/k6/performance-tests) folder. The GitHub Action is generated by running the `yarn run github:codegen` command; be sure to run it after modifying the [generate-github-action.js](`https://github.com/visualize-admin/visualization-tool/blob/main/k6/performance-tests/generate-github-action.js`) file.
213
215
214
-
## Load tests
216
+
## 8. <a name='Loadtests'></a>Load tests
215
217
216
218
The project uses [k6](https://k6.io) for load testing.
217
219
218
-
### Automation
220
+
### 8.1. <a name='Automation-1'></a>Automation
219
221
220
222
There is a [dedicated GitHub Action](https://github.com/visualize-admin/visualization-tool/actions/workflows/manual-load-test.yml) that runs the API load tests against selected environment.
221
223
You can investigate the results by going to Actions section in GitHub and checking the summary results. They are also visible in the cloud (k6.io), if you enable the cloud option.
222
224
223
-
### Local setup
225
+
### 8.2. <a name='Localsetup'></a>Local setup
224
226
225
227
In order to run the tests locally, follow the [documentation](https://k6.io/docs/get-started/installation/) to install `k6` on your machine.
226
228
227
-
### Running the tests locally
229
+
### 8.3. <a name='Runningthetestslocally'></a>Running the tests locally
228
230
229
231
You might want to run the script locally, for example to be able to bypass the cloud limitations of k6 (e.g. max number of VUs bigger than 50). To run a given load test, simply run
230
232
@@ -237,7 +239,7 @@ by directly modifying the `options` object inside a given script and running `ya
237
239
238
240
For the GraphQL tests, you'll also need to pass `--env ENV=(test|int|prod)` flag to point to the proper environment and `--env ENABLE_GQL_SERVER_SIDE_CACHE=(true | false)` to control whether to use GQL server-side caching.
239
241
240
-
### Recording the tests using Playwright
242
+
### 8.4. <a name='RecordingthetestsusingPlaywright'></a>Recording the tests using Playwright
241
243
242
244
While some tests are written manually, other tests come from HAR recordings that span a broad set of actions.
243
245
In order to record a HAR file and convert it into k6 script, use the `testAndSaveHar` inside `e2e/har-utils.ts` file.
@@ -251,13 +253,27 @@ After the HAR file has been recorded, use [har-to-k6](https://k6.io/docs/test-au
251
253
252
254
> ⚠️ You might want to remove requests to Google afterwards manually, to remove false-positives of blocked requests.
253
255
254
-
## Authentication
256
+
## 9. <a name='Authentication'></a>Authentication
255
257
256
258
Authentication is provided by the Swiss federal government's eIAM through ADFS.
257
259
We use Next-auth to integrate our application with it, through a [custom Provider](app/auth-providers/adfs.ts).
258
260
259
-
### Locally
261
+
### 9.1. <a name='Locally'></a>Locally
260
262
261
263
You can use the ref eIAM. ADFS environment variables should be configured in your
262
264
`.env.local`file. You'll find those secret variables in our shared 1Password in
263
265
the "Visualize.admin .env.local" entry.
266
+
267
+
## 10. <a name='Translations'></a>Translations
268
+
269
+
Translations are managed via [Accent](https://accent.interactivethings.io). Right now, you need to
270
+
manually pull and push the translations. The process goes:
271
+
272
+
1. Edit components, add `<Trans />` and `t()`
273
+
2. Run `yarn locales:extract` to write the `en/messages.po`
274
+
3. Run `yarn locales:push --dry-run` to review what will be pushed to Accent
275
+
4. Run `yarn locales:push` to push the new translations to Accent
276
+
5. Edit the new messages in Accent web UI `yarn locales:browse`
277
+
6. Run `yarn locales:pull` to get the messages.po for all translated languages
278
+
279
+
In the future, we might want to integrate further Accent so that it opens pull requests.
msgstr"Visualisierung von diesem Datensatz erstellen"
63
63
64
-
#: app/browser/select-dataset-step.tsx
65
-
#~ msgid "browse.datasets.all-datasets"
66
-
#~ msgstr "Alle Datensätze"
67
-
68
64
#: app/browser/select-dataset-step.tsx
69
65
msgid"browse.datasets.description"
70
66
msgstr"Erkunden Sie die vom LINDAS Linked Data Service bereitgestellten Datensätze, indem Sie entweder nach Kategorien oder Organisationen filtern oder direkt nach bestimmten Stichworten suchen. Klicken Sie auf einen Datensatz, um detailliertere Informationen zu erhalten und Ihre eigenen Visualisierungen zu erstellen."
@@ -221,14 +217,11 @@ msgstr "Symbole"
221
217
msgid"chart.published.toggle.mobile.view"
222
218
msgstr"Kompakte Ansicht"
223
219
224
-
#: app/login/components/profile-tables.tsx
225
-
#~ msgid "chart.rename"
226
-
#~ msgstr "Umbenennen"
227
-
228
220
#: app/charts/table/table.tsx
229
221
msgid"chart.table.number.of.lines"
230
222
msgstr"Anzahl Zeilen"
231
223
224
+
#: app/components/chart-selection-tabs.tsx
232
225
msgid"chat-preview.delete.confirmation"
233
226
msgstr"Sind Sie sicher, dass Sie dieses Diagramm löschen möchten?"
234
227
@@ -1335,10 +1328,6 @@ msgstr "Filter ausblenden"
1335
1328
msgid"interactive.data.filters.show"
1336
1329
msgstr"Filter anzeigen"
1337
1330
1338
-
#: app/login/components/profile-tables.tsx
1339
-
#~ msgid "login.chart.actions.publish"
1340
-
#~ msgstr "Veröffentlichen"
1341
-
1342
1331
#: app/login/components/profile-tables.tsx
1343
1332
msgid"login.chart.actions.unpublish"
1344
1333
msgstr"Veröffentlichung aufheben"
@@ -1388,10 +1377,6 @@ msgstr "Sind Sie sicher, dass Sie diese Aktion durchführen wollen?"
1388
1377
msgid"login.profile.chart.delete.warning"
1389
1378
msgstr"Denken Sie daran, dass das Entfernen dieser Visualisierung sich auf alle Stellen auswirkt, an denen sie möglicherweise bereits eingebettet ist!"
0 commit comments