Commit Graph

2 Commits

Author SHA1 Message Date
RoyS 210421ac47 fix: use configured brand name in JSON and PlainText chat export filenames (#33680)
* fix: use configured brand name in JSON and PlainText chat export filenames

The JSON and PlainText chat export functions were using the hardcoded
default 'matrix' as the brand name in filenames, while the HTML/ZIP
export correctly used the configured brand (e.g., 'Element').

This made the filenames inconsistent:
- ZIP: Element - Room - Chat Export - timestamp.zip
- JSON: matrix - Room - Chat Export - timestamp.json

Now both JSON and PlainText exports pass SdkConfig.get().brand to
makeFileNameNoExtension(), matching the behavior of the base Exporter
class used by HTML exports.

Fixes #32853

Signed-off-by: RoySerbi <roy676564@gmail.com>

* refactor: read brand from SdkConfig inside makeFileNameNoExtension

Address review feedback from @t3chguy: the brand parameter on
makeFileNameNoExtension was effectively dead (all three call sites passed
SdkConfig.get().brand and the 'matrix' default was unreachable).

- Exporter.makeFileNameNoExtension now reads SdkConfig.get().brand directly
- All call sites (Exporter, JSONExport, PlainTextExport) simplified to no-arg
- Drop now-unused SdkConfig imports in JSONExport and PlainTextExport

Tests are unchanged: they already mock SdkConfig to return 'Element', so the
existing 'Element-branded destination file name' snapshots remain valid.

---------

Signed-off-by: RoySerbi <roy676564@gmail.com>
2026-06-01 13:44:28 +00:00
Michael Telatynski 91a3cb03c1 mv element.io @types __mocks__/ debian docker module_system/ playwright res src test webapp Dockerfile .dockerignore .eslintignore .stylelintrc.cjs babel.config.cjs recorder-worklet-loader.cjs .modernizr.json components.json config.json config.sample.json package.json project.json tsconfig.json tsconfig.module_system.json jest.config.ts playwright.config.ts webpack.config.ts build_config.sample.yaml apps/web/
mkdir apps/web/scripts
mv scripts/{cleanup.sh,ci_package.sh,copy-res.ts,deploy.py,package.sh} apps/web/scripts

And a couple of gitignore tweaks

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2026-02-24 15:43:58 +00:00