diff --git a/PackageSettings.props b/PackageSettings.props index eef9144..2f02b9d 100644 --- a/PackageSettings.props +++ b/PackageSettings.props @@ -18,7 +18,7 @@ [TELBlazor.Components]* ExcludeFromCodeCoverage - **/Program.cs,**/Components/TestComponents/*.* + **/Program.cs,**/OptionalImplementations/TestComponents/**/*.* true diff --git a/README.md b/README.md index f40bfd3..af625ee 100644 --- a/README.md +++ b/README.md @@ -162,10 +162,13 @@ It is client side so the users browser will do the work. ``` #### About configuration (just to read) -Visual studio caches the environmental variables so to avoid restarting it you may want to have multiple -environment variables, even if at times they are set to the same values. Then you can switch in configuration -which environment value is used rather than the underlying value, but be careful not to leave nuget.config -changed. Remember to delete your lock files when changing which package your using* ```%envvalue%``` syntax in nuget.config can be populated by environment values by visual studio but not via command line and cicd has to replace the values with ```sed``` +Visual studio caches the environmental variables so to avoid restarting it you may want to have multiple +environment variables, even if at times they are set to the same values. Then you can switch in configuration +which environment value is used rather than the underlying value, but be careful not to leave nuget.config +changed. Remember to delete your lock files when changing which package your using* ```%envvalue%``` syntax in +nuget.config can be populated by environment values by visual studio but not via command line and cicd has to +replace the values with ```sed``` + - The intention of the configuration is you should be able to switch between local packages, remote package, and project references. It will also enable parrallel development with consuming projects, so package changes can be seen in situ during development. - Troubleshooting - delete local `TELBlazor.Components` packages @@ -176,7 +179,7 @@ changed. Remember to delete your lock files when changing which package your usi - restore nuget packages - restore solution - if still not working close visual studio and reopen - - if there are still issues its easier to problem solve by using a random `TELBlazor.Components` and ensuring it fails and says it found the source but not the version + - if there are still issues its easier to problem solve by using a random very high `TELBlazor.Components` package version number and ensuring it fails and says it found the source but not the version - Variables Recommended to add to environment variables (Do this in the next section) - **TELBlazorPackageSource** → https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json - **TELPackageSource** → https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json @@ -186,7 +189,7 @@ changed. Remember to delete your lock files when changing which package your usi - Any of the nuget.config and PackageSetting.props values but visual studio caches environment values so nothing you expect to change regularly -#### Create local files +#### Create local files (do this) - Right click PackgeSettings.props.local and open with xml editor or any preferred way of opening it - copy paste PackgeSettings.props.local.template into it - Set environmental variables (go into windows, edit environmental system variables, then look for environmental variables button, then add to system wide) @@ -194,7 +197,7 @@ changed. Remember to delete your lock files when changing which package your usi - **TELPackageSource** → https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json - **LocalPackageSource** → e.g. C:\dev\LocalPackages - **NupkgOutputPath** → e.g. C:\dev\LocalPackages -- System environment variables or PackageSetting.props.local variables but recommend the latter +- Change system environment variables or PackageSetting.props.local variables can be changed but I recommend the latter - **UseTELBlazorComponentsProjectReference** set it true for faster development - **TELBlazorPackageVersion** set it to a number higher than the production value and increase it every-time you want to produce and use the package locally if not using the project reference - if this were set to auto increment to a file accessible by other projects that would be ideal @@ -334,7 +337,7 @@ TELPackage part of the config but with the system environment variable values yo - once the wasm takes over to debug in the browser you need to do some setup - TODO QQQQ I cant remember what i havent set up on new machine yet, i presume it doesnt work for you kevin? - run TELBlazor.Components.ShowCase.E2ETests.WasmServerHost - - This is pure wasm so notice the loader initially this is because there is no prerender + - This is pure wasm so notice that there is a loader initially this is because there is no prerender - go into tools in the top vs bar you should see toggle test coverage highlighting. Go to loglevelswitcher.razor it should be highlighted red - qqqq todo isnt for mine is it for yours kevin? @@ -346,7 +349,7 @@ TELPackage part of the config but with the system environment variable values yo - **TELBlazorPackageSource** → a local folder outside of the solution - **NupkgOutputPath** → the same local folder outside of the solution - **UseTELBlazorComponentsProjectReference** → false - - **TELBlazorPackageVersion** → pick something greater than [Find package number not dev package number, dev packages have -branchname](https://github.com/TechnologyEnhancedLearning/TELBlazor/pkgs/nuget/TELBlazor.Components) + - **TELBlazorPackageVersion** → pick something greater than the production package number. The one without the dash [TELBlazor.Components Prod and Dev Package location](https://github.com/TechnologyEnhancedLearning/TELBlazor/pkgs/nuget/TELBlazor.Components) - make sure its changed so its more than the TELBlazor Package Version you previously noted - **DisablePackageGeneration** → false - set .runsettings diff --git a/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/Program.cs b/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/Program.cs index f625e3c..3e478c6 100644 --- a/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/Program.cs +++ b/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/Program.cs @@ -71,7 +71,7 @@ builder.Services.AddBlazoredLocalStorage(); //Scoped because being consumed with storage where singleton doesnt survive mvc page teardown - //qqqq do we need it builder.Services.AddScoped(sp => levelSwitch); + // qqqq do we need it builder.Services.AddScoped(sp => levelSwitch); builder.Services.AddScoped(); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); diff --git a/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/packages.lock.json b/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/packages.lock.json index a27101b..ca686c8 100644 --- a/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/packages.lock.json +++ b/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/packages.lock.json @@ -320,7 +320,7 @@ "Blazored.LocalStorage": "[4.5.0, )", "Microsoft.AspNetCore.Components.Web": "[8.0.14, )", "Serilog": "[4.2.0, )", - "TELBlazor.Components": "[1.4.0, )" + "TELBlazor.Components": "[1.8.0, )" } }, "Microsoft.AspNetCore.Components.Web": { diff --git a/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/packages.lock.json b/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/packages.lock.json index 2750846..fd9d8fa 100644 --- a/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/packages.lock.json +++ b/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/packages.lock.json @@ -348,7 +348,7 @@ "Serilog.Settings.Configuration": "[8.0.0, )", "Serilog.Sinks.BrowserConsole": "[8.0.0, )", "Serilog.Sinks.Http": "[8.0.0, )", - "TELBlazor.Components": "[1.4.0, )", + "TELBlazor.Components": "[1.8.0, )", "TELBlazor.Components.ShowCase.Shared": "[1.0.0, )" } }, @@ -358,7 +358,7 @@ "Blazored.LocalStorage": "[4.5.0, )", "Microsoft.AspNetCore.Components.Web": "[8.0.14, )", "Serilog": "[4.2.0, )", - "TELBlazor.Components": "[1.4.0, )" + "TELBlazor.Components": "[1.8.0, )" } }, "Microsoft.AspNetCore.Components.Web": { diff --git a/TELBlazor.Components.ShowCase.E2ETests/Helpers/BrowserHelper.cs b/TELBlazor.Components.ShowCase.E2ETests/Helpers/BrowserHelper.cs index 05a1fa7..087e843 100644 --- a/TELBlazor.Components.ShowCase.E2ETests/Helpers/BrowserHelper.cs +++ b/TELBlazor.Components.ShowCase.E2ETests/Helpers/BrowserHelper.cs @@ -10,29 +10,21 @@ namespace TELBlazor.Components.ShowCase.E2ETests.Helpers { public static class BrowserHelper { - // qqqq Setting value using PackageSetting.props potentially replace appsettings.Test.json in future especially if using apis during testing - //static bool headless => - //#if HEADLESS_TESTING - // true; - //#else - // false; - //#endif public static async Task CreateBrowserContextAsync(IPlaywright playwright, string browserType, bool jsEnabled, ViewportType viewport, string baseUrl) { - //bool headless = Headless IBrowser browser; switch (browserType.ToLower()) { case "chromium": - browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions { /*Headless = headless*/ }); + browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions { }); break; case "firefox": - browser = await playwright.Firefox.LaunchAsync(new BrowserTypeLaunchOptions { /*Headless = headless*/ }); + browser = await playwright.Firefox.LaunchAsync(new BrowserTypeLaunchOptions { }); break; case "webkit": - browser = await playwright.Webkit.LaunchAsync(new BrowserTypeLaunchOptions { /*Headless = headless*/ }); + browser = await playwright.Webkit.LaunchAsync(new BrowserTypeLaunchOptions { }); break; default: throw new ArgumentException($"Unsupported browser type: {browserType}"); diff --git a/TELBlazor.Components.ShowCase.E2ETests/Pages/BaseComponentPages/TELButtonPageTests.cs b/TELBlazor.Components.ShowCase.E2ETests/Pages/BaseComponentPages/TELButtonPageTests.cs index a3c304a..aac63c8 100644 --- a/TELBlazor.Components.ShowCase.E2ETests/Pages/BaseComponentPages/TELButtonPageTests.cs +++ b/TELBlazor.Components.ShowCase.E2ETests/Pages/BaseComponentPages/TELButtonPageTests.cs @@ -19,7 +19,6 @@ public class TELButtonPageTests : BlazorPageTest public TELButtonPageTests() { _tracingEnabled = (bool.TryParse(Environment.GetEnvironmentVariable("TracingEnabled"), out var result) && result); - var runFilenameqqqq = Environment.GetEnvironmentVariable("RunSettingFile"); } // Axe needs js diff --git a/TELBlazor.Components.ShowCase.E2ETests/packages.lock.json b/TELBlazor.Components.ShowCase.E2ETests/packages.lock.json index 4a3b33c..6d47616 100644 --- a/TELBlazor.Components.ShowCase.E2ETests/packages.lock.json +++ b/TELBlazor.Components.ShowCase.E2ETests/packages.lock.json @@ -1601,7 +1601,7 @@ "Serilog.Settings.Configuration": "[8.0.0, )", "Serilog.Sinks.BrowserConsole": "[8.0.0, )", "Serilog.Sinks.Http": "[8.0.0, )", - "TELBlazor.Components": "[1.4.0, )", + "TELBlazor.Components": "[1.8.0, )", "TELBlazor.Components.ShowCase.Shared": "[1.0.0, )" } }, @@ -1611,7 +1611,7 @@ "Blazored.LocalStorage": "[4.5.0, )", "Microsoft.AspNetCore.Components.Web": "[8.0.14, )", "Serilog": "[4.2.0, )", - "TELBlazor.Components": "[1.4.0, )" + "TELBlazor.Components": "[1.8.0, )" } }, "Blazored.LocalStorage": { diff --git a/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ComponentNavMenu.razor b/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ComponentNavMenu.razor index d8ac9a5..087d6da 100644 --- a/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ComponentNavMenu.razor +++ b/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ComponentNavMenu.razor @@ -11,5 +11,6 @@
  • LogLevelSwitcher
  • CssSourceChecker
  • +
  • SearchExperiment
\ No newline at end of file diff --git a/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ShowCase.razor b/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ShowCase.razor index 108e470..e22acfb 100644 --- a/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ShowCase.razor +++ b/TELBlazor.Components.ShowCase.Shared/Layouts/ComponentLayouts/ShowCase.razor @@ -2,7 +2,7 @@
@if(IsTestComponent){

This is a Test Component

-

Test components are components not for production but to aid testing. Or to demo a feature not planned for prodution.

+

Test components are components not for production but to aid testing. Or to demo a feature not planned for production.

Test components do not have test coverage and are not for production.

} diff --git a/TELBlazor.Components.ShowCase.Shared/Pages/ComponentPages/TestComponentPages/CssSourceCheckerPage.razor b/TELBlazor.Components.ShowCase.Shared/Pages/OptionalImplementations/TestComponentPages/CssSourceCheckerPage.razor similarity index 100% rename from TELBlazor.Components.ShowCase.Shared/Pages/ComponentPages/TestComponentPages/CssSourceCheckerPage.razor rename to TELBlazor.Components.ShowCase.Shared/Pages/OptionalImplementations/TestComponentPages/CssSourceCheckerPage.razor diff --git a/TELBlazor.Components.ShowCase.Shared/Pages/ComponentPages/TestComponentPages/LogLevelSwitcherPage.razor b/TELBlazor.Components.ShowCase.Shared/Pages/OptionalImplementations/TestComponentPages/LogLevelSwitcherPage.razor similarity index 100% rename from TELBlazor.Components.ShowCase.Shared/Pages/ComponentPages/TestComponentPages/LogLevelSwitcherPage.razor rename to TELBlazor.Components.ShowCase.Shared/Pages/OptionalImplementations/TestComponentPages/LogLevelSwitcherPage.razor diff --git a/TELBlazor.Components.ShowCase.Shared/Pages/OptionalImplementations/TestComponentPages/SearchExperimentPage.razor b/TELBlazor.Components.ShowCase.Shared/Pages/OptionalImplementations/TestComponentPages/SearchExperimentPage.razor new file mode 100644 index 0000000..4e3352d --- /dev/null +++ b/TELBlazor.Components.ShowCase.Shared/Pages/OptionalImplementations/TestComponentPages/SearchExperimentPage.razor @@ -0,0 +1,15 @@ +@page "/SearchExperiment/" +@Title + + + + +@code { + private bool IsTestComponent => true; + private string Title => "SearchExperiment"; + private string Instructions => "Try searching"; + private string Description => "This is not a prototype for the new search component its a test component just for a component needing a service only"; +} diff --git a/TELBlazor.Components.ShowCase.Shared/_Imports.razor b/TELBlazor.Components.ShowCase.Shared/_Imports.razor index c7abf18..a54e1eb 100644 --- a/TELBlazor.Components.ShowCase.Shared/_Imports.razor +++ b/TELBlazor.Components.ShowCase.Shared/_Imports.razor @@ -11,7 +11,8 @@ @using TELBlazor.Components.Core.Extensions @using Microsoft.AspNetCore.Components.Forms @using TELBlazor.Components.Components.BaseComponents -@using TELBlazor.Components.Components.TestComponents +@using TELBlazor.Components.OptionalImplementations.TestComponents @using Microsoft.Extensions.Logging; @using Microsoft.AspNetCore.Components.Routing @using TELBlazor.Components.ShowCase.Shared.Layouts.ComponentLayouts +@using TELBlazor.Components.OptionalImplementations.TestComponents.SearchExperiment diff --git a/TELBlazor.Components.ShowCase.WasmStaticClient/packages.lock.json b/TELBlazor.Components.ShowCase.WasmStaticClient/packages.lock.json index 25e837f..a5fc1e5 100644 --- a/TELBlazor.Components.ShowCase.WasmStaticClient/packages.lock.json +++ b/TELBlazor.Components.ShowCase.WasmStaticClient/packages.lock.json @@ -463,7 +463,7 @@ "Blazored.LocalStorage": "[4.5.0, )", "Microsoft.AspNetCore.Components.Web": "[8.0.14, )", "Serilog": "[4.2.0, )", - "TELBlazor.Components": "[1.4.0, )" + "TELBlazor.Components": "[1.8.0, )" } }, "Microsoft.AspNetCore.Components.Web": { diff --git a/TELBlazor.Components.UnitTests/_Imports.razor b/TELBlazor.Components.UnitTests/_Imports.razor index 72f821d..d70747a 100644 --- a/TELBlazor.Components.UnitTests/_Imports.razor +++ b/TELBlazor.Components.UnitTests/_Imports.razor @@ -28,7 +28,7 @@ // Unit tests @using TELBlazor.Components.UnitTests.DI -@using TELBlazor.Components.Components.TestComponents +@using TELBlazor.Components.OptionalImplementations.TestComponents @using TELBlazor.Components.Core.Enums @using TELBlazor.Components.Core.Extensions diff --git a/TELBlazor.Components/OptionalImplementations/Core/DI/DI.cs b/TELBlazor.Components/OptionalImplementations/Core/DI/DI.cs index d20af1d..ecf309d 100644 --- a/TELBlazor.Components/OptionalImplementations/Core/DI/DI.cs +++ b/TELBlazor.Components/OptionalImplementations/Core/DI/DI.cs @@ -14,8 +14,21 @@ namespace TELBlazor.Components.OptionalImplementations.Core.DI { public static class DI { - public static IServiceCollection AddTELBlazorComponentServices(this IServiceCollection services, - bool IsClient, + private static IServiceCollection AddTELBlazorComponentServicessShared(this IServiceCollection services, + ITELBlazorBaseComponentConfiguration TELBlazorBaseComponentConfiguration + ) + { + throw new NotImplementedException("This method is not implemented yet. See DI task"); + } + public static IServiceCollection AddTELBlazorComponentServicesClient(this IServiceCollection services, + + ITELBlazorBaseComponentConfiguration TELBlazorBaseComponentConfiguration + ) + { + throw new NotImplementedException("This method is not implemented yet. See DI task"); + } + public static IServiceCollection AddTELBlazorComponentServicesServer(this IServiceCollection services, + ITELBlazorBaseComponentConfiguration TELBlazorBaseComponentConfiguration ) { diff --git a/TELBlazor.Components/Components/TestComponents/CssSourceChecker.razor b/TELBlazor.Components/OptionalImplementations/TestComponents/CssSourceChecker.razor similarity index 100% rename from TELBlazor.Components/Components/TestComponents/CssSourceChecker.razor rename to TELBlazor.Components/OptionalImplementations/TestComponents/CssSourceChecker.razor diff --git a/TELBlazor.Components/Components/TestComponents/CssSourceChecker.razor.css b/TELBlazor.Components/OptionalImplementations/TestComponents/CssSourceChecker.razor.css similarity index 100% rename from TELBlazor.Components/Components/TestComponents/CssSourceChecker.razor.css rename to TELBlazor.Components/OptionalImplementations/TestComponents/CssSourceChecker.razor.css diff --git a/TELBlazor.Components/Components/TestComponents/LogLevelSwitcher.razor b/TELBlazor.Components/OptionalImplementations/TestComponents/LogLevelSwitcher.razor similarity index 100% rename from TELBlazor.Components/Components/TestComponents/LogLevelSwitcher.razor rename to TELBlazor.Components/OptionalImplementations/TestComponents/LogLevelSwitcher.razor diff --git a/TELBlazor.Components/OptionalImplementations/TestComponents/SearchExperiment/SearchExperiment.razor b/TELBlazor.Components/OptionalImplementations/TestComponents/SearchExperiment/SearchExperiment.razor new file mode 100644 index 0000000..605f4da --- /dev/null +++ b/TELBlazor.Components/OptionalImplementations/TestComponents/SearchExperiment/SearchExperiment.razor @@ -0,0 +1,34 @@ + + + + + + \ No newline at end of file diff --git a/TELBlazor.Components/_Imports.razor b/TELBlazor.Components/_Imports.razor index 3a561b7..74150bd 100644 --- a/TELBlazor.Components/_Imports.razor +++ b/TELBlazor.Components/_Imports.razor @@ -7,7 +7,7 @@ @using TELBlazor.Components.Core.Extensions @using Microsoft.AspNetCore.Components.Forms @using TELBlazor.Components.Components.BaseComponents -@using TELBlazor.Components.Components.TestComponents +@using TELBlazor.Components.OptionalImplementations.TestComponents @using Microsoft.Extensions.Logging @using TELBlazor.Components.Core.Services.HelperServices @using System.Diagnostics.CodeAnalysis \ No newline at end of file diff --git a/TELBlazor.sln b/TELBlazor.sln index 3be330d..b6cadbc 100644 --- a/TELBlazor.sln +++ b/TELBlazor.sln @@ -8,8 +8,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .commitlintrc.json = .commitlintrc.json .releaserc.json = .releaserc.json .runsettings = .runsettings - CICD.runsettings = CICD.runsettings .runsettingsTemplate = .runsettingsTemplate + CICD.runsettings = CICD.runsettings Directory.Build.props = Directory.Build.props Directory.Packages.props = Directory.Packages.props global.json = global.json