Skip to content

Rename class "error-ui" to "blazor-error-ui" #14887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -108,7 +108,7 @@ app {
z-index: 1000;
}

#error-ui .dismiss {
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inherits LayoutComponentBase
@inherits LayoutComponentBase

<div class="sidebar">
<NavMenu />
Expand All @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Samples/BlazorServerApp/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ app {
color: red;
}

#error-ui {
#blazor-error-ui {
background: lightyellow;
position: fixed;
border: "1px solid";
Expand All @@ -122,7 +122,7 @@ app {
z-index: 1000;
}

#error-ui .dismiss {
#blazor-error-ui .dismiss {
position: absolute;
right: 5px;
top: 5px;
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Web.JS/dist/Release/blazor.server.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Components/Web.JS/dist/Release/blazor.webassembly.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Components/Web.JS/src/BootErrors.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
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();
e.preventDefault();
};
});

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';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ protected override void InitializeAsyncCore()
// 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();
Expand All @@ -53,15 +53,15 @@ public void ShowsErrorNotification_OnError_Dismiss()
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;']"));
}
}
}
2 changes: 1 addition & 1 deletion src/Components/test/testassets/BasicTestApp/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
outline: 1px solid red;
}

#error-ui {
#blazor-error-ui {
display: none;
}

#error-ui dismiss {
#blazor-error-ui dismiss {
cursor: pointer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -123,7 +123,7 @@ app {
z-index: 1000;
}

#error-ui .dismiss {
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
Expand Down