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
6dda0016
Commit
6dda0016
authored
Sep 29, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
45f0fbcf
ad7b1241
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
43 deletions
+80
-43
app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue
...javascripts/pipeline_new/components/pipeline_new_form.vue
+60
-41
app/assets/stylesheets/utilities.scss
app/assets/stylesheets/utilities.scss
+10
-0
app/views/projects/project_members/import.html.haml
app/views/projects/project_members/import.html.haml
+2
-2
changelogs/unreleased/231072-project-members-import-button.yml
...elogs/unreleased/231072-project-members-import-button.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue
View file @
6dda0016
<
script
>
import
Vue
from
'
vue
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
GlAlert
,
GlIcon
,
GlButton
,
GlForm
,
GlFormGroup
,
...
...
@@ -27,12 +27,13 @@ export default {
variablesDescription
:
s__
(
'
Pipeline|Specify variable values to be used in this run. The values specified in %{linkStart}CI/CD settings%{linkEnd} will be used by default.
'
,
),
formElementClasses
:
'
gl-mr-3 gl-mb-3
table-section section-15
'
,
formElementClasses
:
'
gl-mr-3 gl-mb-3
gl-flex-basis-quarter gl-flex-shrink-0 gl-flex-grow-0
'
,
errorTitle
:
__
(
'
The form contains the following error:
'
),
warningTitle
:
__
(
'
The form contains the following warning:
'
),
maxWarningsSummary
:
__
(
'
%{total} warnings found: showing first %{warningsDisplayed}
'
),
components
:
{
GlAlert
,
GlIcon
,
GlButton
,
GlForm
,
GlFormGroup
,
...
...
@@ -85,7 +86,7 @@ export default {
return
{
searchTerm
:
''
,
refValue
:
this
.
refParam
,
variables
:
{}
,
variables
:
[]
,
error
:
null
,
warnings
:
[],
totalWarnings
:
0
,
...
...
@@ -97,9 +98,6 @@ export default {
const
lowerCasedSearchTerm
=
this
.
searchTerm
.
toLowerCase
();
return
this
.
refs
.
filter
(
ref
=>
ref
.
toLowerCase
().
includes
(
lowerCasedSearchTerm
));
},
variablesLength
()
{
return
Object
.
keys
(
this
.
variables
).
length
;
},
overMaxWarningsLimit
()
{
return
this
.
totalWarnings
>
this
.
maxWarnings
;
},
...
...
@@ -114,6 +112,8 @@ export default {
},
},
created
()
{
this
.
addEmptyVariable
();
if
(
this
.
variableParams
)
{
this
.
setVariableParams
(
VARIABLE_TYPE
,
this
.
variableParams
);
}
...
...
@@ -121,24 +121,26 @@ export default {
if
(
this
.
fileParams
)
{
this
.
setVariableParams
(
FILE_TYPE
,
this
.
fileParams
);
}
this
.
addEmptyVariable
();
},
methods
:
{
addEmptyVariable
()
{
this
.
variables
[
uniqueId
(
'
var
'
)]
=
{
variable_type
:
VARIABLE_TYPE
,
key
:
''
,
value
:
''
,
};
},
setVariableParams
(
type
,
paramsObj
)
{
Object
.
entries
(
paramsObj
).
forEach
(([
key
,
value
])
=>
{
this
.
variables
[
uniqueId
(
'
var
'
)]
=
{
setVariable
(
type
,
key
,
value
)
{
const
variable
=
this
.
variables
.
find
(
v
=>
v
.
key
===
key
);
if
(
variable
)
{
variable
.
type
=
type
;
variable
.
value
=
value
;
}
else
{
// insert before the empty variable
this
.
variables
.
splice
(
this
.
variables
.
length
-
1
,
0
,
{
uniqueId
:
uniqueId
(
'
var
'
),
key
,
value
,
variable_type
:
type
,
};
});
}
},
setVariableParams
(
type
,
paramsObj
)
{
Object
.
entries
(
paramsObj
).
forEach
(([
key
,
value
])
=>
{
this
.
setVariable
(
type
,
key
,
value
);
});
},
setRefSelected
(
ref
)
{
...
...
@@ -147,24 +149,29 @@ export default {
isSelected
(
ref
)
{
return
ref
===
this
.
refValue
;
},
insertNewVariable
()
{
Vue
.
set
(
this
.
variables
,
uniqueId
(
'
var
'
),
{
addEmptyVariable
()
{
this
.
variables
.
push
({
uniqueId
:
uniqueId
(
'
var
'
),
variable_type
:
VARIABLE_TYPE
,
key
:
''
,
value
:
''
,
});
},
removeVariable
(
key
)
{
Vue
.
delete
(
this
.
variables
,
key
);
removeVariable
(
index
)
{
this
.
variables
.
splice
(
index
,
1
);
},
canRemove
(
index
)
{
return
index
<
this
.
variables
L
ength
-
1
;
return
index
<
this
.
variables
.
l
ength
-
1
;
},
createPipeline
()
{
const
filteredVariables
=
Object
.
values
(
this
.
variables
).
filter
(
({
key
,
value
})
=>
key
!==
''
&&
value
!==
''
,
);
const
filteredVariables
=
this
.
variables
.
filter
(({
key
,
value
})
=>
key
!==
''
&&
value
!==
''
)
.
map
(({
variable_type
,
key
,
value
})
=>
({
variable_type
,
key
,
value
,
}));
return
axios
.
post
(
this
.
pipelinesPath
,
{
...
...
@@ -253,35 +260,47 @@ export default {
<gl-form-group
:label=
"s__('Pipeline|Variables')"
>
<div
v-for=
"(va
lue, key
, index) in variables"
:key=
"
key
"
class=
"gl-display-flex gl-align-items-
center gl-mb-4
gl-pb-2 gl-border-b-solid gl-border-gray-200 gl-border-b-1 gl-flex-direction-column gl-md-flex-direction-row"
v-for=
"(va
riable
, index) in variables"
:key=
"
variable.uniqueId
"
class=
"gl-display-flex gl-align-items-
stretch gl-align-items-center gl-mb-4 gl-ml-n3
gl-pb-2 gl-border-b-solid gl-border-gray-200 gl-border-b-1 gl-flex-direction-column gl-md-flex-direction-row"
data-testid=
"ci-variable-row"
>
<gl-form-select
v-model=
"variable
s[key]
.variable_type"
v-model=
"variable.variable_type"
:class=
"$options.formElementClasses"
:options=
"$options.typeOptions"
/>
<gl-form-input
v-model=
"variable
s[key]
.key"
v-model=
"variable.key"
:placeholder=
"s__('CiVariables|Input variable key')"
:class=
"$options.formElementClasses"
data-testid=
"pipeline-form-ci-variable-key"
@
change.once=
"
insertNew
Variable()"
@
change.once=
"
addEmpty
Variable()"
/>
<gl-form-input
v-model=
"variable
s[key]
.value"
v-model=
"variable.value"
:placeholder=
"s__('CiVariables|Input variable value')"
class=
"gl-mr-5 gl-mb-3 table-section section-15"
/>
<gl-button
v-if=
"canRemove(index)"
icon=
"issue-close"
class=
"gl-mb-3"
data-testid=
"remove-ci-variable-row"
@
click=
"removeVariable(key)"
/>
<
template
v-if=
"variables.length > 1"
>
<gl-button
v-if=
"canRemove(index)"
class=
"gl-md-ml-3 gl-mb-3"
data-testid=
"remove-ci-variable-row"
variant=
"danger"
category=
"secondary"
@
click=
"removeVariable(index)"
>
<gl-icon
class=
"gl-mr-0! gl-display-none gl-display-md-block"
name=
"clear"
/>
<span
class=
"gl-display-md-none"
>
{{
s__
(
'
CiVariables|Remove variable
'
)
}}
</span>
</gl-button>
<gl-button
v-else
class=
"gl-md-ml-3 gl-mb-3 gl-display-none gl-display-md-block gl-visibility-hidden"
icon=
"clear"
/>
</
template
>
</div>
<
template
#description
...
...
app/assets/stylesheets/utilities.scss
View file @
6dda0016
...
...
@@ -161,3 +161,13 @@
.gl-z-dropdown-menu
\
!
{
z-index
:
300
!
important
;
}
.gl-flex-basis-quarter
{
flex-basis
:
25%
;
}
.gl-md-ml-3
{
@media
(
min-width
:
$breakpoint-md
)
{
margin-left
:
$gl-spacing-scale-3
;
}
}
app/views/projects/project_members/import.html.haml
View file @
6dda0016
...
...
@@ -11,5 +11,5 @@
.col-sm-10
=
select_tag
(
:source_project_id
,
options_from_collection_for_select
(
@projects
,
:id
,
:name_with_namespace
),
prompt:
"Select project"
,
class:
"select2 lg"
,
required:
true
)
.form-actions
=
button_tag
_
(
'Import project members'
),
class:
"btn btn-success"
=
link_to
_
(
"Cancel"
),
project_project_members_path
(
@project
),
class:
"btn btn-cancel"
=
button_tag
_
(
'Import project members'
),
class:
"btn
gl-button
btn-success"
=
link_to
_
(
"Cancel"
),
project_project_members_path
(
@project
),
class:
"btn
gl-button
btn-cancel"
changelogs/unreleased/231072-project-members-import-button.yml
0 → 100644
View file @
6dda0016
---
title
:
Add gl-button class to import and cancel buttons for project member import page
merge_request
:
43620
author
:
Gary Bell @garybell
type
:
other
locale/gitlab.pot
View file @
6dda0016
...
...
@@ -5102,6 +5102,9 @@ msgstr ""
msgid "CiVariables|Protected"
msgstr ""
msgid "CiVariables|Remove variable"
msgstr ""
msgid "CiVariables|Remove variable row"
msgstr ""
...
...
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