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
c4c08669
Commit
c4c08669
authored
Dec 06, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'revert-gold-trial-mrs' into 'master'
Revert Gold Trial MRs See merge request gitlab-org/gitlab-ee!8726
parents
b3596fbd
a5f97dba
Changes
41
Show whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
47 additions
and
524 deletions
+47
-524
app/assets/javascripts/clusters/clusters_bundle.js
app/assets/javascripts/clusters/clusters_bundle.js
+2
-8
app/assets/javascripts/dismissable_callout.js
app/assets/javascripts/dismissable_callout.js
+27
-0
app/assets/javascripts/pages/groups/clusters/index/index.js
app/assets/javascripts/pages/groups/clusters/index/index.js
+2
-4
app/assets/javascripts/pages/groups/index.js
app/assets/javascripts/pages/groups/index.js
+2
-8
app/assets/javascripts/pages/projects/clusters/index/index.js
...assets/javascripts/pages/projects/clusters/index/index.js
+2
-4
app/assets/javascripts/pages/projects/index.js
app/assets/javascripts/pages/projects/index.js
+2
-4
app/assets/javascripts/pages/root/index.js
app/assets/javascripts/pages/root/index.js
+0
-5
app/assets/javascripts/persistent_user_callout.js
app/assets/javascripts/persistent_user_callout.js
+0
-34
app/helpers/dashboard_helper.rb
app/helpers/dashboard_helper.rb
+0
-2
app/helpers/user_callouts_helper.rb
app/helpers/user_callouts_helper.rb
+0
-2
app/helpers/users_helper.rb
app/helpers/users_helper.rb
+0
-2
app/views/clusters/clusters/_gcp_signup_offer_banner.html.haml
...iews/clusters/clusters/_gcp_signup_offer_banner.html.haml
+2
-2
app/views/dashboard/activity.html.haml
app/views/dashboard/activity.html.haml
+0
-3
app/views/dashboard/groups/index.html.haml
app/views/dashboard/groups/index.html.haml
+0
-2
app/views/dashboard/issues.html.haml
app/views/dashboard/issues.html.haml
+0
-2
app/views/dashboard/merge_requests.html.haml
app/views/dashboard/merge_requests.html.haml
+0
-2
app/views/dashboard/projects/index.html.haml
app/views/dashboard/projects/index.html.haml
+0
-2
app/views/dashboard/projects/starred.html.haml
app/views/dashboard/projects/starred.html.haml
+0
-2
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+0
-2
app/views/explore/groups/index.html.haml
app/views/explore/groups/index.html.haml
+0
-2
app/views/explore/projects/index.html.haml
app/views/explore/projects/index.html.haml
+0
-2
app/views/explore/projects/starred.html.haml
app/views/explore/projects/starred.html.haml
+0
-2
app/views/explore/projects/trending.html.haml
app/views/explore/projects/trending.html.haml
+0
-2
ee/app/assets/javascripts/pages/dashboard/index.js
ee/app/assets/javascripts/pages/dashboard/index.js
+0
-7
ee/app/assets/javascripts/pages/root/index.js
ee/app/assets/javascripts/pages/root/index.js
+0
-6
ee/app/assets/stylesheets/pages/promotions.scss
ee/app/assets/stylesheets/pages/promotions.scss
+1
-19
ee/app/helpers/ee/dashboard_helper.rb
ee/app/helpers/ee/dashboard_helper.rb
+0
-30
ee/app/helpers/ee/user_callouts_helper.rb
ee/app/helpers/ee/user_callouts_helper.rb
+0
-25
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+7
-31
ee/app/views/shared/_gold_trial_callout.html.haml
ee/app/views/shared/_gold_trial_callout.html.haml
+0
-16
ee/changelogs/unreleased/6983-promote-starting-a-gitlab-com-trial.yml
...s/unreleased/6983-promote-starting-a-gitlab-com-trial.yml
+0
-5
ee/spec/features/dashboards/activity_spec.rb
ee/spec/features/dashboards/activity_spec.rb
+0
-8
ee/spec/features/dashboards/groups_spec.rb
ee/spec/features/dashboards/groups_spec.rb
+0
-8
ee/spec/features/dashboards/issues_spec.rb
ee/spec/features/dashboards/issues_spec.rb
+0
-8
ee/spec/features/dashboards/merge_requests_spec.rb
ee/spec/features/dashboards/merge_requests_spec.rb
+0
-8
ee/spec/features/dashboards/projects_spec.rb
ee/spec/features/dashboards/projects_spec.rb
+0
-8
ee/spec/features/dashboards/todos_spec.rb
ee/spec/features/dashboards/todos_spec.rb
+0
-8
ee/spec/helpers/ee/user_callouts_helper_spec.rb
ee/spec/helpers/ee/user_callouts_helper_spec.rb
+0
-160
ee/spec/support/shared_examples/gold_trial_callout_shared_examples.rb
...ort/shared_examples/gold_trial_callout_shared_examples.rb
+0
-63
locale/gitlab.pot
locale/gitlab.pot
+0
-15
spec/features/dashboard/merge_requests_spec.rb
spec/features/dashboard/merge_requests_spec.rb
+0
-1
No files found.
app/assets/javascripts/clusters/clusters_bundle.js
View file @
c4c08669
import
Visibility
from
'
visibilityjs
'
;
import
Vue
from
'
vue
'
;
import
PersistentUserCallout
from
'
../persistent_user
_callout
'
;
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
import
{
s__
,
sprintf
}
from
'
../locale
'
;
import
Flash
from
'
../flash
'
;
import
Poll
from
'
../lib/utils/poll
'
;
...
...
@@ -67,7 +67,7 @@ export default class Clusters {
this
.
showTokenButton
=
document
.
querySelector
(
'
.js-show-cluster-token
'
);
this
.
tokenField
=
document
.
querySelector
(
'
.js-cluster-token
'
);
Clusters
.
initDismissableCallout
(
);
initDismissableCallout
(
'
.js-cluster-security-warning
'
);
initSettingsPanels
();
setupToggleButtons
(
document
.
querySelector
(
'
.js-cluster-enable-toggle-area
'
));
this
.
initApplications
(
clusterType
);
...
...
@@ -108,12 +108,6 @@ export default class Clusters {
});
}
static
initDismissableCallout
()
{
const
callout
=
document
.
querySelector
(
'
.js-cluster-security-warning
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
}
addListeners
()
{
if
(
this
.
showTokenButton
)
this
.
showTokenButton
.
addEventListener
(
'
click
'
,
this
.
showToken
);
eventHub
.
$on
(
'
installApplication
'
,
this
.
installApplication
);
...
...
app/assets/javascripts/dismissable_callout.js
0 → 100644
View file @
c4c08669
import
$
from
'
jquery
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
Flash
from
'
~/flash
'
;
export
default
function
initDismissableCallout
(
alertSelector
)
{
const
alertEl
=
document
.
querySelector
(
alertSelector
);
if
(
!
alertEl
)
{
return
;
}
const
closeButtonEl
=
alertEl
.
getElementsByClassName
(
'
close
'
)[
0
];
const
{
dismissEndpoint
,
featureId
}
=
closeButtonEl
.
dataset
;
closeButtonEl
.
addEventListener
(
'
click
'
,
()
=>
{
axios
.
post
(
dismissEndpoint
,
{
feature_name
:
featureId
,
})
.
then
(()
=>
{
$
(
alertEl
).
alert
(
'
close
'
);
})
.
catch
(()
=>
{
Flash
(
__
(
'
An error occurred while dismissing the alert. Refresh the page and try again.
'
));
});
});
}
app/assets/javascripts/pages/groups/clusters/index/index.js
View file @
c4c08669
import
PersistentUserCallout
from
'
~/persistent_user
_callout
'
;
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
initDismissableCallout
(
'
.gcp-signup-offer
'
);
});
app/assets/javascripts/pages/groups/index.js
View file @
c4c08669
import
PersistentUserCallout
from
'
~/persistent_user
_callout
'
;
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
import
initGkeDropdowns
from
'
~/projects/gke_cluster_dropdowns
'
;
function
initCallout
()
{
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
}
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
{
page
}
=
document
.
body
.
dataset
;
const
newClusterViews
=
[
...
...
@@ -16,7 +10,7 @@ document.addEventListener('DOMContentLoaded', () => {
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
init
Callout
(
);
init
DismissableCallout
(
'
.gcp-signup-offer
'
);
initGkeDropdowns
();
}
});
app/assets/javascripts/pages/projects/clusters/index/index.js
View file @
c4c08669
import
PersistentUserCallout
from
'
~/persistent_user
_callout
'
;
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
initDismissableCallout
(
'
.gcp-signup-offer
'
);
});
app/assets/javascripts/pages/projects/index.js
View file @
c4c08669
import
initDismissableCallout
from
'
~/dismissable_callout
'
;
import
initGkeDropdowns
from
'
~/projects/gke_cluster_dropdowns
'
;
import
PersistentUserCallout
from
'
../../persistent_user_callout
'
;
import
Project
from
'
./project
'
;
import
ShortcutsNavigation
from
'
../../behaviors/shortcuts/shortcuts_navigation
'
;
...
...
@@ -12,9 +12,7 @@ document.addEventListener('DOMContentLoaded', () => {
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
initDismissableCallout
(
'
.gcp-signup-offer
'
);
initGkeDropdowns
();
}
...
...
app/assets/javascripts/pages/root/index.js
deleted
100644 → 0
View file @
b3596fbd
// if the "projects dashboard" is a user's default dashboard, when they visit the
// instance root index, the dashboard will be served by the root controller instead
// of a dashboard controller. The root index redirects for all other default dashboards.
import
'
../dashboard/projects/index
'
;
app/assets/javascripts/persistent_user_callout.js
deleted
100644 → 0
View file @
b3596fbd
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
__
}
from
'
./locale
'
;
import
Flash
from
'
./flash
'
;
export
default
class
PersistentUserCallout
{
constructor
(
container
)
{
const
{
dismissEndpoint
,
featureId
}
=
container
.
dataset
;
this
.
container
=
container
;
this
.
dismissEndpoint
=
dismissEndpoint
;
this
.
featureId
=
featureId
;
this
.
init
();
}
init
()
{
const
closeButton
=
this
.
container
.
querySelector
(
'
.js-close
'
);
closeButton
.
addEventListener
(
'
click
'
,
event
=>
this
.
dismiss
(
event
));
}
dismiss
(
event
)
{
event
.
preventDefault
();
axios
.
post
(
this
.
dismissEndpoint
,
{
feature_name
:
this
.
featureId
,
})
.
then
(()
=>
{
this
.
container
.
remove
();
})
.
catch
(()
=>
{
Flash
(
__
(
'
An error occurred while dismissing the alert. Refresh the page and try again.
'
));
});
}
}
app/helpers/dashboard_helper.rb
View file @
c4c08669
# frozen_string_literal: true
module
DashboardHelper
prepend
EE
::
DashboardHelper
def
assigned_issues_dashboard_path
issues_dashboard_path
(
assignee_username:
current_user
.
username
)
end
...
...
app/helpers/user_callouts_helper.rb
View file @
c4c08669
# frozen_string_literal: true
module
UserCalloutsHelper
prepend
EE
::
UserCalloutsHelper
GKE_CLUSTER_INTEGRATION
=
'gke_cluster_integration'
.
freeze
GCP_SIGNUP_OFFER
=
'gcp_signup_offer'
.
freeze
...
...
app/helpers/users_helper.rb
View file @
c4c08669
# frozen_string_literal: true
module
UsersHelper
prepend
EE
::
UsersHelper
def
user_link
(
user
)
link_to
(
user
.
name
,
user_path
(
user
),
title:
user
.
email
,
...
...
app/views/clusters/clusters/_gcp_signup_offer_banner.html.haml
View file @
c4c08669
-
link
=
link_to
(
s_
(
'ClusterIntegration|sign up'
),
'https://console.cloud.google.com/freetrial?utm_campaign=2018_cpanel&utm_source=gitlab&utm_medium=referral'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
)
.bs-callout.gcp-signup-offer.alert.alert-block.alert-dismissable.prepend-top-default.append-bottom-default
{
role:
'alert'
,
data:
{
feature_id:
UserCalloutsHelper
::
GCP_SIGNUP_OFFER
,
dismiss_endpoint:
user_callouts_path
}
}
%button
.close
.js-close
{
type:
"button"
}
×
.bs-callout.gcp-signup-offer.alert.alert-block.alert-dismissable.prepend-top-default.append-bottom-default
{
role:
'alert'
}
%button
.close
{
type:
"button"
,
data:
{
feature_id:
UserCalloutsHelper
::
GCP_SIGNUP_OFFER
,
dismiss_endpoint:
user_callouts_path
}
}
×
.gcp-signup-offer--content
.gcp-signup-offer--icon.append-right-8
=
sprite_icon
(
"information"
,
size:
16
)
...
...
app/views/dashboard/activity.html.haml
View file @
c4c08669
...
...
@@ -4,9 +4,6 @@
=
content_for
:meta_tags
do
=
auto_discovery_link_tag
(
:atom
,
dashboard_projects_url
(
rss_url_options
),
title:
"All activity"
)
=
render_if_exists
"shared/gold_trial_callout"
-
page_title
"Activity"
-
header_title
"Activity"
,
activity_dashboard_path
...
...
app/views/dashboard/groups/index.html.haml
View file @
c4c08669
-
@hide_top_links
=
true
-
page_title
"Groups"
-
header_title
"Groups"
,
dashboard_groups_path
=
render_if_exists
"shared/gold_trial_callout"
=
render
'dashboard/groups_head'
-
if
params
[
:filter
].
blank?
&&
@groups
.
empty?
...
...
app/views/dashboard/issues.html.haml
View file @
c4c08669
...
...
@@ -4,8 +4,6 @@
=
content_for
:meta_tags
do
=
auto_discovery_link_tag
(
:atom
,
safe_params
.
merge
(
rss_url_options
).
to_h
,
title:
"
#{
current_user
.
name
}
issues"
)
=
render_if_exists
"shared/gold_trial_callout"
.page-title-holder
%h1
.page-title
=
_
(
'Issues'
)
...
...
app/views/dashboard/merge_requests.html.haml
View file @
c4c08669
...
...
@@ -2,8 +2,6 @@
-
page_title
_
(
"Merge Requests"
)
-
@breadcrumb_link
=
merge_requests_dashboard_path
(
assignee_username:
current_user
.
username
)
=
render_if_exists
"shared/gold_trial_callout"
.page-title-holder
%h1
.page-title
=
_
(
'Merge Requests'
)
...
...
app/views/dashboard/projects/index.html.haml
View file @
c4c08669
...
...
@@ -4,8 +4,6 @@
=
content_for
:meta_tags
do
=
auto_discovery_link_tag
(
:atom
,
dashboard_projects_url
(
rss_url_options
),
title:
"All activity"
)
=
render_if_exists
"shared/gold_trial_callout"
-
page_title
"Projects"
-
header_title
"Projects"
,
dashboard_projects_path
...
...
app/views/dashboard/projects/starred.html.haml
View file @
c4c08669
...
...
@@ -4,8 +4,6 @@
-
page_title
"Starred Projects"
-
header_title
"Projects"
,
dashboard_projects_path
=
render_if_exists
"shared/gold_trial_callout"
%div
{
class:
container_class
}
=
render
"projects/last_push"
=
render
'dashboard/projects_head'
...
...
app/views/dashboard/todos/index.html.haml
View file @
c4c08669
...
...
@@ -2,8 +2,6 @@
-
page_title
"Todos"
-
header_title
"Todos"
,
dashboard_todos_path
=
render_if_exists
"shared/gold_trial_callout"
.page-title-holder
%h1
.page-title
=
_
(
'Todos'
)
...
...
app/views/explore/groups/index.html.haml
View file @
c4c08669
...
...
@@ -2,8 +2,6 @@
-
page_title
_
(
"Groups"
)
-
header_title
_
(
"Groups"
),
dashboard_groups_path
=
render_if_exists
"shared/gold_trial_callout"
-
if
current_user
=
render
'dashboard/groups_head'
-
else
...
...
app/views/explore/projects/index.html.haml
View file @
c4c08669
...
...
@@ -2,8 +2,6 @@
-
page_title
_
(
"Projects"
)
-
header_title
_
(
"Projects"
),
dashboard_projects_path
=
render_if_exists
"shared/gold_trial_callout"
-
if
current_user
=
render
'dashboard/projects_head'
-
else
...
...
app/views/explore/projects/starred.html.haml
View file @
c4c08669
...
...
@@ -2,8 +2,6 @@
-
page_title
_
(
"Projects"
)
-
header_title
_
(
"Projects"
),
dashboard_projects_path
=
render_if_exists
"shared/gold_trial_callout"
-
if
current_user
=
render
'dashboard/projects_head'
-
else
...
...
app/views/explore/projects/trending.html.haml
View file @
c4c08669
...
...
@@ -2,8 +2,6 @@
-
page_title
_
(
"Projects"
)
-
header_title
_
(
"Projects"
),
dashboard_projects_path
=
render_if_exists
"shared/gold_trial_callout"
-
if
current_user
=
render
'dashboard/projects_head'
-
else
...
...
ee/app/assets/javascripts/pages/dashboard/index.js
deleted
100644 → 0
View file @
b3596fbd
import
PersistentUserCallout
from
'
~/persistent_user_callout
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
callout
=
document
.
querySelector
(
'
.js-gold-trial-callout
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
});
ee/app/assets/javascripts/pages/root/index.js
deleted
100644 → 0
View file @
b3596fbd
// if the "projects dashboard" is a user's default dashboard, when they visit the
// instance root index, the dashboard will be served by the root controller instead
// of a dashboard controller. The root index redirects for all other default dashboards.
import
'
~/pages/root/index
'
;
import
'
../dashboard/index
'
;
ee/app/assets/stylesheets/pages/promotions.scss
View file @
c4c08669
...
...
@@ -34,7 +34,7 @@
}
.svg-container
{
margin-right
:
$gl-padding
;
margin-right
:
15px
;
}
}
...
...
@@ -77,24 +77,6 @@
margin
:
0
;
}
}
&
.thin-callout
{
.bordered-box
{
padding
:
$gl-padding
;
padding-left
:
40px
;
.close
{
position
:
relative
;
top
:
0
;
right
:
0
;
}
}
.svg-container
.svg
{
max-width
:
39px
;
max-height
:
39px
;
}
}
}
.promotion-modal
{
...
...
ee/app/helpers/ee/dashboard_helper.rb
deleted
100644 → 0
View file @
b3596fbd
# frozen_string_literal: true
module
EE
module
DashboardHelper
def
controller_action_to_child_dashboards
(
controller
=
controller_name
,
action
=
action_name
)
case
"
#{
controller
}
#
#{
action
}
"
when
'projects#index'
,
'root#index'
,
'projects#starred'
,
'projects#trending'
%w(projects)
when
'dashboard#activity'
%w(starred_project_activity project_activity)
when
'groups#index'
%w(groups)
when
'todos#index'
%w(todos)
when
'dashboard#issues'
%w(issues)
when
'dashboard#merge_requests'
%w(merge_requests)
else
[]
end
end
def
user_default_dashboard?
(
user
=
current_user
)
return
false
unless
user
controller_action_to_child_dashboards
.
any?
{
|
dashboard
|
dashboard
==
user
.
dashboard
}
end
end
end
ee/app/helpers/ee/user_callouts_helper.rb
deleted
100644 → 0
View file @
b3596fbd
# frozen_string_literal: true
module
EE
module
UserCalloutsHelper
GOLD_TRIAL
=
'gold_trial'
def
show_gold_trial?
(
user
=
current_user
)
return
false
if
user_dismissed?
(
GOLD_TRIAL
)
return
false
unless
show_gold_trial_suitable_env?
users_namespaces_clean?
(
user
)
end
def
show_gold_trial_suitable_env?
(
::
Gitlab
.
com?
||
Rails
.
env
.
development?
)
&&
!::
Gitlab
::
Database
.
read_only?
end
def
users_namespaces_clean?
(
user
)
return
false
if
user
.
any_namespace_with_gold?
!
user
.
any_namespace_with_trial?
end
end
end
ee/app/models/ee/user.rb
View file @
c4c08669
...
...
@@ -190,36 +190,11 @@ module EE
project_creation_level:
project_creation_levels
)
end
def
any_namespace_with_trial?
::
Namespace
.
from
(
"(
#{
namespace_union
(
:trial_ends_on
)
}
)
#{
::
Namespace
.
table_name
}
"
)
.
where
(
'trial_ends_on > ?'
,
Time
.
now
.
utc
)
.
any?
end
def
any_namespace_with_gold?
::
Namespace
.
includes
(
:plan
)
.
where
(
"namespaces.id IN (
#{
namespace_union
}
)"
)
# rubocop:disable GitlabSecurity/SqlInjection
.
where
.
not
(
plans:
{
id:
nil
})
.
any?
end
override
:has_current_license?
def
has_current_license?
License
.
current
.
present?
end
def
group_sso?
(
group
)
return
false
unless
group
if
group_saml_identities
.
loaded?
group_saml_identities
.
any?
{
|
identity
|
identity
.
saml_provider
.
group_id
==
group
.
id
}
else
group_saml_identities
.
where
(
saml_provider:
group
.
saml_provider
).
any?
end
end
override
:ldap_sync_time
def
ldap_sync_time
::
Gitlab
.
config
.
ldap
[
'sync_time'
]
...
...
@@ -229,13 +204,14 @@ module EE
update_column
:admin_email_unsubscribed_at
,
Time
.
now
end
private
def
group_sso?
(
group
)
return
false
unless
group
def
namespace_union
(
select
=
:id
)
::
Gitlab
::
SQL
::
Union
.
new
([
::
Namespace
.
select
(
select
).
where
(
type:
nil
,
owner:
self
),
owned_groups
.
select
(
select
).
where
(
parent_id:
nil
)
]).
to_sql
if
group_saml_identities
.
loaded?
group_saml_identities
.
any?
{
|
identity
|
identity
.
saml_provider
.
group_id
==
group
.
id
}
else
group_saml_identities
.
where
(
saml_provider:
group
.
saml_provider
).
any?
end
end
end
end
ee/app/views/shared/_gold_trial_callout.html.haml
deleted
100644 → 0
View file @
b3596fbd
-
if
user_default_dashboard?
&&
show_gold_trial?
.pt-1.d-none.d-md-block
{
class:
container_class
}
.user-callout.promotion-callout.thin-callout.js-gold-trial-callout
{
data:
{
uid:
'trial_callout_dismissed'
,
feature_id:
UserCalloutsHelper
::
GOLD_TRIAL
,
dismiss_endpoint:
user_callouts_path
}
}
.bordered-box.justify-content-left.align-items-center
.svg-container
=
image_tag
'illustrations/golden_tanuki.svg'
,
class:
'svg'
.d-flex.flex-grow.align-items-center
.user-callout-copy.ml-0
%h5
.mb-0.mt-0
=
_
(
'Free Trial of GitLab.com Gold'
)
%p
.mb-0
%span
=
_
(
'Try all GitLab has to offer for 30 days.'
)
%span
.d-none.d-sm-inline
=
_
(
'No credit card required.'
)
=
link_to
_
(
'Start your trial'
),
'https://customers.gitlab.com/trials/new?gl_com=true'
,
class:
'btn btn-primary mr-3 mt-2 mt-sm-0'
,
target:
'_blank'
%button
.btn.btn-default.close.js-close
{
type:
'button'
,
'aria-label'
=>
_
(
'Dismiss trial promotion'
)
}
=
sprite_icon
(
'close'
,
css_class:
'dismiss-icon'
)
ee/changelogs/unreleased/6983-promote-starting-a-gitlab-com-trial.yml
deleted
100644 → 0
View file @
b3596fbd
---
title
:
Promote starting a GitLab.com Gold trial on the dashboard
merge_request
:
6947
author
:
type
:
other
ee/spec/features/dashboards/activity_spec.rb
deleted
100644 → 0
View file @
b3596fbd
require
'spec_helper'
describe
'Dashboard activity'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:page_path
)
{
activity_dashboard_path
}
it_behaves_like
'gold trial callout'
end
ee/spec/features/dashboards/groups_spec.rb
deleted
100644 → 0
View file @
b3596fbd
require
'spec_helper'
describe
'Dashboard groups'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:page_path
)
{
dashboard_groups_path
}
it_behaves_like
'gold trial callout'
end
ee/spec/features/dashboards/issues_spec.rb
deleted
100644 → 0
View file @
b3596fbd
require
'spec_helper'
describe
'Dashboard issues'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:page_path
)
{
issues_dashboard_path
}
it_behaves_like
'gold trial callout'
end
ee/spec/features/dashboards/merge_requests_spec.rb
deleted
100644 → 0
View file @
b3596fbd
require
'spec_helper'
describe
'Dashboard merge requests'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:page_path
)
{
merge_requests_dashboard_path
}
it_behaves_like
'gold trial callout'
end
ee/spec/features/dashboards/projects_spec.rb
deleted
100644 → 0
View file @
b3596fbd
require
'spec_helper'
describe
'Dashboard projects'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:page_path
)
{
dashboard_projects_path
}
it_behaves_like
'gold trial callout'
end
ee/spec/features/dashboards/todos_spec.rb
deleted
100644 → 0
View file @
b3596fbd
require
'spec_helper'
describe
'Dashboard todos'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:page_path
)
{
dashboard_todos_path
}
it_behaves_like
'gold trial callout'
end
ee/spec/helpers/ee/user_callouts_helper_spec.rb
deleted
100644 → 0
View file @
b3596fbd
# frozen_string_literal: true
require
'spec_helper'
describe
EE
::
UserCalloutsHelper
do
let
(
:user
)
{
create
(
:user
)
}
before
do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
describe
'.show_gold_trial?'
do
let
(
:suitable_env
)
{
nil
}
before
do
allow
(
helper
).
to
receive
(
:user_dismissed?
).
with
(
described_class
::
GOLD_TRIAL
).
and_return
(
user_dismissed
)
allow
(
helper
).
to
receive
(
:show_gold_trial_suitable_env?
).
and_return
(
suitable_env
)
end
context
'when user has already dismissed the callout'
do
let
(
:user_dismissed
)
{
true
}
it
'returns false'
do
expect
(
helper
.
show_gold_trial?
).
to
be_falsey
end
end
context
'when show_gold_trial_suitable_env? returns false'
do
let
(
:user_dismissed
)
{
false
}
let
(
:suitable_env
)
{
false
}
it
'returns false'
do
expect
(
helper
.
show_gold_trial?
).
to
be_falsey
end
end
context
'when show_gold_trial_namespaces_checked?'
do
let
(
:user_dismissed
)
{
false
}
let
(
:suitable_env
)
{
true
}
before
do
allow
(
helper
).
to
receive
(
:users_namespaces_clean?
).
and_return
(
namespaces_checked
)
end
context
'returns false'
do
let
(
:namespaces_checked
)
{
false
}
it
'returns false'
do
expect
(
helper
.
show_gold_trial?
).
to
be_falsey
end
end
context
'returns true'
do
let
(
:namespaces_checked
)
{
true
}
it
'returns true'
do
expect
(
helper
.
show_gold_trial?
).
to
be_truthy
end
end
end
end
describe
'.show_gold_trial_suitable_env?'
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
gitlab_com
)
allow
(
Rails
.
env
).
to
receive
(
:development?
).
and_return
(
rails_dev_env
)
allow
(
Gitlab
::
Database
).
to
receive
(
:read_only?
).
and_return
(
db_read_only
)
end
context
'with a writable DB'
do
let
(
:db_read_only
)
{
false
}
context
"when we're neither GitLab.com or a Rails development env"
do
let
(
:gitlab_com
)
{
false
}
let
(
:rails_dev_env
)
{
false
}
it
'returns true'
do
expect
(
helper
.
show_gold_trial_suitable_env?
).
to
be_falsey
end
end
context
"when we're GitLab.com"
do
let
(
:gitlab_com
)
{
true
}
let
(
:rails_dev_env
)
{
false
}
it
'returns true'
do
expect
(
helper
.
show_gold_trial_suitable_env?
).
to
be_truthy
end
end
context
"when we're a Rails development env"
do
let
(
:gitlab_com
)
{
false
}
let
(
:rails_dev_env
)
{
true
}
it
'returns true'
do
expect
(
helper
.
show_gold_trial_suitable_env?
).
to
be_truthy
end
end
end
context
'with a readonly DB'
do
let
(
:db_read_only
)
{
true
}
context
"when we're GitLab.com"
do
let
(
:gitlab_com
)
{
true
}
let
(
:rails_dev_env
)
{
false
}
it
'returns true'
do
expect
(
helper
.
show_gold_trial_suitable_env?
).
to
be_falsey
end
end
context
"when we're a Rails development env"
do
let
(
:gitlab_com
)
{
false
}
let
(
:rails_dev_env
)
{
true
}
it
'returns true'
do
expect
(
helper
.
show_gold_trial_suitable_env?
).
to
be_falsey
end
end
end
end
describe
'.show_gold_trial_namespaces_checked?'
do
let
(
:a_name_space_has_trial
)
{
nil
}
before
do
allow
(
user
).
to
receive
(
:any_namespace_with_gold?
).
and_return
(
a_name_space_has_gold
)
allow
(
user
).
to
receive
(
:any_namespace_with_trial?
).
and_return
(
a_name_space_has_trial
)
end
context
"when a user's namespace has gold"
do
let
(
:a_name_space_has_gold
)
{
true
}
it
'returns false'
do
expect
(
helper
.
users_namespaces_clean?
(
user
)).
to
be_falsey
end
end
context
"when a user's namespace does not have gold"
do
let
(
:a_name_space_has_gold
)
{
false
}
context
"but a user's namespace has a trial"
do
let
(
:a_name_space_has_trial
)
{
true
}
it
'returns false'
do
expect
(
helper
.
users_namespaces_clean?
(
user
)).
to
be_falsey
end
end
context
"and does not have a trial"
do
let
(
:a_name_space_has_trial
)
{
false
}
it
'returns true'
do
expect
(
helper
.
users_namespaces_clean?
(
user
)).
to
be_truthy
end
end
end
end
end
ee/spec/support/shared_examples/gold_trial_callout_shared_examples.rb
deleted
100644 → 0
View file @
b3596fbd
shared_examples
'gold trial callout'
do
before
do
sign_in
(
user
)
end
it
'hides promotion callout if not .com'
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
false
)
visit
page_path
expect
(
page
).
not_to
have_selector
'.promotion-callout'
end
context
'.com'
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
end
it
'shows dismissable promotion callout if default dashboard'
,
:js
do
allow_any_instance_of
(
EE
::
DashboardHelper
).
to
receive
(
:user_default_dashboard?
).
and_return
(
true
)
visit
page_path
expect
(
page
).
to
have_selector
'.promotion-callout'
find
(
'.js-close'
).
click
expect
(
page
).
not_to
have_selector
'.promotion-callout'
end
it
'hides dismissable promotion callout if not default dashboard'
,
:js
do
allow_any_instance_of
(
EE
::
DashboardHelper
).
to
receive
(
:user_default_dashboard?
).
and_return
(
false
)
visit
page_path
expect
(
page
).
not_to
have_selector
'.promotion-callout'
end
it
'hides promotion callout if a trial is active'
do
group
=
create
(
:group
,
name:
'trial group'
,
trial_ends_on:
1
.
year
.
from_now
)
group
.
add_owner
(
user
)
visit
page_path
expect
(
page
).
not_to
have_selector
'.promotion-callout'
end
it
'hides promotion callout if a gold plan is active'
,
:js
do
group
=
create
(
:group
,
name:
'gold group'
,
plan: :gold_plan
)
group
.
add_owner
(
user
)
visit
page_path
expect
(
page
).
not_to
have_selector
'.promotion-callout'
end
it
'hides promotion callout if database is in a readonly state'
do
allow
(
Gitlab
::
Database
).
to
receive
(
:read_only?
).
and_return
(
true
)
expect
(
page
).
not_to
have_selector
'.promotion-callout'
end
end
end
locale/gitlab.pot
View file @
c4c08669
...
...
@@ -2980,9 +2980,6 @@ msgstr ""
msgid "Dismiss Merge Request promotion"
msgstr ""
msgid "Dismiss trial promotion"
msgstr ""
msgid "Do you want to customize how Google Code email addresses and usernames are imported into GitLab?"
msgstr ""
...
...
@@ -3718,9 +3715,6 @@ msgstr ""
msgid "Found errors in your .gitlab-ci.yml:"
msgstr ""
msgid "Free Trial of GitLab.com Gold"
msgstr ""
msgid "From %{provider_title}"
msgstr ""
...
...
@@ -5717,9 +5711,6 @@ msgstr ""
msgid "No contributions were found"
msgstr ""
msgid "No credit card required."
msgstr ""
msgid "No due date"
msgstr ""
...
...
@@ -8077,9 +8068,6 @@ msgstr ""
msgid "Start the Runner!"
msgstr ""
msgid "Start your trial"
msgstr ""
msgid "Started"
msgstr ""
...
...
@@ -9001,9 +8989,6 @@ msgstr ""
msgid "Try again?"
msgstr ""
msgid "Try all GitLab has to offer for 30 days."
msgstr ""
msgid "Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now."
msgstr ""
...
...
spec/features/dashboard/merge_requests_spec.rb
View file @
c4c08669
...
...
@@ -6,7 +6,6 @@ describe 'Dashboard Merge Requests' do
include
ProjectForksHelper
let
(
:current_user
)
{
create
:user
}
let
(
:user
)
{
current_user
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:public_project
)
{
create
(
:project
,
:public
,
:repository
)
}
...
...
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