Fixing dev #62

vnext
Paul Schneider 5 years ago
parent 5c4f61c3c7
commit cb5f042221
25 changed files with 276 additions and 82 deletions

@ -15,4 +15,13 @@ pushInPre:
packages:
make -C src/Yavsc.Abstract pack
findResources:
find src -name "*.resx" |sort
prepare_all_code:
make -C src/Yavsc.Abstract prepare_code
make -C src/Yavsc.Server prepare_code
make -C src/Yavsc prepare_code
.PHONY: packages

@ -1,11 +1,13 @@
SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
BASERESX=Resources/Yavsc.Attributes.Validation.Resources.resx Resources/Yavsc.Models.Messaging.Resources.resx
BASERESX=Resources/Yavsc.Attributes.Validation.Resources.resx \
Resources/Yavsc.Models.Messaging.Resources.resx \
Resources/Yavsc.Models.IT.Fixing.Bug.resx
BASERESXGEN=$(BASERESX:.resx=.Designer.cs)
include $(MAKEFILE_DIR)/versioning.mk
include $(MAKEFILE_DIR)/dnx.mk
all: $(BINTARGETPATH)
all: $(BASERESXGEN) $(BINTARGETPATH)
%.Designer.cs: %.resx
strotygen -l -p -t -r "Yavsc.Abstract.Resources." $^

@ -1,12 +1,12 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Yavsc.Attributes.Validation {
using System;

@ -26,7 +26,7 @@ namespace Yavsc.Models.IT.Fixing {
public static System.Resources.ResourceManager ResourceManager {
get {
if (object.Equals(null, resourceMan)) {
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Server.Resources." + "Yavsc.Models.IT.Fixing.Bug"), typeof(Bug).GetTypeInfo().Assembly);
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Abstract.Resources." + "Yavsc.Models.IT.Fixing.Bug"), typeof(Bug).GetTypeInfo().Assembly);
resourceMan = temp;
}
return resourceMan;

@ -58,8 +58,11 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<!--
route name for the api controller used to tag the 'BlogPost' entity
-->
<data name="TitleTooLong"><value>Le titre est trop long</value></data>
</root>
<data name="Rejected" comment="bug statuses"><value>Rejeté</value></data>
<data name="Inserted" comment="bug statuses"><value>Inséré</value></data>
<data name="Confirmed" comment="bug statuses"><value>Confirmé</value></data>
<data name="Feature" comment="bug statuses"><value>Fonctionalité</value></data>
<data name="Fixed" comment="bug statuses"><value>Corrigé</value></data>
</root>

@ -1,12 +1,12 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Yavsc.Models.Messaging {
using System;

@ -1,5 +1,10 @@
SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
BASERESX=Resources/Yavsc.Models.Relationship.HyperLink.resx \
Resources/Yavsc.Models.Streaming.LiveFlow.resx
BASERESXGEN=$(BASERESX:.resx=.Designer.cs)
include $(MAKEFILE_DIR)/versioning.mk
include $(MAKEFILE_DIR)/dnx.mk
@ -17,8 +22,6 @@ $(BINTARGETPATH): ../OAuth.AspNet.AuthServer/bin/$(CONFIGURATION)/OAuth.AspNet.A
%.Designer.cs: %.resx
strotygen -l -p -t -r "Yavsc.Server.Resources." $^
prepare_code: Resources/Yavsc.Models.IT.Fixing.Bug.Designer.cs \
Resources/Yavsc.Models.Relationship.HyperLink.Designer.cs \
Resources/Yavsc.Models.Streaming.LiveFlow.Designer.cs
prepare_code: $(BASERESXGEN)
all: $(BINTARGETPATH)
all: $(BINTARGETPATH)

@ -20,6 +20,7 @@ namespace Yavsc.Controllers
private ApplicationDbContext _context;
ILogger _logger;
IStringLocalizer<Yavsc.YavscLocalisation> _localizer;
IStringLocalizer<BugController> _bugLocalizer;
public ProjectController(ApplicationDbContext context,
ILoggerFactory loggerFactory,
@ -69,7 +70,7 @@ namespace Yavsc.Controllers
ViewBag.PaymentIdItems = _context.PayPalPayment.CreateSelectListItems<PayPalPayment>
(p => p.OrderReference, p => $"{p.Executor.UserName} {p.PaypalPayerId} {p.OrderReference}");
ViewBag.Status = typeof(Yavsc.QueryStatus).CreateSelectListItems(null);
ViewBag.Status = _bugLocalizer.CreateSelectListItems(typeof(Yavsc.QueryStatus), Yavsc.QueryStatus.Inserted);
ViewBag.RepositoryItems = _context.GitRepositoryReference.CreateSelectListItems<GitRepositoryReference>(
u => u.Id.ToString(), u => u.ToString());

@ -8,6 +8,7 @@ using Yavsc.Server.Helpers;
using System.Collections.Generic;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Extensions.Localization;
using Microsoft.AspNet.Authorization;
namespace Yavsc.Controllers
{
@ -15,11 +16,16 @@ namespace Yavsc.Controllers
{
ApplicationDbContext _context;
IStringLocalizer<BugController> _localizer;
IStringLocalizer<Yavsc.Models.IT.Fixing.Resources> _statusLocalizer;
public BugController(ApplicationDbContext context, IStringLocalizer<BugController> localizer )
public BugController(ApplicationDbContext context,
IStringLocalizer<BugController> localizer,
IStringLocalizer<Resources> statusLocalizer
)
{
_context = context;
_localizer = localizer;
_statusLocalizer = statusLocalizer;
}
// GET: Bug
@ -54,9 +60,10 @@ namespace Yavsc.Controllers
}
IEnumerable<SelectListItem> Statuses(BugStatus ?status) =>
typeof(Yavsc.Models.IT.Fixing.BugStatus).CreateSelectListItems(status);
_statusLocalizer.CreateSelectListItems(typeof(BugStatus), status);
IEnumerable<SelectListItem> Features(ApplicationDbContext context) =>
context.Feature.CreateSelectListItems<Feature>(f => f.Id.ToString(), f => f.ShortName, null)
context.Feature.CreateSelectListItems<Feature>(f => f.Id.ToString(), f => $"{f.ShortName} ({f.Description})", null)
.AddNull(_localizer["noAttachedFID"]);
// POST: Bug/Create
@ -76,6 +83,7 @@ namespace Yavsc.Controllers
}
// GET: Bug/Edit/5
[Authorize("AdministratorOnly")]
public async Task<IActionResult> Edit(long? id)
{
if (id == null)
@ -98,6 +106,7 @@ namespace Yavsc.Controllers
// POST: Bug/Edit/5
[HttpPost]
[ValidateAntiForgeryToken]
[Authorize("AdministratorOnly")]
public async Task<IActionResult> Edit(Bug bug)
{
if (ModelState.IsValid)
@ -111,6 +120,7 @@ namespace Yavsc.Controllers
// GET: Bug/Delete/5
[ActionName("Delete")]
[Authorize("AdministratorOnly")]
public async Task<IActionResult> Delete(long? id)
{
if (id == null)
@ -130,6 +140,7 @@ namespace Yavsc.Controllers
// POST: Bug/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
[Authorize("AdministratorOnly")]
public async Task<IActionResult> DeleteConfirmed(long id)
{
Bug bug = await _context.Bug.SingleAsync(m => m.Id == id);

@ -7,6 +7,7 @@ using Microsoft.Data.Entity;
namespace Yavsc.Controllers
{
using Microsoft.Extensions.Localization;
using Models;
using Models.IT.Evolution;
using Yavsc.Server.Helpers;
@ -14,11 +15,14 @@ namespace Yavsc.Controllers
public class FeatureController : Controller
{
private ApplicationDbContext _context;
private IStringLocalizer<BugController> _bugLocalizer;
IEnumerable<SelectListItem> Statuses(FeatureStatus ?status) =>
typeof(FeatureStatus).CreateSelectListItems(status);
public FeatureController(ApplicationDbContext context)
_bugLocalizer.CreateSelectListItems(typeof(FeatureStatus), status);
public FeatureController(ApplicationDbContext context, IStringLocalizer<BugController> bugLocalizer)
{
_context = context;
_bugLocalizer = bugLocalizer;
}
// GET: Feature

@ -1,12 +1,13 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Extensions.Localization;
namespace Yavsc.Server.Helpers
{
public static class PageHelpers
{
public static List<SelectListItem> CreateSelectListItems (this Type enumType, object selectedValue =null)
public static List<SelectListItem> CreateSelectListItems<T> (this IStringLocalizer<T> localisation, Type enumType, object selectedValue =null)
{
string selectedName = (selectedValue != null) ? enumType.GetEnumName(selectedValue) : null;
@ -17,12 +18,11 @@ namespace Yavsc.Server.Helpers
{
var itemName = names[index];
items.Add(new SelectListItem() {
Value = values.GetValue(index).ToString(), Text = itemName, Selected = ( itemName == selectedName)
Value = values.GetValue(index).ToString(), Text = localisation[itemName], Selected = ( itemName == selectedName)
}) ;
}
var list = new SelectList(items);
return items;
}
public static List<SelectListItem> AddNull(this List<SelectListItem> selectList, string displayNull, object selectedValue = null)

@ -4,10 +4,11 @@ HOSTING=localhost
ASPNET_LOG_LEVEL=debug
SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
BASERESX= Resources/Yavsc.ChatHub.resx\
Resources/Yavsc.ViewComponents.CommentViewComponent.resx\
Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx\
Resources/Yavsc.ViewModels.EnrolerViewModel.resx\
BASERESX= Resources/Yavsc.Models.IT.Fixing.Resources.resx \
Resources/Yavsc.ChatHub.resx \
Resources/Yavsc.ViewComponents.CommentViewComponent.resx \
Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx \
Resources/Yavsc.ViewModels.EnrolerViewModel.resx \
Resources/Yavsc.YavscLocalisation.resx
BASERESXGEN=$(BASERESX:.resx=.Designer.cs)
MCS_OPTIONS=--debug
@ -95,7 +96,5 @@ prepare_mvc_templates: $(SOURCE_DIR)/scripts/configure/tools/mvc-code-generators
$(SOURCE_DIR)/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Details.cshtml
cp $^ $(SOURCE_DIR)/packages/Microsoft.Extensions.CodeGenerators.Mvc/1.0.0-rc1-final/Templates/ViewGenerator/
project.lock.json: project.json ../Yavsc.Abstract/project.lock.json ../Yavsc.Server/project.lock.json ../OAuth.AspNet.Token/project.lock.json ../OAuth.AspNet.AuthServer/project.lock.json
$(BINTARGETPATH): $(BASERESXGEN) project.lock.json

@ -0,0 +1,76 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Yavsc.Models.IT.Fixing {
using System;
using System.Reflection;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public partial class Resources {
private static System.Resources.ResourceManager resourceMan;
private static System.Globalization.CultureInfo resourceCulture;
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.Resources.ResourceManager ResourceManager {
get {
if (object.Equals(null, resourceMan)) {
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Resources." + "Yavsc.Models.IT.Fixing.Resources"), typeof(Resources).GetTypeInfo().Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
public static string Rejected {
get {
return ResourceManager.GetString("Rejected", resourceCulture);
}
}
public static string Inserted {
get {
return ResourceManager.GetString("Inserted", resourceCulture);
}
}
public static string Confirmed {
get {
return ResourceManager.GetString("Confirmed", resourceCulture);
}
}
public static string Feature {
get {
return ResourceManager.GetString("Feature", resourceCulture);
}
}
public static string Fixed {
get {
return ResourceManager.GetString("Fixed", resourceCulture);
}
}
}
}

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Rejected" comment="bug statuses"><value>Rejeté</value></data>
<data name="Inserted" comment="bug statuses"><value>Inséré</value></data>
<data name="Confirmed" comment="bug statuses"><value>Confirmé</value></data>
<data name="Feature" comment="bug statuses"><value>Fonctionalité</value></data>
<data name="Fixed" comment="bug statuses"><value>Corrigé</value></data>
</root>

@ -1,12 +1,12 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Yavsc {
using System;
@ -1669,6 +1669,18 @@ namespace Yavsc {
}
}
public static string Feature {
get {
return ResourceManager.GetString("Feature", resourceCulture);
}
}
public static string FeatureId {
get {
return ResourceManager.GetString("FeatureId", resourceCulture);
}
}
public static string to {
get {
return ResourceManager.GetString("to", resourceCulture);
@ -2106,5 +2118,11 @@ namespace Yavsc {
return ResourceManager.GetString("Partenariat", resourceCulture);
}
}
public static string IconWebUploadSpecification {
get {
return ResourceManager.GetString("IconWebUploadSpecification", resourceCulture);
}
}
}
}

@ -398,6 +398,8 @@
<data name="ThisPerformerGivesAccessToHisCalendarAndItAppearsHeShouldNotBeAvailableThis"><value>Selon son calendier Google, ce perstataire pourrait ne pas être disponible ce</value></data>
<data name="ThisPerformerDoesntGiveAccessToHisCalendar"><value>Ce prestataire n'a pas mis de calendrier à disposition.</value></data>
<data name="Title"><value>Titre</value></data>
<data name="Feature"><value>Fonctionalité</value></data>
<data name="FeatureId"><value>Identifiant de fonctionalité</value></data>
<data name="to"><value>à</value></data>
<data name="TwoFactorAuthentication"><value>Double identification</value></data>
<data name="Unitary_cost"><value>Coût unitaire</value></data>
@ -504,4 +506,9 @@ Facture réglée: {5}</value></data>
<data name="LiveFlow"><value>Flux live</value></data>
<data name="Instrumentation"><value>Instrumentation</value></data>
<data name="Partenariat"><value>Partenariat</value></data>
<data name="IconWebUploadSpecification"><value>
Le format png pourrait être supporté ici,
le format Gif, peut-être aussi, et même, mais là, moins souvent, le surnommé Jpg.
</value></data>
</root>

@ -1,4 +1,5 @@
@model Yavsc.Models.IT.Fixing.Bug
@inject IStringLocalizer<Yavsc.Models.IT.Fixing.Resources> SRR
@{
ViewData["Title"] = @SR["Details"];
@ -7,34 +8,32 @@
<h2>@SR["Details"]</h2>
<div>
<h4>Bug</h4>
<h3>Bug</h3>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.FeatureId)
@SR["FeatureId"]
</dt>
<dd>
@Html.DisplayFor(model => model.FeatureId)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Title)
@SR["Title"]
</dt>
<dd>
@Html.DisplayFor(model => model.Title)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Status)
@SR["Status"]
</dt>
<dd>
@Html.DisplayFor(model => model.Status)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Description)
</dt>
<dd>
@Html.DisplayFor(model => model.Description)
@SRR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)Model.Status]]
</dd>
</dl>
<h3>@SR["Description"]</h3>
<code><pre>@Html.DisplayFor(model => model.Description)</pre></code>
</div>
<p>
<a asp-action="Edit" asp-route-id="@Model.Id">@SR["Edit"]</a> |

@ -1,4 +1,5 @@
@model IEnumerable<Yavsc.Models.IT.Fixing.Bug>
@inject IStringLocalizer<Yavsc.Models.IT.Fixing.Resources> SRR
@{
ViewData["Title"] = @SR["Index"];
@ -9,22 +10,20 @@
<p>
<a asp-action="Create">@SR["Create New"]</a>
</p>
<table class="table">
<tr>
<td>
@Html.DisplayNameFor(model => model.Id)
@SR[Html.DisplayNameFor(model => model.Id)]
</td>
<td>
@Html.DisplayNameFor(model => model.Title)
@SR[Html.DisplayNameFor(model => model.Title)]
</td>
<th>
@Html.DisplayNameFor(model => model.FeatureId)
</th>
<th>
@Html.DisplayNameFor(model => model.Status)
@SR[Html.DisplayNameFor(model => model.FeatureId)]
</th>
<th>
@Html.DisplayNameFor(model => model.Description)
@SR[Html.DisplayNameFor(model => model.Status)]
</th>
<th></th>
</tr>
@ -41,18 +40,13 @@
@Html.DisplayFor(modelItem => item.FeatureId)
</td>
<td>
@Html.DisplayFor(modelItem => item.Status)
</td>
<td>
<pre><code>
@item.Description
</code></pre>
@SRR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)item.Status]]
</td>
<td>
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
<a asp-action="Edit" asp-route-id="@item.Id">@SR["Edit"]</a> |
<a asp-action="Details" asp-route-id="@item.Id">@SR["Details"]</a> |
<a asp-action="Delete" asp-route-id="@item.Id">@SR["Delete"]</a>
</td>
</tr>
}

@ -1 +1 @@
test
de dévelopement.|

Loading…