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
7dfa31d5
Commit
7dfa31d5
authored
Oct 02, 2020
by
Marvin Karegyeya
Committed by
Jacques Erasmus
Oct 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace deprecated cluster dropdowns with updated dropdowns
parent
73c45fac
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
57 deletions
+48
-57
app/assets/javascripts/clusters/components/crossplane_provider_stack.vue
...scripts/clusters/components/crossplane_provider_stack.vue
+7
-11
app/assets/javascripts/clusters/components/fluentd_output_settings.vue
...vascripts/clusters/components/fluentd_output_settings.vue
+7
-13
app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue
...ipts/clusters/components/ingress_modsecurity_settings.vue
+8
-12
app/assets/javascripts/clusters/components/knative_domain_editor.vue
...javascripts/clusters/components/knative_domain_editor.vue
+13
-13
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-cl.yml
...Dropdown-with-GlDropdown-in-app-assets-javascripts-cl.yml
+5
-0
spec/frontend/clusters/components/fluentd_output_settings_spec.js
...ntend/clusters/components/fluentd_output_settings_spec.js
+2
-2
spec/frontend/clusters/components/ingress_modsecurity_settings_spec.js
.../clusters/components/ingress_modsecurity_settings_spec.js
+2
-2
spec/frontend/clusters/components/knative_domain_editor_spec.js
...rontend/clusters/components/knative_domain_editor_spec.js
+2
-2
spec/frontend/clusters/services/crossplane_provider_stack_spec.js
...ntend/clusters/services/crossplane_provider_stack_spec.js
+2
-2
No files found.
app/assets/javascripts/clusters/components/crossplane_provider_stack.vue
View file @
7dfa31d5
<
script
>
<
script
>
import
{
GlD
eprecatedDropdown
,
GlDeprecated
DropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
Gl
DropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
../../locale
'
;
import
{
s__
}
from
'
../../locale
'
;
export
default
{
export
default
{
name
:
'
CrossplaneProviderStack
'
,
name
:
'
CrossplaneProviderStack
'
,
components
:
{
components
:
{
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlIcon
,
GlIcon
,
},
},
props
:
{
props
:
{
...
@@ -67,21 +67,17 @@ export default {
...
@@ -67,21 +67,17 @@ export default {
<label>
<label>
{{
s__
(
'
ClusterIntegration|Enabled stack
'
)
}}
{{
s__
(
'
ClusterIntegration|Enabled stack
'
)
}}
</label>
</label>
<gl-d
eprecated-d
ropdown
<gl-dropdown
:disabled=
"crossplane.installed"
:disabled=
"crossplane.installed"
:text=
"dropdownText"
:text=
"dropdownText"
toggle-class=
"dropdown-menu-toggle gl-field-error-outline"
toggle-class=
"dropdown-menu-toggle gl-field-error-outline"
class=
"w-100"
class=
"w-100"
:class=
"
{ 'gl-show-field-errors': validationError }"
:class=
"
{ 'gl-show-field-errors': validationError }"
>
>
<gl-deprecated-dropdown-item
<gl-dropdown-item
v-for=
"stack in stacks"
:key=
"stack.code"
@
click=
"selectStack(stack)"
>
v-for=
"stack in stacks"
:key=
"stack.code"
@
click=
"selectStack(stack)"
>
<span
class=
"ml-1"
>
{{
stack
.
name
}}
</span>
<span
class=
"ml-1"
>
{{
stack
.
name
}}
</span>
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
<span
v-if=
"validationError"
class=
"gl-field-error"
>
{{
validationError
}}
</span>
<span
v-if=
"validationError"
class=
"gl-field-error"
>
{{
validationError
}}
</span>
<p
class=
"form-text text-muted"
>
<p
class=
"form-text text-muted"
>
{{
s__
(
`You must select a stack for configuring your cloud provider. Learn more about`
)
}}
{{
s__
(
`You must select a stack for configuring your cloud provider. Learn more about`
)
}}
...
...
app/assets/javascripts/clusters/components/fluentd_output_settings.vue
View file @
7dfa31d5
<
script
>
<
script
>
import
{
import
{
GlAlert
,
GlButton
,
GlDropdown
,
GlDropdownItem
,
GlFormCheckbox
}
from
'
@gitlab/ui
'
;
GlAlert
,
GlButton
,
GlDeprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlFormCheckbox
,
}
from
'
@gitlab/ui
'
;
import
{
mapValues
}
from
'
lodash
'
;
import
{
mapValues
}
from
'
lodash
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
APPLICATION_STATUS
,
FLUENTD
}
from
'
~/clusters/constants
'
;
import
{
APPLICATION_STATUS
,
FLUENTD
}
from
'
~/clusters/constants
'
;
...
@@ -17,8 +11,8 @@ export default {
...
@@ -17,8 +11,8 @@ export default {
components
:
{
components
:
{
GlAlert
,
GlAlert
,
GlButton
,
GlButton
,
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlFormCheckbox
,
GlFormCheckbox
,
},
},
props
:
{
props
:
{
...
@@ -203,15 +197,15 @@ export default {
...
@@ -203,15 +197,15 @@ export default {
<label
for=
"fluentd-protocol"
>
<label
for=
"fluentd-protocol"
>
<strong>
{{
s__
(
'
ClusterIntegration|SIEM Protocol
'
)
}}
</strong>
<strong>
{{
s__
(
'
ClusterIntegration|SIEM Protocol
'
)
}}
</strong>
</label>
</label>
<gl-d
eprecated-d
ropdown
:text=
"protocolName"
class=
"w-100"
>
<gl-dropdown
:text=
"protocolName"
class=
"w-100"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"(value, index) in protocols"
v-for=
"(value, index) in protocols"
:key=
"index"
:key=
"index"
@
click=
"selectProtocol(value.toLowerCase())"
@
click=
"selectProtocol(value.toLowerCase())"
>
>
{{
value
}}
{{
value
}}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</div>
</div>
<div
class=
"form-group flex flex-wrap"
>
<div
class=
"form-group flex flex-wrap"
>
<gl-form-checkbox
:checked=
"wafLogEnabled"
@
input=
"wafLogChanged"
>
<gl-form-checkbox
:checked=
"wafLogEnabled"
@
input=
"wafLogChanged"
>
...
...
app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue
View file @
7dfa31d5
...
@@ -6,8 +6,8 @@ import {
...
@@ -6,8 +6,8 @@ import {
GlLink
,
GlLink
,
GlToggle
,
GlToggle
,
GlButton
,
GlButton
,
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlIcon
,
GlIcon
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
modSecurityLogo
from
'
images/cluster_app_logos/gitlab.png
'
;
import
modSecurityLogo
from
'
images/cluster_app_logos/gitlab.png
'
;
...
@@ -26,8 +26,8 @@ export default {
...
@@ -26,8 +26,8 @@ export default {
GlLink
,
GlLink
,
GlToggle
,
GlToggle
,
GlButton
,
GlButton
,
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlIcon
,
GlIcon
,
},
},
props
:
{
props
:
{
...
@@ -221,15 +221,11 @@ export default {
...
@@ -221,15 +221,11 @@ export default {
</strong>
</strong>
</p>
</p>
</div>
</div>
<gl-deprecated-dropdown
:text=
"modSecurityModeName"
:disabled=
"saveButtonDisabled"
>
<gl-dropdown
:text=
"modSecurityModeName"
:disabled=
"saveButtonDisabled"
>
<gl-deprecated-dropdown-item
<gl-dropdown-item
v-for=
"(mode, key) in modes"
:key=
"key"
@
click=
"selectMode(key)"
>
v-for=
"(mode, key) in modes"
:key=
"key"
@
click=
"selectMode(key)"
>
{{ mode.name }}
{{ mode.name }}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</div>
</div>
</div>
</div>
<div
v-if=
"showButtons"
class=
"gl-mt-5 gl-display-flex"
>
<div
v-if=
"showButtons"
class=
"gl-mt-5 gl-display-flex"
>
...
...
app/assets/javascripts/clusters/components/knative_domain_editor.vue
View file @
7dfa31d5
<
script
>
<
script
>
import
{
import
{
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownDivider
,
GlDropdownDivider
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlLoadingIcon
,
GlLoadingIcon
,
GlSearchBoxByType
,
GlSearchBoxByType
,
GlSprintf
,
GlSprintf
,
...
@@ -20,9 +20,9 @@ export default {
...
@@ -20,9 +20,9 @@ export default {
GlButton
,
GlButton
,
ClipboardButton
,
ClipboardButton
,
GlLoadingIcon
,
GlLoadingIcon
,
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownDivider
,
GlDropdownDivider
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlSearchBoxByType
,
GlSearchBoxByType
,
GlSprintf
,
GlSprintf
,
},
},
...
@@ -121,7 +121,7 @@ export default {
...
@@ -121,7 +121,7 @@ export default {
<strong>
{{
s__
(
'
ClusterIntegration|Knative Domain Name:
'
)
}}
</strong>
<strong>
{{
s__
(
'
ClusterIntegration|Knative Domain Name:
'
)
}}
</strong>
</label>
</label>
<gl-d
eprecated-d
ropdown
<gl-dropdown
v-if=
"showDomainsDropdown"
v-if=
"showDomainsDropdown"
:text=
"domainDropdownText"
:text=
"domainDropdownText"
toggle-class=
"dropdown-menu-toggle"
toggle-class=
"dropdown-menu-toggle"
...
@@ -132,16 +132,16 @@ export default {
...
@@ -132,16 +132,16 @@ export default {
:placeholder=
"s__('ClusterIntegration|Search domains')"
:placeholder=
"s__('ClusterIntegration|Search domains')"
class=
"gl-m-3"
class=
"gl-m-3"
/>
/>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"domain in filteredDomains"
v-for=
"domain in filteredDomains"
:key=
"domain.id"
:key=
"domain.id"
@
click=
"selectDomain(domain)"
@
click=
"selectDomain(domain)"
>
>
<span
class=
"ml-1"
>
{{
domain
.
domain
}}
</span>
<span
class=
"ml-1"
>
{{
domain
.
domain
}}
</span>
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
<template
v-if=
"searchQuery"
>
<template
v-if=
"searchQuery"
>
<gl-d
eprecated-d
ropdown-divider
/>
<gl-dropdown-divider
/>
<gl-d
eprecated-d
ropdown-item
key=
"custom-domain"
@
click=
"selectCustomDomain(searchQuery)"
>
<gl-dropdown-item
key=
"custom-domain"
@
click=
"selectCustomDomain(searchQuery)"
>
<span
class=
"ml-1"
>
<span
class=
"ml-1"
>
<gl-sprintf
:message=
"s__('ClusterIntegration|Use %
{query}')">
<gl-sprintf
:message=
"s__('ClusterIntegration|Use %
{query}')">
<template
#query
>
<template
#query
>
...
@@ -149,9 +149,9 @@ export default {
...
@@ -149,9 +149,9 @@ export default {
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</span>
</span>
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</template>
</template>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
<input
<input
v-else
v-else
...
...
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-cl.yml
0 → 100644
View file @
7dfa31d5
---
title
:
Replace deprecated cluster dropdowns with updated dropdowns
merge_request
:
41414
author
:
nuwe1
type
:
other
spec/frontend/clusters/components/fluentd_output_settings_spec.js
View file @
7dfa31d5
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlAlert
,
GlD
eprecatedD
ropdown
,
GlFormCheckbox
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlDropdown
,
GlFormCheckbox
}
from
'
@gitlab/ui
'
;
import
FluentdOutputSettings
from
'
~/clusters/components/fluentd_output_settings.vue
'
;
import
FluentdOutputSettings
from
'
~/clusters/components/fluentd_output_settings.vue
'
;
import
{
APPLICATION_STATUS
,
FLUENTD
}
from
'
~/clusters/constants
'
;
import
{
APPLICATION_STATUS
,
FLUENTD
}
from
'
~/clusters/constants
'
;
import
eventHub
from
'
~/clusters/event_hub
'
;
import
eventHub
from
'
~/clusters/event_hub
'
;
...
@@ -36,7 +36,7 @@ describe('FluentdOutputSettings', () => {
...
@@ -36,7 +36,7 @@ describe('FluentdOutputSettings', () => {
};
};
const
findSaveButton
=
()
=>
wrapper
.
find
({
ref
:
'
saveBtn
'
});
const
findSaveButton
=
()
=>
wrapper
.
find
({
ref
:
'
saveBtn
'
});
const
findCancelButton
=
()
=>
wrapper
.
find
({
ref
:
'
cancelBtn
'
});
const
findCancelButton
=
()
=>
wrapper
.
find
({
ref
:
'
cancelBtn
'
});
const
findProtocolDropdown
=
()
=>
wrapper
.
find
(
GlD
eprecatedD
ropdown
);
const
findProtocolDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findCheckbox
=
name
=>
const
findCheckbox
=
name
=>
wrapper
.
findAll
(
GlFormCheckbox
).
wrappers
.
find
(
x
=>
x
.
text
()
===
name
);
wrapper
.
findAll
(
GlFormCheckbox
).
wrappers
.
find
(
x
=>
x
.
text
()
===
name
);
const
findHost
=
()
=>
wrapper
.
find
(
'
#fluentd-host
'
);
const
findHost
=
()
=>
wrapper
.
find
(
'
#fluentd-host
'
);
...
...
spec/frontend/clusters/components/ingress_modsecurity_settings_spec.js
View file @
7dfa31d5
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlAlert
,
GlToggle
,
GlD
eprecatedD
ropdown
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlToggle
,
GlDropdown
}
from
'
@gitlab/ui
'
;
import
IngressModsecuritySettings
from
'
~/clusters/components/ingress_modsecurity_settings.vue
'
;
import
IngressModsecuritySettings
from
'
~/clusters/components/ingress_modsecurity_settings.vue
'
;
import
{
APPLICATION_STATUS
,
INGRESS
}
from
'
~/clusters/constants
'
;
import
{
APPLICATION_STATUS
,
INGRESS
}
from
'
~/clusters/constants
'
;
import
eventHub
from
'
~/clusters/event_hub
'
;
import
eventHub
from
'
~/clusters/event_hub
'
;
...
@@ -33,7 +33,7 @@ describe('IngressModsecuritySettings', () => {
...
@@ -33,7 +33,7 @@ describe('IngressModsecuritySettings', () => {
const
findCancelButton
=
()
=>
const
findCancelButton
=
()
=>
wrapper
.
find
(
'
[data-qa-selector="cancel_ingress_modsecurity_settings"]
'
);
wrapper
.
find
(
'
[data-qa-selector="cancel_ingress_modsecurity_settings"]
'
);
const
findModSecurityToggle
=
()
=>
wrapper
.
find
(
GlToggle
);
const
findModSecurityToggle
=
()
=>
wrapper
.
find
(
GlToggle
);
const
findModSecurityDropdown
=
()
=>
wrapper
.
find
(
GlD
eprecatedD
ropdown
);
const
findModSecurityDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
describe
(
'
when ingress is installed
'
,
()
=>
{
describe
(
'
when ingress is installed
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
...
spec/frontend/clusters/components/knative_domain_editor_spec.js
View file @
7dfa31d5
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecatedD
ropdownItem
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlDropdownItem
,
GlButton
}
from
'
@gitlab/ui
'
;
import
KnativeDomainEditor
from
'
~/clusters/components/knative_domain_editor.vue
'
;
import
KnativeDomainEditor
from
'
~/clusters/components/knative_domain_editor.vue
'
;
import
{
APPLICATION_STATUS
}
from
'
~/clusters/constants
'
;
import
{
APPLICATION_STATUS
}
from
'
~/clusters/constants
'
;
...
@@ -112,7 +112,7 @@ describe('KnativeDomainEditor', () => {
...
@@ -112,7 +112,7 @@ describe('KnativeDomainEditor', () => {
createComponent
({
knative
:
{
...
knative
,
availableDomains
:
[
newDomain
]
}
});
createComponent
({
knative
:
{
...
knative
,
availableDomains
:
[
newDomain
]
}
});
jest
.
spyOn
(
wrapper
.
vm
,
'
selectDomain
'
);
jest
.
spyOn
(
wrapper
.
vm
,
'
selectDomain
'
);
wrapper
.
find
(
GlD
eprecatedD
ropdownItem
).
vm
.
$emit
(
'
click
'
);
wrapper
.
find
(
GlDropdownItem
).
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
vm
.
selectDomain
).
toHaveBeenCalledWith
(
newDomain
);
expect
(
wrapper
.
vm
.
selectDomain
).
toHaveBeenCalledWith
(
newDomain
);
...
...
spec/frontend/clusters/services/crossplane_provider_stack_spec.js
View file @
7dfa31d5
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecatedD
ropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlDropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
CrossplaneProviderStack
from
'
~/clusters/components/crossplane_provider_stack.vue
'
;
import
CrossplaneProviderStack
from
'
~/clusters/components/crossplane_provider_stack.vue
'
;
describe
(
'
CrossplaneProviderStack component
'
,
()
=>
{
describe
(
'
CrossplaneProviderStack component
'
,
()
=>
{
...
@@ -37,7 +37,7 @@ describe('CrossplaneProviderStack component', () => {
...
@@ -37,7 +37,7 @@ describe('CrossplaneProviderStack component', () => {
createComponent
({
crossplane
});
createComponent
({
crossplane
});
});
});
const
findDropdownElements
=
()
=>
wrapper
.
findAll
(
GlD
eprecatedD
ropdownItem
);
const
findDropdownElements
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
findFirstDropdownElement
=
()
=>
findDropdownElements
().
at
(
0
);
const
findFirstDropdownElement
=
()
=>
findDropdownElements
().
at
(
0
);
afterEach
(()
=>
{
afterEach
(()
=>
{
...
...
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