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
8b44ff32
Commit
8b44ff32
authored
Apr 07, 2021
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify configuration paths injection
parent
1449cc3c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
12 deletions
+11
-12
app/assets/javascripts/pipeline_editor/components/code_snippet_alert/code_snippet_alert.vue
...itor/components/code_snippet_alert/code_snippet_alert.vue
+2
-5
app/assets/javascripts/pipeline_editor/components/code_snippet_alert/constants.js
...ipeline_editor/components/code_snippet_alert/constants.js
+1
-1
app/assets/javascripts/pipeline_editor/index.js
app/assets/javascripts/pipeline_editor/index.js
+5
-5
spec/frontend/pipeline_editor/components/code_snippet_alert/code_snippet_alert_spec.js
.../components/code_snippet_alert/code_snippet_alert_spec.js
+3
-1
No files found.
app/assets/javascripts/pipeline_editor/components/code_snippet_alert/code_snippet_alert.vue
View file @
8b44ff32
...
...
@@ -7,9 +7,7 @@ export default {
components
:
{
GlAlert
,
},
inject
:
Object
.
values
(
CODE_SNIPPET_SOURCE_SETTINGS
).
map
(
({
configurationPathInjectKey
})
=>
configurationPathInjectKey
,
),
inject
:
[
'
configurationPaths
'
],
props
:
{
source
:
{
type
:
String
,
...
...
@@ -22,8 +20,7 @@ export default {
return
CODE_SNIPPET_SOURCE_SETTINGS
[
this
.
source
];
},
configurationPath
()
{
const
injectKey
=
this
.
settings
.
configurationPathInjectKey
;
return
this
[
injectKey
];
return
this
.
configurationPaths
[
this
.
source
];
},
},
};
...
...
app/assets/javascripts/pipeline_editor/components/code_snippet_alert/constants.js
View file @
8b44ff32
...
...
@@ -5,7 +5,7 @@ export const CODE_SNIPPET_SOURCE_API_FUZZING = 'api_fuzzing';
export
const
CODE_SNIPPET_SOURCES
=
[
CODE_SNIPPET_SOURCE_API_FUZZING
];
export
const
CODE_SNIPPET_SOURCE_SETTINGS
=
{
[
CODE_SNIPPET_SOURCE_API_FUZZING
]:
{
configurationPathInjec
tKey
:
'
apiFuzzingConfigurationPath
'
,
datase
tKey
:
'
apiFuzzingConfigurationPath
'
,
docsPath
:
helpPagePath
(
'
user/application_security/api_fuzzing/index
'
),
},
};
app/assets/javascripts/pipeline_editor/index.js
View file @
8b44ff32
...
...
@@ -38,10 +38,10 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
ymlHelpPagePath
,
}
=
el
?.
dataset
;
const
provideCodeSnippetC
onfigurationPaths
=
Object
.
fromEntries
(
Object
.
values
(
CODE_SNIPPET_SOURCE_SETTINGS
).
map
(({
configurationPathInjectKey
}
)
=>
[
configurationPathInjectKey
,
el
.
dataset
[
configurationPathInjec
tKey
],
const
c
onfigurationPaths
=
Object
.
fromEntries
(
Object
.
entries
(
CODE_SNIPPET_SOURCE_SETTINGS
).
map
(([
source
,
{
datasetKey
}]
)
=>
[
source
,
el
.
dataset
[
datase
tKey
],
]),
);
...
...
@@ -79,7 +79,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
projectPath
,
projectNamespace
,
ymlHelpPagePath
,
...
provideCodeSnippetC
onfigurationPaths
,
c
onfigurationPaths
,
},
render
(
h
)
{
return
h
(
PipelineEditorApp
);
...
...
spec/frontend/pipeline_editor/components/code_snippet_alert/code_snippet_alert_spec.js
View file @
8b44ff32
...
...
@@ -18,7 +18,9 @@ describe('EE - CodeSnippetAlert', () => {
merge
(
{
provide
:
{
apiFuzzingConfigurationPath
,
configurationPaths
:
{
[
CODE_SNIPPET_SOURCE_API_FUZZING
]:
apiFuzzingConfigurationPath
,
},
},
propsData
:
{
source
:
CODE_SNIPPET_SOURCE_API_FUZZING
,
...
...
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