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
5f110a6a
Commit
5f110a6a
authored
Dec 06, 2018
by
Luke Bennett
Committed by
Michael Kozono
Jan 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port GitLab.com gold trial callout changes to CE
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8731
parent
24665ccb
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
140 additions
and
57 deletions
+140
-57
app/assets/javascripts/clusters/clusters_bundle.js
app/assets/javascripts/clusters/clusters_bundle.js
+8
-2
app/assets/javascripts/dismissable_callout.js
app/assets/javascripts/dismissable_callout.js
+0
-27
app/assets/javascripts/pages/groups/clusters/index/index.js
app/assets/javascripts/pages/groups/clusters/index/index.js
+4
-2
app/assets/javascripts/pages/groups/index.js
app/assets/javascripts/pages/groups/index.js
+8
-2
app/assets/javascripts/pages/projects/clusters/index/index.js
...assets/javascripts/pages/projects/clusters/index/index.js
+4
-2
app/assets/javascripts/pages/projects/index.js
app/assets/javascripts/pages/projects/index.js
+4
-2
app/assets/javascripts/persistent_user_callout.js
app/assets/javascripts/persistent_user_callout.js
+34
-0
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
+3
-0
app/views/dashboard/groups/index.html.haml
app/views/dashboard/groups/index.html.haml
+2
-0
app/views/dashboard/issues.html.haml
app/views/dashboard/issues.html.haml
+2
-0
app/views/dashboard/merge_requests.html.haml
app/views/dashboard/merge_requests.html.haml
+2
-0
app/views/dashboard/projects/index.html.haml
app/views/dashboard/projects/index.html.haml
+2
-0
app/views/dashboard/projects/starred.html.haml
app/views/dashboard/projects/starred.html.haml
+2
-0
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+2
-0
app/views/explore/groups/index.html.haml
app/views/explore/groups/index.html.haml
+2
-0
app/views/explore/projects/index.html.haml
app/views/explore/projects/index.html.haml
+2
-0
app/views/explore/projects/starred.html.haml
app/views/explore/projects/starred.html.haml
+2
-0
app/views/explore/projects/trending.html.haml
app/views/explore/projects/trending.html.haml
+2
-0
spec/features/dashboard/merge_requests_spec.rb
spec/features/dashboard/merge_requests_spec.rb
+1
-0
spec/features/dashboard/root_explore_spec.rb
spec/features/dashboard/root_explore_spec.rb
+33
-0
spec/features/explore/user_explores_projects_spec.rb
spec/features/explore/user_explores_projects_spec.rb
+0
-18
spec/support/shared_examples/project_list_shared_examples.rb
spec/support/shared_examples/project_list_shared_examples.rb
+19
-0
No files found.
app/assets/javascripts/clusters/clusters_bundle.js
View file @
5f110a6a
import
Visibility
from
'
visibilityjs
'
;
import
Vue
from
'
vue
'
;
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
import
PersistentUserCallout
from
'
../persistent_user
_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
'
);
initDismissableCallout
(
'
.js-cluster-security-warning
'
);
Clusters
.
initDismissableCallout
(
);
initSettingsPanels
();
setupToggleButtons
(
document
.
querySelector
(
'
.js-cluster-enable-toggle-area
'
));
this
.
initApplications
(
clusterType
);
...
...
@@ -108,6 +108,12 @@ 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
deleted
100644 → 0
View file @
24665ccb
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 @
5f110a6a
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
import
PersistentUserCallout
from
'
~/persistent_user
_callout
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initDismissableCallout
(
'
.gcp-signup-offer
'
);
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
});
app/assets/javascripts/pages/groups/index.js
View file @
5f110a6a
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
import
PersistentUserCallout
from
'
~/persistent_user
_callout
'
;
import
initGkeDropdowns
from
'
~/projects/gke_cluster_dropdowns
'
;
function
initGcpSignupCallout
()
{
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
=
[
...
...
@@ -10,7 +16,7 @@ document.addEventListener('DOMContentLoaded', () => {
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
init
DismissableCallout
(
'
.gcp-signup-offer
'
);
init
GcpSignupCallout
(
);
initGkeDropdowns
();
}
});
app/assets/javascripts/pages/projects/clusters/index/index.js
View file @
5f110a6a
import
initDismissableCallout
from
'
~/dismissable
_callout
'
;
import
PersistentUserCallout
from
'
~/persistent_user
_callout
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initDismissableCallout
(
'
.gcp-signup-offer
'
);
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
});
app/assets/javascripts/pages/projects/index.js
View file @
5f110a6a
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,7 +12,9 @@ document.addEventListener('DOMContentLoaded', () => {
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
initDismissableCallout
(
'
.gcp-signup-offer
'
);
const
callout
=
document
.
querySelector
(
'
.gcp-signup-offer
'
);
if
(
callout
)
new
PersistentUserCallout
(
callout
);
// eslint-disable-line no-new
initGkeDropdowns
();
}
...
...
app/assets/javascripts/persistent_user_callout.js
0 → 100644
View file @
5f110a6a
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/views/clusters/clusters/_gcp_signup_offer_banner.html.haml
View file @
5f110a6a
-
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'
}
%button
.close
{
type:
"button"
,
data:
{
feature_id:
UserCalloutsHelper
::
GCP_SIGNUP_OFFER
,
dismiss_endpoint:
user_callouts_path
}
}
×
.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"
}
×
.gcp-signup-offer--content
.gcp-signup-offer--icon.append-right-8
=
sprite_icon
(
"information"
,
size:
16
)
...
...
app/views/dashboard/activity.html.haml
View file @
5f110a6a
...
...
@@ -4,6 +4,9 @@
=
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 @
5f110a6a
-
@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 @
5f110a6a
...
...
@@ -4,6 +4,8 @@
=
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 @
5f110a6a
...
...
@@ -2,6 +2,8 @@
-
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 @
5f110a6a
...
...
@@ -4,6 +4,8 @@
=
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 @
5f110a6a
...
...
@@ -4,6 +4,8 @@
-
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 @
5f110a6a
...
...
@@ -2,6 +2,8 @@
-
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 @
5f110a6a
...
...
@@ -2,6 +2,8 @@
-
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 @
5f110a6a
...
...
@@ -2,6 +2,8 @@
-
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 @
5f110a6a
...
...
@@ -2,6 +2,8 @@
-
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 @
5f110a6a
...
...
@@ -2,6 +2,8 @@
-
page_title
_
(
"Projects"
)
-
header_title
_
(
"Projects"
),
dashboard_projects_path
=
render_if_exists
"shared/gold_trial_callout"
-
if
current_user
=
render
'dashboard/projects_head'
-
else
...
...
spec/features/dashboard/merge_requests_spec.rb
View file @
5f110a6a
...
...
@@ -6,6 +6,7 @@ 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
)
}
...
...
spec/features/dashboard/root_explore_spec.rb
0 → 100644
View file @
5f110a6a
# frozen_string_literal: true
require
'spec_helper'
describe
'Root explore'
do
set
(
:public_project
)
{
create
(
:project
,
:public
)
}
set
(
:archived_project
)
{
create
(
:project
,
:archived
)
}
set
(
:internal_project
)
{
create
(
:project
,
:internal
)
}
set
(
:private_project
)
{
create
(
:project
,
:private
)
}
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
end
context
'when logged in'
do
set
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
visit
explore_projects_path
end
include_examples
'shows public and internal projects'
end
context
'when not logged in'
do
before
do
visit
explore_projects_path
end
include_examples
'shows public projects'
end
end
spec/features/explore/user_explores_projects_spec.rb
View file @
5f110a6a
...
...
@@ -6,24 +6,6 @@ describe 'User explores projects' do
set
(
:private_project
)
{
create
(
:project
,
:private
)
}
set
(
:public_project
)
{
create
(
:project
,
:public
)
}
shared_examples_for
'shows public projects'
do
it
'shows projects'
do
expect
(
page
).
to
have_content
(
public_project
.
title
)
expect
(
page
).
not_to
have_content
(
internal_project
.
title
)
expect
(
page
).
not_to
have_content
(
private_project
.
title
)
expect
(
page
).
not_to
have_content
(
archived_project
.
title
)
end
end
shared_examples_for
'shows public and internal projects'
do
it
'shows projects'
do
expect
(
page
).
to
have_content
(
public_project
.
title
)
expect
(
page
).
to
have_content
(
internal_project
.
title
)
expect
(
page
).
not_to
have_content
(
private_project
.
title
)
expect
(
page
).
not_to
have_content
(
archived_project
.
title
)
end
end
context
'when not signed in'
do
context
'when viewing public projects'
do
before
do
...
...
spec/support/shared_examples/project_list_shared_examples.rb
0 → 100644
View file @
5f110a6a
# frozen_string_literal: true
shared_examples
'shows public projects'
do
it
'shows projects'
do
expect
(
page
).
to
have_content
(
public_project
.
title
)
expect
(
page
).
not_to
have_content
(
internal_project
.
title
)
expect
(
page
).
not_to
have_content
(
private_project
.
title
)
expect
(
page
).
not_to
have_content
(
archived_project
.
title
)
end
end
shared_examples
'shows public and internal projects'
do
it
'shows projects'
do
expect
(
page
).
to
have_content
(
public_project
.
title
)
expect
(
page
).
to
have_content
(
internal_project
.
title
)
expect
(
page
).
not_to
have_content
(
private_project
.
title
)
expect
(
page
).
not_to
have_content
(
archived_project
.
title
)
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