gristlabs_grist-core/sandbox/grist
Paul Fitzpatrick 0c5f7cf0a7 (core) add SELF_HYPERLINK() function for generating links to the current document
Summary:
 * Adds a `SELF_HYPERLINK()` python function, with optional keyword arguments to set a label, the page, and link parameters.
 * Adds a `UUID()` python function, since using python's uuid.uuidv4 hits a problem accessing /dev/urandom in the sandbox.  UUID makes no particular quality claims since it doesn't use an audited implementation.  A difficult to guess code is convenient for some use cases that `SELF_HYPERLINK()` enables.

The canonical URL for a document is mutable, but older versions generally forward.  So for implementation simplicity the document url is passed it on sandbox creation and remains fixed throughout the lifetime of the sandbox.  This could and should be improved in future.

The URL is passed into the sandbox as a `DOC_URL` environment variable.

The code for creating the URL is factored out of `Notifier.ts`. Since the url is a function of the organization as well as the document, some rejiggering is needed to make that information available to DocManager.

On document imports, the new document is registered in the database slightly earlier now, in order to keep the procedure for constructing the URL in different starting conditions more homogeneous.

Test Plan: updated test

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2759
2021-03-18 19:37:07 -04:00
..
functions (core) add SELF_HYPERLINK() function for generating links to the current document 2021-03-18 19:37:07 -04:00
imports (core) move data engine code to core 2020-07-29 08:57:25 -04:00
acl_formula.py (core) give more detailed reasons for access denied when memos are present 2021-02-15 17:02:24 -05:00
acl.py (core) granular access control in the presence of schema changes 2021-03-01 13:49:31 -05:00
action_obj.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
action_summary.py (core) Allow using negative rowIds to add records and refer to them in Reference values. 2020-12-15 16:39:56 -05:00
actions.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
autocomplete_context.py (core) For autocomplete suggestions in formulas, add links to suggestions we have documentation for. 2020-09-15 15:24:41 -04:00
codebuilder.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
column.py (core) Allow using negative rowIds to add records and refer to them in Reference values. 2020-12-15 16:39:56 -05:00
csv_patch.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
depend.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
docactions.py (core) Fix another cause of inconsistency that can be triggered by bad DocActions. 2021-01-28 10:21:58 -05:00
docmodel.py (core) Update ACL resources/rules when tables/columns get renamed 2021-01-04 22:03:01 -05:00
engine.py (core) Fix another cause of inconsistency that can be triggered by bad DocActions. 2021-01-28 10:21:58 -05:00
gencode.py (core) Filter out gristHelper columns from the code listing in CodeEditor 2020-07-30 23:18:19 -04:00
gpath.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
grist.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
identifiers.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
import_actions.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
logger.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
lookup.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
main.py (core) Checks that an ACL formula can be parsed, and prevent saving unparsable ACL rules. 2020-12-15 09:43:37 -05:00
match_counter.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
migrations.py (core) Implement new representation of ACL rules. 2020-11-18 08:58:03 -05:00
moment_parse.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
moment.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
objtypes.py (core) Be more careful with avoiding actions which don't change encoded values 2020-12-10 09:09:45 -05:00
records.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
relabeling.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
relation.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
repl.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
runtests.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
sandbox.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
schema.py (core) When checking for metadata consistency, check for stray column records too 2021-01-27 18:10:11 -05:00
summary.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
table_data_set.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
table.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_acl_formula.py (core) give more detailed reasons for access denied when memos are present 2021-02-15 17:02:24 -05:00
test_acl_renames.py (core) Update ACL resources/rules when tables/columns get renamed 2021-01-04 22:03:01 -05:00
test_actions.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_codebuilder.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_column_actions.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_completion.py (core) For autocomplete suggestions in formulas, add links to suggestions we have documentation for. 2020-09-15 15:24:41 -04:00
test_default_formulas.py (core) Fix lookups in default formulas 2020-09-10 18:06:06 -04:00
test_derived.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_display_cols.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_docmodel.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_engine.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_find_col.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_formula_error.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_formula_undo.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_functions.py (core) add SELF_HYPERLINK() function for generating links to the current document 2021-03-18 19:37:07 -04:00
test_gencode.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_gpath.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_import_actions.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_import_transform.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_logger.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_lookups.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_match_counter.py (core) After a spate of spurious test failures, try to fix a few. 2020-09-14 16:17:12 -04:00
test_migrations.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_moment.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_record_func.py (core) Improve object serialization, to help get RECORD data to Custom Widgets. 2020-08-21 18:33:28 -04:00
test_reflist_rel.py (core) Fix a bug that occurs after remaing a table containing a RefList column. 2020-11-26 22:29:37 -05:00
test_relabeling.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_renames2.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_renames.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_side_effects.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_summary2.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_summary.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_table_actions.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_table_data_set.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_temp_rowids.py (core) Allow using negative rowIds to add records and refer to them in Reference values. 2020-12-15 16:39:56 -05:00
test_textbuilder.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_treeview.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_twowaymap.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_types.py (core) Be more careful with avoiding actions which don't change encoded values 2020-12-10 09:09:45 -05:00
test_undo.py (core) Fix another cause of inconsistency that can be triggered by bad DocActions. 2021-01-28 10:21:58 -05:00
test_useractions.py (core) Remove the old attempt at ACLs implemented in Python. 2020-11-12 09:35:08 -05:00
testsamples.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
testscript.json (core) Be more careful with avoiding actions which don't change encoded values 2020-12-10 09:09:45 -05:00
testutil.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
textbuilder.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
treeview.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
twowaymap.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
tzdata.data (core) move data engine code to core 2020-07-29 08:57:25 -04:00
useractions.py (core) Update ACL resources/rules when tables/columns get renamed 2021-01-04 22:03:01 -05:00
usercode.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
usertypes.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00