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
d6a977b0
Commit
d6a977b0
authored
Sep 14, 2021
by
Tomas Vik
Committed by
Annabel Dunstone Gray
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MR review bar hiding part of the right sidebar
parent
cfb58530
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
23 deletions
+69
-23
app/assets/javascripts/batch_comments/components/review_bar.vue
...sets/javascripts/batch_comments/components/review_bar.vue
+7
-0
app/assets/javascripts/batch_comments/constants.js
app/assets/javascripts/batch_comments/constants.js
+2
-0
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+0
-2
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+3
-1
spec/frontend/batch_comments/components/review_bar_spec.js
spec/frontend/batch_comments/components/review_bar_spec.js
+42
-0
spec/frontend/batch_comments/create_batch_comments_store.js
spec/frontend/batch_comments/create_batch_comments_store.js
+15
-0
spec/frontend/diffs/components/app_spec.js
spec/frontend/diffs/components/app_spec.js
+0
-20
No files found.
app/assets/javascripts/batch_comments/components/review_bar.vue
View file @
d6a977b0
<
script
>
<
script
>
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
REVIEW_BAR_VISIBLE_CLASS_NAME
}
from
'
../constants
'
;
import
PreviewDropdown
from
'
./preview_dropdown.vue
'
;
import
PreviewDropdown
from
'
./preview_dropdown.vue
'
;
import
PublishButton
from
'
./publish_button.vue
'
;
import
PublishButton
from
'
./publish_button.vue
'
;
...
@@ -18,6 +19,12 @@ export default {
...
@@ -18,6 +19,12 @@ export default {
}
}
},
},
},
},
mounted
()
{
document
.
body
.
classList
.
add
(
REVIEW_BAR_VISIBLE_CLASS_NAME
);
},
beforeDestroy
()
{
document
.
body
.
classList
.
remove
(
REVIEW_BAR_VISIBLE_CLASS_NAME
);
},
methods
:
{
methods
:
{
...
mapActions
(
'
batchComments
'
,
[
'
expandAllDiscussions
'
]),
...
mapActions
(
'
batchComments
'
,
[
'
expandAllDiscussions
'
]),
},
},
...
...
app/assets/javascripts/batch_comments/constants.js
View file @
d6a977b0
export
const
CHANGES_TAB
=
'
diffs
'
;
export
const
CHANGES_TAB
=
'
diffs
'
;
export
const
DISCUSSION_TAB
=
'
notes
'
;
export
const
DISCUSSION_TAB
=
'
notes
'
;
export
const
SHOW_TAB
=
'
show
'
;
export
const
SHOW_TAB
=
'
show
'
;
export
const
REVIEW_BAR_VISIBLE_CLASS_NAME
=
'
review-bar-visible
'
;
app/assets/javascripts/diffs/components/app.vue
View file @
d6a977b0
...
@@ -229,7 +229,6 @@ export default {
...
@@ -229,7 +229,6 @@ export default {
'
isBatchLoading
'
,
'
isBatchLoading
'
,
'
isBatchLoadingError
'
,
'
isBatchLoadingError
'
,
]),
]),
...
mapGetters
(
'
batchComments
'
,
[
'
draftsCount
'
]),
...
mapGetters
([
'
isNotesFetched
'
,
'
getNoteableData
'
]),
...
mapGetters
([
'
isNotesFetched
'
,
'
getNoteableData
'
]),
diffs
()
{
diffs
()
{
if
(
!
this
.
viewDiffsFileByFile
)
{
if
(
!
this
.
viewDiffsFileByFile
)
{
...
@@ -664,7 +663,6 @@ export default {
...
@@ -664,7 +663,6 @@ export default {
<div
<div
v-if=
"renderFileTree"
v-if=
"renderFileTree"
:style=
"{ width: `${treeWidth}px` }"
:style=
"{ width: `${treeWidth}px` }"
:class=
"{ 'review-bar-visible': draftsCount > 0 }"
class=
"diff-tree-list js-diff-tree-list px-3 pr-md-0"
class=
"diff-tree-list js-diff-tree-list px-3 pr-md-0"
>
>
<panel-resizer
<panel-resizer
...
...
app/assets/stylesheets/pages/issuable.scss
View file @
d6a977b0
...
@@ -122,7 +122,9 @@
...
@@ -122,7 +122,9 @@
.right-sidebar
{
.right-sidebar
{
position
:
fixed
;
position
:
fixed
;
top
:
$header-height
;
top
:
$header-height
;
bottom
:
0
;
// Default value for CSS var must contain a unit
// stylelint-disable-next-line length-zero-no-unit
bottom
:
var
(
--
review-bar-height
,
0px
);
right
:
0
;
right
:
0
;
transition
:
width
$sidebar-transition-duration
;
transition
:
width
$sidebar-transition-duration
;
background
:
$gray-light
;
background
:
$gray-light
;
...
...
spec/frontend/batch_comments/components/review_bar_spec.js
0 → 100644
View file @
d6a977b0
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
ReviewBar
from
'
~/batch_comments/components/review_bar.vue
'
;
import
{
REVIEW_BAR_VISIBLE_CLASS_NAME
}
from
'
~/batch_comments/constants
'
;
import
createStore
from
'
../create_batch_comments_store
'
;
describe
(
'
Batch comments review bar component
'
,
()
=>
{
let
store
;
let
wrapper
;
const
createComponent
=
(
propsData
=
{})
=>
{
store
=
createStore
();
wrapper
=
shallowMount
(
ReviewBar
,
{
store
,
propsData
,
});
};
beforeEach
(()
=>
{
document
.
body
.
className
=
''
;
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
it adds review-bar-visible class to body when review bar is mounted
'
,
async
()
=>
{
expect
(
document
.
body
.
classList
.
contains
(
REVIEW_BAR_VISIBLE_CLASS_NAME
)).
toBe
(
false
);
createComponent
();
expect
(
document
.
body
.
classList
.
contains
(
REVIEW_BAR_VISIBLE_CLASS_NAME
)).
toBe
(
true
);
});
it
(
'
it removes review-bar-visible class to body when review bar is destroyed
'
,
async
()
=>
{
createComponent
();
wrapper
.
destroy
();
expect
(
document
.
body
.
classList
.
contains
(
REVIEW_BAR_VISIBLE_CLASS_NAME
)).
toBe
(
false
);
});
});
spec/frontend/batch_comments/create_batch_comments_store.js
0 → 100644
View file @
d6a977b0
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
batchCommentsModule
from
'
~/batch_comments/stores/modules/batch_comments
'
;
import
notesModule
from
'
~/notes/stores/modules
'
;
Vue
.
use
(
Vuex
);
export
default
function
createDiffsStore
()
{
return
new
Vuex
.
Store
({
modules
:
{
notes
:
notesModule
(),
batchComments
:
batchCommentsModule
(),
},
});
}
spec/frontend/diffs/components/app_spec.js
View file @
d6a977b0
...
@@ -705,24 +705,4 @@ describe('diffs/components/app', () => {
...
@@ -705,24 +705,4 @@ describe('diffs/components/app', () => {
);
);
});
});
});
});
describe
(
'
diff file tree is aware of review bar
'
,
()
=>
{
it
(
'
it does not have review-bar-visible class when review bar is not visible
'
,
()
=>
{
createComponent
({},
({
state
})
=>
{
state
.
diffs
.
diffFiles
=
[{
file_hash
:
'
111
'
,
file_path
:
'
111.js
'
}];
});
expect
(
wrapper
.
find
(
'
.js-diff-tree-list
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.js-diff-tree-list.review-bar-visible
'
).
exists
()).
toBe
(
false
);
});
it
(
'
it does have review-bar-visible class when review bar is visible
'
,
()
=>
{
createComponent
({},
({
state
})
=>
{
state
.
diffs
.
diffFiles
=
[{
file_hash
:
'
111
'
,
file_path
:
'
111.js
'
}];
state
.
batchComments
.
drafts
=
[
'
draft message
'
];
});
expect
(
wrapper
.
find
(
'
.js-diff-tree-list.review-bar-visible
'
).
exists
()).
toBe
(
true
);
});
});
});
});
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