Skip to content

[Admin] Component: Create event details - UI component #214 #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
986d5fe
Feat: 어드민 UI 컴포넌트 Page 추가
KYJKY Sep 1, 2024
aa36c46
Test: 어드민 UI 컴포넌트 테스트 추가
KYJKY Sep 1, 2024
b6d13d1
Feat: 버튼 추가
KYJKY Sep 1, 2024
15b36d4
Merge branch 'main' into feature/214-create-event-details
KYJKY Sep 2, 2024
765a28f
Fix: 피드백 적용
KYJKY Sep 3, 2024
7af315d
Update PlaygroundApp Model 최신화
KYJKY Sep 3, 2024
560c359
Merge: main > Task #214
KYJKY Sep 7, 2024
b578fb2
Refactor: 컴포넌트 수정
KYJKY Sep 7, 2024
70cbc7c
Feat: NodaTime을 사용하여 Time Zone Option 추가
KYJKY Sep 9, 2024
59d5eb7
Feat: 기본값 및 이벤트 설정
KYJKY Sep 9, 2024
6524e01
Refactor: 불필요한 코드 정리
KYJKY Sep 9, 2024
77681cc
Refactor: Time Zone Select 높이 수정
KYJKY Sep 9, 2024
197d7ee
Refactor: CSS 적용 방식 수정 - 외부 스타일 시트 적용
KYJKY Sep 9, 2024
ecb1b2a
Revert "Refactor: CSS 적용 방식 수정 - 외부 스타일 시트 적용"
KYJKY Sep 9, 2024
0fbcc1f
Refactor: 이벤트 종료 날짜 기본값 수정 (오늘 기준 다음날로 적용)
KYJKY Sep 9, 2024
a52fa78
Refactor: NewEventDetailsComponent.razor
KYJKY Sep 19, 2024
1c7b77e
Merge branch 'main' into feature/214-create-event-details
KYJKY Sep 19, 2024
ad18000
Refactor: Remove @temp~ variables
KYJKY Sep 19, 2024
a4b8b4e
Fix: FluentDatePicker, FluentTimePicker ValueChanged error fix
KYJKY Sep 19, 2024
4597c16
Refactor: NewEventDetailsComponent.razor
KYJKY Sep 28, 2024
57475f5
Test: Add NewEventDetailsComponent.razor test
KYJKY Sep 28, 2024
a361c2e
Merge branch 'main' into feature/214-create-event-details
KYJKY Sep 28, 2024
41ce714
Test: Add input test
KYJKY Sep 28, 2024
19fc5a1
Fix: delete inject
KYJKY Sep 28, 2024
9181344
Feat: Get local browser timezone
KYJKY Sep 29, 2024
88f32ef
Refactor: Add JS error handling
KYJKY Sep 29, 2024
60e851a
Refactor: NewEventDetailsComponent.razor
KYJKY Oct 1, 2024
c636124
Test: Add init timezone test
KYJKY Oct 1, 2024
1a3cd8c
Merge branch 'main' into feature/214-create-event-details
KYJKY Oct 3, 2024
6bf9e4f
Fix: Browser Timezone > System Timezone
KYJKY Oct 3, 2024
7c13476
Fix: Test error fix (Now > UtcNow)
KYJKY Oct 4, 2024
77fd773
Fix: add attribute Culture to FluentDatePicker
KYJKY Oct 5, 2024
d5b9d02
Fix: Add culture info in OnAfterRenderAsync
KYJKY Oct 5, 2024
4587101
Feat: Convert from Windows timezone to IANA timezone using TimeZoneCo…
KYJKY Oct 5, 2024
225ff36
Test: Convert from Windows timezone to IANA timezone using TimeZoneCo…
KYJKY Oct 5, 2024
ad7ee1f
Fix: Check OS to get timezone
KYJKY Oct 5, 2024
50d38bf
Test: Refactoring NewEventDetailsPageTests
KYJKY Oct 5, 2024
02ff26f
Test: Refactoring NewEventDetailsPageTests
KYJKY Oct 5, 2024
7e3bdfa
Merge branch 'main' into feature/214-create-event-details
KYJKY Oct 6, 2024
77cf3a1
Refactor: Refactoring NewEventDetailsComponent and test
KYJKY Oct 6, 2024
ff6ed0e
Merge branch 'main' into feature/214-create-event-details
KYJKY Oct 12, 2024
8713a32
Test: Add NewEventDetailsPageTests.cs to AppHost test
KYJKY Oct 12, 2024
e77caa0
Merge branch 'main' into feature/214-create-event-details
KYJKY Oct 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AzureOpenAIProxy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A69C5782-F
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureOpenAIProxy.AppHost.Tests", "test\AzureOpenAIProxy.AppHost.Tests\AzureOpenAIProxy.AppHost.Tests.csproj", "{E8994388-24FA-4221-8E46-4CD1DA96C585}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureOpenAIProxy.PlaygroundApp.Tests", "test\AzureOpenAIProxy.PlaygroundApp.Tests\AzureOpenAIProxy.PlaygroundApp.Tests.csproj", "{0AE9860A-0F8D-49EF-B375-BF95374A1EDA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureOpenAIProxy.PlaygroundApp.Tests", "test\AzureOpenAIProxy.PlaygroundApp.Tests\AzureOpenAIProxy.PlaygroundApp.Tests.csproj", "{0AE9860A-0F8D-49EF-B375-BF95374A1EDA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureOpenAIProxy.ApiApp.Tests", "test\AzureOpenAIProxy.ApiApp.Tests\AzureOpenAIProxy.ApiApp.Tests.csproj", "{0E772300-9263-49CA-8E26-D0B9CC584202}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureOpenAIProxy.ApiApp.Tests", "test\AzureOpenAIProxy.ApiApp.Tests\AzureOpenAIProxy.ApiApp.Tests.csproj", "{0E772300-9263-49CA-8E26-D0B9CC584202}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
@using AzureOpenAIProxy.PlaygroundApp.Models;

<style>
section {
margin-bottom: 100px
}
.create-input-label {
width: 200px;
--type-ramp-base-font-size: 22px;
}
.create-fluent-stack {
height: 100px;
}
.button-section {
display: flex;
justify-content: center;
gap: 50px;
}
.button {
width: 150px;
height: 50px;
font-size: 16px;
margin: 0 10px;
}
</style>

<FluentLayout>
<FluentHeader>Create Event</FluentHeader>
<FluentBodyContent>
<section>
<h2>Event Infomation</h2>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="title" class="create-input-label">Title</FluentLabel>
<FluentTextField Id="title" Name="title" Required />
</FluentStack>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="summary" class="create-input-label">Summary</FluentLabel>
<FluentTextField id="summary" Required />
</FluentStack>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="description" class="create-input-label" Style="">Description</FluentLabel>
<FluentTextArea Id="description" Style="width:300px" />
</FluentStack>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="eventStartDate" class="create-input-label">Event Start Date</FluentLabel>
<FluentDatePicker Id="eventStartDate" />
<FluentTimePicker Id="eventStartTime" DefaultValue="00:00" />
</FluentStack>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="eventEndDate" class="create-input-label">Event End Date</FluentLabel>
<FluentDatePicker Id="eventEndDate" />
<FluentTimePicker Id="eventEndTime" DefaultValue="00:00" />
</FluentStack>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="timezone" class="create-input-label">Time Zone</FluentLabel>
<FluentSelect Id="timezone" TOption="string" Required>
<FluentOption Value="kr">Korea</FluentOption>
<FluentOption Value="us">US</FluentOption>
</FluentSelect>
</FluentStack>
</section>

<section>
<h2>Event Organizer</h2>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="organizerName" class="create-input-label">Organizer Name</FluentLabel>
<FluentTextField Id="organizerName" Required />
</FluentStack>


<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="organizerEmail" class="create-input-label">Organizer Email</FluentLabel>
<FluentTextField Id="organizerEmail" Required />@@<FluentTextField Required />
</FluentStack>
</section>

<section>
<h2>Event Coorganizers</h2>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="organizerName" class="create-input-label">Coorgnizer Name</FluentLabel>
<FluentTextField Id="coorgnizerName" Required />
</FluentStack>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="organizerEmail" class="create-input-label">Coorgnizer Email</FluentLabel>
<FluentTextField Id="coorgnizerEmail" Required />@@<FluentTextField Required />
</FluentStack>
</section>

<section>
<h2>Event Configuration</h2>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="maxTokenCap" class="create-input-label">Max Token Cap</FluentLabel>
<FluentTextField Id="maxTokenCap" Required />
</FluentStack>

<FluentStack class="create-fluent-stack" Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
<FluentLabel For="dailyRequestCap" class="create-input-label">Daily Request Cap</FluentLabel>
<FluentTextField Id="dailyRequestCap" Required />
</FluentStack>
</section>

<section class="button-section">
<FluentButton class="button">Add Event</FluentButton>
<FluentButton class="button">Cancel</FluentButton>
</section>
</FluentBodyContent>
</FluentLayout>


@code {
private AdminEventDetails? adminEventDetails;

Check warning on line 121 in src/AzureOpenAIProxy.PlaygroundApp/Components/UI/Admin/NewEventDetailsComponent.razor

View workflow job for this annotation

GitHub Actions / build-test

The field 'NewEventDetailsComponent.adminEventDetails' is never used

Check warning on line 121 in src/AzureOpenAIProxy.PlaygroundApp/Components/UI/Admin/NewEventDetailsComponent.razor

View workflow job for this annotation

GitHub Actions / build-test

The field 'NewEventDetailsComponent.adminEventDetails' is never used


}

52 changes: 52 additions & 0 deletions src/AzureOpenAIProxy.PlaygroundApp/Models/AdminEventDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace AzureOpenAIProxy.PlaygroundApp.Models;

/// <summary>
/// This represent the event detail data for response by admin event endpoint.
/// </summary>
public class AdminEventDetails : EventDetails
{
/// <summary>
/// Gets or sets the event description.
/// </summary>
public string? Description { get; set; }

/// <summary>
/// Gets or sets the event start date.
/// </summary>
public required DateTimeOffset? DateStart { get; set; }

/// <summary>
/// Gets or sets the event end date.
/// </summary>
public required DateTimeOffset? DateEnd { get; set; }

/// <summary>
/// Gets or sets the event start to end date timezone.
/// </summary>
public required string? TimeZone { get; set; }

/// <summary>
/// Gets or sets the event active status.
/// </summary>
public required bool? IsActive { get; set; }

/// <summary>
/// Gets or sets the event organizer name.
/// </summary>
public required string? OrganizerName { get; set; }

/// <summary>
/// Gets or sets the event organizer email.
/// </summary>
public required string? OrganizerEmail { get; set; }

/// <summary>
/// Gets or sets the event coorganizer name.
/// </summary>
public string? CoorganizerName { get; set; }

/// <summary>
/// Gets or sets the event coorganizer email.
/// </summary>
public string? CoorganizerEmail { get; set; }
}
32 changes: 32 additions & 0 deletions src/AzureOpenAIProxy.PlaygroundApp/Models/EventDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace AzureOpenAIProxy.PlaygroundApp.Models;

/// <summary>
/// This represents the event's detailed data for response by EventEndpoint.
/// </summary>
public class EventDetails
{
/// <summary>
/// Gets or sets the event id.
/// </summary>
public required string? EventId { get; set; }

/// <summary>
/// Gets or sets the event title name.
/// </summary>
public required string? Title { get; set; }

/// <summary>
/// Gets or sets the event summary.
/// </summary>
public required string? Summary { get; set; }

/// <summary>
/// Gets or sets the Azure OpenAI Service request max token capacity.
/// </summary>
public required int? MaxTokenCap { get; set; }

/// <summary>
/// Gets or sets the Azure OpenAI Service daily request capacity.
/// </summary>
public required int? DailyRequestCap { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.Playwright;
using Microsoft.Playwright.NUnit;

namespace AzureOpenAIProxy.PlaygroundApp.Tests.Pages;

[Parallelizable(ParallelScope.Self)]
[TestFixture]
[Property("Category", "Integration")]
public class NewEventDetailsTests : PageTest
{
public override BrowserNewContextOptions ContextOptions() => new()
{
IgnoreHTTPSErrors = true,
};

[Test]
public async Task Given_Root_Page_When_Navigated_Then_It_Should_No_Sidebar()
{
// Arrange
await this.Page.GotoAsync("https://localhost:5001");

// Act
var sidebar = this.Page.Locator("div.sidebar");

// Assert
Expect(sidebar).Equals(null);
}
}
Loading