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
c976e8d3
Commit
c976e8d3
authored
May 14, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor component code
parent
c6c23f3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
app/assets/javascripts/integrations/edit/components/dynamic_field.vue
...avascripts/integrations/edit/components/dynamic_field.vue
+15
-20
No files found.
app/assets/javascripts/integrations/edit/components/dynamic_field.vue
View file @
c976e8d3
...
...
@@ -73,19 +73,18 @@ export default {
return
this
.
isPassword
&&
!
isEmpty
(
this
.
value
);
},
label
()
{
const
title
=
this
.
title
||
startCase
(
this
.
name
);
if
(
this
.
isNonEmptyPassword
)
{
return
sprintf
(
__
(
'
Enter new %{field_title}
'
),
{
field_title
:
this
.
computedT
itle
,
password
:
t
itle
,
});
}
return
t
his
.
computedT
itle
;
return
title
;
},
passwordRequired
()
{
return
isEmpty
(
this
.
value
)
&&
this
.
required
;
},
computedTitle
()
{
return
this
.
title
||
startCase
(
this
.
name
);
},
options
()
{
return
this
.
choices
.
map
(
choice
=>
{
return
{
...
...
@@ -100,6 +99,12 @@ export default {
fieldName
()
{
return
`service[
${
this
.
name
}
]`
;
},
sharedProps
()
{
return
{
id
:
this
.
fieldId
,
name
:
this
.
fieldName
,
};
},
},
created
()
{
if
(
this
.
isNonEmptyPassword
)
{
...
...
@@ -113,29 +118,20 @@ export default {
<gl-form-group
:label=
"label"
:label-for=
"fieldId"
:description=
"help"
>
<template
v-if=
"isCheckbox"
>
<input
:name=
"fieldName"
type=
"hidden"
value=
"false"
/>
<gl-form-checkbox
:id=
"fieldId"
v-model=
"model"
:name=
"fieldName
"
/>
<gl-form-checkbox
v-model=
"model"
v-bind=
"sharedProps
"
/>
</
template
>
<gl-form-select
v-else-if=
"isSelect"
:id=
"fieldId"
v-model=
"model"
:name=
"fieldName"
:options=
"options"
/>
<gl-form-select
v-else-if=
"isSelect"
v-model=
"model"
v-bind=
"sharedProps"
:options=
"options"
/>
<gl-form-textarea
v-else-if=
"isTextarea"
:id=
"fieldId"
v-model=
"model"
:name=
"fieldName
"
v-bind=
"sharedProps
"
:placeholder=
"placeholder"
:required=
"required"
/>
<gl-form-input
v-else-if=
"isPassword"
:id=
"fieldId"
v-model=
"model"
:name=
"fieldName
"
v-bind=
"sharedProps
"
:type=
"type"
autocomplete=
"new-password"
:placeholder=
"placeholder"
...
...
@@ -143,9 +139,8 @@ export default {
/>
<gl-form-input
v-else
:id=
"fieldId"
v-model=
"model"
:name=
"fieldName
"
v-bind=
"sharedProps
"
:type=
"type"
:placeholder=
"placeholder"
:required=
"required"
...
...
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