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
b93d6cac
Commit
b93d6cac
authored
Nov 04, 2020
by
Marvin Karegyeya
Committed by
Olena Horal-Koretska
Nov 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace GlDeprecatedDropdown with GlDropdown in error_tracking
parent
d91805b8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
80 deletions
+74
-80
app/assets/javascripts/error_tracking/components/error_details.vue
...s/javascripts/error_tracking/components/error_details.vue
+17
-17
app/assets/javascripts/error_tracking/components/error_tracking_list.vue
...scripts/error_tracking/components/error_tracking_list.vue
+26
-31
app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue
...s/error_tracking_settings/components/project_dropdown.vue
+8
-8
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-er.yml
...Dropdown-with-GlDropdown-in-app-assets-javascripts-er.yml
+5
-0
spec/frontend/error_tracking/components/error_tracking_list_spec.js
...end/error_tracking/components/error_tracking_list_spec.js
+11
-17
spec/frontend/error_tracking_settings/components/project_dropdown_spec.js
...ror_tracking_settings/components/project_dropdown_spec.js
+7
-7
No files found.
app/assets/javascripts/error_tracking/components/error_details.vue
View file @
b93d6cac
...
...
@@ -8,9 +8,9 @@ import {
GlBadge
,
GlAlert
,
GlSprintf
,
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlD
eprecatedD
ropdownDivider
,
GlDropdown
,
GlDropdownItem
,
GlDropdownDivider
,
GlIcon
,
}
from
'
@gitlab/ui
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
...
...
@@ -43,9 +43,9 @@ export default {
GlBadge
,
GlAlert
,
GlSprintf
,
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlD
eprecatedD
ropdownDivider
,
GlDropdown
,
GlDropdownItem
,
GlDropdownDivider
,
TimeAgoTooltip
,
},
directives
:
{
...
...
@@ -331,38 +331,38 @@ export default {
</gl-button>
</form>
</div>
<gl-d
eprecated-d
ropdown
<gl-dropdown
text=
"Options"
class=
"error-details-options d-md-none"
right
:disabled=
"issueUpdateInProgress"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
data-qa-selector=
"update_ignore_status_button"
@
click=
"onIgnoreStatusUpdate"
>
{{ ignoreBtnLabel }}
</gl-d
eprecated-d
ropdown-item
>
{{ ignoreBtnLabel }}
</gl-dropdown-item
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
data-qa-selector=
"update_resolve_status_button"
@
click=
"onResolveStatusUpdate"
>
{{ resolveBtnLabel }}
</gl-d
eprecated-d
ropdown-item
>
{{ resolveBtnLabel }}
</gl-dropdown-item
>
<gl-d
eprecated-d
ropdown-divider
/>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-divider
/>
<gl-dropdown-item
v-if=
"error.gitlabIssuePath"
data-qa-selector=
"view_issue_button"
:href=
"error.gitlabIssuePath"
variant=
"success"
>
{{ __('View issue') }}
</gl-d
eprecated-d
ropdown-item
>
{{ __('View issue') }}
</gl-dropdown-item
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-if=
"!error.gitlabIssuePath"
:loading=
"issueCreationInProgress"
data-qa-selector=
"create_issue_button"
@
click=
"createIssue"
>
{{ __('Create issue') }}
</gl-d
eprecated-d
ropdown-item
>
{{ __('Create issue') }}
</gl-dropdown-item
>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</div>
</div>
<div>
...
...
app/assets/javascripts/error_tracking/components/error_tracking_list.vue
View file @
b93d6cac
...
...
@@ -8,9 +8,9 @@ import {
GlLoadingIcon
,
GlTable
,
GlFormInput
,
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlD
eprecatedD
ropdownDivider
,
GlDropdown
,
GlDropdownItem
,
GlDropdownDivider
,
GlTooltipDirective
,
GlPagination
,
}
from
'
@gitlab/ui
'
;
...
...
@@ -72,9 +72,9 @@ export default {
components
:
{
GlEmptyState
,
GlButton
,
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlD
eprecatedD
ropdownDivider
,
GlDropdown
,
GlDropdownItem
,
GlDropdownDivider
,
GlIcon
,
GlLink
,
GlLoadingIcon
,
...
...
@@ -233,30 +233,30 @@ export default {
>
<div
class=
"search-box flex-fill mb-1 mb-md-0"
>
<div
class=
"filtered-search-box mb-0"
>
<gl-d
eprecated-d
ropdown
<gl-dropdown
:text=
"__('Recent searches')"
class=
"filtered-search-history-dropdown-wrapper"
toggle-class=
"filtered-search-history-dropdown-toggle-button"
toggle-class=
"filtered-search-history-dropdown-toggle-button
gl-shadow-none! gl-border-r-gray-200! gl-border-1! gl-rounded-0!
"
:disabled=
"loading"
>
<div
v-if=
"!$options.hasLocalStorage"
class=
"px-3"
>
{{
__
(
'
This feature requires local storage to be enabled
'
)
}}
</div>
<template
v-else-if=
"recentSearches.length > 0"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"searchQuery in recentSearches"
:key=
"searchQuery"
@
click=
"setSearchText(searchQuery)"
>
{{
searchQuery
}}
</gl-d
eprecated-d
ropdown-item>
<gl-d
eprecated-d
ropdown-divider
/>
<gl-d
eprecated-d
ropdown-item
ref=
"clearRecentSearches"
@
click=
"clearRecentSearches"
</gl-dropdown-item>
<gl-dropdown-divider
/>
<gl-dropdown-item
ref=
"clearRecentSearches"
@
click=
"clearRecentSearches"
>
{{
__
(
'
Clear recent searches
'
)
}}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</
template
>
<div
v-else
class=
"px-3"
>
{{ __("You don't have any recent searches") }}
</div>
</gl-d
eprecated-d
ropdown>
<div
class=
"filtered-search-input-container
flex-fill
"
>
</gl-dropdown>
<div
class=
"filtered-search-input-container
gl-flex-fill-1
"
>
<gl-form-input
v-model=
"errorSearchQuery"
class=
"pl-2 filtered-search"
...
...
@@ -280,49 +280,44 @@ export default {
</div>
</div>
<gl-d
eprecated-d
ropdown
<gl-dropdown
:text=
"$options.statusFilters[statusFilter]"
class=
"status-dropdown mx-md-1 mb-1 mb-md-0"
menu-class=
"dropdown"
:disabled=
"loading"
right
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"(label, status) in $options.statusFilters"
:key=
"status"
@
click=
"filterErrors(status, label)"
>
<span
class=
"d-flex"
>
<gl-icon
class=
"
flex-shrink-0 append-right-4
"
class=
"
gl-new-dropdown-item-check-icon
"
:class=
"{ invisible: !isCurrentStatusFilter(status) }"
name=
"mobile-issue-close"
/>
{{ label }}
</span>
</gl-d
eprecated-d
ropdown-item>
</gl-d
eprecated-d
ropdown>
</gl-dropdown-item>
</gl-dropdown>
<gl-deprecated-dropdown
:text=
"$options.sortFields[sortField]"
left
:disabled=
"loading"
menu-class=
"dropdown"
>
<gl-deprecated-dropdown-item
<gl-dropdown
:text=
"$options.sortFields[sortField]"
right
:disabled=
"loading"
>
<gl-dropdown-item
v-for=
"(label, field) in $options.sortFields"
:key=
"field"
@
click=
"sortByField(field)"
>
<span
class=
"d-flex"
>
<gl-icon
class=
"
flex-shrink-0 append-right-4
"
class=
"
gl-new-dropdown-item-check-icon
"
:class=
"{ invisible: !isCurrentSortField(field) }"
name=
"mobile-issue-close"
/>
{{ label }}
</span>
</gl-d
eprecated-d
ropdown-item>
</gl-d
eprecated-d
ropdown>
</gl-dropdown-item>
</gl-dropdown>
</div>
<div
v-if=
"loading"
class=
"py-3"
>
...
...
app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue
View file @
b93d6cac
<
script
>
import
{
GlD
eprecatedDropdown
,
GlDeprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
getDisplayName
}
from
'
../utils
'
;
export
default
{
components
:
{
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdown
,
GlDropdownItem
,
},
props
:
{
dropdownLabel
:
{
...
...
@@ -52,22 +52,22 @@ export default {
<div
:class=
"
{ 'gl-show-field-errors': isProjectInvalid }">
<label
class=
"label-bold"
for=
"project-dropdown"
>
{{
__
(
'
Project
'
)
}}
</label>
<div
class=
"row"
>
<gl-d
eprecated-d
ropdown
<gl-dropdown
id=
"project-dropdown"
class=
"col-8 col-md-9 gl-pr-0"
:disabled=
"!hasProjects"
menu-class=
"w-100 mw-100"
toggle-class=
"dropdown-menu-toggle
w-100
gl-field-error-outline"
toggle-class=
"dropdown-menu-toggle gl-field-error-outline"
:text=
"dropdownLabel"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"project in projects"
:key=
"`$
{project.organizationSlug}.${project.slug}`"
class="w-100"
@click="$emit('select-project', project)"
>
{{
getDisplayName
(
project
)
}}
</gl-d
eprecated-d
ropdown-item
>
{{
getDisplayName
(
project
)
}}
</gl-dropdown-item
>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</div>
<p
v-if=
"isProjectInvalid"
class=
"js-project-dropdown-error gl-field-error"
>
{{
invalidProjectLabel
}}
...
...
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-er.yml
0 → 100644
View file @
b93d6cac
---
title
:
Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/error_tracking
merge_request
:
41420
author
:
nuwe1
type
:
other
spec/frontend/error_tracking/components/error_tracking_list_spec.js
View file @
b93d6cac
import
{
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
GlEmptyState
,
GlLoadingIcon
,
GlFormInput
,
GlPagination
,
GlDeprecatedDropdown
,
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlLoadingIcon
,
GlFormInput
,
GlPagination
,
GlDropdown
}
from
'
@gitlab/ui
'
;
import
stubChildren
from
'
helpers/stub_children
'
;
import
ErrorTrackingList
from
'
~/error_tracking/components/error_tracking_list.vue
'
;
import
ErrorTrackingActions
from
'
~/error_tracking/components/error_tracking_actions.vue
'
;
...
...
@@ -24,19 +18,19 @@ describe('ErrorTrackingList', () => {
const
findErrorListTable
=
()
=>
wrapper
.
find
(
'
table
'
);
const
findErrorListRows
=
()
=>
wrapper
.
findAll
(
'
tbody tr
'
);
const
dropdownsArray
=
()
=>
wrapper
.
findAll
(
GlD
eprecatedD
ropdown
);
const
dropdownsArray
=
()
=>
wrapper
.
findAll
(
GlDropdown
);
const
findRecentSearchesDropdown
=
()
=>
dropdownsArray
()
.
at
(
0
)
.
find
(
GlD
eprecatedD
ropdown
);
.
find
(
GlDropdown
);
const
findStatusFilterDropdown
=
()
=>
dropdownsArray
()
.
at
(
1
)
.
find
(
GlD
eprecatedD
ropdown
);
.
find
(
GlDropdown
);
const
findSortDropdown
=
()
=>
dropdownsArray
()
.
at
(
2
)
.
find
(
GlD
eprecatedD
ropdown
);
.
find
(
GlDropdown
);
const
findLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
const
findErrorActions
=
()
=>
wrapper
.
find
(
ErrorTrackingActions
);
...
...
@@ -134,8 +128,8 @@ describe('ErrorTrackingList', () => {
mountComponent
({
stubs
:
{
GlTable
:
false
,
GlD
eprecatedD
ropdown
:
false
,
GlD
eprecatedD
ropdownItem
:
false
,
GlDropdown
:
false
,
GlDropdownItem
:
false
,
GlLink
:
false
,
},
});
...
...
@@ -205,8 +199,8 @@ describe('ErrorTrackingList', () => {
mountComponent
({
stubs
:
{
GlTable
:
false
,
GlD
eprecatedD
ropdown
:
false
,
GlD
eprecatedD
ropdownItem
:
false
,
GlDropdown
:
false
,
GlDropdownItem
:
false
,
},
});
});
...
...
@@ -325,8 +319,8 @@ describe('ErrorTrackingList', () => {
beforeEach
(()
=>
{
mountComponent
({
stubs
:
{
GlD
eprecatedD
ropdown
:
false
,
GlD
eprecatedD
ropdownItem
:
false
,
GlDropdown
:
false
,
GlDropdownItem
:
false
,
},
});
});
...
...
spec/frontend/error_tracking_settings/components/project_dropdown_spec.js
View file @
b93d6cac
import
{
pick
,
clone
}
from
'
lodash
'
;
import
Vuex
from
'
vuex
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecatedDropdown
,
GlDeprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
import
ProjectDropdown
from
'
~/error_tracking_settings/components/project_dropdown.vue
'
;
import
{
defaultProps
,
projectList
,
staleProject
}
from
'
../mock
'
;
...
...
@@ -43,7 +43,7 @@ describe('error tracking settings project dropdown', () => {
describe
(
'
empty project list
'
,
()
=>
{
it
(
'
renders the dropdown
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
#project-dropdown
'
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdown
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
find
(
GlDropdown
).
exists
()).
toBeTruthy
();
});
it
(
'
shows helper text
'
,
()
=>
{
...
...
@@ -58,8 +58,8 @@ describe('error tracking settings project dropdown', () => {
});
it
(
'
does not contain any dropdown items
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdownItem
).
exists
()).
toBeFalsy
();
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdown
).
props
(
'
text
'
)).
toBe
(
'
No projects available
'
);
expect
(
wrapper
.
find
(
GlDropdownItem
).
exists
()).
toBeFalsy
();
expect
(
wrapper
.
find
(
GlDropdown
).
props
(
'
text
'
)).
toBe
(
'
No projects available
'
);
});
});
...
...
@@ -72,12 +72,12 @@ describe('error tracking settings project dropdown', () => {
it
(
'
renders the dropdown
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
#project-dropdown
'
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdown
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
find
(
GlDropdown
).
exists
()).
toBeTruthy
();
});
it
(
'
contains a number of dropdown items
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdownItem
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
findAll
(
GlD
eprecatedD
ropdownItem
).
length
).
toBe
(
2
);
expect
(
wrapper
.
find
(
GlDropdownItem
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
findAll
(
GlDropdownItem
).
length
).
toBe
(
2
);
});
});
...
...
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