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
28d65da6
Commit
28d65da6
authored
Jun 17, 2020
by
Justin Ho
Committed by
Lukas Eipert
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OverrideDropdown to toggle state
parent
b16a0701
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
app/assets/javascripts/integrations/edit/components/integration_form.vue
...scripts/integrations/edit/components/integration_form.vue
+6
-0
app/assets/javascripts/integrations/edit/components/override_dropdown.vue
...cripts/integrations/edit/components/override_dropdown.vue
+56
-0
No files found.
app/assets/javascripts/integrations/edit/components/integration_form.vue
View file @
28d65da6
<
script
>
import
{
mapState
}
from
'
vuex
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
OverrideDropdown
from
'
./override_dropdown.vue
'
;
import
ActiveToggle
from
'
./active_toggle.vue
'
;
import
JiraTriggerFields
from
'
./jira_trigger_fields.vue
'
;
import
JiraIssuesFields
from
'
./jira_issues_fields.vue
'
;
...
...
@@ -9,6 +12,7 @@ import DynamicField from './dynamic_field.vue';
export
default
{
name
:
'
IntegrationForm
'
,
components
:
{
OverrideDropdown
,
ActiveToggle
,
JiraTriggerFields
,
JiraIssuesFields
,
...
...
@@ -49,6 +53,7 @@ export default {
},
},
computed
:
{
...
mapState
([
'
overrideAvailable
'
]),
isJira
()
{
return
this
.
type
===
'
jira
'
;
},
...
...
@@ -61,6 +66,7 @@ export default {
<
template
>
<div>
<override-dropdown
v-if=
"overrideAvailable"
/>
<active-toggle
v-if=
"showActive"
v-bind=
"activeToggleProps"
/>
<jira-trigger-fields
v-if=
"isJira"
v-bind=
"triggerFieldsProps"
/>
<trigger-fields
v-else-if=
"triggerEvents.length"
:events=
"triggerEvents"
:type=
"type"
/>
...
...
app/assets/javascripts/integrations/edit/components/override_dropdown.vue
0 → 100644
View file @
28d65da6
<
script
>
import
{
__
}
from
'
~/locale
'
;
import
{
mapState
}
from
'
vuex
'
;
import
{
GlNewDropdown
,
GlNewDropdownItem
}
from
'
@gitlab/ui
'
;
const
options
=
[
{
value
:
'
instance
'
,
text
:
__
(
'
Use instance level settings
'
),
},
{
value
:
'
project
'
,
text
:
__
(
'
Use custom settings
'
),
},
];
const
defaultOption
=
options
[
0
];
const
customOption
=
options
[
1
];
export
default
{
name
:
'
OverrideDropdown
'
,
components
:
{
GlNewDropdown
,
GlNewDropdownItem
,
},
props
:
{},
data
()
{
return
{
options
,
selected
:
defaultOption
,
};
},
computed
:
{
...
mapState
([
'
override
'
]),
},
methods
:
{
onClick
(
option
)
{
this
.
selected
=
option
;
this
.
$store
.
dispatch
(
'
setOverride
'
,
option
===
customOption
);
},
},
};
</
script
>
<
template
>
<div
class=
"gl-display-flex gl-justify-content-space-between gl-align-items-baseline gl-py-4 gl-mt-5 gl-mb-6 gl-border-t-1 gl-border-t-solid gl-border-b-1 gl-border-b-solid gl-border-gray-100"
>
<span>
{{
__
(
'
This integration has multiple settings available.
'
)
}}
</span>
<gl-new-dropdown
:text=
"selected.text"
>
<gl-new-dropdown-item
v-for=
"option in options"
:key=
"option.value"
@
click=
"onClick(option)"
>
{{
option
.
text
}}
</gl-new-dropdown-item>
</gl-new-dropdown>
</div>
</
template
>
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