Rename class "error-ui" to "blazor-error-ui"
This commit is contained in:
parent
1141654673
commit
0cf058711f
|
|
@ -96,7 +96,7 @@ app {
|
|||
color: red;
|
||||
}
|
||||
|
||||
#error-ui {
|
||||
#blazor-error-ui {
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
|
|
@ -108,7 +108,7 @@ app {
|
|||
z-index: 1000;
|
||||
}
|
||||
|
||||
#error-ui .dismiss {
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<body>
|
||||
<app>Loading...</app>
|
||||
|
||||
<div id="error-ui">
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a href class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@inherits LayoutComponentBase
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<div class="sidebar">
|
||||
<NavMenu />
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<div id="error-ui">
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a class="reload">Reload</a>
|
||||
<a class="dismiss">X</a>
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ app {
|
|||
color: red;
|
||||
}
|
||||
|
||||
#error-ui {
|
||||
#blazor-error-ui {
|
||||
background: lightyellow;
|
||||
position: fixed;
|
||||
border: "1px solid";
|
||||
|
|
@ -122,7 +122,7 @@ app {
|
|||
z-index: 1000;
|
||||
}
|
||||
|
||||
#error-ui .dismiss {
|
||||
#blazor-error-ui .dismiss {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,14 +1,14 @@
|
|||
let hasFailed = false;
|
||||
|
||||
export async function showErrorNotification() {
|
||||
let errorUi = document.querySelector('#error-ui') as HTMLElement;
|
||||
let errorUi = document.querySelector('#blazor-error-ui') as HTMLElement;
|
||||
if (errorUi) {
|
||||
errorUi.style.display = 'block';
|
||||
}
|
||||
|
||||
if (!hasFailed) {
|
||||
hasFailed = true;
|
||||
const errorUiReloads = document.querySelectorAll<HTMLElement>('#error-ui .reload');
|
||||
const errorUiReloads = document.querySelectorAll<HTMLElement>('#blazor-error-ui .reload');
|
||||
errorUiReloads.forEach(reload => {
|
||||
reload.onclick = function (e) {
|
||||
location.reload();
|
||||
|
|
@ -16,10 +16,10 @@ export async function showErrorNotification() {
|
|||
};
|
||||
});
|
||||
|
||||
let errorUiDismiss = document.querySelectorAll<HTMLElement>('#error-ui .dismiss');
|
||||
let errorUiDismiss = document.querySelectorAll<HTMLElement>('#blazor-error-ui .dismiss');
|
||||
errorUiDismiss.forEach(dismiss => {
|
||||
dismiss.onclick = function (e) {
|
||||
const errorUi = document.querySelector<HTMLElement>('#error-ui');
|
||||
const errorUi = document.querySelector<HTMLElement>('#blazor-error-ui');
|
||||
if (errorUi) {
|
||||
errorUi.style.display = 'none';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,20 +28,20 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
|||
// On WebAssembly, page reloads are expensive so skip if possible
|
||||
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
|
||||
Browser.MountTestComponent<ErrorComponent>();
|
||||
Browser.Exists(By.Id("error-ui"));
|
||||
Browser.Exists(By.Id("blazor-error-ui"));
|
||||
Browser.Exists(By.TagName("button"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShowsErrorNotification_OnError_Dismiss()
|
||||
{
|
||||
var errorUi = Browser.FindElement(By.Id("error-ui"));
|
||||
var errorUi = Browser.FindElement(By.Id("blazor-error-ui"));
|
||||
Assert.Equal("none", errorUi.GetCssValue("display"));
|
||||
|
||||
var causeErrorButton = Browser.FindElement(By.TagName("button"));
|
||||
causeErrorButton.Click();
|
||||
|
||||
Browser.Exists(By.CssSelector("#error-ui[style='display: block;']"), TimeSpan.FromSeconds(10));
|
||||
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: block;']"), TimeSpan.FromSeconds(10));
|
||||
|
||||
var reload = Browser.FindElement(By.ClassName("reload"));
|
||||
reload.Click();
|
||||
|
|
@ -53,15 +53,15 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
|||
public void ShowsErrorNotification_OnError_Reload()
|
||||
{
|
||||
var causeErrorButton = Browser.Exists(By.TagName("button"));
|
||||
var errorUi = Browser.FindElement(By.Id("error-ui"));
|
||||
var errorUi = Browser.FindElement(By.Id("blazor-error-ui"));
|
||||
Assert.Equal("none", errorUi.GetCssValue("display"));
|
||||
|
||||
causeErrorButton.Click();
|
||||
Browser.Exists(By.CssSelector("#error-ui[style='display: block;']"));
|
||||
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: block;']"));
|
||||
|
||||
var dismiss = Browser.FindElement(By.ClassName("dismiss"));
|
||||
dismiss.Click();
|
||||
Browser.Exists(By.CssSelector("#error-ui[style='display: none;']"));
|
||||
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: none;']"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
@((RenderFragment)RenderSelectedComponent)
|
||||
</app>
|
||||
|
||||
<div id="error-ui">
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a href class='reload'>Reload</a>
|
||||
<a class='dismiss' style="cursor: pointer;">🗙</a>
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
outline: 1px solid red;
|
||||
}
|
||||
|
||||
#error-ui {
|
||||
#blazor-error-ui {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#error-ui dismiss {
|
||||
#blazor-error-ui dismiss {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
|
||||
</app>
|
||||
|
||||
<div id="error-ui">
|
||||
<div id="blazor-error-ui">
|
||||
<environment include="Staging,Production">
|
||||
An error has occurred. This application may no longer respond until reloaded.
|
||||
</environment>
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ app {
|
|||
color: red;
|
||||
}
|
||||
|
||||
#error-ui {
|
||||
#blazor-error-ui {
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
|
|
@ -123,7 +123,7 @@ app {
|
|||
z-index: 1000;
|
||||
}
|
||||
|
||||
#error-ui .dismiss {
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
|
|
|
|||
Loading…
Reference in New Issue