Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
7b5f7b45
未验证
提交
7b5f7b45
编辑于
6 months ago
作者:
Lindsey Shelton
提交者:
GitLab
6 months ago
浏览文件
操作
下载
补丁
差异文件
Fix for Groups Duo Subscription Bug
Updating groups_helper and specs from feedback Changelog: fixed EE: true
上级
6215e5ff
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
ee/app/helpers/ee/groups_helper.rb
+17
-1
17 个添加, 1 个删除
ee/app/helpers/ee/groups_helper.rb
ee/spec/helpers/ee/groups_helper_spec.rb
+23
-0
23 个添加, 0 个删除
ee/spec/helpers/ee/groups_helper_spec.rb
有
40 个添加
和
1 个删除
ee/app/helpers/ee/groups_helper.rb
+
17
−
1
浏览文件 @
7b5f7b45
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
module
EE
module
EE
module
GroupsHelper
module
GroupsHelper
extend
::
Gitlab
::
Utils
::
Override
extend
::
Gitlab
::
Utils
::
Override
include
::
Gitlab
::
Utils
::
StrongMemoize
include
::
GitlabSubscriptions
::
CodeSuggestionsHelper
include
::
GitlabSubscriptions
::
CodeSuggestionsHelper
include
::
Subscriptions
::
HandRaiseLeadsHelper
include
::
Subscriptions
::
HandRaiseLeadsHelper
include
::
Nav
::
GitlabDuoUsageSettingsPage
include
::
Nav
::
GitlabDuoUsageSettingsPage
...
@@ -115,7 +116,22 @@ def code_suggestions_usage_app_data(group)
...
@@ -115,7 +116,22 @@ def code_suggestions_usage_app_data(group)
hand_raise_lead:
code_suggestions_usage_app_hand_raise_lead_data
,
hand_raise_lead:
code_suggestions_usage_app_hand_raise_lead_data
,
is_free_namespace:
group
.
has_free_or_no_subscription?
.
to_s
,
is_free_namespace:
group
.
has_free_or_no_subscription?
.
to_s
,
buy_subscription_path:
group_billings_path
(
group
)
buy_subscription_path:
group_billings_path
(
group
)
}.
merge
(
duo_pro_trial_link
(
group
),
active_duo_pro_trial_data
(
group
))
}.
merge
(
duo_pro_trial_link
(
group
),
active_duo_pro_trial_data
(
group
),
active_subscription_data
(
group
))
end
def
active_subscription_data
(
group
)
return
{}
unless
group_gitlab_subscription
(
group
)
{
subscription_start_date:
group_gitlab_subscription
(
group
).
start_date
,
subscription_end_date:
group_gitlab_subscription
(
group
).
end_date
}
end
def
group_gitlab_subscription
(
group
)
strong_memoize
(
:group_gitlab_subscription
)
do
group
.
gitlab_subscription
end
end
end
def
active_duo_pro_trial_data
(
group
)
def
active_duo_pro_trial_data
(
group
)
...
...
此差异已折叠。
点击以展开。
ee/spec/helpers/ee/groups_helper_spec.rb
+
23
−
0
浏览文件 @
7b5f7b45
...
@@ -499,6 +499,29 @@
...
@@ -499,6 +499,29 @@
end
end
end
end
describe
'#active_subscription_data'
do
context
'when there is a current subscription'
,
:saas
do
let
(
:subscription
)
{
create
(
:gitlab_subscription
,
namespace:
group
)
}
before
do
group
.
gitlab_subscription
=
subscription
end
it
'returns the subscription start date and end date'
do
expect
(
helper
.
active_subscription_data
(
group
)).
to
eq
({
subscription_start_date:
subscription
.
start_date
,
subscription_end_date:
subscription
.
end_date
})
end
end
context
'when there is no current subscription'
do
it
'returns empty'
do
expect
(
helper
.
active_subscription_data
(
group
)).
to
eq
({})
end
end
end
describe
'#active_duo_pro_trial_data'
do
describe
'#active_duo_pro_trial_data'
do
context
'when an active duo pro trial exists'
do
context
'when an active duo pro trial exists'
do
let
(
:trial_add_on
)
{
create
(
:gitlab_subscription_add_on_purchase
,
:gitlab_duo_pro
,
:trial
,
namespace:
group
)
}
let
(
:trial_add_on
)
{
create
(
:gitlab_subscription_add_on_purchase
,
:gitlab_duo_pro
,
:trial
,
namespace:
group
)
}
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录