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
bdfd2635
Commit
bdfd2635
authored
Dec 01, 2021
by
anna_vovchenko
Committed by
Ezekiel Kigbo
Dec 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented suggestion after the FE review
parent
fe55d8b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
app/assets/javascripts/clusters_list/components/install_agent_modal.vue
...ascripts/clusters_list/components/install_agent_modal.vue
+6
-4
app/assets/javascripts/clusters_list/constants.js
app/assets/javascripts/clusters_list/constants.js
+3
-0
spec/frontend/clusters_list/components/install_agent_modal_spec.js
...tend/clusters_list/components/install_agent_modal_spec.js
+4
-2
No files found.
app/assets/javascripts/clusters_list/components/install_agent_modal.vue
View file @
bdfd2635
...
@@ -21,6 +21,8 @@ import {
...
@@ -21,6 +21,8 @@ import {
EVENT_ACTIONS_OPEN
,
EVENT_ACTIONS_OPEN
,
EVENT_ACTIONS_SELECT
,
EVENT_ACTIONS_SELECT
,
EVENT_ACTIONS_CLICK
,
EVENT_ACTIONS_CLICK
,
MODAL_TYPE_EMPTY
,
MODAL_TYPE_REGISTER
,
}
from
'
../constants
'
;
}
from
'
../constants
'
;
import
{
addAgentToStore
,
addAgentConfigToStore
}
from
'
../graphql/cache_update
'
;
import
{
addAgentToStore
,
addAgentConfigToStore
}
from
'
../graphql/cache_update
'
;
import
createAgent
from
'
../graphql/mutations/create_agent.mutation.graphql
'
;
import
createAgent
from
'
../graphql/mutations/create_agent.mutation.graphql
'
;
...
@@ -133,17 +135,17 @@ export default {
...
@@ -133,17 +135,17 @@ export default {
},
},
modalType
()
{
modalType
()
{
return
!
this
.
availableAgents
?.
length
&&
!
this
.
registered
return
!
this
.
availableAgents
?.
length
&&
!
this
.
registered
?
'
empty_state
'
?
MODAL_TYPE_EMPTY
:
'
agent_registration
'
;
:
MODAL_TYPE_REGISTER
;
},
},
modalSize
()
{
modalSize
()
{
return
this
.
isEmptyStateModal
?
'
sm
'
:
'
md
'
;
return
this
.
isEmptyStateModal
?
'
sm
'
:
'
md
'
;
},
},
isEmptyStateModal
()
{
isEmptyStateModal
()
{
return
this
.
modalType
===
'
empty_state
'
;
return
this
.
modalType
===
MODAL_TYPE_EMPTY
;
},
},
isAgentRegistrationModal
()
{
isAgentRegistrationModal
()
{
return
this
.
modalType
===
'
agent_registration
'
;
return
this
.
modalType
===
MODAL_TYPE_REGISTER
;
},
},
},
},
methods
:
{
methods
:
{
...
...
app/assets/javascripts/clusters_list/constants.js
View file @
bdfd2635
...
@@ -243,3 +243,6 @@ export const EVENT_ACTIONS_OPEN = 'open_modal';
...
@@ -243,3 +243,6 @@ export const EVENT_ACTIONS_OPEN = 'open_modal';
export
const
EVENT_ACTIONS_SELECT
=
'
select_agent
'
;
export
const
EVENT_ACTIONS_SELECT
=
'
select_agent
'
;
export
const
EVENT_ACTIONS_CLICK
=
'
click_button
'
;
export
const
EVENT_ACTIONS_CLICK
=
'
click_button
'
;
export
const
EVENT_ACTIONS_CHANGE
=
'
change_tab
'
;
export
const
EVENT_ACTIONS_CHANGE
=
'
change_tab
'
;
export
const
MODAL_TYPE_EMPTY
=
'
empty_state
'
;
export
const
MODAL_TYPE_REGISTER
=
'
agent_registration
'
;
spec/frontend/clusters_list/components/install_agent_modal_spec.js
View file @
bdfd2635
...
@@ -11,6 +11,8 @@ import {
...
@@ -11,6 +11,8 @@ import {
EVENT_LABEL_MODAL
,
EVENT_LABEL_MODAL
,
EVENT_ACTIONS_OPEN
,
EVENT_ACTIONS_OPEN
,
EVENT_ACTIONS_SELECT
,
EVENT_ACTIONS_SELECT
,
MODAL_TYPE_EMPTY
,
MODAL_TYPE_REGISTER
,
}
from
'
~/clusters_list/constants
'
;
}
from
'
~/clusters_list/constants
'
;
import
getAgentsQuery
from
'
~/clusters_list/graphql/queries/get_agents.query.graphql
'
;
import
getAgentsQuery
from
'
~/clusters_list/graphql/queries/get_agents.query.graphql
'
;
import
getAgentConfigurations
from
'
~/clusters_list/graphql/queries/agent_configurations.query.graphql
'
;
import
getAgentConfigurations
from
'
~/clusters_list/graphql/queries/agent_configurations.query.graphql
'
;
...
@@ -164,7 +166,7 @@ describe('InstallAgentModal', () => {
...
@@ -164,7 +166,7 @@ describe('InstallAgentModal', () => {
findModal
().
vm
.
$emit
(
'
show
'
);
findModal
().
vm
.
$emit
(
'
show
'
);
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
EVENT_ACTIONS_OPEN
,
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
EVENT_ACTIONS_OPEN
,
{
label
:
EVENT_LABEL_MODAL
,
label
:
EVENT_LABEL_MODAL
,
property
:
'
agent_registration
'
,
property
:
MODAL_TYPE_REGISTER
,
});
});
});
});
});
});
...
@@ -300,7 +302,7 @@ describe('InstallAgentModal', () => {
...
@@ -300,7 +302,7 @@ describe('InstallAgentModal', () => {
findModal
().
vm
.
$emit
(
'
show
'
);
findModal
().
vm
.
$emit
(
'
show
'
);
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
EVENT_ACTIONS_OPEN
,
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
EVENT_ACTIONS_OPEN
,
{
label
:
EVENT_LABEL_MODAL
,
label
:
EVENT_LABEL_MODAL
,
property
:
'
empty_state
'
,
property
:
MODAL_TYPE_EMPTY
,
});
});
});
});
});
});
...
...
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