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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
8906de37
Commit
8906de37
authored
Apr 05, 2019
by
Enrique Alcántara
Committed by
Clement Ho
Apr 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not display ingress IP help text
if there isn’t an ingress IP assigned for the cluster yet
parent
2210f5e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
app/assets/javascripts/clusters/clusters_bundle.js
app/assets/javascripts/clusters/clusters_bundle.js
+4
-3
changelogs/unreleased/60068-avoid-null-domain-help-text.yml
changelogs/unreleased/60068-avoid-null-domain-help-text.yml
+5
-0
spec/javascripts/clusters/clusters_bundle_spec.js
spec/javascripts/clusters/clusters_bundle_spec.js
+17
-3
No files found.
app/assets/javascripts/clusters/clusters_bundle.js
View file @
8906de37
...
...
@@ -288,10 +288,11 @@ export default class Clusters {
}
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
)
{
const
helpTextHidden
=
ingressNewState
.
status
!==
APPLICATION_STATUS
.
INSTALLED
;
const
domainSnippetText
=
`
${
ingressNewState
.
externalIp
}${
INGRESS_DOMAIN_SUFFIX
}
`
;
const
{
externalIp
,
status
}
=
ingressNewState
;
const
helpTextHidden
=
status
!==
APPLICATION_STATUS
.
INSTALLED
||
!
externalIp
;
const
domainSnippetText
=
`
${
externalIp
}${
INGRESS_DOMAIN_SUFFIX
}
`
;
if
(
ingressPreviousState
.
status
!==
ingressNewState
.
status
)
{
if
(
ingressPreviousState
.
status
!==
status
)
{
this
.
ingressDomainHelpText
.
classList
.
toggle
(
'
hide
'
,
helpTextHidden
);
this
.
ingressDomainSnippet
.
textContent
=
domainSnippetText
;
}
...
...
changelogs/unreleased/60068-avoid-null-domain-help-text.yml
0 → 100644
View file @
8906de37
---
title
:
Do not display Ingress IP help text when there isn’t an Ingress IP assigned
merge_request
:
27057
author
:
type
:
fixed
spec/javascripts/clusters/clusters_bundle_spec.js
View file @
8906de37
...
...
@@ -300,9 +300,13 @@ describe('Clusters', () => {
describe
(
'
toggleIngressDomainHelpText
'
,
()
=>
{
const
{
INSTALLED
,
INSTALLABLE
,
NOT_INSTALLABLE
}
=
APPLICATION_STATUS
;
let
ingressPreviousState
;
let
ingressNewState
;
const
ingressPreviousState
=
{
status
:
INSTALLABLE
};
const
ingressNewState
=
{
status
:
INSTALLED
,
externalIp
:
'
127.0.0.1
'
};
beforeEach
(()
=>
{
ingressPreviousState
=
{
status
:
INSTALLABLE
};
ingressNewState
=
{
status
:
INSTALLED
,
externalIp
:
'
127.0.0.1
'
};
});
describe
(
`when ingress application new status is
${
INSTALLED
}
`
,
()
=>
{
beforeEach
(()
=>
{
...
...
@@ -333,7 +337,7 @@ describe('Clusters', () => {
});
describe
(
'
when ingress application new status and old status are the same
'
,
()
=>
{
it
(
'
does not
modif
y custom domain help text
'
,
()
=>
{
it
(
'
does not
displa
y custom domain help text
'
,
()
=>
{
ingressPreviousState
.
status
=
INSTALLED
;
ingressNewState
.
status
=
ingressPreviousState
.
status
;
...
...
@@ -342,5 +346,15 @@ describe('Clusters', () => {
expect
(
cluster
.
ingressDomainHelpText
.
classList
.
contains
(
'
hide
'
)).
toEqual
(
true
);
});
});
describe
(
`when ingress new status is
${
INSTALLED
}
and there isn’t an ip assigned`
,
()
=>
{
it
(
'
does not display custom domain help text
'
,
()
=>
{
ingressNewState
.
externalIp
=
null
;
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
expect
(
cluster
.
ingressDomainHelpText
.
classList
.
contains
(
'
hide
'
)).
toEqual
(
true
);
});
});
});
});
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