Browse Source

Merge pull request #144 from abpframework/problem-fix

Fix Problems in Eventhub
pull/146/head
Gizem Mutu Kurt 2 years ago
committed by GitHub
parent
commit
d58cbde595
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs
  2. 2
      src/EventHub.IdentityServer/EventHub.IdentityServer.csproj
  3. 34
      src/EventHub.IdentityServer/Pages/Account/LoggedOut.cshtml
  4. 4
      src/EventHub.Web.Theme/Themes/EventHub/Components/MainNavbar/Default.cshtml
  5. 34
      src/EventHub.Web.Theme/Views/Error/Default.cshtml
  6. 2
      src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_eventSection.cshtml
  7. 2
      src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml
  8. 70
      src/EventHub.Web/Pages/Organizations/Profile.cshtml
  9. 23
      src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs

3
src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs

@ -176,7 +176,8 @@ namespace EventHub
{
builder
.WithOrigins(
EventHubUrlOptions.GetWwwConfigValue(configuration)
EventHubUrlOptions.GetWwwConfigValue(configuration),
EventHubUrlOptions.GetAdminConfigValue(configuration)
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()

2
src/EventHub.IdentityServer/EventHub.IdentityServer.csproj

@ -48,7 +48,7 @@
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="9.0.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="9.0.0" />
<PackageReference Include="Volo.Abp.Account.Application" Version="9.0.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="9.0.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="9.0.0" />
</ItemGroup>
<ItemGroup>

34
src/EventHub.IdentityServer/Pages/Account/LoggedOut.cshtml

@ -1,4 +1,5 @@
page "/Account/LoggedOut"
@page "/Account/LoggedOut"
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@using Volo.Abp.Account.Web.Pages.Account
@ -18,18 +19,19 @@ page "/Account/LoggedOut"
@section styles {
<abp-style src="/Pages/Account/LoggedOut.css" />
}
<abp-card class="loggedOutCard">
<abp-card-body>
<abp-card-title>@L["LoggedOutTitle"]</abp-card-title>
<abp-card-text>@L["LoggedOutText"]</abp-card-text>
@if (Model.PostLogoutRedirectUri != null)
{
<a abp-button="Primary" id="redirectButton" href="@Model.PostLogoutRedirectUri" cname="@Model.ClientName">@L["ReturnToText"]</a>
}
@if (Model.SignOutIframeUrl != null)
{
<iframe class="signout logoutiframe" src="@Model.SignOutIframeUrl"></iframe>
}
</abp-card-body>
</abp-card>
<div class="container mt-5">
<abp-card class="loggedOutCard">
<abp-card-body>
<abp-card-title>@L["LoggedOutTitle"]</abp-card-title>
<abp-card-text>@L["LoggedOutText"]</abp-card-text>
@if (Model.PostLogoutRedirectUri != null)
{
<a abp-button="Primary" id="redirectButton" href="@Model.PostLogoutRedirectUri" cname="@Model.ClientName">@L["ReturnToText"]</a>
}
@if (Model.SignOutIframeUrl != null)
{
<iframe class="signout logoutiframe" src="@Model.SignOutIframeUrl"></iframe>
}
</abp-card-body>
</abp-card>
</div>

4
src/EventHub.Web.Theme/Themes/EventHub/Components/MainNavbar/Default.cshtml

@ -13,11 +13,13 @@
@inject IOptions<EventHubUrlOptions> UrlOptions
@{
var returnUrl = WebUtility.UrlEncode(Context.Request.GetEncodedPathAndQuery());
var returnUrl = WebUtility.UrlEncode(Context.Request.Query.ContainsKey("returnUrl") ? Context.Request.Query["returnUrl"] : Context.Request.GetEncodedPathAndQuery());
if (returnUrl.IsNullOrWhiteSpace())
{
returnUrl = "/";
}
}
<nav class="navbar navbar-expand-lg navbar-light bg-light static-top">
<div class="container">

34
src/EventHub.Web.Theme/Views/Error/Default.cshtml

@ -0,0 +1,34 @@
@using Localization.Resources.AbpUi
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Blockquote
@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Views.Error.AbpErrorViewModel
@inject IHtmlLocalizer<AbpUiResource> L
<div class="container">
<div class="row">
<div class="col-lg-10 col-md-11 mx-auto">
<div class="d-flex flex-column justify-content-center min-vh-100 align-items-center">
<div class="card">
<div class="card-body p-lg-5">
<div class="row">
<div class="col-auto d-flex align-items-center">
<i class="bi bi-emoji-frown text-primary mb-3 mb-md-0 mx-3 mx-md-4" style="font-size: 12em;"></i>
</div>
<div class="col ps-2 ps-lg-4">
<div class="status-content">
<h1 class="fw-bolder display-1 text-brand">@Model.HttpStatusCode</h1>
<h5 class="text-muted">@Model.ErrorInfo.Message</h5>
<p class="mt-3 mb-4">@Model.ErrorInfo.Details</p>
<a href="javascript:history.back()" class="btn btn-primary soft me-2">@L["GoBack"]</a>
<a href="/" class="btn btn-primary">@L["GoHomePage"]</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

2
src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_eventSection.cshtml

@ -140,7 +140,7 @@
<div class="col-md-6 event-location-group">
<div class="form-label-group">
<input type="text" id="inputCity" asp-for="@Model.City" class="form-control" placeholder="City*">
<label for="inputCity">City</label>
<label for="inputCity">City *</label>
<span asp-validation-for="@Model.City" class="text-danger"></span>
</div>
</div>

2
src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml

@ -1,6 +1,6 @@
@model EventHub.Web.Pages.Events.Components.EventsArea.EventsAreaViewComponent.ListAreaViewComponentModel
@if (Model.Events != null && Model.Events.Count > 0)
@if (Model.Events is { Count: > 0 })
{
<div id="EventList" class="row" data-hash-code="@Model.GetHashCode()" data-total-count="@Model.TotalCount" data-skip-count="@Model.SkipCount" data-max-result-count="@Model.MaxResultCount">
<partial name="~/Pages/Events/Components/EventsArea/_eventListSection.cshtml" model="@Model.Events"/>

70
src/EventHub.Web/Pages/Organizations/Profile.cshtml

@ -132,34 +132,54 @@
<div class="row mb-4">
<div class="col-md">
</div>
<div class="col-md-auto">
<div class="list-style">
<ul class="nav nav-pills events" role="tablist">
<li class="nav-item">
<a href="#PastEvent" class="selected" data-bs-toggle="tab"><img src="/assets/past.svg"> Past</a>
</li>
<li class="nav-item">
<a href="#UpcomingEvent" data-bs-toggle="tab"><img src="/assets/now.svg"> Upcoming</a>
</li>
</ul>
@if (Model.HasPastEvents || Model.HasUpcomingEvents)
{
<div class="col-md-auto">
<div class="list-style">
<ul class="nav nav-pills events" role="tablist">
@if (Model.HasPastEvents)
{
<li class="nav-item">
<a href="#PastEvent" class="selected" data-bs-toggle="tab"><img src="/assets/past.svg"> Past</a>
</li>
}
@if (Model.HasUpcomingEvents)
{
<li class="nav-item">
<a href="#UpcomingEvent" data-bs-toggle="tab"><img src="/assets/now.svg"> Upcoming</a>
</li>
}
</ul>
</div>
</div>
</div>
}
</div>
<div class="tab-content">
<div id="PastEvent" class="tab-pane active">
@await Component.InvokeAsync(typeof(EventsAreaViewComponent), new
{
organizationId = Model.Organization.Id,
maxDate = Clock.Now.ClearTime()
})
</div>
<div id="UpcomingEvent" class="tab-pane">
@await Component.InvokeAsync(typeof(EventsAreaViewComponent), new
{
organizationId = Model.Organization.Id,
minDate = Clock.Now.ClearTime()
})
</div>
@if (!Model.HasPastEvents && !Model.HasUpcomingEvents)
{
<p>There is no Event</p>
}
@if (Model.HasPastEvents)
{
<div id="PastEvent" class="tab-pane active">
@await Component.InvokeAsync(typeof(EventsAreaViewComponent), new
{
organizationId = Model.Organization.Id,
maxDate = Clock.Now.ClearTime()
})
</div>
}
@if (Model.HasUpcomingEvents)
{
var isActive = Model.HasPastEvents ? "" : "active";
<div id="UpcomingEvent" class="tab-pane @isActive">
@await Component.InvokeAsync(typeof(EventsAreaViewComponent), new
{
organizationId = Model.Organization.Id,
minDate = Clock.Now.ClearTime()
})
</div>
}
</div>
</div>
<div id="members-section" class="tab-pane fade">

23
src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs

@ -1,8 +1,10 @@
using System;
using System.Threading.Tasks;
using EventHub.Events;
using EventHub.Organizations;
using EventHub.Organizations.Memberships;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
namespace EventHub.Web.Pages.Organizations
{
@ -16,14 +18,21 @@ namespace EventHub.Web.Pages.Organizations
public bool IsOrganizationOwner { get; private set; }
public bool IsShowSocialMediaContent { get; set; }
public bool HasPastEvents { get; set; }
public bool HasUpcomingEvents { get; set; }
private readonly IOrganizationAppService _organizationAppService;
private readonly IEventAppService _eventAppService;
public ProfilePageModel(
IOrganizationAppService organizationAppService,
IOrganizationMembershipAppService organizationMembershipAppService)
IOrganizationMembershipAppService organizationMembershipAppService,
IEventAppService eventAppService)
{
_organizationAppService = organizationAppService;
_eventAppService = eventAppService;
}
public async Task OnGetAsync()
@ -31,6 +40,18 @@ namespace EventHub.Web.Pages.Organizations
await GetProfileAsync();
IsOrganizationOwner = await _organizationAppService.IsOrganizationOwnerAsync(Organization.Id);
HasPastEvents = (await _eventAppService.GetListAsync(new EventListFilterDto()
{
OrganizationId = Organization.Id,
MaxDate = Clock.Now.ClearTime()
})).TotalCount > 0;
HasUpcomingEvents = (await _eventAppService.GetListAsync(new EventListFilterDto()
{
OrganizationId = Organization.Id,
MinDate = Clock.Now.ClearTime()
})).TotalCount > 0;
}
private async Task GetProfileAsync()

Loading…
Cancel
Save