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
a2f2e203
Commit
a2f2e203
authored
Jan 13, 2022
by
Mireya Andres
Committed by
Kushal Pandya
Jan 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix top calculation for trigger job page sidebar
parent
39b7314a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
app/assets/javascripts/jobs/bridge/components/sidebar.vue
app/assets/javascripts/jobs/bridge/components/sidebar.vue
+21
-2
spec/frontend/jobs/bridge/components/sidebar_spec.js
spec/frontend/jobs/bridge/components/sidebar_spec.js
+19
-0
No files found.
app/assets/javascripts/jobs/bridge/components/sidebar.vue
View file @
a2f2e203
...
@@ -8,7 +8,6 @@ import CommitBlock from '../../components/commit_block.vue';
...
@@ -8,7 +8,6 @@ import CommitBlock from '../../components/commit_block.vue';
export
default
{
export
default
{
styles
:
{
styles
:
{
top
:
'
75px
'
,
width
:
'
290px
'
,
width
:
'
290px
'
,
},
},
name
:
'
BridgeSidebar
'
,
name
:
'
BridgeSidebar
'
,
...
@@ -37,17 +36,37 @@ export default {
...
@@ -37,17 +36,37 @@ export default {
required
:
true
,
required
:
true
,
},
},
},
},
data
()
{
return
{
topPosition
:
0
,
};
},
computed
:
{
rootStyle
()
{
return
{
...
this
.
$options
.
styles
,
top
:
`
${
this
.
topPosition
}
px`
};
},
},
mounted
()
{
this
.
setTopPosition
();
},
methods
:
{
methods
:
{
onSidebarButtonClick
()
{
onSidebarButtonClick
()
{
this
.
$emit
(
'
toggleSidebar
'
);
this
.
$emit
(
'
toggleSidebar
'
);
},
},
setTopPosition
()
{
const
navbarEl
=
document
.
querySelector
(
'
.js-navbar
'
);
if
(
navbarEl
)
{
this
.
topPosition
=
navbarEl
.
getBoundingClientRect
().
bottom
;
}
},
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<aside
<aside
class=
"gl-fixed gl-right-0 gl-px-5 gl-bg-gray-10 gl-h-full gl-border-l-solid gl-border-1 gl-border-gray-100 gl-z-index-200 gl-overflow-hidden"
class=
"gl-fixed gl-right-0 gl-px-5 gl-bg-gray-10 gl-h-full gl-border-l-solid gl-border-1 gl-border-gray-100 gl-z-index-200 gl-overflow-hidden"
:style=
"
this.$options.styles
"
:style=
"
rootStyle
"
>
>
<div
class=
"gl-py-5 gl-display-flex gl-align-items-center"
>
<div
class=
"gl-py-5 gl-display-flex gl-align-items-center"
>
<tooltip-on-truncate
:title=
"bridgeJob.name"
truncate-target=
"child"
<tooltip-on-truncate
:title=
"bridgeJob.name"
truncate-target=
"child"
...
...
spec/frontend/jobs/bridge/components/sidebar_spec.js
View file @
a2f2e203
...
@@ -7,6 +7,14 @@ import { mockCommit, mockJob } from '../mock_data';
...
@@ -7,6 +7,14 @@ import { mockCommit, mockJob } from '../mock_data';
describe
(
'
Bridge Sidebar
'
,
()
=>
{
describe
(
'
Bridge Sidebar
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
MockHeaderEl
=
{
getBoundingClientRect
()
{
return
{
bottom
:
'
40
'
,
};
},
};
const
createComponent
=
({
featureFlag
}
=
{})
=>
{
const
createComponent
=
({
featureFlag
}
=
{})
=>
{
wrapper
=
shallowMount
(
BridgeSidebar
,
{
wrapper
=
shallowMount
(
BridgeSidebar
,
{
provide
:
{
provide
:
{
...
@@ -44,6 +52,17 @@ describe('Bridge Sidebar', () => {
...
@@ -44,6 +52,17 @@ describe('Bridge Sidebar', () => {
});
});
});
});
describe
(
'
styles
'
,
()
=>
{
beforeEach
(
async
()
=>
{
jest
.
spyOn
(
document
,
'
querySelector
'
).
mockReturnValue
(
MockHeaderEl
);
createComponent
();
});
it
(
'
calculates root styles correctly
'
,
()
=>
{
expect
(
wrapper
.
attributes
(
'
style
'
)).
toBe
(
'
width: 290px; top: 40px;
'
);
});
});
describe
(
'
sidebar expansion
'
,
()
=>
{
describe
(
'
sidebar expansion
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
();
createComponent
();
...
...
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