File tree Expand file tree Collapse file tree 23 files changed +28
-74
lines changed Expand file tree Collapse file tree 23 files changed +28
-74
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ public bool CanGoBack()
2525
2626 public void RemoveCurrent ( string currentPage )
2727 {
28+ if ( pages . Count == 0 )
29+ {
30+ return ;
31+ }
32+
2833 var lastPage = pages . Last ( ) ;
2934 if ( lastPage == currentPage )
3035 {
Original file line number Diff line number Diff line change @@ -36,10 +36,7 @@ protected void GoBack(string defaultBackPath)
3636 }
3737 else
3838 {
39- if ( ! string . IsNullOrEmpty ( defaultBackPath ) )
40- {
41- _navManager . NavigateTo ( defaultBackPath ) ;
42- }
39+ _navManager . NavigateTo ( ! string . IsNullOrEmpty ( defaultBackPath ) ? defaultBackPath : "/" ) ;
4340 }
4441 }
4542
Original file line number Diff line number Diff line change 55@using Pds .Web .Common
66@using static Pds .Web .Common .TitleExtension
77@using Microsoft .AspNetCore .Components
8- @using Pds .Api .Contracts
98@using Pds .Api .Contracts .Controllers
109@using Pds .Api .Contracts .Controllers .Bill
1110@using Pds .Api .Contracts .Controllers .Bill .CreateBill
1211
13- @inject NavigationManager NavigationManager
1412@inject IApiClient ApiClient
1513@inject IAccessTokenProvider TokenProvider
1614
2624{
2725 <h4 class =" card-header d-flex justify-content-between align-items-center" >
2826 Фиксация дохода
29- <button @onclick =" GoBack" class =" btn btn-primary" > Назад </button >
27+ <button @onclick =' () => GoBack("/bills") ' class =" btn btn-primary" > Назад </button >
3028 </h4 >
3129
3230 <EditForm EditContext =" @editContext" OnSubmit =" @HandleSubmitAsync" >
Original file line number Diff line number Diff line change 11@page " /bills/{billId}/edit"
22@inherits BasePageComponent
33@using Microsoft .AspNetCore .Components .WebAssembly .Authentication
4- @using Pds .Api .Contracts
54@using Pds .Core .Enums
65@using Pds .Web .Common
76@using static Pds .Web .Common .TitleExtension
1110@using Pds .Api .Contracts .Controllers .Bill .EditBill
1211@using Pds .Api .Contracts .Controllers .Bill .GetBill
1312
14- @inject NavigationManager NavigationManager
1513@inject IApiClient ApiClient
1614@inject IMapper Mapper
1715@inject IAccessTokenProvider TokenProvider
2826{
2927 <h4 class =" card-header d-flex justify-content-between align-items-center" >
3028 Редактирование дохода
31- <button @onclick =" GoBack" class =" btn btn-primary" > Назад </button >
29+ <button @onclick =' () => GoBack("/bills") ' class =" btn btn-primary" > Назад </button >
3230 </h4 >
3331 @if (bill .Content ? .Id != null && bill .Content .Title != null )
3432 {
Original file line number Diff line number Diff line change 55@using Pds .Web .Common
66@using static Pds .Web .Common .TitleExtension
77
8- @inject NavigationManager NavigationManager
98@inject IApiClient ApiClient
109@inject IAccessTokenProvider TokenProvider
1110@inject Blazored .LocalStorage .ILocalStorageService localStorage
2221{
2322 <h4 class =" card-header d-flex justify-content-between align-items-center" >
2423 Добавление бренда
25- <button @onclick =" GoBack" class =" btn btn-primary" >Назад</button >
24+ <button @onclick =' () => GoBack("/brands") ' class =" btn btn-primary" >Назад</button >
2625 </h4 >
2726
2827 <EditForm EditContext =" @editContext" OnSubmit =" @HandleSubmit" >
Original file line number Diff line number Diff line change 77@using Pds .Api .Contracts .Controllers .Brand .EditBrand
88@using Pds .Api .Contracts .Controllers .Brand .GetBrand
99
10- @inject NavigationManager NavigationManager
1110@inject IApiClient ApiClient
1211@inject IMapper Mapper
1312@inject IAccessTokenProvider TokenProvider
2524{
2625 <h4 class =" card-header d-flex justify-content-between align-items-center" >
2726 Редактирование бренда
28- <button @onclick =" GoBack" class =" btn btn-primary" >Назад</button >
27+ <button @onclick =' () => GoBack("/brands") ' class =" btn btn-primary" >Назад</button >
2928 </h4 >
3029
3130 <EditForm EditContext =" @editContext" OnSubmit =" @HandleSubmit" >
Original file line number Diff line number Diff line change 55@using Pds .Web .Common
66@using static Pds .Web .Common .TitleExtension
77
8- @inject NavigationManager NavigationManager
98@inject IApiClient ApiClient
109@inject IAccessTokenProvider TokenProvider
1110
2120{
2221 <h4 class =" card-header d-flex justify-content-between align-items-center" >
2322 Добавление клиента
24- <button @onclick =" GoBack" class =" btn btn-primary" >Назад</button >
23+ <button @onclick =' () => GoBack("/clients") ' class =" btn btn-primary" >Назад</button >
2524 </h4 >
2625
2726 <EditForm EditContext =" @editContext" OnSubmit =" @HandleSubmit" >
Original file line number Diff line number Diff line change 77@using Pds .Api .Contracts .Controllers .Client .EditClient
88@using Pds .Api .Contracts .Controllers .Client .GetClient
99
10- @inject NavigationManager NavigationManager
1110@inject IApiClient ApiClient
1211@inject IMapper Mapper
1312@inject IAccessTokenProvider TokenProvider
2423{
2524 <h4 class =" card-header d-flex justify-content-between align-items-center" >
2625 Редактирование клиента
27- <button @onclick =" GoBack" class =" btn btn-primary" >Назад</button >
26+ <button @onclick =' () => GoBack("/clients") ' class =" btn btn-primary" >Назад</button >
2827 </h4 >
2928
3029 <EditForm EditContext =" @editContext" OnSubmit =" @HandleSubmit" >
Original file line number Diff line number Diff line change 88@using Pds .Web .Pages .Clients .Components
99
1010@inject IApiClient ApiClient
11- @inject NavigationManager NavigationManager
1211@inject IAccessTokenProvider TokenProvider
1312
1413@if (client == null )
101100 {
102101 if (isRedirectNeeded )
103102 {
104- NavigationManager . NavigateTo (" /clients" );
103+ GoBack (" /clients" );
105104 }
106105
107106 client = await GetClient ();
Original file line number Diff line number Diff line change 11@page " /content/add"
22@inherits BasePageComponent
33@using Microsoft .AspNetCore .Components .WebAssembly .Authentication
4- @using Pds .Api .Contracts
54@using Pds .Api .Contracts .Controllers
65@using Pds .Api .Contracts .Controllers .Content
76@using Pds .Api .Contracts .Controllers .Content .CreateContent
87@using Pds .Core .Enums
98@using Pds .Web .Common
109@using static Pds .Web .Common .TitleExtension
1110
12- @inject NavigationManager NavigationManager
1311@inject IApiClient ApiClient
1412@inject IAccessTokenProvider TokenProvider
1513
1614<Title >@WithSuffix( "Добавление контента")</Title >
1715
1816<h4 class =" card-header d-flex justify-content-between align-items-center" >
1917 Добавление контента
20- <button @onclick =" GoBack" class =" btn btn-primary" >Назад</button >
18+ <button @onclick =' () => GoBack("/content") ' class =" btn btn-primary" >Назад</button >
2119</h4 >
2220@if (brands == null || clients == null || persons == null )
2321{
You can’t perform that action at this time.
0 commit comments