Merge pull request 'Version de Model et ConsolApp fonctionnelle et prête pour une évaluation blanche' (#49) from dev into master
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #49pull/53/head eval-blanche/2
commit
0aee8f070e
@ -0,0 +1,117 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI-pipeline
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
- dev*
|
||||
- feature/*
|
||||
- gestion/*
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
|
||||
# Build Check
|
||||
- name: build
|
||||
image: mcr.microsoft.com/dotnet/sdk:7.0
|
||||
volumes:
|
||||
- name: docs
|
||||
path: /docs
|
||||
commands:
|
||||
- cd MCTG/
|
||||
- dotnet restore CI-CD.slnf
|
||||
- dotnet build CI-CD.slnf -c Release --no-restore
|
||||
- dotnet publish CI-CD.slnf -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||
|
||||
# Unit Testing Check
|
||||
- name: tests
|
||||
image: mcr.microsoft.com/dotnet/sdk:7.0
|
||||
commands:
|
||||
- cd MCTG/
|
||||
- dotnet restore CI-CD.slnf
|
||||
- dotnet test CI-CD.slnf --no-restore
|
||||
depends_on: [ build ]
|
||||
|
||||
# Code Inspection (Sonar)
|
||||
- name: code-analysis
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7
|
||||
secrets: [ SECRET_SONAR_LOGIN ]
|
||||
environment:
|
||||
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||
sonar_token:
|
||||
from_secret: SECRET_SONAR_LOGIN
|
||||
project_key: "SAE-2.01_MCTG"
|
||||
coverage_exclusions: "Tests/**"
|
||||
commands:
|
||||
- cd MCTG/
|
||||
- dotnet restore CI-CD.slnf
|
||||
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token}
|
||||
- dotnet build CI-CD.slnf -c Release --no-restore
|
||||
- dotnet test CI-CD.slnf --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 CI-CD.slnf -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
|
||||
depends_on: [ tests ]
|
||||
|
||||
# Documentation generation
|
||||
- name: generate-and-deploy-docs
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
|
||||
failure: ignore
|
||||
volumes:
|
||||
- name: docs
|
||||
path: /docs
|
||||
commands:
|
||||
- /entrypoint.sh
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- gestion/*
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
depends_on: [ build ]
|
||||
|
||||
volumes:
|
||||
- name: docs
|
||||
temp: {}
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CD-pipeline
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
- dev
|
||||
# - gestion/*
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
|
||||
# Docker image build and push
|
||||
- name: docker-build-and-push
|
||||
image: plugins/docker
|
||||
settings:
|
||||
dockerfile: MCTG/Dockerfile
|
||||
context: MCTG/
|
||||
registry: hub.codefirst.iut.uca.fr
|
||||
repo: hub.codefirst.iut.uca.fr/alexandre.agostinho/console-mctg
|
||||
username:
|
||||
from_secret: SECRET_REGISTRY_USERNAME
|
||||
password:
|
||||
from_secret: SECRET_REGISTRY_PASSWORD
|
||||
|
||||
# Docker container deployement
|
||||
# - name: deploy-container
|
||||
# image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
# environment:
|
||||
# IMAGENAME: hub.codefirst.iut.uca.fr/alexandre.agostinho/sae-2.01:latest
|
||||
# CONTAINERNAME: console-mctg
|
||||
# COMMAND: create
|
||||
# OVERWRITE: true
|
||||
# depends_on: [ docker-build-and-push ]
|
After Width: | Height: | Size: 76 KiB |
@ -0,0 +1,429 @@
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "SAE 2.01 - MCTG"
|
||||
PROJECT_NUMBER = 1.0.0
|
||||
PROJECT_BRIEF = "Ma Cuisine Trop Géniale - Application MAUI"
|
||||
PROJECT_LOGO = images/CodeFirst.png
|
||||
OUTPUT_DIRECTORY = /docs/doxygen
|
||||
CREATE_SUBDIRS = NO
|
||||
ALLOW_UNICODE_NAMES = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
JAVADOC_BANNER = NO
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
PYTHON_DOCSTRING = YES
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
# Well... the one for Java looks so similar to the one for C#...
|
||||
OPTIMIZE_OUTPUT_JAVA = YES
|
||||
OPTIMIZE_FOR_FORTRAN = NO
|
||||
OPTIMIZE_OUTPUT_VHDL = NO
|
||||
OPTIMIZE_OUTPUT_SLICE = NO
|
||||
EXTENSION_MAPPING =
|
||||
MARKDOWN_SUPPORT = YES
|
||||
TOC_INCLUDE_HEADINGS = 5
|
||||
AUTOLINK_SUPPORT = YES
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
SIP_SUPPORT = NO
|
||||
IDL_PROPERTY_SUPPORT = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
GROUP_NESTED_COMPOUNDS = NO
|
||||
SUBGROUPING = YES
|
||||
INLINE_GROUPED_CLASSES = NO
|
||||
INLINE_SIMPLE_STRUCTS = NO
|
||||
TYPEDEF_HIDES_STRUCT = NO
|
||||
LOOKUP_CACHE_SIZE = 0
|
||||
NUM_PROC_THREADS = 1
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
EXTRACT_ALL = YES
|
||||
# I do not like other members to see my private members... but you can set it to YES if you prefer.
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_PRIV_VIRTUAL = NO
|
||||
EXTRACT_PACKAGE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_ANON_NSPACES = NO
|
||||
RESOLVE_UNNAMED_PARAMS = YES
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
HIDE_COMPOUND_REFERENCE= NO
|
||||
SHOW_HEADERFILE = YES
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
SHOW_GROUPED_MEMB_INC = NO
|
||||
FORCE_LOCAL_INCLUDES = NO
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = NO
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_MEMBERS_CTORS_1ST = NO
|
||||
SORT_GROUP_NAMES = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
STRICT_PROTO_MATCHING = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_FILES = YES
|
||||
SHOW_NAMESPACES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
LAYOUT_FILE =
|
||||
CITE_BIB_FILES =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_IF_INCOMPLETE_DOC = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_AS_ERROR = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
INPUT = ../../MCTG/
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.java \
|
||||
*.ii \
|
||||
*.ixx \
|
||||
*.ipp \
|
||||
*.i++ \
|
||||
*.inl \
|
||||
*.idl \
|
||||
*.ddl \
|
||||
*.odl \
|
||||
*.h \
|
||||
*.hh \
|
||||
*.hxx \
|
||||
*.hpp \
|
||||
*.h++ \
|
||||
*.l \
|
||||
*.cs \
|
||||
*.d \
|
||||
*.php \
|
||||
*.php4 \
|
||||
*.php5 \
|
||||
*.phtml \
|
||||
*.inc \
|
||||
*.m \
|
||||
*.markdown \
|
||||
*.md \
|
||||
*.mm \
|
||||
*.dox \
|
||||
*.py \
|
||||
*.pyw \
|
||||
*.f90 \
|
||||
*.f95 \
|
||||
*.f03 \
|
||||
*.f08 \
|
||||
*.f18 \
|
||||
*.f \
|
||||
*.for \
|
||||
*.vhd \
|
||||
*.vhdl \
|
||||
*.ucf \
|
||||
*.qsf \
|
||||
*.ice
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = */Tests/*
|
||||
EXCLUDE_PATTERNS += */bin/*
|
||||
EXCLUDE_PATTERNS += */obj/*
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
FILTER_SOURCE_PATTERNS =
|
||||
USE_MDFILE_AS_MAINPAGE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
SOURCE_TOOLTIPS = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
CLANG_ASSISTED_PARSING = NO
|
||||
CLANG_ADD_INC_PATHS = YES
|
||||
CLANG_OPTIONS =
|
||||
CLANG_DATABASE_PATH =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ALPHABETICAL_INDEX = YES
|
||||
IGNORE_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER = footer.html
|
||||
HTML_STYLESHEET =
|
||||
HTML_EXTRA_STYLESHEET =
|
||||
HTML_EXTRA_FILES = images/CodeFirst.png images/clubinfo.png
|
||||
HTML_COLORSTYLE_HUE = 215
|
||||
HTML_COLORSTYLE_SAT = 45
|
||||
HTML_COLORSTYLE_GAMMA = 240
|
||||
HTML_TIMESTAMP = NO
|
||||
HTML_DYNAMIC_MENUS = YES
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
HTML_INDEX_NUM_ENTRIES = 100
|
||||
GENERATE_DOCSET = NO
|
||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||
DOCSET_FEEDURL =
|
||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
||||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
|
||||
DOCSET_PUBLISHER_NAME = Publisher
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
CHM_INDEX_ENCODING =
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
GENERATE_QHP = NO
|
||||
QCH_FILE =
|
||||
QHP_NAMESPACE = org.doxygen.Project
|
||||
QHP_VIRTUAL_FOLDER = doc
|
||||
QHP_CUST_FILTER_NAME =
|
||||
QHP_CUST_FILTER_ATTRS =
|
||||
QHP_SECT_FILTER_ATTRS =
|
||||
QHG_LOCATION =
|
||||
GENERATE_ECLIPSEHELP = NO
|
||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
||||
DISABLE_INDEX = NO
|
||||
GENERATE_TREEVIEW = NO
|
||||
FULL_SIDEBAR = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
TREEVIEW_WIDTH = 250
|
||||
EXT_LINKS_IN_WINDOW = NO
|
||||
OBFUSCATE_EMAILS = YES
|
||||
HTML_FORMULA_FORMAT = png
|
||||
FORMULA_FONTSIZE = 10
|
||||
FORMULA_TRANSPARENT = YES
|
||||
FORMULA_MACROFILE =
|
||||
USE_MATHJAX = NO
|
||||
MATHJAX_VERSION = MathJax_2
|
||||
MATHJAX_FORMAT = HTML-CSS
|
||||
MATHJAX_RELPATH =
|
||||
MATHJAX_EXTENSIONS =
|
||||
MATHJAX_CODEFILE =
|
||||
SEARCHENGINE = YES
|
||||
SERVER_BASED_SEARCH = NO
|
||||
EXTERNAL_SEARCH = NO
|
||||
SEARCHENGINE_URL =
|
||||
SEARCHDATA_FILE = searchdata.xml
|
||||
EXTERNAL_SEARCH_ID =
|
||||
EXTRA_SEARCH_MAPPINGS =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME =
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
LATEX_MAKEINDEX_CMD = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
LATEX_FOOTER =
|
||||
LATEX_EXTRA_STYLESHEET =
|
||||
LATEX_EXTRA_FILES =
|
||||
PDF_HYPERLINKS = YES
|
||||
USE_PDFLATEX = YES
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
LATEX_BIB_STYLE = plain
|
||||
LATEX_TIMESTAMP = NO
|
||||
LATEX_EMOJI_DIRECTORY =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_SUBDIR =
|
||||
MAN_LINKS = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_PROGRAMLISTING = YES
|
||||
XML_NS_MEMB_FILE_SCOPE = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the DOCBOOK output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_DOCBOOK = NO
|
||||
DOCBOOK_OUTPUT = docbook
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to Sqlite3 output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
EXTERNAL_PAGES = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
DIA_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
DOT_NUM_THREADS = 0
|
||||
DOT_FONTNAME = Helvetica
|
||||
DOT_FONTSIZE = 10
|
||||
DOT_FONTPATH =
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
UML_LIMIT_NUM_FIELDS = 10
|
||||
DOT_UML_DETAILS = NO
|
||||
DOT_WRAP_THRESHOLD = 17
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DIR_GRAPH_MAX_DEPTH = 1
|
||||
DOT_IMAGE_FORMAT = png
|
||||
INTERACTIVE_SVG = NO
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MSCFILE_DIRS =
|
||||
DIAFILE_DIRS =
|
||||
PLANTUML_JAR_PATH =
|
||||
PLANTUML_CFG_FILE =
|
||||
PLANTUML_INCLUDE_PATH =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
@ -0,0 +1,8 @@
|
||||
<html><body>
|
||||
<p>
|
||||
<hr size="1"/><address style="text-align: right;"><small>Generated on $datetime with
|
||||
<img src="CodeFirst.png" alt="Code#0" align="middle" border="0" height="40px"/>
|
||||
by Doxygen version $doxygenversion</small></address>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 4.6 KiB |
@ -0,0 +1,10 @@
|
||||
{
|
||||
"solution": {
|
||||
"path": "SAE-2.01.sln",
|
||||
"projects": [
|
||||
"ConsoleApp\\ConsoleApp.csproj",
|
||||
"Model\\Model.csproj",
|
||||
"Tests\\Model_UnitTests\\Model_UnitTests.csproj"
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,16 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
|
||||
WORKDIR /MCTG
|
||||
|
||||
ENV DOTNET_EnableDiagnostics=0
|
||||
|
||||
COPY . ./
|
||||
|
||||
RUN dotnet restore CI-CD.slnf
|
||||
RUN dotnet publish CI-CD.slnf -c Release -o out --no-restore
|
||||
|
||||
|
||||
# Build runtime image
|
||||
FROM mcr.microsoft.com/dotnet/runtime:7.0
|
||||
WORKDIR /MCTG
|
||||
COPY --from=build-env /MCTG/out .
|
||||
ENTRYPOINT ["dotnet", "ConsoleApp.dll"]
|
@ -0,0 +1,238 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Define a Recipe for the preparation of a meal.
|
||||
/// </summary>
|
||||
[DataContract(Name = "recipe")]
|
||||
public class Recipe : IEquatable<Recipe>
|
||||
{
|
||||
#region Attributes
|
||||
[DataMember(Name = "title")]
|
||||
private string _title = "";
|
||||
|
||||
[DataMember(Name = "image")]
|
||||
private string _image = "";
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// The ID of the recipe - allows you to compare and/or get this item in an easier way.
|
||||
/// </summary>
|
||||
[DataMember(Name = "id")]
|
||||
public int Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// List of reviews of this recipe.
|
||||
/// </summary>
|
||||
[DataMember(Name = "reviews")]
|
||||
public List<Review> Reviews { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// AuthorMail's mail of the recipe.
|
||||
/// </summary>
|
||||
[DataMember(Name = "authorMail")]
|
||||
public string? AuthorMail { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Title of the recipe. <br/>
|
||||
/// Set to "No title." when the value passed is null, empty or contain white spaces.
|
||||
/// </summary>
|
||||
public string Title
|
||||
{
|
||||
get => _title;
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
_title = "No title.";
|
||||
else
|
||||
_title = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The image of the recipe. <br/>
|
||||
/// Set to "room_service_icon.png" when the value passed is null, empty or contain white space.
|
||||
/// </summary>
|
||||
public string? Image
|
||||
{
|
||||
get => _image;
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(value))
|
||||
_image = "room_service_icon.png";
|
||||
_image = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// The list of ingredients.
|
||||
/// </summary>
|
||||
[DataMember(Name = "ingredient")]
|
||||
public List<Ingredient> Ingredients { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The steps of the preparation. See: <see cref="PreparationStep"/>.
|
||||
/// </summary>
|
||||
[DataMember(Name = "preparation-steps")]
|
||||
public List<PreparationStep> PreparationSteps { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Construct a new recipe.
|
||||
/// </summary>
|
||||
/// <param _name="title">The title of the recipe</param>
|
||||
/// <param _name="id">The id of the recipe. If not given, get a new id.</param>
|
||||
/// <param _name="authorMail">The name of the user that create this recipe.</param>
|
||||
/// <param _name="picture"> The image that represent the recipe</param>
|
||||
/// <param _name="reviews">Thr list of reviews.</param>
|
||||
/// <param _name="ingredients">Thr list of ingredients.</param>
|
||||
/// <param _name="preparationSteps">The steps of the preparation of the meal</param>
|
||||
public Recipe(string title, int? id, string? authorMail, string? picture,
|
||||
List<Review> reviews, List<Ingredient> ingredients,
|
||||
params PreparationStep[] preparationSteps)
|
||||
{
|
||||
Title = title;
|
||||
Image = picture;
|
||||
PreparationSteps = new List<PreparationStep>(preparationSteps);
|
||||
Ingredients = ingredients;
|
||||
Reviews = reviews;
|
||||
AuthorMail = authorMail;
|
||||
|
||||
if (id == null)
|
||||
{
|
||||
var randomGenerator = RandomNumberGenerator.Create();
|
||||
byte[] data = new byte[16];
|
||||
randomGenerator.GetBytes(data);
|
||||
Id = Math.Abs(BitConverter.ToInt16(data));
|
||||
}
|
||||
else Id = (int)id;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
||||
/// </summary>
|
||||
/// <param _name="title">The title of the recipe.</param>
|
||||
/// <param _name="id">The id of the recipe. If not given, get a new id.</param>
|
||||
/// <param _name="authorMail">Mail of the user that create the recipe</param>
|
||||
/// <param _name="preparationSteps">The steps of the preparation of the meal.</param>
|
||||
public Recipe(string title, int? id, string? authorMail, params PreparationStep[] preparationSteps)
|
||||
: this(title, id, authorMail, null, new List<Review>(), new List<Ingredient>(), preparationSteps)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
||||
/// </summary>
|
||||
/// <param _name="title">The title of the recipe.</param>
|
||||
/// <param _name="id">The id of the recipe. If not given, get a new id.</param>
|
||||
/// <param _name="authorMail">Mail of the user that create the recipe</param>
|
||||
/// <param _name="picture">Mail of the user that create the recipe</param>
|
||||
/// <param _name="ingredients">List of ingredients that compose the recipe. </param>
|
||||
/// <param _name="preparationSteps">The steps of the preparation of the meal.</param>
|
||||
public Recipe(string title, int? id, string? authorMail, string? picture, List<Ingredient> ingredients, params PreparationStep[] preparationSteps)
|
||||
: this(title, id, authorMail, picture, new List<Review>(), ingredients, preparationSteps)
|
||||
{
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
||||
///// </summary>
|
||||
///// <param _name="title">The title of the recipe.</param>
|
||||
///// <param _name="id">The id of the recipe. If not given, get a new id.</param>
|
||||
///// <param _name="picture">Image that reppresent the recipe.</param>
|
||||
///// <param _name="preparationSteps">The steps of the preparation of the meal.</param>
|
||||
//public Recipe(string title, int? id, string picture, params PreparationStep[] preparationSteps)
|
||||
// : this(title, id, null, picture, new List<Review>(), new List<Ingredient>(), preparationSteps)
|
||||
//{
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Add a review for the recipe.
|
||||
/// </summary>
|
||||
/// <param _name="review">The new review to add.</param>
|
||||
public void AddReview(Review review)
|
||||
=> Reviews.Add(review);
|
||||
|
||||
/// <summary>
|
||||
/// Get a string representing all the reviews and their informations.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetReviews()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder("Reviews:\n------------------------------\n");
|
||||
foreach (Review review in Reviews)
|
||||
{
|
||||
sb.AppendLine(review.ToString());
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Concatenate the list of ingredients in a single string
|
||||
/// </summary>
|
||||
/// <returns>The list of ingredients in string format</returns>
|
||||
private string ConcatIngredients()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (Ingredient ingredient in Ingredients)
|
||||
{
|
||||
sb.Append("\t- " + ingredient.ToString() + "\n");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
public virtual bool Equals(Recipe? other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
if (other == this) return true;
|
||||
return Title.Equals(other.Title) && PreparationSteps.Equals(other.PreparationSteps);
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
var item = obj as Recipe;
|
||||
if (item == null) return false;
|
||||
return Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Id.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder($"[Recipe n°{Id}] - {Title}\n");
|
||||
foreach (PreparationStep ps in PreparationSteps)
|
||||
{
|
||||
sb.AppendFormat("\t* {0}\n", ps.ToString());
|
||||
}
|
||||
sb.AppendLine();
|
||||
sb.AppendLine(ConcatIngredients());
|
||||
sb.AppendLine();
|
||||
foreach (Review review in Reviews)
|
||||
{
|
||||
sb.AppendLine(review.ToString());
|
||||
}
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($"Posted by: {AuthorMail?.ToString()}");
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// A user is an entity with a _name, a surname, mail, profilePict and a list of priority.
|
||||
/// This user can login with an Id and a password
|
||||
/// </summary>
|
||||
[DataContract(Name = "user")]
|
||||
public class User : IEquatable<User> , INotifyPropertyChanged
|
||||
{
|
||||
#region Private Attributes
|
||||
|
||||
[DataMember] private string name="";
|
||||
[DataMember] private string surname="";
|
||||
[DataMember] private string mail = "";
|
||||
[DataMember] private string picture = "";
|
||||
[DataMember] private string password = "";
|
||||
[DataMember] private List<Priority> priorities;
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Property to get Name of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Name is null</exception>
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
set
|
||||
{
|
||||
|
||||
name = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property to get Surname of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Surname is null</exception>
|
||||
public string Surname
|
||||
{
|
||||
get { return surname; }
|
||||
set
|
||||
{
|
||||
|
||||
surname = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property to get mail of users and a setter
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentException" >User's mail will serve to log the user. So there's no setter, just an init. User will enter one time his email at his
|
||||
/// account creation.</exception>
|
||||
public string Mail
|
||||
{
|
||||
get { return mail; }
|
||||
private init
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
throw new ArgumentException("Impossible d'avoir un champ Email vide!");
|
||||
}
|
||||
mail = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get => password;
|
||||
set => password = value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For now, we define the ProfilPict as a string which is "PhotoParDefaut"
|
||||
/// when the value is null.
|
||||
/// </summary>
|
||||
public string ProfilPict
|
||||
{
|
||||
get => picture;
|
||||
set => picture = value;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is the list of priorities specific tu the user. This list is initiate
|
||||
/// by default. User could change it at will.
|
||||
/// </summary>
|
||||
|
||||
public List<Priority> Priorities
|
||||
{
|
||||
get => priorities;
|
||||
set=> priorities = value;
|
||||
}
|
||||
|
||||
public override bool Equals(object? other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
if (other == this) return true;
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
public bool Equals(User? other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
return Name.Equals(other.Name) && Surname.Equals(other.Surname) && Mail.Equals(other.Mail);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
protected void OnPropertyChanged ([CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Name} {Surname}";
|
||||
}
|
||||
|
||||
[DataMember(Name = "passmgr")]
|
||||
public IPasswordManager psswMgr { get; private set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Construtors of user.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the user</param>
|
||||
/// <param name="surname">The surname of the user</param>
|
||||
/// <param name="mail">The user needs an email to login.</param>
|
||||
/// <param name="password">The password of the new user.</param>
|
||||
/// <param name="passwordManager">The password manager to manage the user password.</param>
|
||||
public User(string name, string surname, string mail, string password, IPasswordManager passwordManager)
|
||||
{
|
||||
Name = name;
|
||||
Surname = surname;
|
||||
Mail = mail;
|
||||
psswMgr = passwordManager;
|
||||
Password = psswMgr.HashPassword(password);
|
||||
priorities = new List<Priority> {
|
||||
Priority.Gourmet,
|
||||
Priority.Economic,
|
||||
Priority.Fast,
|
||||
Priority.Light,
|
||||
Priority.Easy};
|
||||
ProfilPict = picture;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// </summary>
|
||||
public User(string name, string surname, string mail, string password)
|
||||
: this(name, surname,mail, password, new PasswordSHA256())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// </summary>
|
||||
public User()
|
||||
: this("John", "Doe", "truc@gmail.com", "mdp")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="User.User"/>
|
||||
/// </summary>
|
||||
public User (User user)
|
||||
{
|
||||
Name = user.Name;
|
||||
Surname = user.Surname;
|
||||
Mail = user.Mail;
|
||||
psswMgr = user.psswMgr;
|
||||
Password = user.Password;
|
||||
priorities = user.Priorities;
|
||||
ProfilPict = user.ProfilPict;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33516.290
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "ConsoleApp\ConsoleApp.csproj", "{666C2211-8EBB-4FC8-9484-CB93BC854153}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{42FF86BD-92F9-4A32-A938-68515905378F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Views", "Views\Views.csproj", "{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model_UnitTests", "Tests\Model_UnitTests\Model_UnitTests.csproj", "{45AB746A-194B-4E43-81EB-83B06F35AA33}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{08B80CE8-A01D-4D86-8989-AF225D5DA48C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataPersistence", "DataPersistence\DataPersistence.csproj", "{432F9D12-B1F7-4A79-8720-4971BB10B831}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{508B5600-AFD0-4AE4-A3CF-5FA8BE3ECE75}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{45AB746A-194B-4E43-81EB-83B06F35AA33} = {08B80CE8-A01D-4D86-8989-AF225D5DA48C}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {ADEA5603-1EF6-4D43-9493-7D6D9DE7FA3F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -0,0 +1,17 @@
|
||||
using Model;
|
||||
|
||||
namespace Model_UnitTests
|
||||
{
|
||||
public class Recipe_UT
|
||||
{
|
||||
[Fact]
|
||||
public void TestVoidConstructor()
|
||||
{
|
||||
Recipe r = new Recipe(
|
||||
title: "test recipe",
|
||||
id: null,
|
||||
authorMail: "test@test.fr");
|
||||
Assert.NotNull(r.Title);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
global using Xunit;
|
@ -0,0 +1,80 @@
|
||||
<?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="Views.AddRecipe"
|
||||
Title="AddRecipe"
|
||||
xmlns:local="clr-namespace:Views">
|
||||
<VerticalStackLayout>
|
||||
<local:MiniHeader
|
||||
TitleMini="Ajouter une recette"
|
||||
NeedReturn="True"
|
||||
HeightRequest="100"/>
|
||||
<Grid ColumnDefinitions="auto, *"
|
||||
RowDefinitions="auto,auto,auto,auto,auto,auto, auto, auto, auto"
|
||||
Margin="50,20,20,20">
|
||||
<Label Text="Titre de la recette :"/>
|
||||
<Entry Placeholder="Saisie du texte de la recette correspondante"
|
||||
Grid.Row="1"
|
||||
Margin="10"/>
|
||||
<Label Text="Type de la recette" Grid.Row="2"/>
|
||||
<CheckBox x:Name="CheckEntree" Grid.Row="3" Margin="10,0,20,0" />
|
||||
<Label Text="Entrée" Grid.Row="3" Margin="40,20"/>
|
||||
<CheckBox x:Name="CheckPlat" Grid.Row="3" Margin="90,0" />
|
||||
<Label Text="Plat" Grid.Row="3" Margin="120,20"/>
|
||||
<CheckBox x:Name="CheckDessert" Grid.Row="3" Margin="155,0" />
|
||||
<Label Text="Dessert" Grid.Row="3" Margin="185,20"/>
|
||||
|
||||
<Label Text="Type de priorité" Grid.Row="4"/>
|
||||
<Grid BackgroundColor="#D1E8E2"
|
||||
MinimumHeightRequest="100"
|
||||
MaximumWidthRequest="300"
|
||||
Padding="20"
|
||||
Grid.Row="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="Recettes économiques" Grid.Row="0" Padding="5,0,0,0"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="1" />
|
||||
<Label Text="Recettes rapides" Grid.Row="2"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="3" />
|
||||
<Label Text="Recettes simples" Grid.Row="4"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="5" />
|
||||
<Label Text="Recettes légères" Grid.Row="6"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="7" />
|
||||
<Label Text="Recettes gourmandes" Grid.Row="8"/>
|
||||
</Grid>
|
||||
<Label Text="Saisir les étapes de la recette " Grid.Row="6" Margin="0,15"/>
|
||||
<Entry Placeholder="Etape de la recette" Grid.Row="7" Margin="12,0"/>
|
||||
<HorizontalStackLayout Grid.Row="8" Margin="20">
|
||||
<Button WidthRequest="100" Text="Précédent" TextColor="Black" Margin="20,0,20,0"/>
|
||||
<Button WidthRequest="100" Text="Ajouter" TextColor="Black" Margin="20,0"/>
|
||||
</HorizontalStackLayout>
|
||||
<Label Text="Saisir les ingrédients de la recette" Grid.Row="6" Grid.Column="1" Margin="50,15"/>
|
||||
<HorizontalStackLayout Grid.Row="7" Grid.Column="1">
|
||||
<Entry Placeholder="Nom de l'ingrédient" Margin="12,0,50,0" WidthRequest="500"/>
|
||||
<Picker Title="Unité">
|
||||
|
||||
</Picker>
|
||||
</HorizontalStackLayout>
|
||||
<HorizontalStackLayout Grid.Row="8" Grid.Column="1" Margin="20">
|
||||
<Button WidthRequest="100" Text="Précédent" TextColor="Black" Margin="20,0,20,0"/>
|
||||
<Button WidthRequest="100" Text="Ajouter" TextColor="Black" Margin="20,0"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ContentPage>
|
@ -0,0 +1,18 @@
|
||||
using CommunityToolkit.Maui.Behaviors;
|
||||
using DataPersistence;
|
||||
using Model;
|
||||
using Model.Managers;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Views
|
||||
{
|
||||
public partial class AddRecipe : ContentPage
|
||||
{
|
||||
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||
|
||||
public AddRecipe()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<?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:Views"
|
||||
x:Class="Views.App">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
|
||||
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Shell
|
||||
x:Class="Views.AppShell"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
FlyoutBackgroundColor="DarkGray"
|
||||
Shell.FlyoutBehavior="Disabled"
|
||||
Shell.NavBarIsVisible="False">
|
||||
|
||||
|
||||
<ShellContent
|
||||
ContentTemplate="{DataTemplate local:Home}"
|
||||
Route="Home"/>
|
||||
|
||||
</Shell>
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
x:Class="Views.ContainerBase"
|
||||
x:Name="root">
|
||||
|
||||
<Grid RowDefinitions="80, *"
|
||||
ColumnDefinitions="300, *">
|
||||
|
||||
<local:CustomHeader
|
||||
Grid.Column="1"
|
||||
MinimumHeightRequest="80"
|
||||
VerticalOptions="StartAndExpand"/>
|
||||
|
||||
<local:ContainerFlyout
|
||||
Grid.RowSpan="2"
|
||||
MinimumWidthRequest="300"
|
||||
HorizontalOptions="StartAndExpand"
|
||||
IsNotConnected="{Binding IsNotConnected, Source={x:Reference root}}"
|
||||
NeedReturn="{Binding NeedReturn, Source={x:Reference root}}">
|
||||
<local:ContainerFlyout.MyFlyoutContent>
|
||||
<ContentView
|
||||
Content="{Binding MyFlyoutContent, Source={x:Reference root}}"/>
|
||||
</local:ContainerFlyout.MyFlyoutContent>
|
||||
</local:ContainerFlyout>
|
||||
|
||||
<ContentView
|
||||
VerticalOptions="StartAndExpand"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Content="{Binding MyContent, Source={x:Reference root}}"/>
|
||||
</Grid>
|
||||
|
||||
</ContentView>
|
@ -0,0 +1,49 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class ContainerBase : ContentView
|
||||
{
|
||||
public ContainerBase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
// Bind MyContent
|
||||
public static readonly BindableProperty MyContentProperty =
|
||||
BindableProperty.Create("MyContent", typeof(View), typeof(ContainerBase), new Grid());
|
||||
|
||||
public View MyContent
|
||||
{
|
||||
get => (View)GetValue(MyContentProperty);
|
||||
set => SetValue(MyContentProperty, value);
|
||||
}
|
||||
|
||||
// Bind MyFlyoutContent
|
||||
public static readonly BindableProperty MyFlyoutContentProperty =
|
||||
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerBase), new Grid());
|
||||
|
||||
public View MyFlyoutContent
|
||||
{
|
||||
get => (View)GetValue(MyFlyoutContentProperty);
|
||||
set => SetValue(MyFlyoutContentProperty, value);
|
||||
}
|
||||
|
||||
// Bind IsNotConnected
|
||||
public static readonly BindableProperty IsNotConnectedProperty =
|
||||
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true);
|
||||
|
||||
public bool IsNotConnected
|
||||
{
|
||||
get => (bool)GetValue(IsNotConnectedProperty);
|
||||
set => SetValue(IsNotConnectedProperty, value);
|
||||
}
|
||||
|
||||
// bind NeedReturn
|
||||
public static readonly BindableProperty NeedReturnProperty =
|
||||
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
|
||||
|
||||
public bool NeedReturn
|
||||
{
|
||||
get => (bool)GetValue(NeedReturnProperty);
|
||||
set => SetValue(NeedReturnProperty, value);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="Views.ContainerFlyout"
|
||||
x:Name="fl"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray600}}">
|
||||
|
||||
<Grid RowDefinitions="250, *, 100">
|
||||
<VerticalStackLayout Grid.Row="0">
|
||||
|
||||
<Grid RowDefinitions="auto, *">
|
||||
<!-- Return -->
|
||||
<local:ReturnButton NeedReturn="{Binding NeedReturn, Source={x:Reference fl}}" Grid.Row="0"
|
||||
HorizontalOptions="Start" Padding="10, 10, 0, 0"/>
|
||||
<!-- Header -->
|
||||
<ImageButton Source="person_default.png" HorizontalOptions="Center"
|
||||
BackgroundColor="{StaticResource Secondary}"
|
||||
WidthRequest="100" HeightRequest="100"
|
||||
CornerRadius="50" Margin="0, 30, 0, 10"
|
||||
BorderWidth="5" BorderColor="Black"
|
||||
IsEnabled="{Binding IsNotConnected, Source={x:Reference fl}}"
|
||||
Grid.RowSpan="2"/>
|
||||
</Grid>
|
||||
|
||||
<Button Text="Connection" ImageSource="login_icon.png"
|
||||
Style="{StaticResource button2}"
|
||||
IsVisible="{Binding IsNotConnected, Source={x:Reference fl}}"
|
||||
IsEnabled="{Binding IsNotConnected, Source={x:Reference fl}}"/>
|
||||
<StackLayout BindingContext="{Binding user}">
|
||||
<Label Text="{Binding Name}"
|
||||
HorizontalOptions="Center" Margin="0,15"
|
||||
FontSize="20" FontAttributes="Bold" HorizontalTextAlignment="Center"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
|
||||
IsVisible="{Binding IsNotConnected, Converter={toolkit:InvertedBoolConverter} ,Source={x:Reference fl}}"/>
|
||||
<Label Text="{Binding Surname}"
|
||||
HorizontalOptions="Center"
|
||||
FontSize="20" FontAttributes="Bold" HorizontalTextAlignment="Center"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
|
||||
IsVisible="{Binding IsNotConnected, Converter={toolkit:InvertedBoolConverter} ,Source={x:Reference fl}}"/>
|
||||
</StackLayout>
|
||||
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Content -->
|
||||
<ContentView
|
||||
VerticalOptions="Fill"
|
||||
Grid.Row="1"
|
||||
Content="{Binding MyFlyoutContent, Source={x:Reference fl}}"/>
|
||||
|
||||
|
||||
<VerticalStackLayout Grid.Row="2">
|
||||
<!-- Footer -->
|
||||
<Button Text="Déconnection" ImageSource="logout_icon.png"
|
||||
Style="{StaticResource button2}"
|
||||
IsVisible="{Binding IsNotConnected, Converter={toolkit:InvertedBoolConverter}, Source={x:Reference fl}}"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
|
||||
</ContentView>
|
@ -0,0 +1,49 @@
|
||||
using DataPersistence;
|
||||
using Model;
|
||||
using Model.Managers;
|
||||
|
||||
namespace Views;
|
||||
|
||||
public partial class ContainerFlyout : ContentView
|
||||
{
|
||||
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||
public User user => (App.Current as App).CurrentUser;
|
||||
|
||||
public ContainerFlyout()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = this;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Bind MyFlyoutContent
|
||||
public static readonly BindableProperty MyFlyoutContentProperty =
|
||||
BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid());
|
||||
|
||||
public View MyFlyoutContent
|
||||
{
|
||||
get => (View)GetValue(MyFlyoutContentProperty);
|
||||
set => SetValue(MyFlyoutContentProperty, value);
|
||||
}
|
||||
|
||||
// Bind IsNotConnected
|
||||
public static readonly BindableProperty IsNotConnectedProperty =
|
||||
BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true);
|
||||
|
||||
public bool IsNotConnected
|
||||
{
|
||||
get => (bool)GetValue(IsNotConnectedProperty);
|
||||
set => SetValue(IsNotConnectedProperty, value);
|
||||
}
|
||||
|
||||
// bind NeedReturn
|
||||
public static readonly BindableProperty NeedReturnProperty =
|
||||
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
|
||||
|
||||
public bool NeedReturn
|
||||
{
|
||||
get => (bool)GetValue(NeedReturnProperty);
|
||||
set => SetValue(NeedReturnProperty, value);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Views.CustomHeader"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Gray900}}">
|
||||
|
||||
<Grid ColumnDefinitions="*">
|
||||
|
||||
<Label Text="Ma cuisine trop géniale"
|
||||
FontAttributes="Bold" FontSize="30" FontFamily="Forte"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
|
||||
Margin="20, 10, 0, 0"
|
||||
VerticalOptions="Start" HorizontalOptions="Start"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ContentView>
|
@ -0,0 +1,14 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class CustomHeader : ContentView
|
||||
{
|
||||
public CustomHeader()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ImageButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
(App.Current.MainPage as Shell).FlyoutIsPresented ^= true;
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
<?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:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
xmlns:model="clr-namespace:Model;assembly=Model"
|
||||
x:Class="Views.Home">
|
||||
|
||||
<local:ContainerBase
|
||||
IsNotConnected="True">
|
||||
|
||||
<!-- Flyout -->
|
||||
<local:ContainerBase.MyFlyoutContent>
|
||||
<VerticalStackLayout Grid.Row="1">
|
||||
<!-- Research -->
|
||||
<Button
|
||||
Text="Recherche"
|
||||
ImageSource="search_icon.png"
|
||||
MaximumHeightRequest="20"
|
||||
Style="{StaticResource button1}"/>
|
||||
<SearchBar
|
||||
Placeholder="Mots-clés (ex.: rapide, fromage)"
|
||||
FontAttributes="Italic" TextColor="Black"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray300}}"
|
||||
Margin="15, 10, 15, 40"/>
|
||||
|
||||
<!-- Direct research -->
|
||||
<Button
|
||||
Text="Entrées"
|
||||
ImageSource="flatware_icon.png"
|
||||
Style="{StaticResource button1}"/>
|
||||
<Button
|
||||
Text="Plats"
|
||||
ImageSource="room_service_icon.png"
|
||||
Style="{StaticResource button1}"/>
|
||||
<Button
|
||||
Text="Desserts"
|
||||
ImageSource="coffee_icon.png"
|
||||
Style="{StaticResource button1}"/>
|
||||
</VerticalStackLayout>
|
||||
</local:ContainerBase.MyFlyoutContent>
|
||||
|
||||
<!-- Master -->
|
||||
<local:ContainerBase.MyContent>
|
||||
<ScrollView>
|
||||
<StackLayout BindingContext="{Binding AllRecipes}" MinimumWidthRequest="400">
|
||||
<!--Modification du prof apportée sur le stacklayout pour empecher l'affichage d'une seule case recipe-->
|
||||
<Label
|
||||
Text="{Binding Description}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontSize="24"
|
||||
Padding="15"/>
|
||||
|
||||
<FlexLayout
|
||||
Margin="0, 15"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Center"
|
||||
AlignContent="SpaceEvenly"
|
||||
HorizontalOptions="Center"
|
||||
BindableLayout.ItemsSource="{Binding}">
|
||||
|
||||
<BindableLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="model:Recipe">
|
||||
<Border Style="{StaticResource recipeCase}">
|
||||
<Grid RowDefinitions="*, 40">
|
||||
<!--<local:RecipeCase
|
||||
CaseImageSource="room_service_icon.png"
|
||||
Title="{Binding Title}"/>-->
|
||||
|
||||
<Image
|
||||
Grid.Row="0" VerticalOptions="Fill"
|
||||
Source="{Binding Image}"/>
|
||||
|
||||
<Label
|
||||
Text="{Binding Title}" FontSize="18"
|
||||
Grid.Row="1" HorizontalOptions="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</BindableLayout.ItemTemplate>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>-->
|
||||
|
||||
</FlexLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</local:ContainerBase.MyContent>
|
||||
|
||||
</local:ContainerBase>
|
||||
|
||||
</ContentPage>
|
@ -0,0 +1,59 @@
|
||||
<?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="Views.Login"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
Title="Login"
|
||||
x:Name="nlogin">
|
||||
<VerticalStackLayout>
|
||||
<local:MiniHeader
|
||||
TitleMini="Connection"
|
||||
NeedReturn="True"
|
||||
HeightRequest="100"/>
|
||||
|
||||
<Grid ColumnDefinitions="350,*,350">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Text="Login :"
|
||||
FontAttributes="Bold"
|
||||
FontSize="Medium"
|
||||
Padding="0,50,0,10"
|
||||
MinimumWidthRequest="200"/>
|
||||
<Entry Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
BackgroundColor="#D1E8E2"
|
||||
Margin="0,0,0,20"/>
|
||||
<Label Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Text="Mot de passe :"
|
||||
FontAttributes="Bold"
|
||||
FontSize="Medium"
|
||||
Padding="0,50,0,10"
|
||||
MinimumWidthRequest="200"/>
|
||||
<Entry Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
BackgroundColor="#D1E8E2"
|
||||
Margin="0,0,0,50"/>
|
||||
<CheckBox Grid.Column="1"
|
||||
Grid.Row="4"/>
|
||||
<Label Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
Text="première connection"
|
||||
Margin="50,0,0,0"
|
||||
FontAttributes="Italic"/>
|
||||
<Button BackgroundColor="#D1E8E2"
|
||||
Grid.Column="1"
|
||||
Grid.Row="5"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ContentPage>
|
@ -0,0 +1,9 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class Login : ContentPage
|
||||
{
|
||||
public Login()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
x:Class="Views.MiniHeader"
|
||||
x:Name="miniheader">
|
||||
<Grid BackgroundColor="#116466" ColumnDefinitions="*,*,*">
|
||||
<local:ReturnButton NeedReturn="{Binding NeedReturn, Source={x:Reference miniheader}}"
|
||||
HorizontalOptions="Start" Padding="10, 10, 0, 0"
|
||||
WidthRequest="60"
|
||||
/>
|
||||
<Label Grid.Column="1"
|
||||
Text="{Binding TitleMini, Source={Reference miniheader}}"
|
||||
FontSize="Medium"
|
||||
FontAttributes="Bold"
|
||||
LineBreakMode="WordWrap"
|
||||
HorizontalTextAlignment="Center"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center" />
|
||||
<ImageButton Grid.Column="2"
|
||||
Source="person_default.svg"
|
||||
WidthRequest="80" HeightRequest="80"
|
||||
CornerRadius="50"
|
||||
BorderWidth="4" BorderColor="Black"/>
|
||||
</Grid>
|
||||
</ContentView>
|
@ -0,0 +1,27 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class MiniHeader : ContentView
|
||||
{
|
||||
public MiniHeader()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public readonly BindableProperty TitleMiniProperty =
|
||||
BindableProperty.Create("TitleMini", typeof(string), typeof(MiniHeader), "Erreur de titre");
|
||||
|
||||
public string TitleMini
|
||||
{
|
||||
get => (string)GetValue(TitleMiniProperty);
|
||||
set => SetValue(TitleMiniProperty, value);
|
||||
}
|
||||
// bind NeedReturn
|
||||
public static readonly BindableProperty NeedReturnProperty =
|
||||
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
|
||||
|
||||
public bool NeedReturn
|
||||
{
|
||||
get => (bool)GetValue(NeedReturnProperty);
|
||||
set => SetValue(NeedReturnProperty, value);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
<?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:local="clr-namespace:Views"
|
||||
x:Class="Views.MyPosts"
|
||||
Title="MyPosts">
|
||||
|
||||
<local:ContainerBase
|
||||
IsNotConnected="False"
|
||||
NeedReturn="True">
|
||||
|
||||
<local:ContainerBase.MyFlyoutContent>
|
||||
|
||||
<Grid RowDefinitions="250, *, *" VerticalOptions="Fill">
|
||||
<VerticalStackLayout Grid.Row="1">
|
||||
<Button Text="Mes informations" ImageSource="person_default.png" Style="{StaticResource button1}" Grid.Row="1"/>
|
||||
<Button Text="Modifier" ImageSource="settings_icon.png" Style="{StaticResource button1}" Grid.Row="2"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
|
||||
</local:ContainerBase.MyFlyoutContent>
|
||||
|
||||
<local:ContainerBase.MyContent>
|
||||
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<Label Text="Mon profil" TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontAttributes="Bold"
|
||||
FontSize="24" Padding="15, 15, 20, 5"/>
|
||||
<Label Text="Mes publications" TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontSize="20" Padding="15"/>
|
||||
|
||||
<FlexLayout
|
||||
Margin="0, 15"
|
||||
Wrap="Wrap"
|
||||
JustifyContent="Start"
|
||||
AlignItems="Center"
|
||||
AlignContent="SpaceEvenly"
|
||||
HorizontalOptions="Center">
|
||||
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||
|
||||
</FlexLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
</local:ContainerBase.MyContent>
|
||||
|
||||
</local:ContainerBase>
|
||||
|
||||
</ContentPage>
|
@ -0,0 +1,9 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class MyPosts : ContentPage
|
||||
{
|
||||
public MyPosts()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
<?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:local="clr-namespace:Views"
|
||||
xmlns:model="clr-namespace:Model;assembly=Model"
|
||||
x:Class="Views.MyProfil"
|
||||
Title="MyProfil">
|
||||
|
||||
<local:ContainerBase
|
||||
IsNotConnected="False"
|
||||
NeedReturn="True">
|
||||
|
||||
<local:ContainerBase.MyFlyoutContent>
|
||||
|
||||
<Grid RowDefinitions="250, *, *" VerticalOptions="Fill">
|
||||
<VerticalStackLayout Grid.Row="1">
|
||||
<Button Text="Mes Recettes" ImageSource="person_default.png" Style="{StaticResource button1}" Grid.Row="1"/>
|
||||
<Button Text="Ajouter Recette" ImageSource="settings_icon.png" Style="{StaticResource button1}" Grid.Row="2"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
|
||||
</local:ContainerBase.MyFlyoutContent>
|
||||
|
||||
<local:ContainerBase.MyContent>
|
||||
|
||||
<ScrollView>
|
||||
<StackLayout >
|
||||
<!--user's informations-->
|
||||
<Label Text="Mon profil" TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontAttributes="Bold"
|
||||
FontSize="24" Padding="15, 15, 20, 5"/>
|
||||
<HorizontalStackLayout>
|
||||
<VerticalStackLayout >
|
||||
<Label Text="Informations personnelles :" TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontSize="20" Padding="15"/>
|
||||
<Label Text="Nom :"
|
||||
Padding="50,0,0,0"
|
||||
FontSize="18"/>
|
||||
<Entry BackgroundColor="#D1E8E2"
|
||||
Margin="50,10,0,20"
|
||||
Text="{Binding CurrentUser.Name}"/>
|
||||
<Label Text="Prénom :"
|
||||
Padding="50,0,0,0"
|
||||
FontSize="18"/>
|
||||
<Entry BackgroundColor="#D1E8E2"
|
||||
Margin="50,10,0,20"
|
||||
Text="{Binding CurrentUser.Surname} "/>
|
||||
<Label Text="Mail :"
|
||||
Padding="50,0,0,0"
|
||||
FontSize="18"/>
|
||||
<Entry BackgroundColor="#D1E8E2"
|
||||
Margin="50,10,0,20"
|
||||
IsEnabled="False"
|
||||
Text="{Binding CurrentUser.Mail}"/>
|
||||
<!--liste drag and drop-->
|
||||
</VerticalStackLayout>
|
||||
<VerticalStackLayout Padding="100,0,0,0">
|
||||
<Label Text="Priorités du compte : " TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||
FontSize="20" Padding="15"/>
|
||||
<Grid BackgroundColor="#D1E8E2"
|
||||
MinimumHeightRequest="300"
|
||||
Padding="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="Recettes économiques" Grid.Row="0" Padding="5,0,0,0"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="1" />
|
||||
<Label Text="Recettes rapides" Grid.Row="2"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="3" />
|
||||
<Label Text="Recettes simples" Grid.Row="4"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="5" />
|
||||
<Label Text="Recettes légères" Grid.Row="6"/>
|
||||
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="7" />
|
||||
<Label Text="Recettes gourmandes" Grid.Row="8"/>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
</HorizontalStackLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</local:ContainerBase.MyContent>
|
||||
</local:ContainerBase>
|
||||
</ContentPage>
|
@ -0,0 +1,20 @@
|
||||
using CommunityToolkit.Maui.Behaviors;
|
||||
using DataPersistence;
|
||||
using Model;
|
||||
using Model.Managers;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Views;
|
||||
|
||||
public partial class MyProfil : ContentPage
|
||||
{
|
||||
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||
public User user => (App.Current as App).CurrentUser;
|
||||
|
||||
public MyProfil()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = this;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#512BD4</color>
|
||||
<color name="colorPrimaryDark">#2B0B98</color>
|
||||
<color name="colorAccent">#2B0B98</color>
|
||||
</resources>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/appicon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
using Microsoft.Maui;
|
||||
using Microsoft.Maui.Hosting;
|
||||
using System;
|
||||
|
||||
namespace Vue
|
||||
{
|
||||
internal class Program : MauiApplication
|
||||
{
|
||||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var app = new Program();
|
||||
app.Run(args);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<maui:MauiWinUIApplication
|
||||
x:Class="Vue.WinUI.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:maui="using:Microsoft.Maui"
|
||||
xmlns:local="using:Vue.WinUI">
|
||||
|
||||
</maui:MauiWinUIApplication>
|
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
IgnorableNamespaces="uap rescap">
|
||||
|
||||
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="4BDED58C-168B-44A1-9464-BB39916D6439" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>$placeholder$</DisplayName>
|
||||
<PublisherDisplayName>User Name</PublisherDisplayName>
|
||||
<Logo>$placeholder$.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="$placeholder$"
|
||||
Description="$placeholder$"
|
||||
Square150x150Logo="$placeholder$.png"
|
||||
Square44x44Logo="$placeholder$.png"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
|
||||
<uap:SplashScreen Image="$placeholder$.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
</Capabilities>
|
||||
|
||||
</Package>
|
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="Vue.WinUI.app"/>
|
||||
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<!-- The combination of below two tags have the following effect:
|
||||
1) Per-Monitor for >= Windows 10 Anniversary Update
|
||||
2) System < Windows 10 Anniversary Update
|
||||
-->
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/appicon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Windows Machine": {
|
||||
"commandName": "MsixPackage",
|
||||
"nativeDebugging": false
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Views"
|
||||
x:Class="Views.RecipeCase"
|
||||
x:Name="rCase">
|
||||
|
||||
<Border Style="{StaticResource recipeCase}">
|
||||
<Grid RowDefinitions="*, 40">
|
||||
|
||||
<Image
|
||||
Grid.Row="0" VerticalOptions="Fill"
|
||||
Source="{Binding CaseImageSource, Source={x:Reference rCase}}"/>
|
||||
|
||||
<Label Text="Recette 1" FontSize="18"
|
||||
Grid.Row="1" HorizontalOptions="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</ContentView>
|
@ -0,0 +1,18 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class RecipeCase : ContentView
|
||||
{
|
||||
public RecipeCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly BindableProperty CaseImageSourceProperty =
|
||||
BindableProperty.Create("CaseImageSource", typeof(ImageSource), typeof(Image));
|
||||
|
||||
public ImageSource CaseImageSource
|
||||
{
|
||||
get => (ImageSource)GetValue(CaseImageSourceProperty);
|
||||
set => SetValue(CaseImageSourceProperty, value);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace Views;
|
||||
|
||||
public partial class RecipeReviews : ContentPage
|
||||
{
|
||||
public RecipeReviews()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 228 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue