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
61fa509b
Commit
61fa509b
authored
Jul 08, 2021
by
Dallas Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a slightly improper usage of gitlab-experiment
parent
fcd2128c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
ee/app/helpers/trial_status_widget_helper.rb
ee/app/helpers/trial_status_widget_helper.rb
+13
-7
No files found.
ee/app/helpers/trial_status_widget_helper.rb
View file @
61fa509b
...
@@ -21,7 +21,7 @@ module TrialStatusWidgetHelper
...
@@ -21,7 +21,7 @@ module TrialStatusWidgetHelper
base_attrs
.
merge
(
base_attrs
.
merge
(
group_name:
group
.
name
,
group_name:
group
.
name
,
purchase_href:
ultimate_subscription_path_for_group
(
group
),
purchase_href:
ultimate_subscription_path_for_group
(
group
),
start_initially_shown:
in_forced_popover_experiment?
(
group
)
&&
force_popover_to_be_shown?
(
group
.
trial_days_remaining
),
start_initially_shown:
force_popover_to_be_shown?
(
group
),
target_id:
base_attrs
[
:container_id
],
target_id:
base_attrs
[
:container_id
],
trial_end_date:
group
.
trial_ends_on
trial_end_date:
group
.
trial_ends_on
)
)
...
@@ -49,8 +49,18 @@ module TrialStatusWidgetHelper
...
@@ -49,8 +49,18 @@ module TrialStatusWidgetHelper
group
.
trial_active?
&&
can?
(
current_user
,
:admin_namespace
,
group
)
group
.
trial_active?
&&
can?
(
current_user
,
:admin_namespace
,
group
)
end
end
def
force_popover_to_be_shown?
(
days_remaining
)
def
force_popover_to_be_shown?
(
group
)
D14_CALLOUT_RANGE
.
cover?
(
days_remaining
)
||
D3_CALLOUT_RANGE
.
cover?
(
days_remaining
)
experiment
(
:forcibly_show_trial_status_popover
,
group:
group
)
do
|
e
|
e
.
use
{
false
}
e
.
try
do
days_remaining
=
group
.
trial_days_remaining
D14_CALLOUT_RANGE
.
cover?
(
days_remaining
)
||
D3_CALLOUT_RANGE
.
cover?
(
days_remaining
)
end
e
.
run
end
end
end
def
trial_status_common_data_attrs
(
group
)
def
trial_status_common_data_attrs
(
group
)
...
@@ -64,8 +74,4 @@ module TrialStatusWidgetHelper
...
@@ -64,8 +74,4 @@ module TrialStatusWidgetHelper
def
ultimate_subscription_path_for_group
(
group
)
def
ultimate_subscription_path_for_group
(
group
)
new_subscriptions_path
(
namespace_id:
group
.
id
,
plan_id:
ZUORA_ULTIMATE_PLAN_ID
)
new_subscriptions_path
(
namespace_id:
group
.
id
,
plan_id:
ZUORA_ULTIMATE_PLAN_ID
)
end
end
def
in_forced_popover_experiment?
(
group
)
experiment
(
:forcibly_show_trial_status_popover
,
group:
group
).
variant
.
group
==
:experiment
end
end
end
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