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
ca5ac4b1
Commit
ca5ac4b1
authored
Sep 24, 2020
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add invitation declined page
For new users
parent
797a2c2a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
16 deletions
+60
-16
app/assets/stylesheets/pages/experimental_separate_sign_up.scss
...sets/stylesheets/pages/experimental_separate_sign_up.scss
+4
-0
app/controllers/invites_controller.rb
app/controllers/invites_controller.rb
+2
-0
app/views/invites/decline.html.haml
app/views/invites/decline.html.haml
+8
-0
changelogs/unreleased/reminder-emails-invitation-declined-screen.yml
...unreleased/reminder-emails-invitation-declined-screen.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+12
-0
spec/features/invites_spec.rb
spec/features/invites_spec.rb
+29
-16
No files found.
app/assets/stylesheets/pages/experimental_separate_sign_up.scss
View file @
ca5ac4b1
...
...
@@ -57,4 +57,8 @@
height
:
$default-icon-size
;
}
}
.decline-page
{
width
:
350px
;
}
}
app/controllers/invites_controller.rb
View file @
ca5ac4b1
...
...
@@ -29,6 +29,8 @@ class InvitesController < ApplicationController
def
decline
if
member
.
decline_invite!
return
render
layout:
'devise_experimental_onboarding_issues'
if
!
current_user
&&
member
.
invite_to_unknown_user?
&&
member
.
created_by
path
=
if
current_user
dashboard_projects_path
...
...
app/views/invites/decline.html.haml
0 → 100644
View file @
ca5ac4b1
-
page_title
_
(
'Invitation declined'
)
.decline-page.gl-display-flex.gl-flex-direction-column.gl-mx-auto
{
class:
'gl-xs-w-full!'
}
.gl-align-self-center.gl-mb-4.gl-mt-7.gl-sm-mt-0
=
sprite_icon
(
'check-circle'
,
size:
48
,
css_class:
'gl-text-green-400'
)
%h2
.gl-font-size-h2
=
_
(
'You successfully declined the invitation'
)
%p
=
html_escape
(
_
(
'We will notify %{inviter} that you declined their invitation to join GitLab. You will stop receiving reminders.'
))
%
{
inviter:
sanitize_name
(
@member
.
created_by
.
name
)
}
%p
=
_
(
'You can now close this window.'
)
changelogs/unreleased/reminder-emails-invitation-declined-screen.yml
0 → 100644
View file @
ca5ac4b1
---
title
:
Add invitation declined page
merge_request
:
43305
author
:
type
:
changed
locale/gitlab.pot
View file @
ca5ac4b1
...
...
@@ -13905,6 +13905,9 @@ msgstr ""
msgid "Invitation"
msgstr ""
msgid "Invitation declined"
msgstr ""
msgid "Invite"
msgstr ""
...
...
@@ -28536,6 +28539,9 @@ msgstr ""
msgid "We want to be sure it is you, please confirm you are not a robot."
msgstr ""
msgid "We will notify %{inviter} that you declined their invitation to join GitLab. You will stop receiving reminders."
msgstr ""
msgid "We've found no vulnerabilities"
msgstr ""
...
...
@@ -29150,6 +29156,9 @@ msgstr ""
msgid "You can notify the app / group or a project by sending them an email notification"
msgstr ""
msgid "You can now close this window."
msgstr ""
msgid "You can now export your security dashboard to a CSV report."
msgstr ""
...
...
@@ -29399,6 +29408,9 @@ msgstr ""
msgid "You reached %{usage_in_percent} of %{namespace_name}'s storage capacity (%{used_storage} of %{storage_limit})"
msgstr ""
msgid "You successfully declined the invitation"
msgstr ""
msgid "You tried to fork %{link_to_the_project} but it failed for the following reason:"
msgstr ""
...
...
spec/features/invites_spec.rb
View file @
ca5ac4b1
...
...
@@ -81,10 +81,10 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do
end
end
context
'when inviting a user
using their email address
'
do
context
'when inviting a user'
do
let
(
:new_user
)
{
build_stubbed
(
:user
)
}
let
(
:invite_email
)
{
new_user
.
email
}
let
(
:group_invite
)
{
create
(
:group_member
,
:invited
,
group:
group
,
invite_email:
invite_email
)
}
let
(
:group_invite
)
{
create
(
:group_member
,
:invited
,
group:
group
,
invite_email:
invite_email
,
created_by:
owner
)
}
let!
(
:project_invite
)
{
create
(
:project_member
,
:invited
,
project:
project
,
invite_email:
invite_email
)
}
context
'when user has not signed in yet'
do
...
...
@@ -210,30 +210,43 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do
context
'when declining the invitation'
do
let
(
:send_email_confirmation
)
{
true
}
context
'when signed in'
do
before
do
sign_in
(
user
)
visit
invite_path
(
group_invite
.
raw_invite_token
)
context
'as an existing user'
do
let
(
:group_invite
)
{
create
(
:group_member
,
user:
user
,
group:
group
,
created_by:
owner
)
}
context
'when signed in'
do
before
do
sign_in
(
user
)
visit
decline_invite_path
(
group_invite
.
raw_invite_token
)
end
it
'declines application and redirects to dashboard'
do
expect
(
current_path
).
to
eq
(
dashboard_projects_path
)
expect
(
page
).
to
have_content
(
'You have declined the invitation to join group Owned.'
)
expect
{
group_invite
.
reload
}.
to
raise_error
ActiveRecord
::
RecordNotFound
end
end
it
'declines application and redirects to dashboard'
do
page
.
click_link
'Decline'
context
'when signed out'
do
before
do
visit
decline_invite_path
(
group_invite
.
raw_invite_token
)
end
expect
(
current_path
).
to
eq
(
dashboard_projects_path
)
expect
(
page
).
to
have_content
(
'You have declined the invitation to join group Owned.'
)
expect
{
group_invite
.
reload
}.
to
raise_error
ActiveRecord
::
RecordNotFound
it
'declines application and redirects to sign in page'
do
expect
(
current_path
).
to
eq
(
new_user_session_path
)
expect
(
page
).
to
have_content
(
'You have declined the invitation to join group Owned.'
)
expect
{
group_invite
.
reload
}.
to
raise_error
ActiveRecord
::
RecordNotFound
end
end
end
context
'
when signed out
'
do
context
'
as a non-existing user
'
do
before
do
visit
decline_invite_path
(
group_invite
.
raw_invite_token
)
end
it
'declines application and redirects to sign in page'
do
expect
(
current_path
).
to
eq
(
new_user_session_path
)
expect
(
page
).
to
have_content
(
'You have declined the invitation to join group Owned.'
)
it
'declines application and shows a decline page'
do
expect
(
current_path
).
to
eq
(
decline_invite_path
(
group_invite
.
raw_invite_token
))
expect
(
page
).
to
have_content
(
'You successfully declined the invitation'
)
expect
{
group_invite
.
reload
}.
to
raise_error
ActiveRecord
::
RecordNotFound
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