Skip to content

Commit

Permalink
Changed obsoled mudblazor "checked" to "value" and "onkeypress" to "o…
Browse files Browse the repository at this point in the history
…nkeyup"
  • Loading branch information
MarvinHo64 committed Dec 5, 2024
1 parent 56909ff commit c536827
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion IntegrationTest/Dialogues/LmsLoginDialogIt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public async Task EnterDetailsAndPressEnterInPasswordField_CallsPresentationLogi
mudTextFields[0].Find("input").Change("https://foobar.com");
mudTextFields[1].Find("input").Change("Username");
mudTextFields[2].Find("input").Change("Password");
mudTextFields[2].Find("input").KeyPress(Key.Enter);
mudTextFields[2].Find("input").KeyUp(Key.Enter);

_applicationConfiguration.Received()[IApplicationConfiguration.BackendBaseUrl] = "https://foobar.com";
_applicationConfiguration.Received()[IApplicationConfiguration.BackendUsername] = "Username";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</MudTd>
<MudTd DataLabel="@Localizer["AdaptivityContentDialog.Table.Header.RequiredTask"]">
<div class="flex justify-center">
<MudCheckBox T="bool?" Checked="@(context.MinimumRequiredDifficulty != null)" Disabled="true"/>
<MudCheckBox T="bool?" Value="@(context.MinimumRequiredDifficulty != null)" Disabled="true"/>
</div>
</MudTd>
@foreach (var difficulty in Enum.GetValues(typeof(QuestionDifficulty)).Cast<QuestionDifficulty>())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@using System.Diagnostics.CodeAnalysis
@using AutoMapper
@using BusinessLogic.Entities.LearningContent.Adaptivity.Question
@using Microsoft.Extensions.Localization
@using Presentation.Components.Adaptivity.Forms.Models
@using Presentation.Components.Forms
@using Presentation.PresentationLogic.API
@using Presentation.PresentationLogic.LearningContent.AdaptivityContent
@using Presentation.PresentationLogic.LearningContent.AdaptivityContent.Question
@using Shared.Adaptivity
@using BusinessLogic.Entities.LearningContent.Adaptivity.Question
@using AutoMapper
@using System.Diagnostics.CodeAnalysis
<div class="w-full flex flex-row items-center justify-between cursor-default">
<MudText Class="px-2" Typo="Typo.h6">
@(Task.Questions.FirstOrDefault(x => x.Difficulty == Difficulty) == null
Expand Down Expand Up @@ -46,8 +46,8 @@
<MudText Class="text-adlergrey-200">@Localizer["MultipleChoiceQuestionForm.Switch.MultipleChoice"]</MudText>
<MudSwitch T="bool"
Style="margin-right: 0px; margin-left: 2px"
Checked="FormDataContainer.FormModel.IsSingleResponse"
CheckedChanged="b => IsSingleResponseChanged((bool)b!)"
Value="FormDataContainer.FormModel.IsSingleResponse"
ValueChanged="b => IsSingleResponseChanged((bool)b!)"
Color="Color.Info"
UnCheckedColor="Color.Info"
For="@(() => FormModel.IsSingleResponse)">
Expand All @@ -61,8 +61,8 @@
<MudText Class="text-adlerblue">@Localizer["MultipleChoiceQuestionForm.Switch.MultipleChoice"]</MudText>
<MudSwitch T="bool"
Style="margin-right: 0px; margin-left: 2px"
Checked="FormDataContainer.FormModel.IsSingleResponse"
CheckedChanged="b => IsSingleResponseChanged((bool)b!)"
Value="FormDataContainer.FormModel.IsSingleResponse"
ValueChanged="b => IsSingleResponseChanged((bool)b!)"
Color="Color.Info"
UnCheckedColor="Color.Info"
For="@(() => FormModel.IsSingleResponse)">
Expand All @@ -79,13 +79,13 @@
@if (FormModel.IsSingleResponse)
{
<div class="bg-white">
<MudRadioGroup T="ChoiceViewModel" SelectedOption="FormModel.CorrectChoices.First()" SelectedOptionChanged="ChangeCorrectChoice" Class="overflow-y-auto">
<MudRadioGroup T="ChoiceViewModel" Value="FormModel.CorrectChoices.First()" ValueChanged="ChangeCorrectChoice" Class="overflow-y-auto">
<div class="overflow-y-scroll w-[460px] h-56 border-4 border-adlergrey-100 rounded-md">
@foreach (var choice in FormDataContainer.FormModel.Choices)
{
<div class="flex flex-row justify-center items-center">
<MudRadio Size="Size.Small"
Option="choice"
Value="choice"
Class="flex justify-center items-center m-0"/>
<MudForm Model="choice" Validation="ValidateChoiceModel">
<MudTextField T="string"
Expand Down Expand Up @@ -116,8 +116,8 @@
{
<div class="flex flex-row justify-center items-center">
<MudCheckBox T="bool"
Checked="FormDataContainer.FormModel.CorrectChoices.Contains(choice)"
CheckedChanged="b => ChangeCorrectness(choice, (bool)b!)"
Value="FormDataContainer.FormModel.CorrectChoices.Contains(choice)"
ValueChanged="b => ChangeCorrectness(choice, (bool)b!)"
Class="flex justify-center items-center m-0"
Size="Size.Small"/>

Expand Down
12 changes: 6 additions & 6 deletions Presentation/Components/ContentFiles/ContentFilesView.razor
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@using System.Diagnostics.CodeAnalysis
@using System.Runtime.Serialization
@using Microsoft.Extensions.Localization
@using MudBlazor.Extensions
@using Presentation.Components.Dialogues
@using Presentation.PresentationLogic.API
Expand All @@ -8,9 +11,6 @@
@using Presentation.PresentationLogic.LearningElement
@using Presentation.PresentationLogic.LearningWorld
@using Presentation.PresentationLogic.Mediator
@using Microsoft.Extensions.Localization
@using System.Diagnostics.CodeAnalysis
@using System.Runtime.Serialization
<style type="text/css">
.mud-table-toolbar {
padding: 0;
Expand Down Expand Up @@ -48,7 +48,7 @@
</ChildContent>

</MudMenu>
<MudCheckBox T="bool?" TriState="true" Value="@MultipleSelected" CheckedChanged="OnMultipleSelectedChanged" Class="m-2 p-0" Size="Size.Small" Dense="true"></MudCheckBox>
<MudCheckBox T="bool?" TriState="true" Value="@MultipleSelected" ValueChanged="OnMultipleSelectedChanged" Class="m-2 p-0" Size="Size.Small" Dense="true"></MudCheckBox>

<MudText Class="m-0 pl-1 pt-1 text-sm text-adlergrey-500">@_deletionCandidates.Count()</MudText>
<MudIconButton Icon="@Icons.Material.Filled.Delete"
Expand Down Expand Up @@ -79,7 +79,7 @@
<RowTemplate>
<MudTd Class="py-0 flex flex-row gap-2" DataLabel="Delete">

<MudCheckBox T="bool" Checked="_deletionCandidates.Contains(context)" CheckedChanged="b => OnCheckedChange(context, b)" Class="m-0 pl-3.5 py-1.5"></MudCheckBox>
<MudCheckBox T="bool" Value="_deletionCandidates.Contains(context)" ValueChanged="b => OnCheckedChange(context, b)" Class="m-0 pl-3.5 py-1.5"></MudCheckBox>

@if (GetUsage(context).Any())
{
Expand Down Expand Up @@ -151,7 +151,7 @@
<MudTablePager HideRowsPerPage="true" HorizontalAlignment="HorizontalAlignment.Left"/>
<div class="w-full max-h-40% min-h-fit shrink grow flex flex-row items-center mb-2 justify-between">
<div class="flex justify-center items-center">
<MudSwitch Class="pl-2 w-12" @bind-Checked="_showFilepath" Color="Color.Info"></MudSwitch>
<MudSwitch Class="pl-2 w-12" @bind-Value="_showFilepath" Color="Color.Info"></MudSwitch>
<p class="text-xs flex justify-start">@Localizer["PagerContent.Filepath.Text"]</p>
</div>
<button @onclick="@OpenContentFilesFolder" class="relative btn-standard p-2 justify-end items-center shadow-lg">
Expand Down
2 changes: 1 addition & 1 deletion Presentation/Components/Dialogues/LmsLoginDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
Required="true"
RequiredError="@Localizer["DialogContent.Field.Username.Required"]"/>
<MudTextField @bind-Value="_password" Label=@Localizer["DialogContent.Field.Password"]
OnKeyPress="OnKeyPress"
OnKeyUp="OnKeyPress"
InputType=@PasswordInputType Adornment="Adornment.End"
AdornmentIcon=@ShowPasswordIcon
OnAdornmentClick="() => _isPasswordVisible = !_isPasswordVisible"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<MudIconButton OnClick="() => _sortByDate = true" Icon="@Icons.Material.Filled.DateRange" Class="@(SortByDateButtonClass.Build())" Title="@Localizer["Page.LearningWorld.SortByDate"]"/>
<MudIconButton OnClick="() => _sortByDate = false" Icon="@Icons.Material.Filled.SortByAlpha" Class="@(SortByNameButtonClass.Build())" Title="@Localizer["Page.LearningWorld.SortByName"]"/>
<MudDivider Vertical="true" FlexItem="true"/>
<MudCheckBox @bind-Checked="_showFileName" title="@Localizer["Page.LearningWorld.ShowFile.Checkbox"]">
<MudCheckBox @bind-Value="_showFileName" title="@Localizer["Page.LearningWorld.ShowFile.Checkbox"]">
<p class="text-sm">@Localizer["Checkbox.ShowFileName.Label"]</p>
</MudCheckBox>
</div>
Expand Down

0 comments on commit c536827

Please sign in to comment.