Removing FilesSearch feature flag (#17548)
* Removing FilesSearch feature flag * Fixing tests * Adding an improvement on plain text extraction * Adding tests for plain text extraction * Removed unneeded conversion * Adding missed license * Remove the feature flag from the migration * Fixing some tests * Updating i18n/en.json file
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e2b9cb98aa
Коммит
df695115be
@@ -734,11 +734,6 @@ func searchFiles(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if !c.App.Config().FeatureFlags.FilesSearch {
|
||||
c.Err = model.NewAppError("searchFiles", "api.post.search_files.not_implemented.app_error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
|
||||
if !c.App.SessionHasPermissionToTeam(*c.App.Session(), c.Params.TeamId, model.PERMISSION_VIEW_TEAM) {
|
||||
c.SetPermissionError(model.PERMISSION_VIEW_TEAM)
|
||||
return
|
||||
|
||||
@@ -1048,33 +1048,15 @@ func TestGetPublicFile(t *testing.T) {
|
||||
require.Equal(t, http.StatusNotFound, resp.StatusCode, "should've failed to get file after it is deleted")
|
||||
}
|
||||
|
||||
func TestSearchFilesOnFeatureFlagDisabled(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
terms := "search"
|
||||
isOrSearch := false
|
||||
timezoneOffset := 5
|
||||
searchParams := model.SearchParameter{
|
||||
Terms: &terms,
|
||||
IsOrSearch: &isOrSearch,
|
||||
TimeZoneOffset: &timezoneOffset,
|
||||
}
|
||||
_, resp := th.Client.SearchFilesWithParams(th.BasicTeam.Id, &searchParams)
|
||||
require.NotNil(t, resp.Error)
|
||||
}
|
||||
|
||||
func TestSearchFiles(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
experimentalViewArchivedChannels := *th.App.Config().TeamSettings.ExperimentalViewArchivedChannels
|
||||
defer func() {
|
||||
os.Unsetenv("MM_FEATUREFLAGS_FILESSEARCH")
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
cfg.TeamSettings.ExperimentalViewArchivedChannels = &experimentalViewArchivedChannels
|
||||
})
|
||||
}()
|
||||
os.Setenv("MM_FEATUREFLAGS_FILESSEARCH", "true")
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.TeamSettings.ExperimentalViewArchivedChannels = true
|
||||
})
|
||||
|
||||
Ссылка в новой задаче
Block a user