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
1c978e77
Commit
1c978e77
authored
Jan 21, 2021
by
Kev
Committed by
Illya Klymov
Jan 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move "number of changed files" into Web IDE sidebar badge
parent
f6f171cb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
1 deletion
+37
-1
app/assets/javascripts/ide/components/activity_bar.vue
app/assets/javascripts/ide/components/activity_bar.vue
+4
-1
app/assets/stylesheets/page_bundles/ide.scss
app/assets/stylesheets/page_bundles/ide.scss
+11
-0
changelogs/unreleased/196628-move-number-of-changed-files-into-web-ide-sidebar-badge.yml
...ve-number-of-changed-files-into-web-ide-sidebar-badge.yml
+5
-0
spec/frontend/ide/components/activity_bar_spec.js
spec/frontend/ide/components/activity_bar_spec.js
+17
-0
No files found.
app/assets/javascripts/ide/components/activity_bar.vue
View file @
1c978e77
...
...
@@ -11,7 +11,7 @@ export default {
GlTooltip
:
GlTooltipDirective
,
},
computed
:
{
...
mapState
([
'
currentActivityView
'
]),
...
mapState
([
'
currentActivityView
'
,
'
stagedFiles
'
]),
},
methods
:
{
...
mapActions
([
'
updateActivityBarView
'
]),
...
...
@@ -81,6 +81,9 @@ export default {
@click.prevent="changedActivityView($event, $options.leftSidebarViews.commit.name)"
>
<gl-icon
name=
"commit"
/>
<div
v-if=
"stagedFiles.length > 0"
class=
"ide-commit-badge badge badge-pill"
>
{{
stagedFiles
.
length
}}
</div>
</button>
</li>
</ul>
...
...
app/assets/stylesheets/page_bundles/ide.scss
View file @
1c978e77
...
...
@@ -601,6 +601,17 @@ $ide-commit-header-height: 48px;
left
:
-1px
;
}
}
.ide-commit-badge
{
background-color
:
var
(
--
ide-highlight-accent
,
$almost-black
)
!
important
;
color
:
var
(
--
ide-highlight-background
,
$white
)
!
important
;
position
:
absolute
;
left
:
38px
;
top
:
$gl-padding-8
;
font-size
:
$gl-font-size-12
;
padding
:
2px
$gl-padding-4
;
font-weight
:
$gl-font-weight-bold
!
important
;
}
}
.ide-activity-bar
{
...
...
changelogs/unreleased/196628-move-number-of-changed-files-into-web-ide-sidebar-badge.yml
0 → 100644
View file @
1c978e77
---
title
:
Move "number of changed files" into Web IDE sidebar badge
merge_request
:
51166
author
:
Kev @KevSlashNull
type
:
added
spec/frontend/ide/components/activity_bar_spec.js
View file @
1c978e77
...
...
@@ -9,6 +9,8 @@ describe('IDE activity bar', () => {
let
vm
;
let
store
;
const
findChangesBadge
=
()
=>
vm
.
$el
.
querySelector
(
'
.badge
'
);
beforeEach
(()
=>
{
store
=
createStore
();
...
...
@@ -69,4 +71,19 @@ describe('IDE activity bar', () => {
});
});
});
describe
(
'
changes badge
'
,
()
=>
{
it
(
'
is rendered when files are staged
'
,
()
=>
{
store
.
state
.
stagedFiles
=
[{
path
:
'
/path/to/file
'
}];
vm
.
$mount
();
expect
(
findChangesBadge
()).
toBeTruthy
();
expect
(
findChangesBadge
().
textContent
.
trim
()).
toBe
(
'
1
'
);
});
it
(
'
is not rendered when no changes are present
'
,
()
=>
{
vm
.
$mount
();
expect
(
findChangesBadge
()).
toBeFalsy
();
});
});
});
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