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
d775d790
Commit
d775d790
authored
Aug 21, 2020
by
Jeremy Elder
Committed by
Tim Zallmann
Aug 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace deprecated button …/compare_versions.vue
parent
8d626e03
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
+24
-19
app/assets/javascripts/diffs/components/compare_versions.vue
app/assets/javascripts/diffs/components/compare_versions.vue
+18
-17
changelogs/unreleased/219797-replace-gl-deprecated-button-with-gl-button-in-app-assets-javascri.yml
...precated-button-with-gl-button-in-app-assets-javascri.yml
+5
-0
spec/frontend/diffs/components/compare_versions_spec.js
spec/frontend/diffs/components/compare_versions_spec.js
+1
-2
No files found.
app/assets/javascripts/diffs/components/compare_versions.vue
View file @
d775d790
<
script
>
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
GlTooltipDirective
,
GlLink
,
Gl
Deprecated
Button
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlTooltipDirective
,
GlLink
,
GlButton
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
polyfillSticky
}
from
'
~/lib/utils/sticky
'
;
import
{
polyfillSticky
}
from
'
~/lib/utils/sticky
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
CompareDropdownLayout
from
'
./compare_dropdown_layout.vue
'
;
import
CompareDropdownLayout
from
'
./compare_dropdown_layout.vue
'
;
import
SettingsDropdown
from
'
./settings_dropdown.vue
'
;
import
SettingsDropdown
from
'
./settings_dropdown.vue
'
;
import
DiffStats
from
'
./diff_stats.vue
'
;
import
DiffStats
from
'
./diff_stats.vue
'
;
...
@@ -12,9 +11,8 @@ import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants';
...
@@ -12,9 +11,8 @@ import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants';
export
default
{
export
default
{
components
:
{
components
:
{
CompareDropdownLayout
,
CompareDropdownLayout
,
Icon
,
GlLink
,
GlLink
,
Gl
Deprecated
Button
,
GlButton
,
GlSprintf
,
GlSprintf
,
SettingsDropdown
,
SettingsDropdown
,
DiffStats
,
DiffStats
,
...
@@ -84,18 +82,15 @@ export default {
...
@@ -84,18 +82,15 @@ export default {
[CENTERED_LIMITED_CONTAINER_CLASSES]: isLimitedContainer,
[CENTERED_LIMITED_CONTAINER_CLASSES]: isLimitedContainer,
}"
}"
>
>
<button
<
gl-
button
v-gl-tooltip
.
hover
v-gl-tooltip
.
hover
type=
"button"
variant=
"default"
class=
"btn btn-default gl-mr-3 js-toggle-tree-list"
icon=
"file-tree"
:class=
"
{
class=
"gl-mr-3 js-toggle-tree-list"
active: showTreeList,
}"
:title=
"toggleFileBrowserTitle"
:title=
"toggleFileBrowserTitle"
:selected=
"showTreeList"
@
click=
"toggleShowTreeList"
@
click=
"toggleShowTreeList"
>
/>
<icon
name=
"file-tree"
/>
</button>
<gl-sprintf
<gl-sprintf
v-if=
"showDropdowns"
v-if=
"showDropdowns"
class=
"d-flex align-items-center compare-versions-container"
class=
"d-flex align-items-center compare-versions-container"
...
@@ -124,16 +119,22 @@ export default {
...
@@ -124,16 +119,22 @@ export default {
:added-lines=
"addedLines"
:added-lines=
"addedLines"
:removed-lines=
"removedLines"
:removed-lines=
"removedLines"
/>
/>
<gl-
deprecated-
button
<gl-button
v-if=
"commit || startVersion"
v-if=
"commit || startVersion"
:href=
"latestVersionPath"
:href=
"latestVersionPath"
variant=
"default"
class=
"gl-mr-3 js-latest-version"
class=
"gl-mr-3 js-latest-version"
>
>
{{ __('Show latest version') }}
{{ __('Show latest version') }}
</gl-deprecated-button>
</gl-button>
<gl-deprecated-button
v-show=
"hasCollapsedFile"
class=
"gl-mr-3"
@
click=
"expandAllFiles"
>
<gl-button
v-show=
"hasCollapsedFile"
variant=
"default"
class=
"gl-mr-3"
@
click=
"expandAllFiles"
>
{{ __('Expand all') }}
{{ __('Expand all') }}
</gl-
deprecated-
button>
</gl-button>
<settings-dropdown
/>
<settings-dropdown
/>
</div>
</div>
</div>
</div>
...
...
changelogs/unreleased/219797-replace-gl-deprecated-button-with-gl-button-in-app-assets-javascri.yml
0 → 100644
View file @
d775d790
---
title
:
Replace deprecated button with new button
merge_request
:
38940
author
:
type
:
other
spec/frontend/diffs/components/compare_versions_spec.js
View file @
d775d790
...
@@ -2,7 +2,6 @@ import { trimText } from 'helpers/text_helper';
...
@@ -2,7 +2,6 @@ import { trimText } from 'helpers/text_helper';
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
CompareVersionsComponent
from
'
~/diffs/components/compare_versions.vue
'
;
import
CompareVersionsComponent
from
'
~/diffs/components/compare_versions.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
createStore
}
from
'
~/mr_notes/stores
'
;
import
{
createStore
}
from
'
~/mr_notes/stores
'
;
import
diffsMockData
from
'
../mock_data/merge_request_diffs
'
;
import
diffsMockData
from
'
../mock_data/merge_request_diffs
'
;
import
getDiffWithCommit
from
'
../mock_data/diff_with_commit
'
;
import
getDiffWithCommit
from
'
../mock_data/diff_with_commit
'
;
...
@@ -51,7 +50,7 @@ describe('CompareVersions', () => {
...
@@ -51,7 +50,7 @@ describe('CompareVersions', () => {
expect
(
treeListBtn
.
exists
()).
toBe
(
true
);
expect
(
treeListBtn
.
exists
()).
toBe
(
true
);
expect
(
treeListBtn
.
attributes
(
'
title
'
)).
toBe
(
'
Hide file browser
'
);
expect
(
treeListBtn
.
attributes
(
'
title
'
)).
toBe
(
'
Hide file browser
'
);
expect
(
treeListBtn
.
find
(
Icon
).
props
(
'
name
'
)).
toBe
(
'
file-tree
'
);
expect
(
treeListBtn
.
props
(
'
icon
'
)).
toBe
(
'
file-tree
'
);
});
});
it
(
'
should render comparison dropdowns with correct values
'
,
()
=>
{
it
(
'
should render comparison dropdowns with correct values
'
,
()
=>
{
...
...
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