[MM-31247] Add support for compressed export files with attachments (#16614)
* Include filepaths for post attachments * Cleanup * Enable exporting file attachments * Fix file import * Enable zip export * Support creating missing directories when unzipping * Add test * Add translations * Export direct channel posts attachments * Fix returned values order Remove pointer to slice in return * [MM-31597] Implement export process job (#16626) * Implement export process job * Add translations * Remove unused value * [MM-31249] Add /exports API endpoint (#16633) * Implement API endpoints to list, download and delete export files * Add endpoint for single resource * Update i18n/en.json Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> * Update i18n/en.json Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> * Fix var name Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9a33c3706a
Коммит
572f861675
@@ -1439,3 +1439,31 @@ func TestConfigImportSettingsIsValid(t *testing.T) {
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, "model.config.is_valid.import.retention_days_too_low.app_error", err.Id)
|
||||
}
|
||||
|
||||
func TestConfigExportSettingsDefaults(t *testing.T) {
|
||||
cfg := Config{}
|
||||
cfg.SetDefaults()
|
||||
|
||||
require.Equal(t, "./export", *cfg.ExportSettings.Directory)
|
||||
require.Equal(t, 30, *cfg.ExportSettings.RetentionDays)
|
||||
}
|
||||
|
||||
func TestConfigExportSettingsIsValid(t *testing.T) {
|
||||
cfg := Config{}
|
||||
cfg.SetDefaults()
|
||||
|
||||
err := cfg.ExportSettings.isValid()
|
||||
require.Nil(t, err)
|
||||
|
||||
*cfg.ExportSettings.Directory = ""
|
||||
err = cfg.ExportSettings.isValid()
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, "model.config.is_valid.export.directory.app_error", err.Id)
|
||||
|
||||
cfg.SetDefaults()
|
||||
|
||||
*cfg.ExportSettings.RetentionDays = 0
|
||||
err = cfg.ExportSettings.isValid()
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, "model.config.is_valid.export.retention_days_too_low.app_error", err.Id)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user