Feature edit attachments (#29769)
* Updated patch/update post API to allow file modification (#29447) * WIP * WIP * Atatched new files ton post * WIP: deleting removed files * Deleted removed files and invalidated file metadata cache * removed file ignore logif from update post API * Added TestFindExclusives * Added tests for DeleteForPostByIds * Added app layer tests * Added tests * Added API level tests * test enhancements * Fixed a test * Edit history include file metadata (#29505) * Send file metadata in edit history metadata * Added app tests * Added store tests * Added tests for populateEditHistoryFileMetadata{ * Added cache to avoid repetitigve DB calls for edits with only message changes * Added API tests * i18m fix * removed commented code * Improved test helper * Show attachments in edit history RHS (#29519) * Send file metadata in edit history metadata * Added app tests * Added store tests * Added tests for populateEditHistoryFileMetadata{ * Added cache to avoid repetitigve DB calls for edits with only message changes * Added API tests * i18m fix * WIUP: displa files in edit * removed commented code * Displayed file in edit history * Handled file icon * Fixed closing history component on clicking on file * Simplified selector * Simplified selector * Improved test helper * Disabled action menu on edit history file * Added tests * Improved selector * Updated snapshot * review Fixes * restructured componnets * Updated test * Updated test * Restore post api (#29643) * Restore post version API WIP * Undelete files WIP * Added store tests * Created post restore API * Updated updatepost safeUpdate signature * review fixex and improvements * Fixed an app test * Added API laer tests * Added API tests and OpenAPI specs * Fixed a typo * Allow editing files when editing posts (#29709) * WIP - basic view files when editing post * Cleanup * bg color * Added text editor tests for files * WIP * WIP * removed debug log * Allowed admin to add and remove files on someone else's post * Handled drafts and scheduled posts * linter fixes * Updated snapshot * server test fix * CI * Added doc * Restore post api integration (#29719) * WIP - basic view files when editing post * Cleanup * bg color * Added text editor tests for files * WIP * WIP * removed debug log * Allowed admin to add and remove files on someone else's post * Handled drafts and scheduled posts * linter fixes * Updated snapshot * server test fix * Used new API to restore post * handled edut limit and undo * lint fix * added comments * Fixed edit post item tests * Fixed buttons * Aded snapshots * fix test * Updated snapshot * Minor fixes * fixed snapshot * Edit file dnd area (#29763) * dnd wip * DND continued * Supported multiple unbind dragster funcs * lint fixes * Got center channel file drop working when editing a post * file dnd working with center channel and rhs * file dnd working with center channel and rhs * removed unneeded stopPropogation calls * cleanup * DND overlay fix * Lint fix * Advanced text editor test updates for file upload overlay * fixed use upload hook tests * Updated some more snapshots * minor cleanup * Updated i18n * removed need of array for dragster unbind events * lint fixes * edit history cursor * Fixed bugu causing faliure to delete empty posts (#29778) * Files in restore confirmation (#29781) * Added files to restore post confirmation dialog * Fixed post restore toast colors * Fixed restore bug * Fixed restore confirmation toast tests * a11y improvement and modal width fix * Edit attachment misc fixes (#29808) * Removed single image actions in restore post confirmation dialog * Fixed file drop overlay size and position * Made edit indiator accessible * Lint fix * Added bunch of more tests * ANother test migrated from enzyme to react testing library * More test enhancements * More test enhancements * More test enhancements * lint fixes * Fixed a test * Added missing snapshots * Test fixes
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ecdce71fc4
Коммит
6e5a67caec
@@ -94,6 +94,24 @@ func (_m *FileInfoStore) DeleteForPost(c request.CTX, postID string) (string, er
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteForPostByIds provides a mock function with given fields: rctx, postId, fileIDs
|
||||
func (_m *FileInfoStore) DeleteForPostByIds(rctx request.CTX, postId string, fileIDs []string) error {
|
||||
ret := _m.Called(rctx, postId, fileIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteForPostByIds")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) error); ok {
|
||||
r0 = rf(rctx, postId, fileIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *FileInfoStore) Get(id string) (*model.FileInfo, error) {
|
||||
ret := _m.Called(id)
|
||||
@@ -124,9 +142,9 @@ func (_m *FileInfoStore) Get(id string) (*model.FileInfo, error) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByIds provides a mock function with given fields: ids
|
||||
func (_m *FileInfoStore) GetByIds(ids []string) ([]*model.FileInfo, error) {
|
||||
ret := _m.Called(ids)
|
||||
// GetByIds provides a mock function with given fields: ids, includeDeleted, allowFromCache
|
||||
func (_m *FileInfoStore) GetByIds(ids []string, includeDeleted bool, allowFromCache bool) ([]*model.FileInfo, error) {
|
||||
ret := _m.Called(ids, includeDeleted, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByIds")
|
||||
@@ -134,19 +152,19 @@ func (_m *FileInfoStore) GetByIds(ids []string) ([]*model.FileInfo, error) {
|
||||
|
||||
var r0 []*model.FileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]string) ([]*model.FileInfo, error)); ok {
|
||||
return rf(ids)
|
||||
if rf, ok := ret.Get(0).(func([]string, bool, bool) ([]*model.FileInfo, error)); ok {
|
||||
return rf(ids, includeDeleted, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]string) []*model.FileInfo); ok {
|
||||
r0 = rf(ids)
|
||||
if rf, ok := ret.Get(0).(func([]string, bool, bool) []*model.FileInfo); ok {
|
||||
r0 = rf(ids, includeDeleted, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
||||
r1 = rf(ids)
|
||||
if rf, ok := ret.Get(1).(func([]string, bool, bool) error); ok {
|
||||
r1 = rf(ids, includeDeleted, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -487,6 +505,24 @@ func (_m *FileInfoStore) PermanentDeleteForPost(rctx request.CTX, postID string)
|
||||
return r0
|
||||
}
|
||||
|
||||
// RestoreForPostByIds provides a mock function with given fields: rctx, postId, fileIDs
|
||||
func (_m *FileInfoStore) RestoreForPostByIds(rctx request.CTX, postId string, fileIDs []string) error {
|
||||
ret := _m.Called(rctx, postId, fileIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RestoreForPostByIds")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) error); ok {
|
||||
r0 = rf(rctx, postId, fileIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: ctx, info
|
||||
func (_m *FileInfoStore) Save(ctx request.CTX, info *model.FileInfo) (*model.FileInfo, error) {
|
||||
ret := _m.Called(ctx, info)
|
||||
|
||||
Ссылка в новой задаче
Block a user