зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1565212) for linting failure on application.ftl:116:2. CLOSED TREE
Backed out changeset dc67f09ede45 (bug 1565212) Backed out changeset f21e8b5c98f0 (bug 1565212)
This commit is contained in:
Родитель
541d75e8ff
Коммит
020e9de6e6
|
@ -17,8 +17,6 @@
|
|||
@import "resource://devtools/client/application/src/components/manifest/ManifestLoader.css";
|
||||
@import "resource://devtools/client/application/src/components/manifest/ManifestSection.css";
|
||||
@import "resource://devtools/client/application/src/components/routing/PageSwitcher.css";
|
||||
@import "resource://devtools/client/application/src/components/routing/Sidebar.css";
|
||||
@import "resource://devtools/client/application/src/components/routing/SidebarItem.css";
|
||||
@import "resource://devtools/client/application/src/components/service-workers/Worker.css";
|
||||
@import "resource://devtools/client/application/src/components/service-workers/WorkerList.css";
|
||||
@import "resource://devtools/client/application/src/components/service-workers/WorkerListEmpty.css";
|
||||
|
|
|
@ -23,9 +23,7 @@
|
|||
--list-line-height: 1.25;
|
||||
|
||||
/* Global colours */
|
||||
--separator-color: var(--theme-splitter-color);
|
||||
--bg-color: var(--theme-toolbar-background);
|
||||
--highlight-color: var(--theme-toolbar-background-hover);
|
||||
--separator-color: var(--theme-text-color-alt);
|
||||
|
||||
/* extra, raw colors */
|
||||
--blue-50-a30: rgba(10, 132, 255, 0.3);
|
||||
|
|
|
@ -12,8 +12,3 @@ a.disabled-link:visited {
|
|||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.app {
|
||||
display: grid;
|
||||
grid-template-columns: calc(var(--base-unit) * 50) auto;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ const FluentReact = require("devtools/client/shared/vendor/fluent-react");
|
|||
const LocalizationProvider = createFactory(FluentReact.LocalizationProvider);
|
||||
|
||||
const PageSwitcher = createFactory(require("./routing/PageSwitcher"));
|
||||
const Sidebar = createFactory(require("./routing/Sidebar"));
|
||||
|
||||
/**
|
||||
* This is the main component for the application panel.
|
||||
|
@ -32,7 +31,7 @@ class App extends PureComponent {
|
|||
|
||||
return LocalizationProvider(
|
||||
{ bundles: fluentBundles },
|
||||
main({ className: `app` }, Sidebar({}), PageSwitcher({}))
|
||||
main({ className: `application` }, PageSwitcher({}))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
.app-page {
|
||||
min-height: 100vh;
|
||||
padding: 0 2rem;
|
||||
padding: calc(var(--base-unit) * 2) calc(var(--base-unit) * 6);
|
||||
display: grid;
|
||||
user-select: none;
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
/*
|
||||
* Sidebar list container
|
||||
*/
|
||||
.sidebar {
|
||||
height: 100vh;
|
||||
border-right: 1px solid var(--separator-color);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: var(--bg-color);
|
||||
}
|
||||
|
||||
.sidebar__list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
font-size: var(--body-10-font-size);
|
||||
font-weight: var(--body-10-font-weight);
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {
|
||||
createFactory,
|
||||
PureComponent,
|
||||
} = require("devtools/client/shared/vendor/react");
|
||||
const {
|
||||
aside,
|
||||
ul,
|
||||
} = require("devtools/client/shared/vendor/react-dom-factories");
|
||||
|
||||
const SidebarItem = createFactory(require("./SidebarItem"));
|
||||
|
||||
const { PAGE_TYPES } = require("../../constants");
|
||||
|
||||
class Sidebar extends PureComponent {
|
||||
render() {
|
||||
const navItems = Object.values(PAGE_TYPES);
|
||||
|
||||
return aside(
|
||||
{
|
||||
className: "sidebar",
|
||||
},
|
||||
ul(
|
||||
{
|
||||
className: "sidebar__list",
|
||||
},
|
||||
navItems.map(page => {
|
||||
return SidebarItem({
|
||||
page: page,
|
||||
key: `sidebar-item-${page}`,
|
||||
});
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Exports
|
||||
module.exports = Sidebar;
|
|
@ -1,27 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
/*
|
||||
* Sidebar list items
|
||||
*/
|
||||
|
||||
.sidebar-item {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
grid-gap: var(--base-unit);
|
||||
padding: calc(var(--base-unit)) calc(var(--base-unit) * 6);
|
||||
}
|
||||
|
||||
.sidebar-item:hover {
|
||||
background-color: var(--highlight-color);
|
||||
}
|
||||
|
||||
.sidebar-item__icon {
|
||||
height: calc(var(--base-unit) * 4);
|
||||
width: calc(var(--base-unit) * 4);
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {
|
||||
createFactory,
|
||||
PureComponent,
|
||||
} = require("devtools/client/shared/vendor/react");
|
||||
const {
|
||||
img,
|
||||
li,
|
||||
span,
|
||||
} = require("devtools/client/shared/vendor/react-dom-factories");
|
||||
|
||||
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
|
||||
|
||||
const FluentReact = require("devtools/client/shared/vendor/fluent-react");
|
||||
const Localized = createFactory(FluentReact.Localized);
|
||||
|
||||
const { PAGE_TYPES } = require("../../constants");
|
||||
|
||||
const ICONS = {
|
||||
[PAGE_TYPES.MANIFEST]:
|
||||
"chrome://devtools/skin/images/application-manifest.svg",
|
||||
[PAGE_TYPES.SERVICE_WORKERS]:
|
||||
"chrome://devtools/skin/images/debugging-workers.svg",
|
||||
};
|
||||
|
||||
const LOCALIZATION_IDS = {
|
||||
[PAGE_TYPES.MANIFEST]: "sidebar-item-manifest",
|
||||
[PAGE_TYPES.SERVICE_WORKERS]: "sidebar-item-service-workers",
|
||||
};
|
||||
|
||||
class SidebarItem extends PureComponent {
|
||||
static get propTypes() {
|
||||
return {
|
||||
page: PropTypes.oneOf(Object.values(PAGE_TYPES)),
|
||||
};
|
||||
}
|
||||
render() {
|
||||
const { page } = this.props;
|
||||
return li(
|
||||
{ className: "sidebar-item" },
|
||||
Localized(
|
||||
{
|
||||
id: LOCALIZATION_IDS[page],
|
||||
attrs: {
|
||||
alt: true,
|
||||
title: true,
|
||||
},
|
||||
},
|
||||
img({
|
||||
src: ICONS[page],
|
||||
className: "sidebar-item__icon",
|
||||
})
|
||||
),
|
||||
Localized(
|
||||
{
|
||||
id: LOCALIZATION_IDS[page],
|
||||
attrs: {
|
||||
title: true,
|
||||
},
|
||||
},
|
||||
span({ className: "devtools-ellipsis-text" })
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Exports
|
||||
module.exports = SidebarItem;
|
|
@ -5,8 +5,4 @@
|
|||
DevToolsModules(
|
||||
'PageSwitcher.css',
|
||||
'PageSwitcher.js',
|
||||
'Sidebar.css',
|
||||
'Sidebar.js',
|
||||
'SidebarItem.css',
|
||||
'SidebarItem.js'
|
||||
)
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
exports[`App renders the expected snapshot 1`] = `
|
||||
<LocalizationProvider>
|
||||
<main
|
||||
className="app"
|
||||
className="application"
|
||||
>
|
||||
<Sidebar />
|
||||
<Connect(PageSwitcher) />
|
||||
</main>
|
||||
</LocalizationProvider>
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Sidebar renders the expected snapshot 1`] = `
|
||||
<aside
|
||||
className="sidebar"
|
||||
>
|
||||
<ul
|
||||
className="sidebar__list"
|
||||
>
|
||||
<SidebarItem
|
||||
key="sidebar-item-manifest"
|
||||
page="manifest"
|
||||
/>
|
||||
<SidebarItem
|
||||
key="sidebar-item-service-workers"
|
||||
page="service-workers"
|
||||
/>
|
||||
</ul>
|
||||
</aside>
|
||||
`;
|
|
@ -1,67 +0,0 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`SidebarItem renders the expected snapshot with manifest page 1`] = `
|
||||
<li
|
||||
className="sidebar-item"
|
||||
>
|
||||
<Localized
|
||||
attrs={
|
||||
Object {
|
||||
"alt": true,
|
||||
"title": true,
|
||||
}
|
||||
}
|
||||
id="sidebar-item-manifest"
|
||||
>
|
||||
<img
|
||||
className="sidebar-item__icon"
|
||||
src="chrome://devtools/skin/images/application-manifest.svg"
|
||||
/>
|
||||
</Localized>
|
||||
<Localized
|
||||
attrs={
|
||||
Object {
|
||||
"title": true,
|
||||
}
|
||||
}
|
||||
id="sidebar-item-manifest"
|
||||
>
|
||||
<span
|
||||
className="devtools-ellipsis-text"
|
||||
/>
|
||||
</Localized>
|
||||
</li>
|
||||
`;
|
||||
|
||||
exports[`SidebarItem renders the expected snapshot with service-workers page 1`] = `
|
||||
<li
|
||||
className="sidebar-item"
|
||||
>
|
||||
<Localized
|
||||
attrs={
|
||||
Object {
|
||||
"alt": true,
|
||||
"title": true,
|
||||
}
|
||||
}
|
||||
id="sidebar-item-service-workers"
|
||||
>
|
||||
<img
|
||||
className="sidebar-item__icon"
|
||||
src="chrome://devtools/skin/images/debugging-workers.svg"
|
||||
/>
|
||||
</Localized>
|
||||
<Localized
|
||||
attrs={
|
||||
Object {
|
||||
"title": true,
|
||||
}
|
||||
}
|
||||
id="sidebar-item-service-workers"
|
||||
>
|
||||
<span
|
||||
className="devtools-ellipsis-text"
|
||||
/>
|
||||
</Localized>
|
||||
</li>
|
||||
`;
|
|
@ -1,23 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Import libs
|
||||
const { shallow } = require("enzyme");
|
||||
const { createFactory } = require("react");
|
||||
|
||||
const Sidebar = createFactory(
|
||||
require("devtools/client/application/src/components/routing/Sidebar")
|
||||
);
|
||||
|
||||
/**
|
||||
* Test for Sidebar.js component
|
||||
*/
|
||||
|
||||
describe("Sidebar", () => {
|
||||
it("renders the expected snapshot", () => {
|
||||
const wrapper = shallow(Sidebar());
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
|
@ -1,36 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Import libs
|
||||
const { shallow } = require("enzyme");
|
||||
const { createFactory } = require("react");
|
||||
|
||||
const SidebarItem = createFactory(
|
||||
require("devtools/client/application/src/components/routing/SidebarItem")
|
||||
);
|
||||
|
||||
/**
|
||||
* Test for SidebarItem.js component
|
||||
*/
|
||||
|
||||
describe("SidebarItem", () => {
|
||||
it("renders the expected snapshot with manifest page", () => {
|
||||
const wrapper = shallow(
|
||||
SidebarItem({
|
||||
page: "manifest",
|
||||
})
|
||||
);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("renders the expected snapshot with service-workers page", () => {
|
||||
const wrapper = shallow(
|
||||
SidebarItem({
|
||||
page: "service-workers",
|
||||
})
|
||||
);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
|
@ -95,7 +95,6 @@ devtools.jar:
|
|||
skin/images/aboutdebugging-information.svg (themes/images/aboutdebugging-information.svg)
|
||||
skin/images/aboutdebugging-process-icon.svg (themes/images/aboutdebugging-process-icon.svg)
|
||||
skin/images/aboutdebugging-usb-icon.svg (themes/images/aboutdebugging-usb-icon.svg)
|
||||
skin/images/application-manifest.svg (themes/images/application-manifest.svg)
|
||||
skin/images/fox-smiling.svg (themes/images/fox-smiling.svg)
|
||||
skin/images/grid.svg (themes/images/grid.svg)
|
||||
skin/images/angle-swatch.svg (themes/images/angle-swatch.svg)
|
||||
|
|
|
@ -111,23 +111,12 @@ manifest-loaded-error = There was an error while loading the manifest:
|
|||
# Text displayed when the page has no manifest available
|
||||
manifest-non-existing = No manifest found to inspect.
|
||||
|
||||
# Sidebar navigation item for Manifest sidebar item section
|
||||
sidebar-item-manifest = Manifest
|
||||
.alt = Manifest Icon
|
||||
.title = Manifest
|
||||
|
||||
# Sidebar navigation item for Service Workers sidebar item section
|
||||
sidebar-item-service-workers = Service Workers
|
||||
.alt = Service Workers Icon
|
||||
.title = Service Workers
|
||||
|
||||
# Text for the ALT and TITLE attributes of the warning icon
|
||||
icon-warning =
|
||||
.alt = Warning icon
|
||||
.title = Warning
|
||||
.alt = Warning icon
|
||||
.title = Warning
|
||||
|
||||
# Text for the ALT and TITLE attributes of the error icon
|
||||
icon-error =
|
||||
.alt = Error icon
|
||||
.title = Error
|
||||
|
||||
.alt = Error icon
|
||||
.title = Error
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16" fill="context-fill">
|
||||
<path d="M12.6647273,4.78981818 L8.30109091,0.426181818 C8.02837421,0.153382728 7.65846518,8.23816807e-05 7.27272727,0 L5.81818182,0 L2,0 C0.8954305,2.02906125e-16 -2.13367219e-15,0.8954305 -1.99840144e-15,2 L-1.86719327e-15,8.72727273 L-1.86719327e-15,13.0909091 C-1.86719327e-15,14.6975556 1.30244436,16 2.90909091,16 L10.1818182,16 C11.7884647,16 13.0909091,14.6975556 13.0909091,13.0909091 L13.0909091,5.81818182 C13.0908267,5.43244391 12.9375264,5.06253488 12.6647273,4.78981818 Z M9.57963636,5.81818182 L7.27272727,5.81818182 L7.27272727,3.51127273 L9.57963636,5.81818182 Z M2.90909091,13.0909091 L2.90909091,2.90909091 L5.81818182,2.90909091 L5.81818182,6.54545455 C5.81818182,6.94711618 6.14379291,7.27272727 6.54545455,7.27272727 L10.1818182,7.27272727 L10.1818182,13.0909091 L2.90909091,13.0909091 Z" />
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 1.1 KiB |
Загрузка…
Ссылка в новой задаче