1
1
@page " /Creator/MyVideoPlans"
2
- @implements IDisposable
2
+ @implements IAsyncDisposable
3
3
4
4
@attribute [Authorize(Roles = FairPlayCombined.Common.Constants.RoleName.BasicPlanUser)]
5
5
9
9
@using FairPlayCombined .Interfaces .FairPlayTube
10
10
@using FairPlayCombined .Models .FairPlayTube .VideoInfo
11
11
@using FairPlayCombined .Models .FairPlayTube .VideoPlan
12
+ @using FairPlayTube .SharedUI .Components .Paginators
12
13
@using FairPlayTube .SharedUI .Components .Spinners
13
14
@using Google .Apis .YouTube .v3 .Data
14
15
15
- @inject IVideoPlanService videoPlanService
16
- @inject IToastService toastService
17
- @inject IUserProviderService userProviderService
18
- @inject ILogger <MyVideoPlans > logger
16
+ <PageTitle >
17
+ @Localizer ![MyVideoPlansTextKey]
18
+ </PageTitle >
19
19
20
20
<FluentLabel Typo =" Typography.H3" >
21
- My Video Plans
21
+ @Localizer ![MyVideoPlansTextKey]
22
22
</FluentLabel >
23
23
<LoadingIndicator ShowSpinners =" this.IsBusy" ></LoadingIndicator >
24
24
25
25
26
26
<FluentDataGrid ItemsProvider =" this.itemsProvider" >
27
27
<TemplateColumn >
28
28
<FluentAnchor data-enhance-nav =" false"
29
- data-bs-toggle =" tooltip" data-bs-placement =" top" title =" Edit "
29
+ data-bs-toggle =" tooltip" data-bs-placement =" top" title =" @Localizer![EditTextKey] "
30
30
IconStart =" @(new Icons.Regular.Size20.Edit())"
31
31
Href =" @($" /Creator /UpdateVideoPlan /{context.VideoPlanId} " )" >
32
- Edit
32
+ @Localizer ![EditTextKey]
33
33
</FluentAnchor >
34
34
</TemplateColumn >
35
- <PropertyColumn Property =" @(p=>p.VideoName)" ></PropertyColumn >
36
- <PropertyColumn Property =" @(p=>p.VideoDescription)" ></PropertyColumn >
37
- <PropertyColumn Property =" @(p=>p.VideoScript)" ></PropertyColumn >
35
+ <PropertyColumn Property =" @(p=>p.VideoName)" Title = " @Localizer![VideoNameTextKey] " ></PropertyColumn >
36
+ <PropertyColumn Property =" @(p=>p.VideoDescription)" Title = " @Localizer![VideoDescriptionTextKey] " ></PropertyColumn >
37
+ <PropertyColumn Property =" @(p=>p.VideoScript)" Title = " @Localizer![VideoScriptTextKey] " ></PropertyColumn >
38
38
</FluentDataGrid >
39
- <FluentPaginator State =" this.paginationState" ></FluentPaginator >
40
- @code {
41
- private readonly CancellationTokenSource cancellationTokenSource = new ();
42
- private bool IsBusy { get ; set ; }
43
- private readonly PaginationState paginationState = new ()
44
- {
45
- ItemsPerPage = Constants .Pagination .PageSize
46
- };
47
- private GridItemsProvider <VideoPlanModel >? itemsProvider ;
48
-
49
- protected override void OnInitialized ()
50
- {
51
- this .itemsProvider = async req =>
52
- {
53
- this .IsBusy = true ;
54
- StateHasChanged ();
55
- var items = await this .videoPlanService .GetPaginatedVideoPlanAsync (paginationRequest : new ()
56
- {
57
- PageSize = paginationState .ItemsPerPage
58
- }, cancellationToken :this .cancellationTokenSource .Token );
59
- this .IsBusy = false ;
60
- StateHasChanged ();
61
- var result = GridItemsProviderResult .From <VideoPlanModel >(items ! .Items ! , items .TotalItems );
62
- return result ;
63
- };
64
- }
65
-
66
- void IDisposable .Dispose ()
67
- {
68
- this .cancellationTokenSource .Dispose ();
69
- }
70
- }
39
+ <CustomFluentPaginator State =" @this.paginationState" ></CustomFluentPaginator >
0 commit comments