Compare commits
100 Commits
EF_Entity_
...
master
@ -0,0 +1,89 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: LolProject
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||||
|
volumes:
|
||||||
|
- name: docs
|
||||||
|
path: /docs
|
||||||
|
commands:
|
||||||
|
- cd src/EntityFramework_LoL/Sources/
|
||||||
|
- dotnet restore LeagueOfLegendsCI.sln
|
||||||
|
- dotnet build LeagueOfLegendsCI.sln -c Release --no-restore
|
||||||
|
- dotnet publish LeagueOfLegendsCI.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||||
|
|
||||||
|
- name: tests
|
||||||
|
image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||||
|
commands:
|
||||||
|
- cd src/EntityFramework_LoL/Sources/
|
||||||
|
- dotnet restore LeagueOfLegendsCI.sln
|
||||||
|
- dotnet test LeagueOfLegendsCI.sln --no-restore
|
||||||
|
depends_on: [build]
|
||||||
|
|
||||||
|
- name: code-analysis
|
||||||
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
|
||||||
|
commands:
|
||||||
|
- cd src/EntityFramework_LoL/Sources/
|
||||||
|
- dotnet restore LeagueOfLegendsCI.sln
|
||||||
|
- dotnet sonarscanner begin /k:LolProjectIUT /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**,DbManager/**,Client/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||||
|
- dotnet build LeagueOfLegendsCI.sln -c Release --no-restore
|
||||||
|
- dotnet test LeagueOfLegendsCI.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
|
||||||
|
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
||||||
|
- dotnet publish LeagueOfLegendsCI.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||||
|
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||||
|
secrets: [ SECRET_SONAR_LOGIN ]
|
||||||
|
settings:
|
||||||
|
# accessible en ligne de commande par ${PLUGIN_SONAR_HOST}
|
||||||
|
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||||
|
# accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN}
|
||||||
|
sonar_token:
|
||||||
|
from_secret: SECRET_SONAR_LOGIN
|
||||||
|
depends_on: [tests]
|
||||||
|
# docker image build
|
||||||
|
|
||||||
|
- name: docker-build-and-push
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: src/EntityFramework_LoL/Sources/ApiLol/Dockerfile
|
||||||
|
context: src/EntityFramework_LoL/Sources/
|
||||||
|
registry: hub.codefirst.iut.uca.fr
|
||||||
|
repo: hub.codefirst.iut.uca.fr/emre.kartal/lolproject
|
||||||
|
username:
|
||||||
|
from_secret: SECRET_REGISTRY_USERNAME
|
||||||
|
password:
|
||||||
|
from_secret: SECRET_REGISTRY_PASSWORD
|
||||||
|
|
||||||
|
# container deployment
|
||||||
|
- name: deploy-container
|
||||||
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||||
|
environment:
|
||||||
|
IMAGENAME: hub.codefirst.iut.uca.fr/emre.kartal/lolproject:latest
|
||||||
|
CONTAINERNAME: lolApi
|
||||||
|
COMMAND: create
|
||||||
|
OVERWRITE: true
|
||||||
|
depends_on: [ docker-build-and-push ]
|
||||||
|
|
||||||
|
- name: generate-and-deploy-docs
|
||||||
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
|
||||||
|
failure: ignore
|
||||||
|
volumes:
|
||||||
|
- name: docs
|
||||||
|
path: /docs
|
||||||
|
commands:
|
||||||
|
#- cd Documentation/doxygen
|
||||||
|
#- doxygen Doxyfile
|
||||||
|
- /entrypoint.sh
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
depends_on: [ build ]
|
||||||
|
|
||||||
|
#volumes:
|
||||||
|
#- name: docs
|
||||||
|
# temp: {}
|
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 60 MiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 75 KiB |
@ -0,0 +1,25 @@
|
|||||||
|
**/.classpath
|
||||||
|
**/.dockerignore
|
||||||
|
**/.env
|
||||||
|
**/.git
|
||||||
|
**/.gitignore
|
||||||
|
**/.project
|
||||||
|
**/.settings
|
||||||
|
**/.toolstarget
|
||||||
|
**/.vs
|
||||||
|
**/.vscode
|
||||||
|
**/*.*proj.user
|
||||||
|
**/*.dbmdl
|
||||||
|
**/*.jfm
|
||||||
|
**/azds.yaml
|
||||||
|
**/bin
|
||||||
|
**/charts
|
||||||
|
**/docker-compose*
|
||||||
|
**/Dockerfile*
|
||||||
|
**/node_modules
|
||||||
|
**/npm-debug.log
|
||||||
|
**/obj
|
||||||
|
**/secrets.dev.yaml
|
||||||
|
**/values.dev.yaml
|
||||||
|
LICENSE
|
||||||
|
README.md
|
@ -0,0 +1,26 @@
|
|||||||
|
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["ApiLol/ApiLol.csproj", "ApiLol/"]
|
||||||
|
COPY ["StubLib/StubLib.csproj", "StubLib/"]
|
||||||
|
COPY ["Model/Model.csproj", "Model/"]
|
||||||
|
COPY ["Shared/Shared.csproj", "Shared/"]
|
||||||
|
COPY ["DTO/DTO.csproj", "DTO/"]
|
||||||
|
RUN dotnet restore "ApiLol/ApiLol.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/ApiLol"
|
||||||
|
RUN dotnet build "ApiLol.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "ApiLol.csproj" -c Release -o /app/publish
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "ApiLol.dll"]
|
@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\DTO\DTO.csproj" />
|
||||||
|
<ProjectReference Include="..\Model\Model.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,53 @@
|
|||||||
|
using DTO;
|
||||||
|
using Model;
|
||||||
|
|
||||||
|
namespace ApiMapping.enums
|
||||||
|
{
|
||||||
|
public static class ChampionClassMapper
|
||||||
|
{
|
||||||
|
public static ChampionClassDto ToDto(this ChampionClass championClass)
|
||||||
|
{
|
||||||
|
switch (championClass)
|
||||||
|
{
|
||||||
|
case ChampionClass.Unknown:
|
||||||
|
return ChampionClassDto.Unknown;
|
||||||
|
case ChampionClass.Assassin:
|
||||||
|
return ChampionClassDto.Assassin;
|
||||||
|
case ChampionClass.Fighter:
|
||||||
|
return ChampionClassDto.Fighter;
|
||||||
|
case ChampionClass.Mage:
|
||||||
|
return ChampionClassDto.Mage;
|
||||||
|
case ChampionClass.Marksman:
|
||||||
|
return ChampionClassDto.Marksman;
|
||||||
|
case ChampionClass.Support:
|
||||||
|
return ChampionClassDto.Support;
|
||||||
|
case ChampionClass.Tank:
|
||||||
|
return ChampionClassDto.Tank;
|
||||||
|
default:
|
||||||
|
return ChampionClassDto.Unknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static ChampionClass ToModel(this ChampionClassDto championClass)
|
||||||
|
{
|
||||||
|
switch (championClass)
|
||||||
|
{
|
||||||
|
case ChampionClassDto.Unknown:
|
||||||
|
return ChampionClass.Unknown;
|
||||||
|
case ChampionClassDto.Assassin:
|
||||||
|
return ChampionClass.Assassin;
|
||||||
|
case ChampionClassDto.Fighter:
|
||||||
|
return ChampionClass.Fighter;
|
||||||
|
case ChampionClassDto.Mage:
|
||||||
|
return ChampionClass.Mage;
|
||||||
|
case ChampionClassDto.Marksman:
|
||||||
|
return ChampionClass.Marksman;
|
||||||
|
case ChampionClassDto.Support:
|
||||||
|
return ChampionClass.Support;
|
||||||
|
case ChampionClassDto.Tank:
|
||||||
|
return ChampionClass.Tank;
|
||||||
|
default:
|
||||||
|
return ChampionClass.Unknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ApiMapping\ApiMapping.csproj" />
|
||||||
|
<ProjectReference Include="..\DTO\DTO.csproj" />
|
||||||
|
<ProjectReference Include="..\Model\Model.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Model\Model.csproj" />
|
||||||
|
<ProjectReference Include="..\MyFlib\MyFlib.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,142 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:vm="clr-namespace:LolApp.ViewModels"
|
||||||
|
xmlns:myviews="clr-namespace:LolApp.ContentViews"
|
||||||
|
xmlns:appvm="clr-namespace:LolApp.ViewModels"
|
||||||
|
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||||
|
x:Class="LolApp.AddChampionPage"
|
||||||
|
Title="AddChampionPage"
|
||||||
|
x:Name="root">
|
||||||
|
<Grid RowDefinitions="Auto,*, Auto" BackgroundColor="{StaticResource Black}">
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="Nouveau Champion" IsVisible="{Binding IsNew}"
|
||||||
|
Style="{StaticResource title}"/>
|
||||||
|
<Label Text="Modifier le Champion" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"
|
||||||
|
Style="{StaticResource title}"/>
|
||||||
|
<Grid><Line Stroke="{StaticResource Primary}"
|
||||||
|
X1="0" Y1="0" X2="200" Y2="0"
|
||||||
|
HorizontalOptions="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
<ScrollView Grid.Row="1">
|
||||||
|
<Grid ColumnDefinitions="*, 3*" RowDefinitions="Auto, Auto, Auto, 162, 162, Auto, Auto, Auto, Auto">
|
||||||
|
<Label Text="Nom :"
|
||||||
|
Style="{StaticResource labelForEntry}"/>
|
||||||
|
<Entry Grid.Column="1" Placeholder="Nom du champion" Text="{Binding Champion.Name}"
|
||||||
|
Style="{StaticResource defaultEntry}"
|
||||||
|
IsEnabled="{Binding IsNew}"/>
|
||||||
|
|
||||||
|
<Label Text="Icone :" Grid.Row="1" Style="{StaticResource labelForEntry}"/>
|
||||||
|
<ImageButton Grid.Row="1" Grid.Column="1" HeightRequest="42" WidthRequest="42"
|
||||||
|
Source="{Binding Champion.IconBase64, TargetNullValue='lol.png',
|
||||||
|
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||||
|
BackgroundColor="{StaticResource Secondary}"
|
||||||
|
HorizontalOptions="Start"
|
||||||
|
Margin="6"
|
||||||
|
Command="{Binding PickIconCommand}"/>
|
||||||
|
<Label Text="Image :" Grid.Row="2" Style="{StaticResource labelForEntry}"/>
|
||||||
|
<Grid Grid.Row="2" Grid.Column="1" x:Name="largeImageGrid" Margin="0, 0, 12, 0">
|
||||||
|
<ImageButton WidthRequest="{Binding Width, Source={x:Reference largeImageGrid}}"
|
||||||
|
HeightRequest="150"
|
||||||
|
Source="{Binding Champion.LargeImageBase64, TargetNullValue='lollogo.jpg',
|
||||||
|
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||||
|
BackgroundColor="{StaticResource Secondary}"
|
||||||
|
HorizontalOptions="Start"
|
||||||
|
Margin="6"
|
||||||
|
Command="{Binding PickLargeImageCommand}"/>
|
||||||
|
</Grid>
|
||||||
|
<Label Text="Bio :" Grid.Row="3"
|
||||||
|
Style="{StaticResource labelForEntry}"/>
|
||||||
|
<Editor Grid.Column="1" Grid.Row="3"
|
||||||
|
Text="{Binding Champion.Bio}" Style="{StaticResource defaultEditor}"/>
|
||||||
|
<Label Text="Classe :" Grid.Row="4"
|
||||||
|
Style="{StaticResource labelForEntry}"/>
|
||||||
|
<myviews:ChampionClassSelector Grid.Row="4" Grid.Column="1" MaximumWidthRequest="{OnPlatform WinUI=400}"
|
||||||
|
CheckedColor="{StaticResource Primary}"
|
||||||
|
UncheckedColor="{StaticResource Secondary}"
|
||||||
|
SelectedValue="{Binding Champion.ChampionClass, Mode=TwoWay}"/>
|
||||||
|
<Label Text="Caractéristiques :" Grid.Row="5" Grid.RowSpan="2"
|
||||||
|
Style="{StaticResource labelForEntry}" VerticalOptions="Start"/>
|
||||||
|
<Border Stroke="{StaticResource Secondary}" Grid.Row="5" Grid.Column="1" VerticalOptions="FillAndExpand"> <ListView ItemsSource="{Binding Champion.Characteristics}"
|
||||||
|
Margin="6" HeightRequest="100" HorizontalOptions="Fill" VerticalOptions="Fill"
|
||||||
|
BackgroundColor="{StaticResource Black}" SeparatorColor="{StaticResource Secondary}" >
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<ViewCell>
|
||||||
|
<ViewCell.ContextActions>
|
||||||
|
<MenuItem Command="{Binding Source={x:Reference root}, Path=BindingContext.RemoveCharacteristicCommand}"
|
||||||
|
CommandParameter="{Binding .}"
|
||||||
|
IsDestructive="True" Text="Delete"/>
|
||||||
|
</ViewCell.ContextActions>
|
||||||
|
<Border Margin="0,4" BackgroundColor="{StaticResource Secondary}">
|
||||||
|
<Border.StrokeShape>
|
||||||
|
<RoundRectangle CornerRadius="10, 10, 0, 10"/>
|
||||||
|
</Border.StrokeShape>
|
||||||
|
<Grid ColumnDefinitions="*, Auto">
|
||||||
|
<Label Text="{Binding Key}" TextColor="{StaticResource Black}"
|
||||||
|
HorizontalOptions="Start" VerticalOptions="Center" Margin="4, 0, 0, 0"/>
|
||||||
|
<Label Text="{Binding Value}" Grid.Column="1" TextColor="{StaticResource Black}"
|
||||||
|
HorizontalOptions="End" VerticalOptions="Center" Margin="0, 0, 4, 0"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</ViewCell>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
</Border>
|
||||||
|
<Grid Grid.Column="1" Grid.Row="6" ColumnDefinitions="*, 58, Auto">
|
||||||
|
<Entry Style="{StaticResource defaultEntry}" Placeholder="Caractéristique" Text="{Binding NewCharacteristicDescription}"/>
|
||||||
|
<Entry Style="{StaticResource defaultEntry}" Placeholder="Valeur" Grid.Column="1" Text="{Binding NewCharacteristicValue}" Keyboard="Numeric">
|
||||||
|
<Entry.Behaviors>
|
||||||
|
<toolkit:NumericValidationBehavior Flags="ValidateOnValueChanged"
|
||||||
|
MinimumValue="0"
|
||||||
|
MaximumValue="9999999"
|
||||||
|
MaximumDecimalPlaces="0"
|
||||||
|
InvalidStyle="{StaticResource InvalidEntryStyle}"
|
||||||
|
ValidStyle="{StaticResource defaultEntry}"/>
|
||||||
|
</Entry.Behaviors>
|
||||||
|
</Entry>
|
||||||
|
<Button Grid.Column="2" Margin="4,8" CornerRadius="22"
|
||||||
|
Text="{StaticResource plus}"
|
||||||
|
Command="{Binding AddCharacteristicCommand}"/>
|
||||||
|
</Grid>
|
||||||
|
<Label Style="{StaticResource labelForEntry}" Text="Compétences :" Grid.Row="7" VerticalOptions="Start"/>
|
||||||
|
<Grid Grid.Row="7" Grid.Column="1" ColumnDefinitions="*, Auto">
|
||||||
|
<ListView ItemsSource="{Binding Champion.Skills}" Margin="6"
|
||||||
|
HeightRequest="100" HorizontalOptions="Fill" VerticalOptions="Fill" HasUnevenRows="True"
|
||||||
|
BackgroundColor="{StaticResource Black}" SeparatorColor="{StaticResource Secondary}">
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<ViewCell>
|
||||||
|
<Grid RowDefinitions="Auto, Auto, *">
|
||||||
|
<Grid.Resources>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="TextColor" Value="{StaticResource Primary}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</Grid.Resources>
|
||||||
|
<Label Text="{Binding Name}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"/>
|
||||||
|
<Label Text="{Binding Type}" Grid.Row="1" VerticalOptions="Center" FontAttributes="Italic" FontSize="Micro"/>
|
||||||
|
<Label Text="{Binding Description}" FontSize="Micro" FontAttributes="Italic"
|
||||||
|
Grid.Row="2"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</ViewCell>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
<Button Grid.Column="1" Margin="4,8" CornerRadius="22"
|
||||||
|
Text="{StaticResource plus}" VerticalOptions="Start"
|
||||||
|
Command="{Binding AddSkillCommand}"/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</ScrollView>
|
||||||
|
<HorizontalStackLayout Grid.Row="2" HorizontalOptions="Center" Spacing="40" Margin="0, 10, 0, 20">
|
||||||
|
<Button Text="Ajouter" Command="{Binding AddChampionCommand}" IsVisible="{Binding IsNew}"/>
|
||||||
|
<Button Text="Modifier" Command="{Binding EditChampionCommand}" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"/>
|
||||||
|
<Button Text="Annuler" Command="{Binding CancelCommand}"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</ContentPage>
|
@ -0,0 +1,73 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="LolApp.AddOrEditSkinPage"
|
||||||
|
Title="AddOrEditSkinPage"
|
||||||
|
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit">
|
||||||
|
<Grid RowDefinitions="Auto,*, Auto" BackgroundColor="{StaticResource Black}">
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="Nouveau Skin" IsVisible="{Binding IsNew}"
|
||||||
|
Style="{StaticResource title}"/>
|
||||||
|
<Label Text="Modifier le Skin" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"
|
||||||
|
Style="{StaticResource title}"/>
|
||||||
|
<Grid><Line Stroke="{StaticResource Primary}"
|
||||||
|
X1="0" Y1="0" X2="200" Y2="0"
|
||||||
|
HorizontalOptions="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
<ScrollView Grid.Row="1">
|
||||||
|
<Grid ColumnDefinitions="*, 3*" RowDefinitions="Auto, Auto, Auto, Auto, 162">
|
||||||
|
<Label Text="Nom :"
|
||||||
|
Style="{StaticResource labelForEntry}"/>
|
||||||
|
<Entry Grid.Column="1" Placeholder="Nom du skin" Text="{Binding Skin.Name}"
|
||||||
|
Style="{StaticResource defaultEntry}"
|
||||||
|
IsEnabled="{Binding IsNew}"/>
|
||||||
|
|
||||||
|
<Label Text="Icone :" Grid.Row="1" Style="{StaticResource labelForEntry}"/>
|
||||||
|
<ImageButton Grid.Row="1" Grid.Column="1" HeightRequest="42" WidthRequest="42"
|
||||||
|
Source="{Binding Skin.IconBase64, TargetNullValue='lol.png',
|
||||||
|
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||||
|
BackgroundColor="{StaticResource Secondary}"
|
||||||
|
HorizontalOptions="Start"
|
||||||
|
Margin="6"
|
||||||
|
Command="{Binding PickIconCommand}"/>
|
||||||
|
<Label Text="Image :" Grid.Row="2" Style="{StaticResource labelForEntry}"/>
|
||||||
|
<Grid Grid.Row="2" Grid.Column="1" x:Name="largeImageGrid" Margin="0, 0, 12, 0">
|
||||||
|
<ImageButton WidthRequest="{Binding Width, Source={x:Reference largeImageGrid}}"
|
||||||
|
HeightRequest="150"
|
||||||
|
Source="{Binding Skin.LargeImageBase64, TargetNullValue='lollogo.jpg',
|
||||||
|
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||||
|
BackgroundColor="{StaticResource Secondary}"
|
||||||
|
HorizontalOptions="Start"
|
||||||
|
Margin="6"
|
||||||
|
Command="{Binding PickLargeImageCommand}"/>
|
||||||
|
</Grid>
|
||||||
|
<Label Text="Prix :" Grid.Row="3"
|
||||||
|
Style="{StaticResource labelForEntry}"/>
|
||||||
|
<HorizontalStackLayout Grid.Column="1" Grid.Row="3" Margin="6">
|
||||||
|
<Image Source="rp.png" HeightRequest="16" WidthRequest="16"/>
|
||||||
|
<Entry Grid.Column="1" Placeholder="Nom du skin" Text="{Binding Skin.Price}"
|
||||||
|
Style="{StaticResource defaultEntry}" Margin="4, 0, 0, 0" HorizontalTextAlignment="Start">
|
||||||
|
<Entry.Behaviors>
|
||||||
|
<toolkit:NumericValidationBehavior Flags="ValidateOnValueChanged"
|
||||||
|
MinimumValue="0"
|
||||||
|
MaximumValue="9999999"
|
||||||
|
MaximumDecimalPlaces="0"
|
||||||
|
InvalidStyle="{StaticResource InvalidEntryStyle}"
|
||||||
|
ValidStyle="{StaticResource defaultEntry}"/>
|
||||||
|
</Entry.Behaviors>
|
||||||
|
</Entry>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
<Label Text="Description :" Grid.Row="4"
|
||||||
|
Style="{StaticResource labelForEntry}"/>
|
||||||
|
<Editor Grid.Column="1" Grid.Row="4"
|
||||||
|
Text="{Binding Skin.Description}" Style="{StaticResource defaultEditor}"/>
|
||||||
|
</Grid>
|
||||||
|
</ScrollView>
|
||||||
|
<HorizontalStackLayout Grid.Row="2" HorizontalOptions="Center" Spacing="40" Margin="0, 10, 0, 20">
|
||||||
|
<Button Text="Ajouter" Command="{Binding AddSkinCommand}" IsVisible="{Binding IsNew}"/>
|
||||||
|
<Button Text="Modifier" Command="{Binding EditSkinCommand}" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"/>
|
||||||
|
<Button Text="Annuler" Command="{Binding CancelCommand}"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Grid>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="LolApp.AddSkill"
|
||||||
|
xmlns:appvm="clr-namespace:LolApp.ViewModels"
|
||||||
|
Title="AddSkill">
|
||||||
|
<Grid RowDefinitions="Auto,*, Auto" BackgroundColor="{StaticResource Gray900}">
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Label Text="Nouvelle Compétence"
|
||||||
|
Style="{StaticResource title}"/>
|
||||||
|
<Grid>
|
||||||
|
<Line Stroke="{StaticResource Primary}"
|
||||||
|
X1="0" Y1="0" X2="200" Y2="0"
|
||||||
|
HorizontalOptions="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
<ScrollView Grid.Row="1">
|
||||||
|
<Grid ColumnDefinitions="*, 3*" RowDefinitions="Auto, Auto, *">
|
||||||
|
<Label Text="Nom :" Style="{StaticResource labelForEntry}"/>
|
||||||
|
<Entry Text="{Binding Name}" Style="{StaticResource defaultEntry}"
|
||||||
|
Grid.Column="1"/>
|
||||||
|
<Label Text="Type :" Style="{StaticResource labelForEntry}" Grid.Row="1"/>
|
||||||
|
<Picker ItemsSource="{Binding AllSkills}" SelectedItem="{Binding SkillType}"
|
||||||
|
Grid.Row="1" Grid.Column="1"
|
||||||
|
Style="{StaticResource defaultPicker}"/>
|
||||||
|
<Label Text="Description :" Style="{StaticResource labelForEntry}" Grid.Row="2"/>
|
||||||
|
<Editor Grid.Row="2" Grid.Column="1" Text="{Binding Description}"
|
||||||
|
Style="{StaticResource defaultEditor}"/>
|
||||||
|
</Grid>
|
||||||
|
</ScrollView>
|
||||||
|
<HorizontalStackLayout Grid.Row="2" HorizontalOptions="Center" Spacing="40" Margin="0, 10, 0, 20">
|
||||||
|
<Button Text="Ajouter" Command="{Binding AddSkillToChampionCommand}"/>
|
||||||
|
<Button Text="Annuler" Command="{Binding CancelCommand}"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
</Grid>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version = "1.0" encoding = "UTF-8" ?>
|
||||||
|
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:LolApp"
|
||||||
|
x:Class="LolApp.App">
|
||||||
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="Resources/Styles/FontAwesomeGlyphs.xaml" x:Name="Colors" />
|
||||||
|
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
|
||||||
|
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
|
||||||
|
<ResourceDictionary Source="Resources/Styles/MyStyles.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<Shell
|
||||||
|
x:Class="LolApp.AppShell"
|
||||||
|
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:LolApp"
|
||||||
|
Shell.FlyoutBehavior="Disabled">
|
||||||
|
<TabBar>
|
||||||
|
<ShellContent
|
||||||
|
Title="Home"
|
||||||
|
ContentTemplate="{DataTemplate local:MainPage}"
|
||||||
|
Route="MainPage"
|
||||||
|
Icon="{OnPlatform 'lol.png'}" />
|
||||||
|
<ShellContent
|
||||||
|
Title="Champions"
|
||||||
|
ContentTemplate="{DataTemplate local:ChampionsPage}"
|
||||||
|
Route="Championspage"
|
||||||
|
Icon="{OnPlatform 'sword.png'}" />
|
||||||
|
</TabBar>
|
||||||
|
</Shell>
|
||||||
|
|