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
fb7a1b5b
Commit
fb7a1b5b
authored
Apr 20, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display the unavailable state when user has no access
- Refactor props destructuring
parent
a256e32a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
ee/app/assets/javascripts/security_dashboard/first_class_init.js
...assets/javascripts/security_dashboard/first_class_init.js
+23
-14
No files found.
ee/app/assets/javascripts/security_dashboard/first_class_init.js
View file @
fb7a1b5b
...
@@ -5,6 +5,7 @@ import { DASHBOARD_TYPES } from 'ee/security_dashboard/store/constants';
...
@@ -5,6 +5,7 @@ import { DASHBOARD_TYPES } from 'ee/security_dashboard/store/constants';
import
FirstClassProjectSecurityDashboard
from
'
./components/first_class_project_security_dashboard.vue
'
;
import
FirstClassProjectSecurityDashboard
from
'
./components/first_class_project_security_dashboard.vue
'
;
import
FirstClassGroupSecurityDashboard
from
'
./components/first_class_group_security_dashboard.vue
'
;
import
FirstClassGroupSecurityDashboard
from
'
./components/first_class_group_security_dashboard.vue
'
;
import
FirstClassInstanceSecurityDashboard
from
'
./components/first_class_instance_security_dashboard.vue
'
;
import
FirstClassInstanceSecurityDashboard
from
'
./components/first_class_instance_security_dashboard.vue
'
;
import
UnavailableState
from
'
./components/unavailable_state.vue
'
;
import
createStore
from
'
./store
'
;
import
createStore
from
'
./store
'
;
import
createRouter
from
'
./store/router
'
;
import
createRouter
from
'
./store/router
'
;
import
projectsPlugin
from
'
./store/plugins/projects
'
;
import
projectsPlugin
from
'
./store/plugins/projects
'
;
...
@@ -21,27 +22,35 @@ export default (
...
@@ -21,27 +22,35 @@ export default (
dashboardType
=
isRequired
(
'
No dashboard type was passed to the security dashboard initializer
'
),
dashboardType
=
isRequired
(
'
No dashboard type was passed to the security dashboard initializer
'
),
/* eslint-enable @gitlab/require-i18n-strings */
/* eslint-enable @gitlab/require-i18n-strings */
)
=>
{
)
=>
{
if
(
el
.
dataset
.
isUnavailable
)
{
return
new
Vue
({
el
,
render
(
createElement
)
{
return
createElement
(
UnavailableState
,
{
props
:
{
link
:
el
.
dataset
.
dashboardDocumentation
,
svgPath
:
el
.
dataset
.
emptyStateSvgPath
,
},
});
},
});
}
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
apolloProvider
=
new
VueApollo
({
const
apolloProvider
=
new
VueApollo
({
defaultClient
:
createDefaultClient
(),
defaultClient
:
createDefaultClient
(),
});
});
const
{
dashboardDocumentation
,
emptyStateSvgPath
,
hasPipelineData
,
securityDashboardHelpPath
,
projectAddEndpoint
,
projectListEndpoint
,
}
=
el
.
dataset
;
const
props
=
{
const
props
=
{
emptyStateSvgPath
,
emptyStateSvgPath
:
el
.
dataset
.
emptyStateSvgPath
,
dashboardDocumentation
,
dashboardDocumentation
:
el
.
dataset
.
dashboardDocumentation
,
hasPipelineData
:
Boolean
(
hasPipelineData
),
hasPipelineData
:
Boolean
(
el
.
dataset
.
hasPipelineData
),
securityDashboardHelpPath
,
securityDashboardHelpPath
:
el
.
dataset
.
securityDashboardHelpPath
,
projectAddEndpoint
,
projectAddEndpoint
:
el
.
dataset
.
projectAddEndpoint
,
projectListEndpoint
,
projectListEndpoint
:
el
.
dataset
.
projectListEndpoint
,
};
};
let
component
;
let
component
;
if
(
dashboardType
===
DASHBOARD_TYPES
.
PROJECT
)
{
if
(
dashboardType
===
DASHBOARD_TYPES
.
PROJECT
)
{
...
...
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