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
3b13c2b5
Commit
3b13c2b5
authored
Aug 04, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemeent Vuex module for fetching security configurations
* Impleement actions, mutations, mutation types, and store
parent
a2a272b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
0 deletions
+57
-0
ee/app/assets/javascripts/security_configuration/modules/configuration/actions.js
...s/security_configuration/modules/configuration/actions.js
+28
-0
ee/app/assets/javascripts/security_configuration/modules/configuration/mutation_types.js
...ity_configuration/modules/configuration/mutation_types.js
+5
-0
ee/app/assets/javascripts/security_configuration/modules/configuration/mutations.js
...security_configuration/modules/configuration/mutations.js
+17
-0
ee/app/assets/javascripts/security_configuration/modules/configuration/state.js
...pts/security_configuration/modules/configuration/state.js
+7
-0
No files found.
ee/app/assets/javascripts/security_configuration/modules/configuration/actions.js
0 → 100644
View file @
3b13c2b5
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
*
as
types
from
'
./mutation_types
'
;
export
const
setSecurityConfigurationEndpoint
=
({
commit
},
endpoint
)
=>
commit
(
types
.
SET_SECURITY_CONFIGURATION_ENDPOINT
,
endpoint
);
export
const
fetchSecurityConfiguration
=
({
commit
,
state
})
=>
{
if
(
!
state
.
securityConfigurationPath
)
{
return
commit
(
types
.
RECEIVE_SECURITY_CONFIGURATION_ERROR
);
}
commit
(
types
.
REQUEST_SECURITY_CONFIGURATION
);
return
axios
({
method
:
'
GET
'
,
url
:
state
.
securityConfigurationPath
,
})
.
then
(
response
=>
{
const
{
data
}
=
response
;
commit
(
types
.
RECEIVE_SECURITY_CONFIGURATION_SUCCESS
,
data
);
})
.
catch
(
error
=>
{
Sentry
.
captureException
(
error
);
commit
(
types
.
RECEIVE_SECURITY_CONFIGURATION_ERROR
);
});
};
\ No newline at end of file
ee/app/assets/javascripts/security_configuration/modules/configuration/mutation_types.js
0 → 100644
View file @
3b13c2b5
export
const
SET_SECURITY_CONFIGURATION_ENDPOINT
=
'
SET_SECURITY_CONFIGURATION_ENDPOINT
'
;
export
const
REQUEST_SECURITY_CONFIGURATION
=
'
REQUEST_SECURITY_CONFIGURATION
'
;
export
const
RECEIVE_SECURITY_CONFIGURATION_SUCCESS
=
'
RECEIVE_SECURITY_CONFIGURATION_SUCCESS
'
;
export
const
RECEIVE_SECURITY_CONFIGURATION_ERROR
=
'
RECEIVE_SECURITY_CONFIGURATION_ERROR
'
;
\ No newline at end of file
ee/app/assets/javascripts/security_configuration/modules/configuration/mutations.js
0 → 100644
View file @
3b13c2b5
import
*
as
types
from
'
./mutation_types
'
;
export
default
{
[
types
.
SET_SECURITY_CONFIGURATION_ENDPOINT
](
state
,
payload
)
{
state
.
securityConfigurationPath
=
payload
;
},
[
types
.
REQUEST_SECURITY_CONFIGURATION
](
state
)
{
state
.
isLoading
=
true
;
},
[
types
.
RECEIVE_SECURITY_CONFIGURATION_SUCCESS
](
state
,
payload
)
{
state
.
isLoading
=
false
;
state
.
pipelineJobs
=
payload
;
},
[
types
.
RECEIVE_SECURITY_CONFIGURATION_ERROR
](
state
)
{
state
.
isLoading
=
false
;
},
};
ee/app/assets/javascripts/security_configuration/modules/configuration/state.js
0 → 100644
View file @
3b13c2b5
export
default
()
=>
({
securityConfigurationPath
:
''
,
initialized
:
false
,
isLoading
:
false
,
errorLoading
:
false
,
configuration
:
[],
});
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