Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
8703fdaa
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8703fdaa
编写于
4月 26, 2019
作者:
E
Enrique Alcantara
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix base domain help text update
上级
5065f187
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
11 addition
and
36 deletion
+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
未找到文件。
app/assets/javascripts/clusters/clusters_bundle.js
浏览文件 @
8703fdaa
...
@@ -279,14 +279,10 @@ export default class Clusters {
...
@@ -279,14 +279,10 @@ export default class Clusters {
this
.
store
.
acknowledgeSuccessfulUpdate
(
appId
);
this
.
store
.
acknowledgeSuccessfulUpdate
(
appId
);
}
}
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
)
{
toggleIngressDomainHelpText
({
externalIp
},
{
externalIp
:
newExternalIp
})
{
const
{
externalIp
,
status
}
=
ingressNewState
;
if
(
externalIp
!==
newExternalIp
)
{
const
helpTextHidden
=
status
!==
APPLICATION_STATUS
.
INSTALLED
||
!
externalIp
;
this
.
ingressDomainHelpText
.
classList
.
toggle
(
'
hide
'
,
!
newExternalIp
);
const
domainSnippetText
=
`
${
externalIp
}${
INGRESS_DOMAIN_SUFFIX
}
`
;
this
.
ingressDomainSnippet
.
textContent
=
`
${
newExternalIp
}${
INGRESS_DOMAIN_SUFFIX
}
`
;
if
(
ingressPreviousState
.
status
!==
status
)
{
this
.
ingressDomainHelpText
.
classList
.
toggle
(
'
hide
'
,
helpTextHidden
);
this
.
ingressDomainSnippet
.
textContent
=
domainSnippetText
;
}
}
}
}
...
...
spec/frontend/clusters/clusters_bundle_spec.js
浏览文件 @
8703fdaa
...
@@ -6,7 +6,7 @@ import { loadHTMLFixture } from 'helpers/fixtures';
...
@@ -6,7 +6,7 @@ import { loadHTMLFixture } from 'helpers/fixtures';
import
{
setTestTimeout
}
from
'
helpers/timeout
'
;
import
{
setTestTimeout
}
from
'
helpers/timeout
'
;
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
const
{
INSTALLING
,
INSTALLABLE
,
INSTALLED
,
NOT_INSTALLABLE
}
=
APPLICATION_STATUS
;
const
{
INSTALLING
,
INSTALLABLE
,
INSTALLED
}
=
APPLICATION_STATUS
;
describe
(
'
Clusters
'
,
()
=>
{
describe
(
'
Clusters
'
,
()
=>
{
setTestTimeout
(
1000
);
setTestTimeout
(
1000
);
...
@@ -317,13 +317,12 @@ describe('Clusters', () => {
...
@@ -317,13 +317,12 @@ describe('Clusters', () => {
let
ingressNewState
;
let
ingressNewState
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
ingressPreviousState
=
{
status
:
INSTALLABLE
};
ingressPreviousState
=
{
externalIp
:
null
};
ingressNewState
=
{
status
:
INSTALLED
,
externalIp
:
'
127.0.0.1
'
};
ingressNewState
=
{
externalIp
:
'
127.0.0.1
'
};
});
});
describe
(
`when ingress
application new status is
${
INSTALLED
}
`
,
()
=>
{
describe
(
`when ingress
have an external ip assigned
`
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
ingressNewState
.
status
=
INSTALLED
;
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
});
});
...
@@ -338,31 +337,11 @@ describe('Clusters', () => {
...
@@ -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
'
,
()
=>
{
it
(
'
hides custom domain help text
'
,
()
=>
{
ingressNewState
.
status
=
NOT_INSTALLABLE
;
ingressPreviousState
.
externalIp
=
'
127.0.0.1
'
;
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
'
,
()
=>
{
ingressNewState
.
externalIp
=
null
;
ingressNewState
.
externalIp
=
null
;
cluster
.
ingressDomainHelpText
.
classList
.
remove
(
'
hide
'
);
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
cluster
.
toggleIngressDomainHelpText
(
ingressPreviousState
,
ingressNewState
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录