Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4014ff2c
Commit
4014ff2c
authored
May 13, 2021
by
Frédéric Caplette
Committed by
Scott Hampton
May 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix animation for pipeline editor drawer on load
parent
421d10b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
app/assets/javascripts/pipeline_editor/components/drawer/pipeline_editor_drawer.vue
...eline_editor/components/drawer/pipeline_editor_drawer.vue
+12
-2
spec/frontend/pipeline_editor/components/drawer/pipeline_editor_drawer_spec.js
...e_editor/components/drawer/pipeline_editor_drawer_spec.js
+16
-1
No files found.
app/assets/javascripts/pipeline_editor/components/drawer/pipeline_editor_drawer.vue
View file @
4014ff2c
...
...
@@ -28,7 +28,7 @@ export default {
},
data
()
{
return
{
isExpanded
:
tru
e
,
isExpanded
:
fals
e
,
topPosition
:
0
,
};
},
...
...
@@ -49,8 +49,18 @@ export default {
},
mounted
()
{
this
.
setTopPosition
();
this
.
setInitialExpandState
();
},
methods
:
{
setInitialExpandState
()
{
// We check in the local storage and if no value is defined, we want the default
// to be true. We want to explicitly set it to true here so that the drawer
// animates to open on load.
const
localValue
=
localStorage
.
getItem
(
this
.
$options
.
localDrawerKey
);
if
(
localValue
===
null
)
{
this
.
isExpanded
=
true
;
}
},
setTopPosition
()
{
const
navbarEl
=
document
.
querySelector
(
'
.js-navbar
'
);
...
...
@@ -68,7 +78,7 @@ export default {
<local-storage-sync
v-model=
"isExpanded"
:storage-key=
"$options.localDrawerKey"
as-json
>
<aside
aria-live=
"polite"
class=
"gl-fixed gl-right-0 gl-bg-gray-10 gl-shadow-drawer gl-transition-medium gl-border-l-solid gl-border-1 gl-border-gray-100 gl-h-full gl-z-index-3 gl-overflow-y-auto"
class=
"gl-fixed gl-right-0 gl-bg-gray-10 gl-shadow-drawer gl-transition-
property-width gl-transition-duration-
medium gl-border-l-solid gl-border-1 gl-border-gray-100 gl-h-full gl-z-index-3 gl-overflow-y-auto"
:style=
"rootStyle"
>
<gl-button
...
...
spec/frontend/pipeline_editor/components/drawer/pipeline_editor_drawer_spec.js
View file @
4014ff2c
...
...
@@ -38,6 +38,16 @@ describe('Pipeline editor drawer', () => {
localStorage
.
clear
();
});
it
(
'
it sets the drawer to be opened by default
'
,
async
()
=>
{
createComponent
();
expect
(
findDrawerContent
().
exists
()).
toBe
(
false
);
await
nextTick
();
expect
(
findDrawerContent
().
exists
()).
toBe
(
true
);
});
describe
(
'
when the drawer is collapsed
'
,
()
=>
{
beforeEach
(
async
()
=>
{
createComponent
();
...
...
@@ -100,10 +110,15 @@ describe('Pipeline editor drawer', () => {
describe
(
'
local storage
'
,
()
=>
{
it
(
'
saves the drawer expanded value to local storage
'
,
async
()
=>
{
localStorage
.
setItem
(
DRAWER_EXPANDED_KEY
,
'
false
'
);
createComponent
();
await
clickToggleBtn
();
expect
(
localStorage
.
setItem
.
mock
.
calls
).
toEqual
([[
DRAWER_EXPANDED_KEY
,
'
false
'
]]);
expect
(
localStorage
.
setItem
.
mock
.
calls
).
toEqual
([
[
DRAWER_EXPANDED_KEY
,
'
false
'
],
[
DRAWER_EXPANDED_KEY
,
'
true
'
],
]);
});
it
(
'
loads the drawer collapsed when local storage is set to `false`,
'
,
async
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment