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
7849def4
Commit
7849def4
authored
Sep 17, 2020
by
Matthew Nearents
Committed by
Vitaly Slobodin
Sep 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GlDropdown geo node form
parent
3d9f7a44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
17 deletions
+23
-17
ee/app/assets/javascripts/geo_node_form/components/geo_node_form_namespaces.vue
...pts/geo_node_form/components/geo_node_form_namespaces.vue
+19
-13
ee/spec/frontend/geo_node_form/components/geo_node_form_namespaces_spec.js
...geo_node_form/components/geo_node_form_namespaces_spec.js
+4
-4
No files found.
ee/app/assets/javascripts/geo_node_form/components/geo_node_form_namespaces.vue
View file @
7849def4
<
script
>
import
{
GlIcon
,
GlSearchBoxByType
,
GlD
eprecatedDropdown
,
GlDeprecatedButto
n
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlSearchBoxByType
,
GlD
ropdow
n
}
from
'
@gitlab/ui
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
__
,
n__
}
from
'
~/locale
'
;
import
{
SELECTIVE_SYNC_NAMESPACES
}
from
'
../constants
'
;
...
...
@@ -9,8 +9,7 @@ export default {
components
:
{
GlIcon
,
GlSearchBoxByType
,
GlDeprecatedDropdown
,
GlDeprecatedButton
,
GlDropdown
,
},
props
:
{
selectedNamespaces
:
{
...
...
@@ -48,14 +47,21 @@ export default {
</
script
>
<
template
>
<gl-deprecated-dropdown
:text=
"dropdownTitle"
@
show=
"fetchSyncNamespaces('')"
>
<gl-search-box-by-type
class=
"gl-m-3"
:debounce=
"500"
@
input=
"fetchSyncNamespaces"
/>
<li
v-for=
"namespace in synchronizationNamespaces"
:key=
"namespace.id"
>
<gl-deprecated-button
class=
"d-flex align-items-center"
@
click=
"toggleNamespace(namespace)"
>
<gl-icon
:class=
"[
{ invisible: !isSelected(namespace) }]" name="mobile-issue-close" />
<span
class=
"ml-1"
>
{{
namespace
.
name
}}
</span>
</gl-deprecated-button>
</li>
<div
v-if=
"noSyncNamespaces"
class=
"text-secondary p-2"
>
{{
__
(
'
Nothing found…
'
)
}}
</div>
</gl-deprecated-dropdown>
<gl-dropdown
:text=
"dropdownTitle"
@
show=
"fetchSyncNamespaces('')"
>
<gl-search-box-by-type
class=
".gl-m-3"
:debounce=
"500"
@
input=
"fetchSyncNamespaces"
/>
<button
v-for=
"namespace in synchronizationNamespaces"
:key=
"namespace.id"
class=
"dropdown-item"
type=
"button"
@
click=
"toggleNamespace(namespace)"
>
<gl-icon
:class=
"[
{ 'gl-visibility-hidden': !isSelected(namespace) }]"
name="mobile-issue-close"
/>
<span
class=
"gl-ml-2"
>
{{
namespace
.
name
}}
</span>
</button>
<div
v-if=
"noSyncNamespaces"
class=
"gl-text-gray-500 gl-p-3"
>
{{
__
(
'
Nothing found…
'
)
}}
</div>
</gl-dropdown>
</
template
>
ee/spec/frontend/geo_node_form/components/geo_node_form_namespaces_spec.js
View file @
7849def4
import
Vuex
from
'
vuex
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
,
GlSearchBoxByType
,
GlD
eprecatedD
ropdown
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlSearchBoxByType
,
GlDropdown
}
from
'
@gitlab/ui
'
;
import
GeoNodeFormNamespaces
from
'
ee/geo_node_form/components/geo_node_form_namespaces.vue
'
;
import
{
MOCK_SYNC_NAMESPACES
}
from
'
../mock_data
'
;
...
...
@@ -45,9 +45,9 @@ describe('GeoNodeFormNamespaces', () => {
wrapper
.
destroy
();
});
const
findGlDropdown
=
()
=>
wrapper
.
find
(
GlD
eprecatedD
ropdown
);
const
findGlDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findGlDropdownSearch
=
()
=>
findGlDropdown
().
find
(
GlSearchBoxByType
);
const
findDropdownItems
=
()
=>
findGlDropdown
().
findAll
(
'
li
'
);
const
findDropdownItems
=
()
=>
findGlDropdown
().
findAll
(
'
button
'
);
const
findDropdownItemsText
=
()
=>
findDropdownItems
().
wrappers
.
map
(
w
=>
w
.
text
());
const
findGlIcons
=
()
=>
wrapper
.
findAll
(
GlIcon
);
...
...
@@ -98,7 +98,7 @@ describe('GeoNodeFormNamespaces', () => {
});
it
(
'
hides GlIcon if namespace not in selectedNamespaces
'
,
()
=>
{
expect
(
findGlIcons
().
wrappers
.
every
(
w
=>
w
.
classes
(
'
invisible
'
))).
toBe
(
true
);
expect
(
findGlIcons
().
wrappers
.
every
(
w
=>
w
.
classes
(
'
gl-visibility-hidden
'
))).
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