Skip to content

Commit 7cf820f

Browse files
committed
update screenshots
- adding some hover and focus for the QuickAccess.vue
1 parent 765fc5b commit 7cf820f

111 files changed

Lines changed: 371 additions & 295 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
887 Bytes
Loading

plugins/CoreHome/stylesheets/layout.less

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@_layout-pageWrap-margin: 18px;
12

23
.card-content > .row:last-child {
34
margin-bottom: 0;
@@ -125,7 +126,7 @@ nav {
125126

126127
#root {
127128
.pageWrap {
128-
width: calc(~'100% - 18px'); // 100% - pageWrap margin
129+
width: calc(~'100% - @{_layout-pageWrap-margin}');
129130
height: fit-content;
130131
padding-left: 9px;
131132
padding-right: 9px;
@@ -183,14 +184,6 @@ nav {
183184
}
184185
}
185186

186-
.quickAccessPlaceholder {
187-
width: 0;
188-
visibility: hidden;
189-
display: inline-block;
190-
position: relative;
191-
margin-right: -1px;
192-
}
193-
194187
.piwikTopControl {
195188
display: inline-block;
196189
float: none;
@@ -267,7 +260,7 @@ nav {
267260
}
268261

269262
.pageWrap {
270-
width: calc(~'100% - 18px') !important; // 100% - pageWrap margin
263+
width: calc(~'100% - @{_layout-pageWrap-margin}') !important;
271264
}
272265
}
273266

@@ -599,7 +592,7 @@ nav {
599592

600593
#root{
601594
.layoutWithSidebar--hasSidebar .page > .pageWrap {
602-
width: calc(~'100% - 18px') !important; // 100% - pageWrap margin
595+
width: calc(~'100% - @{_layout-pageWrap-margin}') !important;
603596
}
604597
}
605598
#content.home,

plugins/CoreHome/templates/_menu.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% macro menu(menu, anchorlink, cssClass, currentModule, currentAction, collapsible, isSuperUser, renderQuickAccess) %}
22
<div id="secondNavBar" class="{{ cssClass }} z-depth-1">
33
{% if renderQuickAccess|default(false) %}
4-
<div vue-entry="CoreHome.QuickAccess" class="piwikTopControl borderedControl"></div>
4+
<div vue-entry="CoreHome.QuickAccess" class="piwikTopControl"></div>
55
{% endif %}
66
<ul class="navbar {% if collapsible %}collapsible collapsible-accordion{% endif %} hide-on-med-and-down" aria-label="{{ 'CoreHome_MainNavigation'|translate|e('html_attr') }}" role="menu">
77
{% for level1,level2 in menu %}
Lines changed: 2 additions & 2 deletions
Loading

plugins/CoreHome/vue/dist/CoreHome.umd.js

Lines changed: 51 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/CoreHome/vue/dist/CoreHome.umd.min.js

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/CoreHome/vue/src/QuickAccess/QuickAccess.less

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
.quick-access {
22
position: relative;
3-
box-shadow: none !important;
4-
border: 1px solid @theme-color-background-lowContrast !important;
5-
border-radius: 8px !important;
3+
box-shadow: none;
4+
border: 1px solid @theme-color-background-lowContrast;
5+
border-radius: 8px;
66
width: 200px;
77

88
&:hover,
99
&.expanded,
1010
&.active {
11-
input {
12-
background-color: @theme-color-background-contrast !important;
11+
border-color: transparent;
12+
.quickAccessInside .quickAccessInput {
13+
background-color: @theme-color-background-contrast;
14+
border: 1px solid @theme-color-focus-ring;
15+
outline: 0;
16+
box-shadow: none;
1317
}
1418
}
1519
li {
@@ -37,14 +41,11 @@
3741
font-size: 14px;
3842
padding: 10px 12px 10px 38px;
3943
border: 0;
40-
margin: 0;
41-
box-sizing: border-box;
42-
box-shadow: none!important;
4344
border-radius: 8px;
44-
background-color: @theme-color-background-contrast !important;
45-
&:focus {
46-
outline: none;
47-
border-bottom: none !important;
45+
width: 100%;
46+
&:focus-visible {
47+
border: 1px solid @theme-color-focus-ring;
48+
outline: 1px solid @theme-color-focus-ring;
4849
}
4950
}
5051
.quickAccessInside .quickAccessDropdown.dropdown {
@@ -88,4 +89,4 @@
8889
li.quick-access-help a {
8990
word-break: break-word;
9091
}
91-
}
92+
}

plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
@mouseenter="searchActive = true"
1717
/>
1818
<input
19-
class="quickAccessInput"
19+
class="quickAccessInput browser-default"
2020
@keydown="onKeypress($event)"
2121
@focus="searchActive = true"
22+
@blur="searchActive = false"
2223
v-model="searchTerm"
2324
type="text"
24-
tabindex="2"
25+
tabindex="5"
2526
v-focus-if="{ focused: searchActive }"
2627
v-tooltips
2728
:title="quickAccessTitle"
@@ -107,6 +108,7 @@ import Site from '../SiteSelector/Site';
107108
import Matomo from '../Matomo/Matomo';
108109
import debounce from '../debounce';
109110
import Tooltips from '../Tooltips/Tooltips';
111+
import { closeMobileLeftMenu } from '../SideNav/SideNav';
110112
111113
const { ListingFormatter } = window;
112114
@@ -157,6 +159,7 @@ function scrollFirstElementIntoView(element: HTMLElement) {
157159
}
158160
159161
export default defineComponent({
162+
name: 'QuickAccess',
160163
directives: {
161164
FocusAnywhereButHere,
162165
FocusIf,
@@ -257,6 +260,8 @@ export default defineComponent({
257260
this.deactivateSearch();
258261
} else if (isEscKey && areSearchResultsDisplayed) {
259262
this.deactivateSearch();
263+
} else if (isTabKey) {
264+
this.searchActive = false;
260265
} else {
261266
setTimeout(() => {
262267
this.searchActive = true;
@@ -381,12 +386,15 @@ export default defineComponent({
381386
this.makeSureSelectedItemIsInViewport();
382387
},
383388
selectSite(idSite: string|number) {
389+
this.deactivateSearch();
390+
closeMobileLeftMenu();
384391
SitesStore.loadSite(idSite);
385392
},
386393
selectMenuItem(index: number) {
387394
const target: HTMLElement|null = document.querySelector(`[quick_access='${index}']`);
388395
if (target) {
389396
this.deactivateSearch();
397+
closeMobileLeftMenu();
390398
391399
const href = target.getAttribute('href');
392400
if (href && href.length > 10 && target && target.click) {

plugins/CoreHome/vue/src/SideNav/SideNav.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ interface SideNavArgs {
1717
initialized?: boolean;
1818
}
1919

20+
export function closeMobileLeftMenu(): void {
21+
const secondNavBar = document.getElementById('secondNavBar');
22+
if (!secondNavBar?.classList.contains('mobileLeftMenuOpen')) {
23+
return;
24+
}
25+
26+
const mobileLeftMenu = document.getElementById('mobile-left-menu');
27+
if (!mobileLeftMenu) {
28+
return;
29+
}
30+
31+
try {
32+
window.$(mobileLeftMenu).sidenav('close');
33+
} catch (e) {
34+
// The mobile sidenav is not initialized outside mobile layouts.
35+
}
36+
}
37+
2038
/**
2139
* Will activate the materialize side nav feature once rendered. We use this directive as
2240
* it makes sure the actual left menu is rendered at the time we init the side nav.

plugins/CorePluginsAdmin/tests/UI/PluginsAdmin_spec.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,30 @@ describe("PluginsAdmin", function () {
3636

3737
await page.waitForNetworkIdle();
3838
await page.waitForTimeout(200);
39+
const text = await page.$eval(
40+
'#secondNavBar .navbar .menuTab.active .item.manage-plugins',
41+
(el) => el.textContent.trim(),
42+
);
3943

40-
expect(await page.screenshotSelector('#secondNavBar')).to.matchImage('plugins_update_menu');
44+
expect(text).to.contain('2')
4145
});
4246

4347
it('should load the plugins admin page correctly when internet disabled', async function () {
44-
testEnvironment.overrideConfig('General', {
48+
await testEnvironment.overrideConfig('General', {
4549
enable_internet_features: 0
4650
});
47-
testEnvironment.save();
51+
await testEnvironment.save();
4852

4953
await page.goto("?" + generalParams + "&module=CorePluginsAdmin&action=plugins");
5054

5155
expect(await screenshotPageWrap()).to.matchImage('plugins_no_internet');
5256
});
5357

5458
it('should load the plugins admin page correctly when admin disabled', async function () {
55-
testEnvironment.overrideConfig('General', {
59+
await testEnvironment.overrideConfig('General', {
5660
enable_plugins_admin: 0
5761
});
58-
testEnvironment.save();
62+
await testEnvironment.save();
5963

6064
await page.goto("?" + generalParams + "&module=CorePluginsAdmin&action=plugins");
6165

0 commit comments

Comments
 (0)