marinedup 6 weeks ago | flag | on: URL builders to use in dashboards

As of 23/01/2024, filesUrl function is replaced by 2 functions:

/// Returns an URL for the file, identified by the hash, at the provided path in /files, and (if known at compile-time) remembers that said file is referenced by this script.
[restricted]
map fileUrl(hash: text, path: text) : text as "fileurl(txt,txt)"

/// Returns an URL for the folder at the provided path in /files, and (if known at compile-time) remembers that said folder is referenced by this script.
[restricted]
map folderUrl(path: text) : text as "folderurl(txt)"

marinedup 3 months | flag | on: URL builders to use in dashboards

/// Returns its argument as-is. If the path is known at compile-time and points to /files, remembers that said file is referenced by this script.
[restricted]
map downloadUrl(fullpath: text) : text as "downloadurl(txt)"

/// Returns an URL for the file with the provided hash, to be downloaded as the provided name.
[restricted]
map downloadUrl(hash: text, name: text) : text as "downloadurl(txt,txt)"

/// Returns an URL for the folder at the provided path in /files, and (if known at compile-time) remembers that said folder is referenced by this script.
[restricted]
map filesUrl(path: text) : text as "filesurl(txt)"

marinedup 5 months | flag | on: Other functions generating URLs

Other useful functions generating URLs are not listed in this documentation:

sliceUrl(slice: ordinal) -> text, pure function
Produces a link to the specified slice, in the current dashboard

sliceUrl(slice: ordinal, tab: text) -> text, pure function
Produces a link to the specified slice & tab, in the current dashboard

dashUrl() -> text, pure function
Produces an url towards the current project dashboard

dashUrl(tabSearch: text) -> text, pure function
Convert a tab name into an url to be used as a link to a specific dashboard tab in current project dashboard

dashUrl(project: number, tabSearch: text) -> text, pure function
Convert a project id and a tab name into an url to be used as a link to a specific dashboard tab

dashUrl(project: number) -> text, pure function
Convert a project id into an url to be used as a link to a dashboard

currentDashUrl() -> text, pure function
Produces an url towards the current run's dashboard.

"The returned text value that contains an URL can be rendered as a link through the StyleCode element {text: "link"}"
{text: link} is deprecated, {href: #(link)} or {href: #[T.Link]} should be used instead

marinedup 5 months | flag | on: sliceSearchUrl overloads

sliceSearchUrl(sliceSearch: text) 🡒 text, pure function
Convert an inspector name search key into an url to be used as a link to a specific slice in current project dashboard

sliceSearchUrl(project: number, sliceSearch: text) 🡒 text, pure function
Convert a project id and an inspector name search key into an url to be used as a link to a specific dashboard slice

sliceSearchUrl(sliceSearch: text, tabSearch: text) 🡒 text, pure function
Convert an inspector name search key and a tab name into an url to be used as a link to a specific dashboard slice and tab in the current project dashboard

sliceSearchUrl(project: number, sliceSearch: text, tabSearch: text) 🡒 text, pure function
Convert a project id, an inspector name search key and a tab name into an url to be used as a link to a specific dashboard slice and tab

It is possible to have sanity checks in user defined functions and throw an error if the check is not passed.
Cf. https://docs.lokad.com/reference/abc/assertfail/