Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
e854d57b
Verified
Commit
e854d57b
authored
Jan 20, 2023
by
Chocobozzz
Browse files
Refactor row selection reset
parent
345f579b
Changes
16
Hide whitespace changes
Inline
Side-by-side
client/src/app/+admin/follows/followers-list/followers-list.component.ts
View file @
e854d57b
...
...
@@ -140,7 +140,7 @@ export class FollowersListComponent extends RestTable <ActorFollow> implements O
return
follow
.
follower
.
name
+
'
@
'
+
follow
.
follower
.
host
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
this
.
followService
.
getFollowers
({
pagination
:
this
.
pagination
,
sort
:
this
.
sort
,
search
:
this
.
search
})
.
subscribe
({
next
:
resultList
=>
{
...
...
client/src/app/+admin/follows/following-list/following-list.component.ts
View file @
e854d57b
...
...
@@ -62,8 +62,10 @@ export class FollowingListComponent extends RestTable <ActorFollow> implements O
}
async
removeFollowing
(
follows
:
ActorFollow
[])
{
const
icuParams
=
{
count
:
follows
.
length
,
entryName
:
this
.
buildFollowingName
(
follows
[
0
])
}
const
message
=
prepareIcu
(
$localize
`Do you really want to unfollow {count, plural, =1 {{entryName}?} other {{count} entries?}}`
)(
{
count
:
follows
.
length
,
entryName
:
this
.
buildFollowingName
(
follows
[
0
])
}
,
icuParams
,
$localize
`Do you really want to unfollow these entries?`
)
...
...
@@ -75,7 +77,7 @@ export class FollowingListComponent extends RestTable <ActorFollow> implements O
next
:
()
=>
{
// eslint-disable-next-line max-len
const
message
=
prepareIcu
(
$localize
`You are not following {count, plural, =1 {{entryName} anymore.} other {these {count} entries anymore.}}`
)(
{
count
:
follows
.
length
,
entryName
:
this
.
buildFollowingName
(
follows
[
0
])
}
,
icuParams
,
$localize
`You are not following them anymore.`
)
...
...
@@ -87,7 +89,7 @@ export class FollowingListComponent extends RestTable <ActorFollow> implements O
})
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
this
.
followService
.
getFollowing
({
pagination
:
this
.
pagination
,
sort
:
this
.
sort
,
search
:
this
.
search
})
.
subscribe
({
next
:
resultList
=>
{
...
...
client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
View file @
e854d57b
...
...
@@ -162,7 +162,7 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
const
options
=
{
pagination
:
this
.
pagination
,
sort
:
this
.
sort
,
...
...
client/src/app/+admin/moderation/registration-list/registration-list.component.ts
View file @
e854d57b
...
...
@@ -92,7 +92,7 @@ export class RegistrationListComponent extends RestTable <UserRegistration> impl
this
.
reloadData
()
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
this
.
adminRegistrationService
.
listRegistrations
({
pagination
:
this
.
pagination
,
sort
:
this
.
sort
,
...
...
client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
View file @
e854d57b
...
...
@@ -159,26 +159,25 @@ export class VideoBlockListComponent extends RestTable implements OnInit {
})
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
this
.
videoBlocklistService
.
listBlocks
({
pagination
:
this
.
pagination
,
sort
:
this
.
sort
,
search
:
this
.
search
})
.
subscribe
({
next
:
async
resultList
=>
{
this
.
totalRecords
=
resultList
.
total
}).
subscribe
({
next
:
async
resultList
=>
{
this
.
totalRecords
=
resultList
.
total
this
.
blocklist
=
resultList
.
data
this
.
blocklist
=
resultList
.
data
for
(
const
element
of
this
.
blocklist
)
{
Object
.
assign
(
element
,
{
reasonHtml
:
await
this
.
toHtml
(
element
.
reason
)
})
}
},
for
(
const
element
of
this
.
blocklist
)
{
Object
.
assign
(
element
,
{
reasonHtml
:
await
this
.
toHtml
(
element
.
reason
)
})
}
},
error
:
err
=>
this
.
notifier
.
error
(
err
.
message
)
})
error
:
err
=>
this
.
notifier
.
error
(
err
.
message
)
})
}
}
client/src/app/+admin/overview/comments/video-comment-list.component.ts
View file @
e854d57b
...
...
@@ -117,7 +117,7 @@ export class VideoCommentListComponent extends RestTable <VideoCommentAdmin> imp
return
this
.
markdownRenderer
.
textMarkdownToHTML
({
markdown
:
text
,
withHtml
:
true
,
withEmoji
:
true
})
}
reloadData
()
{
protected
reloadData
Internal
()
{
this
.
videoCommentService
.
getAdminVideoComments
({
pagination
:
this
.
pagination
,
sort
:
this
.
sort
,
...
...
client/src/app/+admin/overview/users/user-list/user-list.component.ts
View file @
e854d57b
...
...
@@ -283,9 +283,7 @@ export class UserListComponent extends RestTable <User> implements OnInit {
})
}
protected
reloadData
()
{
this
.
selectedRows
=
[]
protected
reloadDataInternal
()
{
this
.
userAdminService
.
getUsers
({
pagination
:
this
.
pagination
,
sort
:
this
.
sort
,
...
...
client/src/app/+admin/overview/videos/video-list.component.ts
View file @
e854d57b
...
...
@@ -183,9 +183,23 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
return
files
.
reduce
((
p
,
f
)
=>
p
+=
f
.
size
,
0
)
}
reloadData
()
{
this
.
selectedRows
=
[]
async
removeVideoFile
(
video
:
Video
,
file
:
VideoFile
,
type
:
'
hls
'
|
'
webtorrent
'
)
{
const
message
=
$localize
`Are you sure you want to delete this
${
file
.
resolution
.
label
}
file?`
const
res
=
await
this
.
confirmService
.
confirm
(
message
,
$localize
`Delete file`
)
if
(
res
===
false
)
return
this
.
videoService
.
removeFile
(
video
.
uuid
,
file
.
id
,
type
)
.
subscribe
({
next
:
()
=>
{
this
.
notifier
.
success
(
$localize
`File removed.`
)
this
.
reloadData
()
},
error
:
err
=>
this
.
notifier
.
error
(
err
.
message
)
})
}
protected
reloadDataInternal
()
{
this
.
loading
=
true
this
.
videoAdminService
.
getAdminVideos
({
...
...
@@ -203,22 +217,6 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
})
}
async
removeVideoFile
(
video
:
Video
,
file
:
VideoFile
,
type
:
'
hls
'
|
'
webtorrent
'
)
{
const
message
=
$localize
`Are you sure you want to delete this
${
file
.
resolution
.
label
}
file?`
const
res
=
await
this
.
confirmService
.
confirm
(
message
,
$localize
`Delete file`
)
if
(
res
===
false
)
return
this
.
videoService
.
removeFile
(
video
.
uuid
,
file
.
id
,
type
)
.
subscribe
({
next
:
()
=>
{
this
.
notifier
.
success
(
$localize
`File removed.`
)
this
.
reloadData
()
},
error
:
err
=>
this
.
notifier
.
error
(
err
.
message
)
})
}
private
async
removeVideos
(
videos
:
Video
[])
{
const
message
=
prepareIcu
(
$localize
`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`
)(
{
count
:
videos
.
length
},
...
...
client/src/app/+admin/system/jobs/jobs.component.ts
View file @
e854d57b
...
...
@@ -120,7 +120,7 @@ export class JobsComponent extends RestTable implements OnInit {
this
.
reloadData
()
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
let
jobState
=
this
.
jobState
as
JobState
if
(
this
.
jobState
===
'
all
'
)
jobState
=
null
...
...
client/src/app/+my-library/my-ownership/my-ownership.component.ts
View file @
e854d57b
...
...
@@ -59,7 +59,7 @@ export class MyOwnershipComponent extends RestTable implements OnInit {
})
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
return
this
.
videoOwnershipService
.
getOwnershipChanges
(
this
.
pagination
,
this
.
sort
)
.
subscribe
({
next
:
resultList
=>
{
...
...
client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts
View file @
e854d57b
...
...
@@ -68,7 +68,7 @@ export class MyVideoChannelSyncsComponent extends RestTable implements OnInit {
]
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
this
.
error
=
undefined
this
.
authService
.
userInformationLoaded
...
...
client/src/app/+my-library/my-video-imports/my-video-imports.component.ts
View file @
e854d57b
...
...
@@ -90,7 +90,7 @@ export class MyVideoImportsComponent extends RestTable implements OnInit {
})
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
this
.
videoImportService
.
getMyVideoImports
(
this
.
pagination
,
this
.
sort
,
this
.
search
)
.
subscribe
({
next
:
resultList
=>
{
...
...
client/src/app/core/rest/rest-table.ts
View file @
e854d57b
...
...
@@ -81,7 +81,13 @@ export abstract class RestTable <T = unknown> {
return
this
.
selectedRows
.
length
!==
0
}
protected
abstract
reloadData
():
void
protected
abstract
reloadDataInternal
():
void
protected
reloadData
()
{
this
.
selectedRows
=
[]
this
.
reloadDataInternal
()
}
private
getSortLocalStorageKey
()
{
return
'
rest-table-sort-
'
+
this
.
getIdentifier
()
...
...
client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
View file @
e854d57b
...
...
@@ -175,7 +175,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
return
Actor
.
IS_LOCAL
(
abuse
.
reporterAccount
.
host
)
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
debugLogger
(
'
Loading data.
'
)
const
options
=
{
...
...
client/src/app/shared/shared-moderation/account-blocklist.component.ts
View file @
e854d57b
...
...
@@ -48,7 +48,7 @@ export class GenericAccountBlocklistComponent extends RestTable implements OnIni
)
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
const
operation
=
this
.
mode
===
BlocklistComponentType
.
Account
?
this
.
blocklistService
.
getUserAccountBlocklist
({
pagination
:
this
.
pagination
,
...
...
client/src/app/shared/shared-moderation/server-blocklist.component.ts
View file @
e854d57b
...
...
@@ -75,7 +75,7 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
})
}
protected
reloadData
()
{
protected
reloadData
Internal
()
{
const
operation
=
this
.
mode
===
BlocklistComponentType
.
Account
?
this
.
blocklistService
.
getUserServerBlocklist
({
pagination
:
this
.
pagination
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment