grist-core
grist-core copied to clipboard
Include workspace name in exported filename ?
Hi there :)
While our Grist usage increases, we start to have some clashes in exported filenames (that we consume from another framework), because we have two documents with the same table inside "suivi reporting" for example.
Would that make sense to also include the workspace in the generated filename (as a prefix I'd say) ?
Thanks :)
Yohan
Do you mean CSV exports? Those are named as <docTitle>-<tableId>
. In your case, are you saying that you have same-named documents, with same-named tables, in different workspaces?
Are these exports made manually from the browser, or using the API?
Do you mean CSV exports? Those are named as <docTitle>-<tableId>. In your case, are you saying that you have same-named documents, with same-named tables, in different workspaces?
Well, not really! But close to :) In practical, we use the workspace for "subteams" inside the ANCT, so the documents and table have "generic names", like "Suivi" for a document and "BDD" for a table. So the exported document "miss" the context (which is in the workspace). That may be very specific to our usage, I understand. Do you see a scenario where this naming could be customized with a plugin or something when self-hosted ?
Are these exports made manually from the browser, or using the API?
At this time, only by hand, but see #348 :)
We could add an option for whether to include the workspace name into the name of the exports, but most users, I imagine, wouldn't use that option. (For self-hosting, it could be an environment variable, to save the work of adding UI for it.)
But a much simpler solution is to rename your documents to include the workspace name, e.g. "Suivi" -> "Workspace1 Suivi" ;)
I like the env variable option :) this would indeed be pretty useful to us
While we're at it, let's also include the org / team site's name ? So with this GRIST_INCLUDE_CONTEXT_TO_DOWNLOAD_FILENAMES=true
the downloaded doc would look like <orgName>-<workspaceName>-<docTitle>-<tableId>
?