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
8703fdaa
Commit
8703fdaa
authored
Apr 26, 2019
by
Enrique Alcantara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix base domain help text update
parent
5065f187
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
36 deletions
+11
-36
app/assets/javascripts/clusters/clusters_bundle.js
app/assets/javascripts/clusters/clusters_bundle.js
+4
-8
spec/frontend/clusters/clusters_bundle_spec.js
spec/frontend/clusters/clusters_bundle_spec.js
+7
-28
No files found.
app/assets/javascripts/clusters/clusters_bundle.js
View file @
8703fdaa
...
...
@@ -279,14 +279,10 @@ export default class Clusters {
this
.
store
.
acknowledgeSuccessfulUpdate
(
appId
);
}
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
)
{
const
{
externalIp
,
status
}
=
ingressNewState
;
const
helpTextHidden
=
status
!==
APPLICATION_STATUS
.
INSTALLED
||
!
externalIp
;
const
domainSnippetText
=
`
${
externalIp
}${
INGRESS_DOMAIN_SUFFIX
}
`
;
if
(
ingressPreviousState
.
status
!==
status
)
{
this
.
ingressDomainHelpText
.
classList
.
toggle
(
'
hide
'
,
helpTextHidden
);
this
.
ingressDomainSnippet
.
textContent
=
domainSnippetText
;
toggleIngressDomainHelpText
({
externalIp
},
{
externalIp
:
newExternalIp
})
{
if
(
externalIp
!==
newExternalIp
)
{
this
.
ingressDomainHelpText
.
classList
.
toggle
(
'
hide
'
,
!
newExternalIp
);
this
.
ingressDomainSnippet
.
textContent
=
`
${
newExternalIp
}${
INGRESS_DOMAIN_SUFFIX
}
`
;
}
}
...
...
spec/frontend/clusters/clusters_bundle_spec.js
View file @
8703fdaa
...
...
@@ -6,7 +6,7 @@ import { loadHTMLFixture } from 'helpers/fixtures';
import
{
setTestTimeout
}
from
'
helpers/timeout
'
;
import
$
from
'
jquery
'
;
const
{
INSTALLING
,
INSTALLABLE
,
INSTALLED
,
NOT_INSTALLABLE
}
=
APPLICATION_STATUS
;
const
{
INSTALLING
,
INSTALLABLE
,
INSTALLED
}
=
APPLICATION_STATUS
;
describe
(
'
Clusters
'
,
()
=>
{
setTestTimeout
(
1000
);
...
...
@@ -317,13 +317,12 @@ describe('Clusters', () => {
let
ingressNewState
;
beforeEach
(()
=>
{
ingressPreviousState
=
{
status
:
INSTALLABLE
};
ingressNewState
=
{
status
:
INSTALLED
,
externalIp
:
'
127.0.0.1
'
};
ingressPreviousState
=
{
externalIp
:
null
};
ingressNewState
=
{
externalIp
:
'
127.0.0.1
'
};
});
describe
(
`when ingress
application new status is
${
INSTALLED
}
`
,
()
=>
{
describe
(
`when ingress
have an external ip assigned
`
,
()
=>
{
beforeEach
(()
=>
{
ingressNewState
.
status
=
INSTALLED
;
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
});
...
...
@@ -338,31 +337,11 @@ describe('Clusters', () => {
});
});
describe
(
`when ingress
application new status is different from
${
INSTALLED
}
`
,
()
=>
{
describe
(
`when ingress
does not have an external ip assigned
`
,
()
=>
{
it
(
'
hides custom domain help text
'
,
()
=>
{
ingressNewState
.
status
=
NOT_INSTALLABLE
;
cluster
.
ingressDomainHelpText
.
classList
.
remove
(
'
hide
'
);
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
expect
(
cluster
.
ingressDomainHelpText
.
classList
.
contains
(
'
hide
'
)).
toEqual
(
true
);
});
});
describe
(
'
when ingress application new status and old status are the same
'
,
()
=>
{
it
(
'
does not display custom domain help text
'
,
()
=>
{
ingressPreviousState
.
status
=
INSTALLED
;
ingressNewState
.
status
=
ingressPreviousState
.
status
;
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
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
'
,
()
=>
{
ingressPreviousState
.
externalIp
=
'
127.0.0.1
'
;
ingressNewState
.
externalIp
=
null
;
cluster
.
ingressDomainHelpText
.
classList
.
remove
(
'
hide
'
);
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
...
...
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