Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PackageSettings.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- What to test -->
<Include>[TELBlazor.Components]*</Include>
<ExcludeByAttribute>ExcludeFromCodeCoverage</ExcludeByAttribute>
<ExcludeByFile>**/Program.cs,**/Components/TestComponents/*.*</ExcludeByFile>
<ExcludeByFile>**/Program.cs,**/OptionalImplementations/TestComponents/**/*.*</ExcludeByFile>
<IncludeTestAssembly>true</IncludeTestAssembly>

<!--centralising TestResults output could reduce abitity to run tests in parralel-->
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -186,15 +189,15 @@ 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)
- **TELBlazorPackageSource** → https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json
- **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
Expand Down Expand Up @@ -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?

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<LoggingLevelSwitch>(sp => levelSwitch);
// qqqq do we need it builder.Services.AddScoped<LoggingLevelSwitch>(sp => levelSwitch);
builder.Services.AddScoped<ILogLevelSwitcherService, SerilogLogLevelSwitcherService>();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, )"
}
},
Expand All @@ -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": {
Expand Down
14 changes: 3 additions & 11 deletions TELBlazor.Components.ShowCase.E2ETests/Helpers/BrowserHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IBrowserContext> 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}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class TELButtonPageTests : BlazorPageTest<Program>
public TELButtonPageTests()
{
_tracingEnabled = (bool.TryParse(Environment.GetEnvironmentVariable("TracingEnabled"), out var result) && result);
var runFilenameqqqq = Environment.GetEnvironmentVariable("RunSettingFile");
}

// Axe needs js
Expand Down
4 changes: 2 additions & 2 deletions TELBlazor.Components.ShowCase.E2ETests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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, )"
}
},
Expand All @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<ul class="nhsuk-list app-side-nav__list">
<li class="app-side-nav__item"><NavLink class="app-side-nav__link" href="LogLevelSwitcher">LogLevelSwitcher</NavLink></li>
<li class="app-side-nav__item"><NavLink class="app-side-nav__link" href="CssSourceChecker">CssSourceChecker</NavLink></li>
<li class="app-side-nav__item"><NavLink class="app-side-nav__link" href="SearchExperiment">SearchExperiment</NavLink></li>
</ul>
</nav>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="component-showcase">
@if(IsTestComponent){
<h1 class="test-component-warning-header">This is a Test Component</h1>
<p>Test components are components not for production but to aid testing. Or to demo a feature not planned for prodution.</p>
<p>Test components are components not for production but to aid testing. Or to demo a feature not planned for production.</p>
<p>Test components do not have test coverage and are not for production.</p>
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@page "/SearchExperiment/"
<PageTitle>@Title</PageTitle>
<ShowCase Title="@Title"
Instructions="@Instructions"
Description="@Description"
IsTestComponent="@IsTestComponent">
<SearchExperiment />
</ShowCase>

@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";
}
3 changes: 2 additions & 1 deletion TELBlazor.Components.ShowCase.Shared/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion TELBlazor.Components.UnitTests/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 15 additions & 2 deletions TELBlazor.Components/OptionalImplementations/Core/DI/DI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--qqqq see microsoft default and ecommerce-->
<!--@bind-value="SearchText"
@bind-value:event="oninput"-->
<!--will want debounce-->
<!--will want cancel if still going-->

<header class="nhsuk-header" role="banner">
<div id="content-header">
<div class="nhsuk-width-container nhsuk-header__container app-width-container ">
<div class="nhsuk-header__search">
<div class="nhsuk-header__search-wrap" id="wrap-search">
<form class="nhsuk-header__search-form" id="search" method="get" role="search" action="/search/results">
<label class="nhsuk-u-visually-hidden" for="search-field">Search the learning hub</label>
<input class="nhsuk-search__input" id="search-field" name="term" type="search" placeholder="Search the learning hub" autocomplete="off" >
<ul id="search-field_listbox" class="nhsuk-list autosuggestion-menu" style="display:none"></ul>
<button class="nhsuk-search__submit" type="submit">
<svg class="nhsuk-icon nhsuk-icon__search" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false" width="27" height="27">
<path d="M19.71 18.29l-4.11-4.1a7 7 0 1 0-1.41 1.41l4.1 4.11a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 10a5 5 0 1 1 5 5 5 5 0 0 1-5-5z"></path>
</svg>
<span class="nhsuk-u-visually-hidden">Search</span>
</button>

<label for="header-mobile-search-control" class="nhsuk-search__close" id="close-search">
<svg class="nhsuk-icon nhsuk-icon__close" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false" width="27" height="27">
<path d="M13.41 12l5.3-5.29a1 1 0 1 0-1.42-1.42L12 10.59l-5.29-5.3a1 1 0 0 0-1.42 1.42l5.3 5.29-5.3 5.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l5.29-5.3 5.29 5.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"></path>
</svg>
<span class="nhsuk-u-visually-hidden">Close search</span>
</label>
</form>
</div>
</div>
</div>
</div>
</header>
2 changes: 1 addition & 1 deletion TELBlazor.Components/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion TELBlazor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading