Commit Graph

2634 Commits

Author SHA1 Message Date
Paul Fitzpatrick
db52bb0082 (core) move test/server/lib/GranularAccess.ts to core
Summary:
Move an important set of tests that were in our SaaS
repo for no good reason.

Test Plan: moving tests

Reviewers: jordigh

Reviewed By: jordigh

Differential Revision: https://phab.getgrist.com/D4300
2024-07-17 12:16:42 -04:00
Dmitry S
f0d0a07295 (core) Implement PREVIOUS/NEXT/RANK and lookupRecords().find.* methods.
Summary:
- `lookupRecords()` now allows efficient search in sorted results, with
  the syntax  `lookupRecords(..., order_by="-Date").find.le($Date)`. This will find the record with the nearest date that's <= `$Date`.
- The `find.*` methods are `le`, `lt`, `ge`, `gt`, and `eq`. All have O(log N) performance.
- `PREVIOUS(rec, group_by=..., order_by=...)` finds the previous record to rec, according to `group_by` / `order_by`, in amortized O(log N) time. For example, `PREVIOUS(rec, group_by="Account", order_by="Date")`.
- `PREVIOUS(rec, order_by=None)` finds the previous record in the full table, sorted by the `manualSort` column, to match the order visible in the unsorted table.
- `NEXT(...)` is just like `PREVIOUS(...)` but finds the next record.
- `RANK(rec, group_by=..., order_by=..., order="asc")` returns the rank of the record within the group, starting with 1. Order can be `"asc"` (default) or `"desc"`.
- The `order_by` argument in `lookupRecords`, and the new functions now supports tuples, as well as the "-" prefix to reverse order, e.g. `("Category", "-Date")`.
- New functions are only available in Python3, for a minor reason (to support keyword-only arguments for `group_by` and `order_by`) and also as a nudge to Python2 users to update.

- Includes fixes for several situations related to lookups that used to cause quadratic complexity.

Test Plan:
- New performance check that sorted lookups don't add quadratic complexity.
- Tests added for lookup find.* methods, and for PREVIOUS/NEXT/RANK.
- Tests added that renaming columns updates `order_by` and `group_by` arguments, and attributes on results (e.g. `PREVIOUS(...).ColId`) appropriately.
- Python3 tests can now produce verbose output when VERBOSE=1 and -v are given.

Reviewers: jarek, georgegevoian

Reviewed By: jarek, georgegevoian

Subscribers: paulfitz, jarek

Differential Revision: https://phab.getgrist.com/D4265
2024-07-17 12:00:55 -04:00
Dmitry S
063df75204 (core) Forms improvements: mouse selection in firefox, focus, and styling
Summary:
- Remove unused Form file (Label.ts)
- Fix Firefox-specific bug in Forms, where mouse selection wasn't working in textarea.
- Focus and set cursor in textarea on click.
- Save on blur but only when focus stays within the Grist app, as for editing cells.
- Make paragraph margins of rendered form match those in the form editor.

Test Plan: Tested manually on Firefox and Chrome; relying on existing tests that nothing broke.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4281
2024-07-17 08:55:04 -04:00
Spoffy
1d92e69c43
Adds a home directory for non-root docker user in container (#1109)
Fixes some edge cases where certain programs (e.g yarn) wouldn't work correctly due to HOME being set to a folder with bad permissions.
2024-07-16 22:35:27 +01:00
Jarosław Sadziński
2868ee2fa1 (core) Replacing python3 specifc code
Summary: Removing JSONDecodeError type from python code that is python3 only.

Test Plan: Existing

Reviewers: paulfitz, georgegevoian

Reviewed By: paulfitz, georgegevoian

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D4298
2024-07-16 17:52:38 +02:00
George Gevoian
b5e0e020ef (core) Disable SelectionSummary when diffing documents
Summary:
Cell values can't be summarized if they are diffs of two different
document versions. This was causing a JS error to be thrown when
comparing snapshots.

Test Plan: Browser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4292
2024-07-16 09:52:07 -04:00
Libor Blaheta
73e022b0c5
Translated using Weblate (Czech)
Currently translated at 7.9% (107 of 1340 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/cs/
2024-07-16 13:10:24 +02:00
Владимир В
30eb956f5c
Translated using Weblate (Russian)
Currently translated at 99.6% (1335 of 1340 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/ru/
2024-07-16 13:10:23 +02:00
Dmitry
d922bdbb2d
Fix typo in README.md 2024-07-12 14:21:11 -04:00
Jordi Gutiérrez Hermoso
5afd3cdf2a v1.1.16 2024-07-12 12:54:50 -04:00
Jordi Gutiérrez Hermoso
6760416a24 workflows: don't build stable twice, just push it twice
This now matches the `docker_latest.yml` setup. No point building
grist-ee/grist twice.
2024-07-12 12:49:50 -04:00
Jordi Gutiérrez Hermoso
aafc9baac8 workflows: use variable tags for the stable build
This will make it easier to do some testing while I make sure that
this build is correct.
2024-07-12 12:49:50 -04:00
Jordi Gutiérrez Hermoso
b6e48abf66 workflows: add a dummy ext to the stable build
See a437dfa28c for details
2024-07-12 12:49:50 -04:00
Leslie H
632620544c
Update dropdown conditions on column rename (#1038)
Automatically update dropdown condition formulas on Ref, RefList, Choice and ChoiceList columns when a column referred to has been renamed.
Also fixed column references in ACL formulas using the "$" notation not being properly renamed.
2024-07-12 14:58:49 +00:00
Jordi Gutiérrez Hermoso
a437dfa28c workflows: explicitly add a dummy ext/ directory
Having it checked in to git caused problems with Grist Desktop and
Grist Static because their build processes expected to have nothing
there, as well as interfering with checking out Grist Core as a
submodule.

So we do this instead.
2024-07-11 16:55:41 -04:00
Jordi Gutiérrez Hermoso
8f443a3d78 workflows: move experimental tag back to latest
Our builds seem to be fine now. It is time to release boldly and
widely the new Docker images to the `latest` tag.
2024-07-11 13:06:32 -04:00
Jordi Gutiérrez Hermoso
78f5bd9f5d workflow: conditionally restore ext/ directory
Now that we *have* to have something in the ext directory, we need to
either restore the external ext or the default OSS ext depending on
which build we are doing.
2024-07-10 14:53:39 -04:00
Florent
39eb042ff1
Remove GRIST_SKIP_REDIS_CHECKSUM_MISMATCH (#1098)
Skipping the redis checksum mismatch is now generalized. A warning is
logged when we see a mismatch.
2024-07-10 14:28:20 -04:00
Jordi Gutiérrez Hermoso
d33629366b grist-ee: bump version 2024-07-09 16:15:53 -04:00
Jordi Gutiérrez Hermoso
8b52d55a13 (core) README: proofread the French
Summary: Change "bien" to "beaucoup" and add a space before the exclamation mark as is usually done in French.

Test Plan: None.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D4291
2024-07-09 16:01:55 -04:00
Paul Fitzpatrick
0cdfeeb992 (core) updates from grist-core 2024-07-09 14:33:35 -04:00
Jarosław Sadziński
b8c4b83a8c (core) Updating paths after core changed
Summary: Path for the HomeDbManager has beed updated after merging with core.

Test Plan: Existing

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: georgegevoian

Differential Revision: https://phab.getgrist.com/D4288
2024-07-09 12:19:25 +02:00
Spoffy
a999b4250e Fixes OSS including EE by providing empty ext dir 2024-07-08 14:21:39 -04:00
Spoffy
90a9291e0d
Configures Enterprise Edition image to automatically start with enterprise features enabled (#1084)
* Makes EE be separately built and pushed
* Adds parameterisation to docker_latest.yml to simplify testing
2024-07-08 13:23:36 -04:00
Spoffy
6908807236
Extracts config.json into its own module (#1061)
This adds a config file that's loaded very early on during startup. 

It enables us to save/load settings from within Grist's admin panel, that affect the startup of the FlexServer.

The config file loading:
- Is type-safe, 
- Validates the config file on startup
- Provides a path to upgrade to future versions.

It should be extensible from other versions of Grist (such as desktop), by overriding `getGlobalConfig` in stubs.

----

Some minor refactors needed to occur to make this possible. This includes:
- Extracting config loading into its own module (out of FlexServer).
- Cleaning up the `loadConfig` function in FlexServer into `loadLoginSystem` (which is what its main purpose was before).
2024-07-08 15:40:45 +01:00
Paul Fitzpatrick
6171a012db (core) updates from grist-core 2024-07-08 08:52:56 -04:00
Florent
786ba6b31e
Move HomeDBManager to gen-server/lib/homedb (#1076) 2024-07-05 16:02:39 +02:00
Jarosław Sadziński
9c4814e7aa (core) Bundling save funciton in the field editor
Summary:
Some editors do some async work before saving the value (Ref column can add new
records). Those actions were send without bundling, so it wasn't possible to undo those
actions with togheter.

Test Plan: Added new test

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4285
2024-07-05 08:58:09 +02:00
CamilleLegeron
0bfdaa9c02
Add authorization header in webhooks stored in secrets table (#941)
Summary:
Adding authorization header support for webhooks.

Issue:  https://github.com/gristlabs/grist-core/issues/827

---------

Co-authored-by: Florent <florent.git@zeteo.me>
2024-07-04 14:17:10 +02:00
Leslie H
2750ed6bd9
Enable external contributors to create previews (#1068)
Reorganize preview workflows so that previews can be made for PRs from outside contributors.
2024-07-03 19:36:17 +00:00
Paul Fitzpatrick
5f9ecdcfe4 docstrings, moment import, fix log format 2024-07-03 15:03:14 -04:00
Paul Fitzpatrick
95b8134614 add a getSnapshotProgress implementation to DocStorageManager 2024-07-03 15:03:14 -04:00
Paul Fitzpatrick
4815a007ed log periodic per-document statistics about snapshot generation
This is to facilitate alerting to detect if snapshot generation were to
stall for a document.
2024-07-03 15:03:14 -04:00
Jarosław Sadziński
7f28aee79c (core) Billing updates
Summary:
- Adding confirmation dialog when user doesn't want to cancel site
- Changing `Cancel subscription` to `Cancel plan`
- Removing `Pro` from upgrade header on pricing modal
- Better handling situation when there is no default price
- Removing mentions about sprouts program
- Removing cache for stripe plans

Test Plan: Updated tests

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4273
2024-07-03 09:18:50 +02:00
Roman Holinec
3082fe0f01
Translated using Weblate (Slovak)
Currently translated at 100.0% (1340 of 1340 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/sk/
2024-07-02 02:52:29 +02:00
Grégoire Cutzach
6801732c29
Translated using Weblate (French)
Currently translated at 99.1% (1329 of 1340 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/fr/
2024-07-02 02:52:28 +02:00
Jordi Gutiérrez Hermoso
6888f9bcee tsconfig-ext: revert bc52f65b26
While the intent was to run tests with it, we don't need it. Instead,
this caused problems because the stubs overrode the intended `ext`
directory and therefore disabled the ext features.
2024-07-01 10:21:50 -04:00
Jordi Gutiérrez Hermoso
6e11e497bc workflows: Do not use ext/ director to run tests
We need this directory for building the image, but not for running the
tests outside of it.
2024-07-01 10:21:50 -04:00
Paul Fitzpatrick
919cff0398 (core) updates from grist-core 2024-07-01 09:37:47 -04:00
CamilleLegeron
61421e8251
Create user last connection datetime (#935)
Each time the a Grist page is reload the `last_connection_at` of the user is updated

resolve [#924](https://github.com/gristlabs/grist-core/issues/924)
2024-07-01 15:13:39 +02:00
Paul Janzen
0e777b1fcf
Translated using Weblate (German)
Currently translated at 100.0% (1340 of 1340 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/de/
2024-06-30 13:16:10 +02:00
Paul Janzen
d6d9d1c52e
Translated using Weblate (Spanish)
Currently translated at 100.0% (1340 of 1340 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/es/
2024-06-30 13:16:10 +02:00
Paul Janzen
3769c57915
Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1340 of 1340 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/pt_BR/
2024-06-30 13:16:10 +02:00
Roman Holinec
994432e5de
Translated using Weblate (Slovak)
Currently translated at 100.0% (1337 of 1337 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/sk/
2024-06-29 11:09:32 +00:00
Riccardo Polignieri
6e9dae291c
Translated using Weblate (Italian)
Currently translated at 100.0% (1337 of 1337 strings)

Translation: Grist/client
Translate-URL: https://hosted.weblate.org/projects/grist/client/it/
2024-06-29 11:09:31 +00:00
Jordi Gutiérrez Hermoso
cefadc50c4 workflows: ensure we also use the experimental image we just built
I think without a tag it defaults to `latest`, which is not what we
want.
2024-06-27 16:22:25 -04:00
Jordi Gutiérrez Hermoso
1e5cc585a7 workflows: update the latest branch conditionally
Since we now run the build three times, we don't want to update the
latest branch unless all three builds complete successfully.
2024-06-27 16:22:25 -04:00
Spoffy
a8431c69a7
Makes docker images default to non-root execution (#1031)
De-escalates to a normal user when the docker image is run as root.

Allows GRIST_DOCKER_USER and GRIST_DOCKER_GROUP to be passed to override the default de-escalation behaviour.

Backwards compatible with previous root installations.

--------

This change adds a new docker_entrypoint.sh, which when run as root de-escalates to the provided user, defaulting to grist:grist. This is similar to the approach used by the official postgres docker image.

To achieve backwards compatibility, it changes ownership of any files in `/persist` to the user it's given at runtime. Since the docker container is typically run as root, this should always work.

If the container is run as a standard user from the very start:
* It's the admin's responsibility to ensure `/persist` is writable by that user.
* `/grist` remains owned by root and is read-only.
2024-06-27 14:24:32 +01:00
Jarosław Sadziński
184be9387f (core) Enabling telemetry on /api/version endpoint
Summary:
Version API endpoint wasn't logging telemetry from POST requests. The issue was in registration
order, this endpoint was registered before `expressJson` and it couldn't read json body in the handler.

Test Plan: Added new test

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D4277
2024-06-27 12:05:15 +02:00
Jordi Gutiérrez Hermoso
40f7060ac5 workflows: fix syntax error
Oops, have to quote the string because of the colon
2024-06-26 15:28:26 -04:00