-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend product manager with Menuitems (#25)
* Initial menu item groundwork * Adds MenuItem service and repository * Adds menu items property to products * Small fix * Adding ComboBox for menuitems * Address breaking changes in products API * Convert voucher to filter on domain model * Update API specs * Revert ObservableCollection to IEnumerable * Remove ToString on domain models * Remove unused dict * Refactor lambda * Changes menuitem to record * Update API json --------- Co-authored-by: Frederik Petersen <[email protected]> Co-authored-by: Andreas Trøstrup <[email protected]>
- Loading branch information
1 parent
3684863
commit b2341a2
Showing
20 changed files
with
1,872 additions
and
442 deletions.
There are no files selected for viewing
1,000 changes: 853 additions & 147 deletions
1,000
Shifty.Api/Generated/AnalogCoreV2/AnalogCoreV2.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@namespace Components | ||
@using System.ComponentModel.DataAnnotations | ||
@using Shifty.App.Services | ||
@using Shifty.Api.Generated.AnalogCoreV1 | ||
@using Shifty.Api.Generated.AnalogCoreV2 | ||
@using Shared | ||
@using LanguageExt.UnsafeValueAccess | ||
@using Shifty.App.Repositories | ||
@inject ISnackbar Snackbar | ||
@inject IJSRuntime JSRuntime | ||
|
||
<MudPaper Elevation="15" Style="margin: 2em; border-radius: 5px;"> | ||
@if (_loading) | ||
{ | ||
<MudContainer Style="width: 100%; display: flex;"> | ||
<LoadingIndicator Height="400px" /> | ||
</MudContainer> | ||
} | ||
</MudPaper> | ||
|
||
@code | ||
{ | ||
private bool _loading = true; | ||
|
||
protected override async Task OnInitializedAsync() | ||
Check warning on line 25 in Shifty.App/Components/MenuItems.razor GitHub Actions / dev-deploy / Build codebase / Build webapp / Build and test Webapp
Check warning on line 25 in Shifty.App/Components/MenuItems.razor GitHub Actions / dev-deploy / Build codebase / Build webapp / Build and test Webapp
|
||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Data.Common; | ||
using Shifty.Api.Generated.AnalogCoreV1; | ||
using Shifty.Api.Generated.AnalogCoreV2; | ||
|
||
namespace Shifty.App.DomainModels | ||
{ | ||
public record MenuItem { | ||
public int Id { get; init; } | ||
public string Name { get; set; } | ||
public static MenuItem FromDto(MenuItemResponse dto) | ||
{ | ||
return new MenuItem() | ||
{ | ||
Id = dto.Id, | ||
Name = dto.Name | ||
}; | ||
} | ||
|
||
public static AddMenuItemRequest ToAddRequest(MenuItem menuItem) | ||
{ | ||
return new AddMenuItemRequest() | ||
{ | ||
Name = menuItem.Name | ||
}; | ||
} | ||
|
||
public static UpdateMenuItemRequest ToUpdateRequest(MenuItem menuItem) | ||
{ | ||
return new UpdateMenuItemRequest() | ||
{ | ||
Name = menuItem.Name | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.