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
40526400
Commit
40526400
authored
Dec 09, 2021
by
mgandres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use utils classes to style sidebar
parent
76d9f8da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
44 deletions
+41
-44
app/assets/javascripts/jobs/bridge/components/sidebar.vue
app/assets/javascripts/jobs/bridge/components/sidebar.vue
+34
-36
spec/frontend/jobs/bridge/components/sidebar_spec.js
spec/frontend/jobs/bridge/components/sidebar_spec.js
+7
-8
No files found.
app/assets/javascripts/jobs/bridge/components/sidebar.vue
View file @
40526400
...
...
@@ -7,6 +7,10 @@ import { JOB_SIDEBAR } from '../../constants';
import
{
SIDEBAR_COLLAPSE_BREAKPOINTS
}
from
'
./constants
'
;
export
default
{
styles
:
{
top
:
'
75px
'
,
width
:
'
290px
'
,
},
name
:
'
BridgeSidebar
'
,
i18n
:
{
...
JOB_SIDEBAR
,
...
...
@@ -55,46 +59,40 @@ export default {
</
script
>
<
template
>
<aside
class=
"right-sidebar build-sidebar"
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"
:class=
"
{
'right-sidebar-expanded': isSidebarExpanded,
'right-sidebar-collapsed': !isSidebarExpanded,
'gl-display-none': !isSidebarExpanded,
}"
data-offset-top="101"
data-spy="affix"
>
<div
class=
"sidebar-container"
>
<div
class=
"blocks-container"
>
<div
class=
"gl-py-5 gl-display-flex gl-align-items-center"
>
<tooltip-on-truncate
:title=
"buildName"
truncate-target=
"child"
><h4
class=
"gl-mb-0 gl-mr-2 gl-text-truncate"
>
{{
buildName
}}
</h4>
</tooltip-on-truncate>
<!-- TODO: implement retry actions -->
<div
class=
"gl-flex-grow-1 gl-flex-shrink-0 gl-text-right"
>
<gl-dropdown
:text=
"$options.i18n.retryButton"
category=
"primary"
variant=
"confirm"
right
size=
"medium"
>
<gl-dropdown-item>
{{
$options
.
i18n
.
retryTriggerJob
}}
</gl-dropdown-item>
<gl-dropdown-item>
{{
$options
.
i18n
.
retryDownstreamPipeline
}}
</gl-dropdown-item>
</gl-dropdown>
</div>
<gl-button
:aria-label=
"$options.i18n.toggleSidebar"
data-testid=
"sidebar-expansion-toggle"
category=
"tertiary"
class=
"gl-md-display-none gl-ml-2"
icon=
"chevron-double-lg-right"
@
click=
"toggleSidebar"
/>
</div>
<!-- TODO: get job details and show commit block, stage dropdown, jobs list -->
<div
class=
"gl-py-5 gl-display-flex gl-align-items-center"
>
<tooltip-on-truncate
:title=
"buildName"
truncate-target=
"child"
><h4
class=
"gl-mb-0 gl-mr-2 gl-text-truncate"
>
{{
buildName
}}
</h4>
</tooltip-on-truncate>
<!-- TODO: implement retry actions -->
<div
class=
"gl-flex-grow-1 gl-flex-shrink-0 gl-text-right"
>
<gl-dropdown
:text=
"$options.i18n.retryButton"
category=
"primary"
variant=
"confirm"
right
size=
"medium"
>
<gl-dropdown-item>
{{
$options
.
i18n
.
retryTriggerJob
}}
</gl-dropdown-item>
<gl-dropdown-item>
{{
$options
.
i18n
.
retryDownstreamPipeline
}}
</gl-dropdown-item>
</gl-dropdown>
</div>
<gl-button
:aria-label=
"$options.i18n.toggleSidebar"
data-testid=
"sidebar-expansion-toggle"
category=
"tertiary"
class=
"gl-md-display-none gl-ml-2"
icon=
"chevron-double-lg-right"
@
click=
"toggleSidebar"
/>
</div>
<!-- TODO: get job details and show commit block, stage dropdown, jobs list -->
</aside>
</
template
>
spec/frontend/jobs/bridge/components/sidebar_spec.js
View file @
40526400
...
...
@@ -40,14 +40,12 @@ describe('Bridge Sidebar', () => {
});
it
(
'
toggles expansion on button click
'
,
async
()
=>
{
expect
(
findSidebar
().
classes
()).
toContain
(
'
right-sidebar-expanded
'
);
expect
(
findSidebar
().
classes
()).
not
.
toContain
(
'
right-sidebar-collapsed
'
);
expect
(
findSidebar
().
classes
()).
not
.
toContain
(
'
gl-display-none
'
);
findToggle
().
vm
.
$emit
(
'
click
'
);
await
nextTick
();
expect
(
findSidebar
().
classes
()).
toContain
(
'
right-sidebar-collapsed
'
);
expect
(
findSidebar
().
classes
()).
not
.
toContain
(
'
right-sidebar-expanded
'
);
expect
(
findSidebar
().
classes
()).
toContain
(
'
gl-display-none
'
);
});
describe
(
'
on resize
'
,
()
=>
{
...
...
@@ -62,14 +60,15 @@ describe('Bridge Sidebar', () => {
'
sets isSidebarExpanded to `$isSidebarExpanded` when the breakpoint is "$breakpoint"
'
,
async
({
breakpoint
,
isSidebarExpanded
})
=>
{
jest
.
spyOn
(
GlBreakpointInstance
,
'
getBreakpointSize
'
).
mockReturnValue
(
breakpoint
);
const
sidebarClass
=
isSidebarExpanded
?
'
right-sidebar-expanded
'
:
'
right-sidebar-collapsed
'
;
window
.
dispatchEvent
(
new
Event
(
'
resize
'
));
await
nextTick
();
expect
(
findSidebar
().
classes
()).
toContain
(
sidebarClass
);
if
(
isSidebarExpanded
)
{
expect
(
findSidebar
().
classes
()).
not
.
toContain
(
'
gl-display-none
'
);
}
else
{
expect
(
findSidebar
().
classes
()).
toContain
(
'
gl-display-none
'
);
}
},
);
});
...
...
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