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
@@ -782,7 +782,7 @@ func (a *App) UploadFileX(channelID, name string, input io.Reader,
|
||||
}
|
||||
}
|
||||
|
||||
if *a.Config().FileSettings.ExtractContent && a.Config().FeatureFlags.FilesSearch {
|
||||
if *a.Config().FileSettings.ExtractContent {
|
||||
infoCopy := *t.fileinfo
|
||||
a.Srv().Go(func() {
|
||||
err := a.ExtractContentFromFileInfo(&infoCopy)
|
||||
@@ -1040,7 +1040,7 @@ func (a *App) DoUploadFileExpectModification(now time.Time, rawTeamId string, ra
|
||||
}
|
||||
}
|
||||
|
||||
if *a.Config().FileSettings.ExtractContent && a.Config().FeatureFlags.FilesSearch {
|
||||
if *a.Config().FileSettings.ExtractContent {
|
||||
infoCopy := *info
|
||||
a.Srv().Go(func() {
|
||||
err := a.ExtractContentFromFileInfo(&infoCopy)
|
||||
|
||||
@@ -288,9 +288,6 @@ func (a *App) DoSystemConsoleRolesCreationMigration() {
|
||||
}
|
||||
|
||||
func (a *App) doContentExtractionConfigDefaultTrueMigration() {
|
||||
if !a.Config().FeatureFlags.FilesSearch {
|
||||
return
|
||||
}
|
||||
// If the migration is already marked as completed, don't do it again.
|
||||
if _, err := a.Srv().Store.System().GetByName(ContentExtractionConfigDefaultTrueMigrationKey); err == nil {
|
||||
return
|
||||
|
||||
@@ -177,6 +177,7 @@ func TestPreparePostForClient(t *testing.T) {
|
||||
defer th.TearDown()
|
||||
|
||||
fileInfo, err := th.App.DoUploadFile(time.Now(), th.BasicTeam.Id, th.BasicChannel.Id, th.BasicUser.Id, "test.txt", []byte("test"))
|
||||
fileInfo.Content = "test"
|
||||
require.Nil(t, err)
|
||||
|
||||
post, err := th.App.CreatePost(&model.Post{
|
||||
|
||||
@@ -299,7 +299,7 @@ func (a *App) UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInfo
|
||||
}
|
||||
}
|
||||
|
||||
if *a.Config().FileSettings.ExtractContent && a.Config().FeatureFlags.FilesSearch {
|
||||
if *a.Config().FileSettings.ExtractContent {
|
||||
infoCopy := *info
|
||||
a.Srv().Go(func() {
|
||||
err := a.ExtractContentFromFileInfo(&infoCopy)
|
||||
|
||||
Ссылка в новой задаче
Block a user