Skip to content

Commit

Permalink
Merge pull request #30 from thiagomaia971/feature/blazor
Browse files Browse the repository at this point in the history
Feature/blazor
  • Loading branch information
thiagomaia971 authored Jan 5, 2024
2 parents 3ac1413 + e8227b6 commit f9a6667
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/CruderSimple.Blazor/Components/Errors/401Page.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Row Flex="Flex.JustifyContent.Center">
<Column ColumnSize="ColumnSize.Is4.OnWidescreen">
<Div TextAlignment="TextAlignment.Center">
<Image Source="_content/OdontoManagement.Shared/img/illustrations/map-location.png" Text="File not found Image" Style="height: 90px;" />
<Image Source="_content/CruderSimple.Blazor/img/illustrations/map-location.png" Text="File not found Image" Style="height: 90px;" />

<DisplayHeading Size="DisplayHeadingSize.Is1" TextColor="TextColor.Primary" Margin="Margin.Is4.FromTop">
401
Expand Down
2 changes: 1 addition & 1 deletion src/CruderSimple.Blazor/Components/Errors/404Page.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Row Flex="Flex.JustifyContent.Center">
<Column ColumnSize="ColumnSize.Is4.OnWidescreen">
<Div TextAlignment="TextAlignment.Center">
<Image Source="_content/OdontoManagement.Shared/img/illustrations/map-location.png" Text="File not found Image" Style="height: 90px;" />
<Image Source="_content/CruderSimple.Blazor/img/illustrations/map-location.png" Text="File not found Image" Style="height: 90px;" />

<DisplayHeading Size="DisplayHeadingSize.Is1" TextColor="TextColor.Primary" Margin="Margin.Is4.FromTop">
404
Expand Down
4 changes: 3 additions & 1 deletion src/CruderSimple.Blazor/Components/Errors/500Page.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<OdontoManagement.Shared.Components.PageTitle Title="500 Error" BreadcrumbItems="@(new string[] { "OdontoManagement", "500" })" />
<CruderSimple.Blazor.Components.PageTitle Title="500 Error" BreadcrumbItems="@(new BreadcrumbList.Breadcrum[] {
new BreadcrumbList.Breadcrum("/", "Home"),
new BreadcrumbList.Breadcrum("/", "500") })" />

<Row Flex="Flex.JustifyContent.Center">
<Column ColumnSize="ColumnSize.Is4.OnWidescreen">
Expand Down
8 changes: 5 additions & 3 deletions src/CruderSimple.Blazor/Components/Menu/SideMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@inject IdentityAuthenticationStateProvider state
@using Microsoft.Extensions.Configuration
@inject IdentityAuthenticationStateProvider state
@inject IConfiguration configuration

<Bar Breakpoint="Breakpoint.Desktop" NavigationBreakpoint="Breakpoint.Tablet" ThemeContrast="ThemeContrast.Dark"
Mode="BarMode.VerticalInline" CollapseMode="BarCollapseMode.Small">
Expand All @@ -7,7 +9,7 @@
<BarItem>
<BarLink To="">
<BarIcon IconName="customIcon" />
OdontoManagement
@configuration["APPLICATION_NAME"]
</BarLink>
</BarItem>
</BarBrand>
Expand Down Expand Up @@ -43,7 +45,7 @@
@code{
[Inject]
public NavigationManager NavigationManager { get; set; }
RenderFragment customIcon =@<img src="/_content/OdontoManagement.Shared/brand-logo.png" style="width:32px; height: 32px" />;
RenderFragment customIcon =@<img src="/_content/CruderSimple.Blazor/brand-logo.png" style="width:32px; height: 32px" />;
public ICollection<PageSide>? Routes { get; set; } = new List<PageSide>();
public string CurrentRoute => NavigationManager.Uri;
public bool ToggleItem(PageSide item)
Expand Down
6 changes: 4 additions & 2 deletions src/CruderSimple.Blazor/Components/Menu/TopMenu.razor
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.Extensions.Configuration
@inject NavigationManager navigationManager
@inject AuthenticationStateProvider authenticationState
@inject IdentityAuthenticationStateProvider authentication
@inject IConfiguration configuration

<Bar Breakpoint="Breakpoint.Desktop" Background="Background.Light" ThemeContrast="ThemeContrast.Light">
<BarBrand>
<BarItem>
<BarLink To="">
OdontoManagement
@configuration["APPLICATION_NAME"]
</BarLink>
</BarItem>
</BarBrand>
Expand All @@ -20,7 +22,7 @@
<BarItem>
<BarDropdown RightAligned>
<BarDropdownToggle Display="Display.InlineBlock.OnTablet.None.OnMobile">
<Image Class="avatar" Source="_content/OdontoManagement.Shared/img/avatars/avatar-6.jpg" Text="Avatar" Fluid Border="Border.RoundedCircle" Margin="Margin.Is1.FromEnd" Style="width:40px; height:40px;" />
<Image Class="avatar" Source="_content/CruderSimple.Blazor/img/avatars/avatar-6.jpg" Text="Avatar" Fluid Border="Border.RoundedCircle" Margin="Margin.Is1.FromEnd" Style="width:40px; height:40px;" />
<Span TextColor="TextColor.Dark">@UserName</Span>
@*<Span TextColor="TextColor.Muted">Founder</Span>*@
</BarDropdownToggle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ private static IServiceCollection AddCruderServices(this IServiceCollection serv
{
var inputDto = types.FirstOrDefault(x => x.Name == $"{entityType.Name}Input");
var outputDto = types.FirstOrDefault(x => x.Name == $"{entityType.Name}Output");
var dto = types.FirstOrDefault(x => x.Name == $"{entityType.Name}Dto");
if (inputDto is not null)
AddCruderService(services, types, entityType, inputDto);
if (outputDto is not null)
AddCruderService(services, types, entityType, outputDto);
if (dto is not null)
AddCruderService(services, types, entityType, dto);
}
return services;
}
Expand Down
7 changes: 5 additions & 2 deletions src/CruderSimple.Blazor/Services/CrudService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using CruderSimple.Core.EndpointQueries;
using CruderSimple.Core.Entities;
using CruderSimple.Core.ViewModels;
using Microsoft.Extensions.Configuration;

namespace CruderSimple.Blazor.Services
{
Expand All @@ -12,10 +13,12 @@ public class CrudService<TItem, TDto>
{
public IRequestService RequestService { get; }

public CrudService(IRequestService requestService)
public CrudService(IRequestService requestService, IConfiguration configuration)
{
RequestService = requestService;
RequestService.HttpClientName("OdontoManagement.Api");
if (string.IsNullOrEmpty(configuration["API_URL"]))
throw new ArgumentException("API_URL most be set in Environment Variables");
RequestService.HttpClientName(configuration["API_URL"]);
}

public async Task<Pagination<TDto>> GetAll(GetAllEndpointQuery query)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9a6667

Please sign in to comment.