From 055c868ce9cee2d6084430f81e3c6bfc2c8414dc Mon Sep 17 00:00:00 2001 From: Julien Riboulet Date: Sat, 19 Nov 2022 11:17:53 +0100 Subject: [PATCH] :memo: Update docs --- .../docusaurus/docs/add-item/redirection.md | 51 ++----------------- .../docusaurus/docs/configuration.md | 2 - .../current/add-item/redirection.md | 51 ++----------------- .../current/configuration.md | 2 - 4 files changed, 6 insertions(+), 100 deletions(-) diff --git a/Documentation/docusaurus/docs/add-item/redirection.md b/Documentation/docusaurus/docs/add-item/redirection.md index 1df31ee..7f8b866 100644 --- a/Documentation/docusaurus/docs/add-item/redirection.md +++ b/Documentation/docusaurus/docs/add-item/redirection.md @@ -12,45 +12,18 @@ Open the `Pages/Add.razor.cs` file and add the highlighted lines: ```csharp title="Pages/Add.razor.cs" public partial class Add { - [Inject] - public ILocalStorageService LocalStorage { get; set; } + ... // highlight-start [Inject] public NavigationManager NavigationManager { get; set; } // highlight-end - /// - /// The default roles. - /// - private List roles = new List() { "admin", "writter", "reader", "member" }; - - /// - /// The current data model - /// - private DataModel dataModel = new() - { - DateOfBirth = DateTime.Now, - Roles = new List() - }; + ... private async void HandleValidSubmit() { - // Get the current data - var currentData = await LocalStorage.GetItemAsync>("data"); - - // Simulate the Id - dataModel.Id = currentData.Max(s => s.Id) + 1; - - // Add the item to the current data - currentData.Add(new Data - { - LastName = dataModel.LastName, - DateOfBirth = dataModel.DateOfBirth, - FirstName = dataModel.FirstName, - Id = dataModel.Id, - Roles = dataModel.Roles - }); + ... // Save the data await LocalStorage.SetItemAsync("data", currentData); @@ -58,24 +31,6 @@ public partial class Add // highlight-next-line NavigationManager.NavigateTo("list"); } - - private void OnRoleChange(string item, object checkedValue) - { - if ((bool)checkedValue) - { - if (!dataModel.Roles.Contains(item)) - { - dataModel.Roles.Add(item); - } - - return; - } - - if (dataModel.Roles.Contains(item)) - { - dataModel.Roles.Remove(item); - } - } } ``` diff --git a/Documentation/docusaurus/docs/configuration.md b/Documentation/docusaurus/docs/configuration.md index 724bbd2..c6aafbe 100644 --- a/Documentation/docusaurus/docs/configuration.md +++ b/Documentation/docusaurus/docs/configuration.md @@ -154,8 +154,6 @@ The following code: ``` ```csharp title="Config.razor.cs" -private PositionOptions positionOptions; - public partial class Config { [Inject] diff --git a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/add-item/redirection.md b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/add-item/redirection.md index 0097e08..8e884b2 100644 --- a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/add-item/redirection.md +++ b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/add-item/redirection.md @@ -12,45 +12,18 @@ Ouvrez le fichier `Pages/Add.razor.cs` et ajouter les lignes en surbrillances : ```csharp title="Pages/Add.razor.cs" public partial class Add { - [Inject] - public ILocalStorageService LocalStorage { get; set; } + ... // highlight-start [Inject] public NavigationManager NavigationManager { get; set; } // highlight-end - /// - /// The default roles. - /// - private List roles = new List() { "admin", "writter", "reader", "member" }; - - /// - /// The current data model - /// - private DataModel dataModel = new() - { - DateOfBirth = DateTime.Now, - Roles = new List() - }; + ... private async void HandleValidSubmit() { - // Get the current data - var currentData = await LocalStorage.GetItemAsync>("data"); - - // Simulate the Id - dataModel.Id = currentData.Max(s => s.Id) + 1; - - // Add the item to the current data - currentData.Add(new Data - { - LastName = dataModel.LastName, - DateOfBirth = dataModel.DateOfBirth, - FirstName = dataModel.FirstName, - Id = dataModel.Id, - Roles = dataModel.Roles - }); + ... // Save the data await LocalStorage.SetItemAsync("data", currentData); @@ -58,24 +31,6 @@ public partial class Add // highlight-next-line NavigationManager.NavigateTo("list"); } - - private void OnRoleChange(string item, object checkedValue) - { - if ((bool)checkedValue) - { - if (!dataModel.Roles.Contains(item)) - { - dataModel.Roles.Add(item); - } - - return; - } - - if (dataModel.Roles.Contains(item)) - { - dataModel.Roles.Remove(item); - } - } } ``` diff --git a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/configuration.md b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/configuration.md index 528ab9c..a5cb0f7 100644 --- a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/configuration.md +++ b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/configuration.md @@ -158,8 +158,6 @@ Le code suivant : ``` ```csharp title="Config.razor.cs" -private PositionOptions positionOptions; - public partial class Config { [Inject]