-
Notifications
You must be signed in to change notification settings - Fork 18
[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
justinyoo
merged 43 commits into
aliencube:main
from
KYJKY:feature/214-create-event-details
Oct 12, 2024
Merged
Changes from 4 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
986d5fe
Feat: 어드민 UI 컴포넌트 Page 추가
KYJKY aa36c46
Test: 어드민 UI 컴포넌트 테스트 추가
KYJKY b6d13d1
Feat: 버튼 추가
KYJKY 15b36d4
Merge branch 'main' into feature/214-create-event-details
KYJKY 765a28f
Fix: 피드백 적용
KYJKY 7af315d
Update PlaygroundApp Model 최신화
KYJKY 560c359
Merge: main > Task #214
KYJKY b578fb2
Refactor: 컴포넌트 수정
KYJKY 70cbc7c
Feat: NodaTime을 사용하여 Time Zone Option 추가
KYJKY 59d5eb7
Feat: 기본값 및 이벤트 설정
KYJKY 6524e01
Refactor: 불필요한 코드 정리
KYJKY 77681cc
Refactor: Time Zone Select 높이 수정
KYJKY 197d7ee
Refactor: CSS 적용 방식 수정 - 외부 스타일 시트 적용
KYJKY ecb1b2a
Revert "Refactor: CSS 적용 방식 수정 - 외부 스타일 시트 적용"
KYJKY 0fbcc1f
Refactor: 이벤트 종료 날짜 기본값 수정 (오늘 기준 다음날로 적용)
KYJKY a52fa78
Refactor: NewEventDetailsComponent.razor
KYJKY 1c7b77e
Merge branch 'main' into feature/214-create-event-details
KYJKY ad18000
Refactor: Remove @temp~ variables
KYJKY a4b8b4e
Fix: FluentDatePicker, FluentTimePicker ValueChanged error fix
KYJKY 4597c16
Refactor: NewEventDetailsComponent.razor
KYJKY 57475f5
Test: Add NewEventDetailsComponent.razor test
KYJKY a361c2e
Merge branch 'main' into feature/214-create-event-details
KYJKY 41ce714
Test: Add input test
KYJKY 19fc5a1
Fix: delete inject
KYJKY 9181344
Feat: Get local browser timezone
KYJKY 88f32ef
Refactor: Add JS error handling
KYJKY 60e851a
Refactor: NewEventDetailsComponent.razor
KYJKY c636124
Test: Add init timezone test
KYJKY 1a3cd8c
Merge branch 'main' into feature/214-create-event-details
KYJKY 6bf9e4f
Fix: Browser Timezone > System Timezone
KYJKY 7c13476
Fix: Test error fix (Now > UtcNow)
KYJKY 77fd773
Fix: add attribute Culture to FluentDatePicker
KYJKY d5b9d02
Fix: Add culture info in OnAfterRenderAsync
KYJKY 4587101
Feat: Convert from Windows timezone to IANA timezone using TimeZoneCo…
KYJKY 225ff36
Test: Convert from Windows timezone to IANA timezone using TimeZoneCo…
KYJKY ad7ee1f
Fix: Check OS to get timezone
KYJKY 50d38bf
Test: Refactoring NewEventDetailsPageTests
KYJKY 02ff26f
Test: Refactoring NewEventDetailsPageTests
KYJKY 7e3bdfa
Merge branch 'main' into feature/214-create-event-details
KYJKY 77cf3a1
Refactor: Refactoring NewEventDetailsComponent and test
KYJKY ff6ed0e
Merge branch 'main' into feature/214-create-event-details
KYJKY 8713a32
Test: Add NewEventDetailsPageTests.cs to AppHost test
KYJKY e77caa0
Merge branch 'main' into feature/214-create-event-details
KYJKY File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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
125 changes: 125 additions & 0 deletions
125
src/AzureOpenAIProxy.PlaygroundApp/Components/UI/Admin/NewEventDetailsComponent.razor
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,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> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<FluentLayout> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<FluentHeader>Create Event</FluentHeader> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<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" /> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</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> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<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 /> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</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 /> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</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> | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</section> | ||
</FluentBodyContent> | ||
</FluentLayout> | ||
|
||
|
||
@code { | ||
private AdminEventDetails? adminEventDetails; | ||
Check warning on line 121 in src/AzureOpenAIProxy.PlaygroundApp/Components/UI/Admin/NewEventDetailsComponent.razor
|
||
|
||
|
||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
52 changes: 52 additions & 0 deletions
52
src/AzureOpenAIProxy.PlaygroundApp/Models/AdminEventDetails.cs
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,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; } | ||
} |
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,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; } | ||
} |
28 changes: 28 additions & 0 deletions
28
test/AzureOpenAIProxy.PlaygroundApp.Tests/Pages/NewEventDetailsTests.cs
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 @@ | ||
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); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.