Skip to content

Commit 1b08683

Browse files
refactor: demo things search
1 parent f73e2cf commit 1b08683

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/1-Libraries/Application/Dtos/SearchDemoThingsInputDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ namespace CanBeYours.Application.Dtos;
55

66
public class SearchDemoThingsInputDto : SearchInputDto
77
{
8-
public DemoThingType Type { get; set; }
8+
public DemoThingType? Type { get; set; }
99
}

src/1-Libraries/Infrastructure/DbContext/SettingsDbSeeder.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ private static void SeedDemoThings(this IServiceScope serviceScope)
4141
};
4242

4343
foreach (var thing in demoThings)
44+
{
45+
// We recreate the demo things only to add a delay and have different creation time for each.
46+
var demoThing = DemoThing.Create(thing.Name, thing.Description, thing.Type, thing.UserId);
4447
demoThingRepository.Add(thing);
48+
Thread.Sleep(10);
49+
}
4550
}
4651
}

src/2-Clients/AdminPanel/Pages/DemoThings/Components/SearchDemoThings.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<EditForm Model="SearchDemoThingsInputDto" OnSubmit="HandleSearchDemoThings" class="row gy-2 gx-3 align-items-center">
44

5-
<div class="col-12">
6-
<a class="btn f-sm btn-success" @onclick="@(() => ModalService.Show<CreateDemoThing>(AdminPanelLocalizer[AdminPanelResource.CreateDemoThing], new ModalOptions { Class="blazored-modal width-xs-90 width-md-50"}))">
5+
<div class="col-6 col-sm-3">
6+
<a class="btn d-block f-sm btn-success" @onclick="@(() => ModalService.Show<CreateDemoThing>(AdminPanelLocalizer[AdminPanelResource.CreateDemoThing], new ModalOptions { Class="blazored-modal width-xs-90 width-md-50"}))">
77
@AdminPanelLocalizer[AdminPanelResource.CreateDemoThing]
88
</a>
99
</div>

0 commit comments

Comments
 (0)