From f6d192399da28059d5adeb92da16df958303b210 Mon Sep 17 00:00:00 2001
From: Nasreddine Azahaf <110824702+azn-smart@users.noreply.github.com>
Date: Wed, 6 Dec 2023 01:14:27 +0100
Subject: [PATCH] =?UTF-8?q?feature(PAIL-153):=20[BE=20-=20UNITY]=20Radiobu?=
=?UTF-8?q?tton=20on=20Adresse=20diff=C3=A9rente=20coch=C3=A9ar=20d=C3=A9f?=
=?UTF-8?q?aut?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Pages/Changelog.cshtml | 545 +++++++++---------
.../Pages/Templates/Subscription.cshtml | 17 +-
.../Pages/Templates/Subscription.cshtml.cs | 8 +
.../Smart.Design.Library.csproj | 2 +-
.../Elements/Radio/RadioHtmlGenerator.cs | 18 +-
5 files changed, 307 insertions(+), 283 deletions(-)
diff --git a/src/Smart.Design.Library.Showcase.WebApp/Pages/Changelog.cshtml b/src/Smart.Design.Library.Showcase.WebApp/Pages/Changelog.cshtml
index f472cc41..79fb534e 100644
--- a/src/Smart.Design.Library.Showcase.WebApp/Pages/Changelog.cshtml
+++ b/src/Smart.Design.Library.Showcase.WebApp/Pages/Changelog.cshtml
@@ -11,276 +11,283 @@
This is listing all the changes/improvments on the Smart.Design.Library
(does not include changes on the Smart.Design.Library.Showcase).
+ -
+
December 6, 2023 - Version 3.1.9
+
+ -
+ Radio button: Refactoring -> issue with model
+
+
+
+ -
+
October 30, 2023 - Version 3.1.7
+
+ -
+ Add missing favicon
+
+ -
+ Add styles for "Concession tab"
+
+ -
+ Update table-of-content.js
+
+
+
+ -
+
September 25, 2023 - Version 3.0.0
+
+ -
+ Reorganize .js and .css for an optimal use
+
+ -
+ Import all Mono elements (.scss, .js, images, icons, fonts)
+
+
+
+ -
+
October 17, 2023 - Version 2.1.13
+
+ -
+ Tooltip: Adapt css so we can click on the tooltip in mobile view
+
+ -
+ Tooltip: Adapt css so the tooltip stays at the same line as the label
+
+
+
+ -
+
October 5, 2023 - Version 2.1.10
+
+ -
+ Checkbox: Adapat css so we can add formatted html for the label without breaking the design
+
+
+
+ -
+
October 4, 2023 - Version 2.1.9
+
+ -
+ Date input number: add optional parameter min and max in order to prevent user to put a number inferior to min and greater than max.
+
+
+
+ -
+
September 14, 2023 - Version 2.1.8
+
+ -
+ Date tag: When a value has been selected and the form submitted after that, if there errors on other fields,
+ the date tag will keep its value
+
+
+
+ -
+
September 8, 2023 - Version 2.1.7
+
+ -
+ Select tag: show red border around select when value is required and it is empty after submit
+
+ -
+ Select tag: When a value has been selected and the form submitted after that, if there errors on other fields,
+ the select will keep its value
+
+
+
+ -
+
September 7, 2023 - Version 2.1.6
+
+ -
+ Input number tag: fix issue where model was not binding
+
+
+
+ -
+
September 5, 2023 - Version 2.1.5
+
+ -
+ Update header tag: change wording 'documentation'
+
+
+
+ -
+
September 4, 2023 - Version 2.1.4
+
+ -
+ Update header tag: delete main label & Question link
+
+
+
+ -
+
August 31, 2023 - Version 2.1.3
+
+ -
+ Checkbox tag: Allow html tag in label.
+
+ -
+ Provide the option of adding Select default value
+
+ -
+ Enable decimal encoding for Input type Number
+
+
+
+ -
+
August 24, 2023 - Version 2.1.2
+
+ -
+ Fix the Regex for Input type Tel
+
+
+
+ -
+
August 16, 2023 - Version 2.1.1
+
+ -
+ Update documentation Select Taghelper
+
+ -
+ Update select option for languages
+
+
+
+ -
+
July 31, 2023 - Version 2.1.0
+
+ -
+ Add Box TagHelper: a responsive box
+
+ - Add some specific css for Box Taghelper
+
+
+ -
+
July 31, 2023 - Version 2.0.0
+
+ -
+ Add Smart-not-logged-in-header TagHelper: a header with the Smart logo and a switcher language
+
+ -
+ Improve TagHelper Radio button :
+
+ - Give the ability to add HTML in the Radio button Label
+ - Add missing ID attribut
+
+
+ -
+ Improve TagHelper Select
+
+ - Add an Enum for HTML Option tag
+ - Add missing Name attribut
+
+
+ -
+ Add variations to Smart-input TagHelper
+
+ - Smart-input-date TagHelper
+ - Smart-input-phone TagHelper
+ - Smart-input-email TagHelper
+ - Smart-input-number TagHelper
+
+
+ -
+ Fix some typo errors in some TagHelpers
+
+ -
+ Change styles for hover for c-button--highlights in main.css
+
+
+
+ -
+
June 06, 2023 - Version 1.5.1
+
+ -
+ Update CSS styles for :
+
+ - .dynamic-dashboard--grid
+ - .card__banner--ag
+ - .c-card__banner--text
+ - .c-button--secondary (color)
+ - .c-button--highlights
+ - .c-content ol
+
+
+
+
+ -
+
May 10, 2023 - Version 1.5.0
+
+ - Embark logo image inside nugget package
+
+
+ -
+
May 04, 2023 - Version 1.4.3
+
+ -
+ Update CSS styles for
+
+ - .c-content ul li
+ - .c-content ol li
+
- -
-
October 30, 2023 - Version 3.1.7
-
- -
- Add missing favicon
-
- -
- Add styles for "Concession tab"
-
- -
- Update table-of-content.js
-
-
-
- -
-
September 25, 2023 - Version 3.0.0
-
- -
- Reorganize .js and .css for an optimal use
-
- -
- Import all Mono elements (.scss, .js, images, icons, fonts)
-
-
-
- -
-
October 17, 2023 - Version 2.1.13
-
- -
- Tooltip: Adapt css so we can click on the tooltip in mobile view
-
- -
- Tooltip: Adapt css so the tooltip stays at the same line as the label
-
-
-
- -
-
October 5, 2023 - Version 2.1.10
-
- -
- Checkbox: Adapat css so we can add formatted html for the label without breaking the design
-
-
-
- -
-
October 4, 2023 - Version 2.1.9
-
- -
- Date input number: add optional parameter min and max in order to prevent user to put a number inferior to min and greater than max.
-
-
-
- -
-
September 14, 2023 - Version 2.1.8
-
- -
- Date tag: When a value has been selected and the form submitted after that, if there errors on other fields,
- the date tag will keep its value
-
-
-
- -
-
September 8, 2023 - Version 2.1.7
-
- -
- Select tag: show red border around select when value is required and it is empty after submit
-
- -
- Select tag: When a value has been selected and the form submitted after that, if there errors on other fields,
- the select will keep its value
-
-
-
- -
-
September 7, 2023 - Version 2.1.6
-
- -
- Input number tag: fix issue where model was not binding
-
-
-
- -
-
September 5, 2023 - Version 2.1.5
-
- -
- Update header tag: change wording 'documentation'
-
-
-
- -
-
September 4, 2023 - Version 2.1.4
-
- -
- Update header tag: delete main label & Question link
-
-
-
- -
-
August 31, 2023 - Version 2.1.3
-
- -
- Checkbox tag: Allow html tag in label.
-
- -
- Provide the option of adding Select default value
-
- -
- Enable decimal encoding for Input type Number
-
-
-
- -
-
August 24, 2023 - Version 2.1.2
-
- -
- Fix the Regex for Input type Tel
-
-
-
- -
-
August 16, 2023 - Version 2.1.1
-
- -
- Update documentation Select Taghelper
-
- -
- Update select option for languages
-
-
-
- -
-
July 31, 2023 - Version 2.1.0
-
- -
- Add Box TagHelper: a responsive box
-
- - Add some specific css for Box Taghelper
-
-
- -
-
July 31, 2023 - Version 2.0.0
-
- -
- Add Smart-not-logged-in-header TagHelper: a header with the Smart logo and a switcher language
-
- -
- Improve TagHelper Radio button :
-
- - Give the ability to add HTML in the Radio button Label
- - Add missing ID attribut
-
-
- -
- Improve TagHelper Select
-
- - Add an Enum for HTML Option tag
- - Add missing Name attribut
-
-
- -
- Add variations to Smart-input TagHelper
-
- - Smart-input-date TagHelper
- - Smart-input-phone TagHelper
- - Smart-input-email TagHelper
- - Smart-input-number TagHelper
-
-
- -
- Fix some typo errors in some TagHelpers
-
- -
- Change styles for hover for c-button--highlights in main.css
-
-
-
- -
-
June 06, 2023 - Version 1.5.1
-
- -
- Update CSS styles for :
-
- - .dynamic-dashboard--grid
- - .card__banner--ag
- - .c-card__banner--text
- - .c-button--secondary (color)
- - .c-button--highlights
- - .c-content ol
-
-
-
-
- -
-
May 10, 2023 - Version 1.5.0
-
- - Embark logo image inside nugget package
-
-
- -
-
May 04, 2023 - Version 1.4.3
-
- -
- Update CSS styles for
-
- - .c-content ul li
- - .c-content ol li
-
-
-
-
-
- -
-
April 27, 2023 - Version 1.4.1
-
- - Improve Tag Helper smart-header with a svg logo
-
-
- -
-
April 24, 2023 - Version 1.4.0
-
- - Improve Tag Helper smart-header smart-table-of-content (delete class not-numbered)
- -
- Update CSS styles for :
-
- - .o-flex
- - .o-block
- - .c-table-of-content-navigation
- - .c-toolbar__right
- - .u-t-align-right
-
-
-
-
- -
-
April 12, 2023 - Version 1.3.7
-
-
- -
-
Date
-
-
- -
-
Date
-
-
- -
-
Date
-
-
- -
-
Date
-
-
- -
-
Before August 17, 2022
-
- - Go to the design.smart.coop inline Changelog
-
-
+
+
+
+
+ April 27, 2023 - Version 1.4.1
+
+ - Improve Tag Helper smart-header with a svg logo
+
+
+
+ April 24, 2023 - Version 1.4.0
+
+ - Improve Tag Helper smart-header smart-table-of-content (delete class not-numbered)
+ -
+ Update CSS styles for :
+
+ - .o-flex
+ - .o-block
+ - .c-table-of-content-navigation
+ - .c-toolbar__right
+ - .u-t-align-right
+
+
+
+
+
+ April 12, 2023 - Version 1.3.7
+
+
+
+ Date
+
+
+
+ Date
+
+
+
+ Date
+
+
+
+ Date
+
+
+
+ Before August 17, 2022
+
+ - Go to the design.smart.coop inline Changelog
+
+
diff --git a/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml b/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml
index 6172c24b..f14964a7 100644
--- a/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml
+++ b/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml
@@ -157,10 +157,10 @@
Adresse Courrier
-
+
-
+
@@ -325,8 +325,17 @@
}
docReady(function () {
+ var sameAddress = document.getElementById("sameAddress");
+ var anotherAddress = document.getElementById("anotherAddress");
+
// add click event on sameAddress and anotherAddress
- document.getElementById("sameAddress").addEventListener("click", SameAddress);
- document.getElementById("anotherAddress").addEventListener("click", AnotherAddress);
+ sameAddress.addEventListener("click", SameAddress);
+ anotherAddress.addEventListener("click", AnotherAddress);
+
+ if (sameAddress.checked) {
+ SameAddress();
+ } else {
+ AnotherAddress()
+ }
});
diff --git a/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml.cs b/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml.cs
index d0e87b10..a98bbc98 100644
--- a/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml.cs
+++ b/src/Smart.Design.Library.Showcase.WebApp/Pages/Templates/Subscription.cshtml.cs
@@ -49,11 +49,19 @@ public class SubscriptionModel : PageModel
[BindProperty]
public Subscription Subscription { get; set; }
+ [BindProperty]
+ public bool SameAddress { get; set; }
+
+
public void OnGet()
{
+ SameAddress = true;
}
+
public async Task
OnPostAsync()
{
+ SameAddress = Request.Form.ContainsKey("sameAddress") && bool.Parse(Request.Form["sameAddress"]);
+
if (!ModelState.IsValid)
{
ModelState.AddModelError(string.Empty, "error");
diff --git a/src/Smart.Design.Library/Smart.Design.Library.csproj b/src/Smart.Design.Library/Smart.Design.Library.csproj
index 8e9b55a6..16e66197 100644
--- a/src/Smart.Design.Library/Smart.Design.Library.csproj
+++ b/src/Smart.Design.Library/Smart.Design.Library.csproj
@@ -4,7 +4,7 @@
net6.0
true
enable
- 3.1.8
+ 3.1.9
Smart Coop
Smart Coop
Tag Helpers implementation of the Smart Design System. Official documentation can be seen at https://design-showcase.smartbe.be/
diff --git a/src/Smart.Design.Library/TagHelpers/Elements/Radio/RadioHtmlGenerator.cs b/src/Smart.Design.Library/TagHelpers/Elements/Radio/RadioHtmlGenerator.cs
index 888f97ea..9b004a2a 100644
--- a/src/Smart.Design.Library/TagHelpers/Elements/Radio/RadioHtmlGenerator.cs
+++ b/src/Smart.Design.Library/TagHelpers/Elements/Radio/RadioHtmlGenerator.cs
@@ -20,21 +20,21 @@ public TagBuilder GenerateSmartRadio(string? id, string? name, string? label, st
inputRadioTagBuilder.Attributes.Add("type", "radio");
inputRadioTagBuilder.Attributes.Add("id", id);
- if (@checked)
- {
- inputRadioTagBuilder.Attributes.Add("checked", "checked");
- }
var modelValue = Convert.ToString(@for?.Model, CultureInfo.CurrentCulture);
- if (modelValue != null &&
- string.Equals(modelValue, value, StringComparison.OrdinalIgnoreCase))
+ if (@for?.Model is not null)
{
- inputRadioTagBuilder.Attributes.Add("checked", "checked");
+ inputRadioTagBuilder.Attributes["value"] = Convert.ToString(@for.Model, CultureInfo.InvariantCulture);
}
- else if (!string.IsNullOrWhiteSpace(value))
+ else if (value is not null)
+ {
+ inputRadioTagBuilder.Attributes["value"] = Convert.ToString(value, CultureInfo.InvariantCulture);
+ }
+
+ if (@checked)
{
- inputRadioTagBuilder.Attributes.Add("value", value);
+ inputRadioTagBuilder.Attributes["checked"] = "checked";
}
if (!string.IsNullOrWhiteSpace(id))