Skip to content

Commit

Permalink
some ui changes + api simplificatoin
Browse files Browse the repository at this point in the history
  • Loading branch information
m-GDEV committed Jul 21, 2024
1 parent e554c75 commit 6a3e00f
Show file tree
Hide file tree
Showing 40 changed files with 1,321 additions and 346 deletions.
13 changes: 13 additions & 0 deletions .idea/.idea.WardrobeManager/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/.idea.WardrobeManager/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.WardrobeManager/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.WardrobeManager/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

284 changes: 284 additions & 0 deletions Session.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
let SessionLoad = 1
if &cp | set nocp | endif
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
silent tabonly
cd /mnt/FILEZ/Files/Documents/code/GITCLONE/my-stuff/WardrobeManager
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
if &shortmess =~ 'A'
set shortmess=aoOA
else
set shortmess=aoO
endif
badd +92 WardrobeManager.Api/Program.cs
badd +15 WardrobeManager.Shared/Models/User.cs
badd +1 .deepsource.toml
badd +51 WardrobeManager.Presentation/Program.cs
badd +48 WardrobeManager.Shared/Models/ServerClothingItem.cs
badd +1 WardrobeManager.Api/Database/DatabaseContext.cs
badd +1 WardrobeManager.Api/Database/Services/Implementation/ClothingItemService.cs
badd +48 WardrobeManager.Api/Database/Services/Implementation/UserService.cs
badd +1 WardrobeManager.Presentation/Pages/Dashboard.razor
badd +35 WardrobeManager.Presentation/Pages/Authenticated/Dashboard.razor
badd +85 WardrobeManager.Presentation/Pages/Authenticated/Clothing.razor
badd +5 WardrobeManager.Presentation/Pages/Authenticated/LoginInfo.razor
badd +1 WardrobeManager.Presentation/Pages/Public/Authentication.razor
badd +15 WardrobeManager.Presentation/Pages/Public/LoginInfo.razor
badd +13 WardrobeManager.Presentation/Pages/Public/Index.razor
badd +49 WardrobeManager.Presentation/Services/Implementation/ApiService.cs
badd +10 WardrobeManager.Api/Database/Services/Interfaces/IUserService.cs
badd +11 WardrobeManager.Presentation/Services/Interfaces/IApiService.cs
badd +1 WardrobeManager.Shared/Exceptions/UserNotFoundException.cs
badd +10 WardrobeManager.Api/Database/DatabaseInitializer.cs
argglobal
%argdel
$argadd WardrobeManager.Api/Program.cs
set stal=2
tabnew +setlocal\ bufhidden=wipe
tabnew +setlocal\ bufhidden=wipe
tabnew +setlocal\ bufhidden=wipe
tabrewind
edit WardrobeManager.Api/Program.cs
argglobal
balt WardrobeManager.Api/Database/DatabaseInitializer.cs
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let &fdl = &fdl
let s:l = 100 - ((10 * winheight(0) + 22) / 45)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 100
normal! 018|
tabnext
edit WardrobeManager.Presentation/Pages/Public/Index.razor
let s:save_splitbelow = &splitbelow
let s:save_splitright = &splitright
set splitbelow splitright
wincmd _ | wincmd |
split
1wincmd k
wincmd w
let &splitbelow = s:save_splitbelow
let &splitright = s:save_splitright
wincmd t
let s:save_winminheight = &winminheight
let s:save_winminwidth = &winminwidth
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe '1resize ' . ((&lines * 27 + 24) / 48)
exe '2resize ' . ((&lines * 17 + 24) / 48)
argglobal
balt WardrobeManager.Presentation/Pages/Authenticated/Clothing.razor
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let &fdl = &fdl
let s:l = 13 - ((12 * winheight(0) + 13) / 27)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 13
normal! 027|
wincmd w
argglobal
if bufexists(fnamemodify("WardrobeManager.Presentation/Services/Implementation/ApiService.cs", ":p")) | buffer WardrobeManager.Presentation/Services/Implementation/ApiService.cs | else | edit WardrobeManager.Presentation/Services/Implementation/ApiService.cs | endif
balt WardrobeManager.Presentation/Services/Interfaces/IApiService.cs
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let &fdl = &fdl
let s:l = 21 - ((3 * winheight(0) + 8) / 17)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 21
normal! 021|
wincmd w
exe '1resize ' . ((&lines * 27 + 24) / 48)
exe '2resize ' . ((&lines * 17 + 24) / 48)
tabnext
edit WardrobeManager.Shared/Models/User.cs
let s:save_splitbelow = &splitbelow
let s:save_splitright = &splitright
set splitbelow splitright
wincmd _ | wincmd |
split
1wincmd k
wincmd w
let &splitbelow = s:save_splitbelow
let &splitright = s:save_splitright
wincmd t
let s:save_winminheight = &winminheight
let s:save_winminwidth = &winminwidth
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe '1resize ' . ((&lines * 22 + 24) / 48)
exe '2resize ' . ((&lines * 22 + 24) / 48)
argglobal
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let &fdl = &fdl
let s:l = 16 - ((15 * winheight(0) + 11) / 22)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 16
normal! 0
wincmd w
argglobal
if bufexists(fnamemodify("WardrobeManager.Shared/Models/ServerClothingItem.cs", ":p")) | buffer WardrobeManager.Shared/Models/ServerClothingItem.cs | else | edit WardrobeManager.Shared/Models/ServerClothingItem.cs | endif
balt WardrobeManager.Api/Program.cs
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let &fdl = &fdl
let s:l = 25 - ((0 * winheight(0) + 11) / 22)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 25
normal! 083|
wincmd w
exe '1resize ' . ((&lines * 22 + 24) / 48)
exe '2resize ' . ((&lines * 22 + 24) / 48)
tabnext
let s:save_splitbelow = &splitbelow
let s:save_splitright = &splitright
set splitbelow splitright
wincmd _ | wincmd |
split
wincmd _ | wincmd |
split
2wincmd k
wincmd w
wincmd w
let &splitbelow = s:save_splitbelow
let &splitright = s:save_splitright
wincmd t
let s:save_winminheight = &winminheight
let s:save_winminwidth = &winminwidth
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe '1resize ' . ((&lines * 15 + 24) / 48)
exe '2resize ' . ((&lines * 14 + 24) / 48)
exe '3resize ' . ((&lines * 16 + 24) / 48)
argglobal
terminal ++curwin ++cols=116 ++rows=15
let s:term_buf_41 = bufnr()
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
let s:l = 4 - ((3 * winheight(0) + 7) / 15)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 4
normal! 0
wincmd w
argglobal
terminal ++curwin ++cols=116 ++rows=14
let s:term_buf_42 = bufnr()
balt \!/bin/bash
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
let s:l = 34 - ((10 * winheight(0) + 7) / 14)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 34
normal! 0
wincmd w
argglobal
terminal ++curwin ++cols=116 ++rows=16
let s:term_buf_43 = bufnr()
balt \!/bin/bash\ (1)
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
let s:l = 4 - ((3 * winheight(0) + 8) / 16)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 4
normal! 030|
wincmd w
exe '1resize ' . ((&lines * 15 + 24) / 48)
exe '2resize ' . ((&lines * 14 + 24) / 48)
exe '3resize ' . ((&lines * 16 + 24) / 48)
tabnext 1
set stal=1
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20
let &shortmess = s:shortmess_save
let &winminheight = s:save_winminheight
let &winminwidth = s:save_winminwidth
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :
9 changes: 8 additions & 1 deletion WardrobeManager.Api/Database/DatabaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@

namespace WardrobeManager.Api.Database;

public class DatabaseContext : DbContext, IDatabaseContext
public class DatabaseContext : DbContext
{

public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options)
{

}

public DbSet<User> Users { get; set; }
public DbSet<ServerClothingItem> ClothingItems { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

modelBuilder.Entity<User>()
.HasMany(e=> e.ServerClothingItems)
.WithOne(e=> e.User)
.HasForeignKey(e=> e.UserId)
.IsRequired();
}
}
14 changes: 1 addition & 13 deletions WardrobeManager.Api/Database/DatabaseInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ public class DatabaseInitializer
{
public static void Initialize(DatabaseContext context)
{
if (context.ClothingItems.Count() > 0) { return; }


var clothingItems = new List<ServerClothingItem>
{
// Creating two base clothing items
new ServerClothingItem("Test Clothing 1", ClothingCategory.TShirt, null),
new ServerClothingItem("Test Clothing 2", ClothingCategory.Sweatpants, null)
};


clothingItems.ForEach(d => context.ClothingItems.Add(d));
context.SaveChanges();
// nothing for now, users will be created through webapp
}
}
8 changes: 0 additions & 8 deletions WardrobeManager.Api/Database/IDatabaseContext.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public ClothingItemService(DatabaseContext databaseContext)
_databaseContext = databaseContext;
}

public async Task CreateUser(string userId)
// public async Task CreateUser(string userId)

public async Task<List<ServerClothingItem>> GetClothes()
{
Expand Down
Loading

0 comments on commit 6a3e00f

Please sign in to comment.