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
2dd31493
Commit
2dd31493
authored
Jul 24, 2021
by
Siddharth Asthana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename GraphQL query resource from "instanceDashboard" to "instance"
Changelog: other EE: true
parent
21607dbf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
36 deletions
+20
-36
ee/app/assets/javascripts/security_dashboard/components/instance/instance_security_dashboard.vue
...board/components/instance/instance_security_dashboard.vue
+1
-1
ee/app/assets/javascripts/security_dashboard/components/instance/project_list.vue
...s/security_dashboard/components/instance/project_list.vue
+1
-1
ee/app/assets/javascripts/security_dashboard/components/instance/project_manager.vue
...ecurity_dashboard/components/instance/project_manager.vue
+3
-3
ee/app/assets/javascripts/security_dashboard/components/shared/filters/project_filter.vue
...ty_dashboard/components/shared/filters/project_filter.vue
+8
-19
ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report.vue
...rity_dashboard/components/shared/vulnerability_report.vue
+4
-9
ee/app/assets/javascripts/security_dashboard/graphql/queries/instance_projects.query.graphql
...dashboard/graphql/queries/instance_projects.query.graphql
+1
-1
ee/spec/frontend/security_dashboard/components/instance/project_list_spec.js
...curity_dashboard/components/instance/project_list_spec.js
+1
-1
ee/spec/frontend/security_dashboard/mock_data/index.js
ee/spec/frontend/security_dashboard/mock_data/index.js
+1
-1
No files found.
ee/app/assets/javascripts/security_dashboard/components/instance/instance_security_dashboard.vue
View file @
2dd31493
...
...
@@ -22,7 +22,7 @@ export default {
projects
:
{
query
:
instanceProjectsQuery
,
update
(
data
)
{
return
data
?.
instance
SecurityDashboard
?.
projects
?.
nodes
??
[];
return
data
?.
instance
?.
projects
?.
nodes
??
[];
},
error
()
{
createFlash
({
message
:
PROJECT_LOADING_ERROR_MESSAGE
});
...
...
ee/app/assets/javascripts/security_dashboard/components/instance/project_list.vue
View file @
2dd31493
...
...
@@ -27,7 +27,7 @@ export default {
projects
:
{
query
:
projectsQuery
,
update
(
data
)
{
const
projects
=
data
?.
instance
SecurityDashboard
?.
projects
?.
nodes
;
const
projects
=
data
?.
instance
?.
projects
?.
nodes
;
if
(
projects
===
undefined
)
{
this
.
showErrorFlash
();
...
...
ee/app/assets/javascripts/security_dashboard/components/instance/project_manager.vue
View file @
2dd31493
...
...
@@ -77,8 +77,8 @@ export default {
const
newProject
=
results
.
addProjectToSecurityDashboard
.
project
;
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
draftData
.
instance
SecurityDashboard
.
projects
.
nodes
=
[
...
draftData
.
instance
SecurityDashboard
.
projects
.
nodes
,
draftData
.
instance
.
projects
.
nodes
=
[
...
draftData
.
instance
.
projects
.
nodes
,
{
...
newProject
,
vulnerabilitySeveritiesCount
:
newProject
.
vulnerabilitySeveritiesCount
||
null
,
...
...
@@ -153,7 +153,7 @@ export default {
const
sourceData
=
store
.
readQuery
({
query
:
instanceProjectsQuery
});
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
draftData
.
instance
SecurityDashboard
.
projects
.
nodes
=
draftData
.
instanceSecurityDashboard
.
projects
.
nodes
.
filter
(
draftData
.
instance
.
projects
.
nodes
=
draftData
.
instance
.
projects
.
nodes
.
filter
(
(
curr
)
=>
curr
.
id
!==
id
,
);
});
...
...
ee/app/assets/javascripts/security_dashboard/components/shared/filters/project_filter.vue
View file @
2dd31493
...
...
@@ -21,17 +21,6 @@ const SEARCH_TERM_MINIMUM_LENGTH = 3;
const
SELECTED_PROJECTS_MAX_COUNT
=
100
;
const
PROJECT_ENTITY_NAME
=
'
Project
'
;
const
QUERY_CONFIGS
=
{
[
DASHBOARD_TYPES
.
GROUP
]:
{
query
:
groupProjectsQuery
,
property
:
'
group
'
,
},
[
DASHBOARD_TYPES
.
INSTANCE
]:
{
query
:
instanceProjectsQuery
,
property
:
'
instanceSecurityDashboard
'
,
},
};
export
default
{
components
:
{
FilterBody
,
...
...
@@ -88,15 +77,17 @@ export default {
const
ids
=
this
.
querystringIds
.
includes
(
this
.
filter
.
allOption
.
id
)
?
[]
:
this
.
querystringIds
;
return
ids
.
filter
((
id
)
=>
!
has
(
this
.
projectsCache
,
id
));
},
queryConfig
()
{
return
QUERY_CONFIGS
[
this
.
dashboardType
];
query
()
{
return
this
.
dashboardType
===
DASHBOARD_TYPES
.
GROUP
?
groupProjectsQuery
:
instanceProjectsQuery
;
},
},
apollo
:
{
// Gets the projects from the project IDs in the querystring and adds them to the cache.
projectsById
:
{
query
()
{
return
this
.
query
Config
.
query
;
return
this
.
query
;
},
manual
:
true
,
variables
()
{
...
...
@@ -114,8 +105,7 @@ export default {
this
.
$set
(
this
.
projectsCache
,
id
,
undefined
);
});
const
property
=
data
[
this
.
queryConfig
.
property
];
const
projects
=
mapProjects
(
property
.
projects
.
nodes
);
const
projects
=
mapProjects
(
data
[
this
.
dashboardType
].
projects
.
nodes
);
this
.
saveProjectsToCache
(
projects
);
// Now that we have the project for each uncached ID, set the selected options.
this
.
selectedOptions
=
this
.
querystringOptions
;
...
...
@@ -131,7 +121,7 @@ export default {
// Gets the projects for the group with an optional search, to show as dropdown options.
projects
:
{
query
()
{
return
this
.
query
Config
.
query
;
return
this
.
query
;
},
variables
()
{
return
{
...
...
@@ -140,8 +130,7 @@ export default {
};
},
update
(
data
)
{
const
property
=
data
[
this
.
queryConfig
.
property
];
return
mapProjects
(
property
.
projects
.
nodes
);
return
mapProjects
(
data
[
this
.
dashboardType
].
projects
.
nodes
);
},
result
()
{
this
.
saveProjectsToCache
(
this
.
projects
);
...
...
ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report.vue
View file @
2dd31493
...
...
@@ -53,25 +53,20 @@ export default {
autoFixDocumentation
:
{
default
:
undefined
},
pipeline
:
{
default
:
undefined
},
},
queries
:
{
[
DASHBOARD_TYPES
.
GROUP
]:
groupProjectsQuery
,
[
DASHBOARD_TYPES
.
INSTANCE
]:
instanceProjectsQuery
,
},
apollo
:
{
projects
:
{
query
()
{
return
this
.
$options
.
queries
[
this
.
dashboardType
]
;
return
this
.
isGroup
?
groupProjectsQuery
:
instanceProjectsQuery
;
},
variables
()
{
return
this
.
isGroup
?
{
fullPath
:
this
.
groupFullPath
}
:
{};
},
update
(
data
)
{
return
this
.
isGroup
?
data
.
group
.
projects
.
nodes
:
data
.
instanceSecurityDashboard
.
projects
.
nodes
;
return
this
.
isGroup
?
data
.
group
.
projects
.
nodes
:
data
.
instance
.
projects
.
nodes
;
},
skip
()
{
return
!
this
.
$options
.
queries
[
this
.
dashboardType
];
// Only run this query on the group and instance-level dashboards.
return
!
(
this
.
isGroup
||
this
.
isInstance
);
},
},
},
...
...
ee/app/assets/javascripts/security_dashboard/graphql/queries/instance_projects.query.graphql
View file @
2dd31493
query
instanceProjects
(
$search
:
String
)
{
instanceSecurityDashboard
{
instance
:
instance
SecurityDashboard
{
projects
(
search
:
$search
)
{
nodes
{
id
...
...
ee/spec/frontend/security_dashboard/components/instance/project_list_spec.js
View file @
2dd31493
...
...
@@ -29,7 +29,7 @@ describe('Project List component', () => {
const
getMockData
=
(
projects
)
=>
({
data
:
{
instance
SecurityDashboard
:
{
instance
:
{
projects
:
{
nodes
:
projects
,
},
...
...
ee/spec/frontend/security_dashboard/mock_data/index.js
View file @
2dd31493
...
...
@@ -196,7 +196,7 @@ export const mockProjectSecurityChartsWithData = () => ({
export
const
mockVulnerableProjectsInstance
=
()
=>
({
data
:
{
instance
SecurityDashboard
:
{
instance
:
{
projects
:
{
nodes
:
[
{
...
...
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