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
e0775471
Commit
e0775471
authored
Sep 14, 2021
by
Sashi Kumar Kumaresan
Committed by
Olena Horal-Koretska
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE specific pipeline sources out of CE
parent
6235833f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
66 deletions
+75
-66
app/assets/javascripts/pipelines/components/pipelines_list/tokens/constants.js
...s/pipelines/components/pipelines_list/tokens/constants.js
+52
-0
app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_source_token.vue
...omponents/pipelines_list/tokens/pipeline_source_token.vue
+6
-65
ee/app/assets/javascripts/pipelines/components/pipelines_list/tokens/constants.js
...s/pipelines/components/pipelines_list/tokens/constants.js
+15
-0
spec/frontend/pipelines/tokens/pipeline_source_token_spec.js
spec/frontend/pipelines/tokens/pipeline_source_token_spec.js
+2
-1
No files found.
app/assets/javascripts/pipelines/components/pipelines_list/tokens/constants.js
0 → 100644
View file @
e0775471
import
{
s__
}
from
'
~/locale
'
;
export
const
PIPELINE_SOURCES
=
[
{
text
:
s__
(
'
Pipeline|Source|Push
'
),
value
:
'
push
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Web
'
),
value
:
'
web
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Trigger
'
),
value
:
'
trigger
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Schedule
'
),
value
:
'
schedule
'
,
},
{
text
:
s__
(
'
Pipeline|Source|API
'
),
value
:
'
api
'
,
},
{
text
:
s__
(
'
Pipeline|Source|External
'
),
value
:
'
external
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Pipeline
'
),
value
:
'
pipeline
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Chat
'
),
value
:
'
chat
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Web IDE
'
),
value
:
'
webide
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Merge Request
'
),
value
:
'
merge_request_event
'
,
},
{
text
:
s__
(
'
Pipeline|Source|External Pull Request
'
),
value
:
'
external_pull_request_event
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Parent Pipeline
'
),
value
:
'
parent_pipeline
'
,
},
];
app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_source_token.vue
View file @
e0775471
<
script
>
import
{
GlFilteredSearchToken
,
GlFilteredSearchSuggestion
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
PIPELINE_SOURCES
}
from
'
ee_else_ce/pipelines/components/pipelines_list/tokens/constants
'
;
export
default
{
PIPELINE_SOURCES
,
components
:
{
GlFilteredSearchToken
,
GlFilteredSearchSuggestion
,
...
...
@@ -18,68 +19,8 @@ export default {
},
},
computed
:
{
sources
()
{
return
[
{
text
:
s__
(
'
Pipeline|Source|Push
'
),
value
:
'
push
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Web
'
),
value
:
'
web
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Trigger
'
),
value
:
'
trigger
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Schedule
'
),
value
:
'
schedule
'
,
},
{
text
:
s__
(
'
Pipeline|Source|API
'
),
value
:
'
api
'
,
},
{
text
:
s__
(
'
Pipeline|Source|External
'
),
value
:
'
external
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Pipeline
'
),
value
:
'
pipeline
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Chat
'
),
value
:
'
chat
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Web IDE
'
),
value
:
'
webide
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Merge Request
'
),
value
:
'
merge_request_event
'
,
},
{
text
:
s__
(
'
Pipeline|Source|External Pull Request
'
),
value
:
'
external_pull_request_event
'
,
},
{
text
:
s__
(
'
Pipeline|Source|Parent Pipeline
'
),
value
:
'
parent_pipeline
'
,
},
{
text
:
s__
(
'
Pipeline|Source|On-Demand DAST Scan
'
),
value
:
'
ondemand_dast_scan
'
,
},
{
text
:
s__
(
'
Pipeline|Source|On-Demand DAST Validation
'
),
value
:
'
ondemand_dast_validation
'
,
},
];
},
findActiveSource
()
{
return
this
.
sources
.
find
((
source
)
=>
source
.
value
===
this
.
value
.
data
);
activeSource
()
{
return
PIPELINE_SOURCES
.
find
((
source
)
=>
source
.
value
===
this
.
value
.
data
);
},
},
};
...
...
@@ -89,13 +30,13 @@ export default {
<gl-filtered-search-token
v-bind=
"
{ ...$props, ...$attrs }" v-on="$listeners">
<template
#view
>
<div
class=
"gl-display-flex gl-align-items-center"
>
<span>
{{
findA
ctiveSource
.
text
}}
</span>
<span>
{{
a
ctiveSource
.
text
}}
</span>
</div>
</
template
>
<
template
#suggestions
>
<gl-filtered-search-suggestion
v-for=
"source in
sources
"
v-for=
"source in
$options.PIPELINE_SOURCES
"
:key=
"source.value"
:value=
"source.value"
>
...
...
ee/app/assets/javascripts/pipelines/components/pipelines_list/tokens/constants.js
0 → 100644
View file @
e0775471
import
{
s__
}
from
'
~/locale
'
;
import
{
PIPELINE_SOURCES
as
CE_PIPELINE_SOURCES
}
from
'
~/pipelines/components/pipelines_list/tokens/constants
'
;
const
EE_PIPELINE_SOURCES
=
[
{
text
:
s__
(
'
Pipeline|Source|On-Demand DAST Scan
'
),
value
:
'
ondemand_dast_scan
'
,
},
{
text
:
s__
(
'
Pipeline|Source|On-Demand DAST Validation
'
),
value
:
'
ondemand_dast_validation
'
,
},
];
export
const
PIPELINE_SOURCES
=
[...
CE_PIPELINE_SOURCES
,
...
EE_PIPELINE_SOURCES
];
spec/frontend/pipelines/tokens/pipeline_source_token_spec.js
View file @
e0775471
import
{
GlFilteredSearchToken
,
GlFilteredSearchSuggestion
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
PIPELINE_SOURCES
}
from
'
ee_else_ce/pipelines/components/pipelines_list/tokens/constants
'
;
import
{
stubComponent
}
from
'
helpers/stub_component
'
;
import
PipelineSourceToken
from
'
~/pipelines/components/pipelines_list/tokens/pipeline_source_token.vue
'
;
...
...
@@ -44,7 +45,7 @@ describe('Pipeline Source Token', () => {
describe
(
'
shows sources correctly
'
,
()
=>
{
it
(
'
renders all pipeline sources available
'
,
()
=>
{
expect
(
findAllFilteredSearchSuggestions
()).
toHaveLength
(
wrapper
.
vm
.
sources
.
length
);
expect
(
findAllFilteredSearchSuggestions
()).
toHaveLength
(
PIPELINE_SOURCES
.
length
);
});
});
});
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