Browse Source

Rename Link to OnlineLink in Event

pull/20/head
Berkan 6 years ago
parent
commit
547e3dea4d
  1. 4
      src/EventHub.Application.Contracts/Events/CreateEventDto.cs
  2. 2
      src/EventHub.Application.Contracts/Events/EventLocationDto.cs
  3. 4
      src/EventHub.Application/Events/EventAppService.cs
  4. 4
      src/EventHub.Domain.Shared/Events/EventConsts.cs
  5. 3
      src/EventHub.Domain.Shared/Localization/EventHub/en.json
  6. 8
      src/EventHub.Domain/Events/Event.cs
  7. 2542
      src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210209081448_Renamed_Link_To_OnlineLink.Designer.cs
  8. 23
      src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210209081448_Renamed_Link_To_OnlineLink.cs
  9. 2
      src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/EventHubMigrationsDbContextModelSnapshot.cs
  10. 2
      src/EventHub.EntityFrameworkCore/EntityFrameworkCore/EventHubDbContextModelCreatingExtensions.cs
  11. 4
      src/EventHub.Web/Pages/Events/Components/LocationArea/Default.cshtml
  12. 4
      src/EventHub.Web/Pages/Events/Components/LocationArea/LocationAreaViewComponent.cs
  13. 2
      src/EventHub.Web/Pages/Events/New.cshtml
  14. 4
      src/EventHub.Web/Pages/Events/New.cshtml.cs

4
src/EventHub.Application.Contracts/Events/CreateEventDto.cs

@ -26,8 +26,8 @@ namespace EventHub.Events
public bool IsOnline { get; set; }
[CanBeNull]
[StringLength(EventConsts.MaxLinkLength, MinimumLength = EventConsts.MinLinkLength)]
public string Link { get; set; }
[StringLength(EventConsts.MaxOnlineLinkLength, MinimumLength = EventConsts.MinOnlineLinkLength)]
public string OnlineLink { get; set; }
public Guid? CountryId { get; set; }

2
src/EventHub.Application.Contracts/Events/EventLocationDto.cs

@ -9,7 +9,7 @@ namespace EventHub.Events
public bool IsRegistered { get; set; }
public string Link { get; set; }
public string OnlineLink { get; set; }
public string Country { get; set; }

4
src/EventHub.Application/Events/EventAppService.cs

@ -58,7 +58,7 @@ namespace EventHub.Events
input.Description
);
@event.SetLocation(input.IsOnline, input.Link, input.CountryId, input.City);
@event.SetLocation(input.IsOnline, input.OnlineLink, input.CountryId, input.City);
@event.Language = input.Language;
@event.Capacity = input.Capacity;
@ -146,7 +146,7 @@ namespace EventHub.Events
if (!dto.IsRegistered)
{
dto.Link = null;
dto.OnlineLink = null;
dto.City = null;
}

4
src/EventHub.Domain.Shared/Events/EventConsts.cs

@ -12,8 +12,8 @@
public const int MinDescriptionLength = 50;
public const int MaxDescriptionLength = 2000;
public const int MinLinkLength = 4;
public const int MaxLinkLength = 2000;
public const int MinOnlineLinkLength = 4;
public const int MaxOnlineLinkLength = 2000;
public const int MinCityLength = 2;
public const int MaxCityLength = 32;

3
src/EventHub.Domain.Shared/Localization/EventHub/en.json

@ -52,6 +52,7 @@
"GoToEventAddress": "Go to Event Address",
"AttendeesCanSeeEventLocation": "Only attendees can see the event's {0}.",
"LoginToSeeLocation": "Login to see location",
"LocationHasNotSpecifiedYet": "Event {0} has not been specified yet."
"LocationHasNotSpecifiedYet": "Event {0} has not been specified yet.",
"Language": "Language"
}
}

8
src/EventHub.Domain/Events/Event.cs

@ -22,7 +22,7 @@ namespace EventHub.Events
public bool IsOnline { get; private set; }
public string Link { get; private set; }
public string OnlineLink { get; private set; }
public Guid? CountryId { get; private set; }
@ -83,15 +83,15 @@ namespace EventHub.Events
return this;
}
public Event SetLocation(bool isOnline, string link, Guid? countryId, string city)
public Event SetLocation(bool isOnline, string onlineLink, Guid? countryId, string city)
{
IsOnline = isOnline;
if (isOnline)
{
if (!link.IsNullOrWhiteSpace())
if (!onlineLink.IsNullOrWhiteSpace())
{
Link = link;
OnlineLink = onlineLink;
}
return this;

2542
src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210209081448_Renamed_Link_To_OnlineLink.Designer.cs

File diff suppressed because it is too large

23
src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/20210209081448_Renamed_Link_To_OnlineLink.cs

@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EventHub.Migrations
{
public partial class Renamed_Link_To_OnlineLink : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Link",
table: "AppEvents",
newName: "OnlineLink");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "OnlineLink",
table: "AppEvents",
newName: "Link");
}
}
}

2
src/EventHub.EntityFrameworkCore.DbMigrations/Migrations/EventHubMigrationsDbContextModelSnapshot.cs

@ -116,7 +116,7 @@ namespace EventHub.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Link")
b.Property<string>("OnlineLink")
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");

2
src/EventHub.EntityFrameworkCore/EntityFrameworkCore/EventHubDbContextModelCreatingExtensions.cs

@ -65,7 +65,7 @@ namespace EventHub.EntityFrameworkCore
b.Property(x => x.Description).IsRequired().HasMaxLength(EventConsts.MaxDescriptionLength);
b.Property(x => x.UrlCode).IsRequired().HasMaxLength(EventConsts.UrlCodeLength);
b.Property(x => x.Url).IsRequired().HasMaxLength(EventConsts.MaxUrlLength);
b.Property(x => x.Link).HasMaxLength(EventConsts.MaxLinkLength);
b.Property(x => x.OnlineLink).HasMaxLength(EventConsts.MaxOnlineLinkLength);
b.Property(x => x.City).HasMaxLength(EventConsts.MaxCityLength);
b.Property(x => x.Language).HasMaxLength(EventConsts.MaxLanguageLength);

4
src/EventHub.Web/Pages/Events/Components/LocationArea/Default.cshtml

@ -10,9 +10,9 @@
{
if (Model.IsOnline)
{
if (Model.Link != null)
if (Model.OnlineLink != null)
{
<a href="@Model.Link">@L["GoToEventAddress"]</a>
<a href="@Model.OnlineLink">@L["GoToEventAddress"]</a>
}
else
{

4
src/EventHub.Web/Pages/Events/Components/LocationArea/LocationAreaViewComponent.cs

@ -46,7 +46,7 @@ namespace EventHub.Web.Pages.Events.Components.LocationArea
model.IsOnline = @event.IsOnline;
model.IsRegistered = @event.IsRegistered;
model.Link = @event.Link;
model.OnlineLink = @event.OnlineLink;
model.Country = @event.Country;
model.City = @event.City;
}
@ -59,7 +59,7 @@ namespace EventHub.Web.Pages.Events.Components.LocationArea
public Guid EventId { get; set; }
public bool IsRegistered { get; set; }
public bool IsOnline { get; set; }
public string Link { get; set; }
public string OnlineLink { get; set; }
public string Country { get; set; }
public string City { get; set; }
}

2
src/EventHub.Web/Pages/Events/New.cshtml

@ -26,7 +26,7 @@ else
<abp-input asp-for="Event.Description" />
<abp-input asp-for="Event.IsOnline" />
<div id="event-link-group" style="display: none">
<abp-input asp-for="Event.Link" />
<abp-input asp-for="Event.OnlineLink" />
</div>
<div id="event-location-group">
<abp-select asp-for="Event.CountryId" />

4
src/EventHub.Web/Pages/Events/New.cshtml.cs

@ -134,8 +134,8 @@ namespace EventHub.Web.Pages.Events
public bool IsOnline { get; set; }
[CanBeNull]
[StringLength(EventConsts.MaxLinkLength, MinimumLength = EventConsts.MinLinkLength)]
public string Link { get; set; }
[StringLength(EventConsts.MaxOnlineLinkLength, MinimumLength = EventConsts.MinOnlineLinkLength)]
public string OnlineLink { get; set; }
[SelectItems(nameof(Countries))]
[DisplayName("Country")]

Loading…
Cancel
Save