Commit bdb4288a authored by Douwe Maan's avatar Douwe Maan

Merge branch 'mention-name-in-flash-msg' into 'master'

Mention group and project names in flash messages upon create, update and delete.

Mention group and project names in flash messages upon create, update and delete. I also changed some wording inconsistency.

**Before**

![project_created](https://gitlab.com/axil/gitlab-ce/uploads/b91b92e46b08d6c566acee8d88fccff1/project_created.png)

**After**

![project_created_after](https://gitlab.com/axil/gitlab-ce/uploads/56db5125f2769386c43cf9e2f175a54d/project_created_after.png)

See merge request !1070
parents 33070084 feb2865f
...@@ -23,6 +23,7 @@ v 7.14.0 (unreleased) ...@@ -23,6 +23,7 @@ v 7.14.0 (unreleased)
- Fix bug causing Bitbucket importer to crash when OAuth application had been removed. - Fix bug causing Bitbucket importer to crash when OAuth application had been removed.
- Add fetch command to the MR page. - Add fetch command to the MR page.
- Disabled autocapitalize and autocorrect on login field (Daryl Chan) - Disabled autocapitalize and autocorrect on login field (Daryl Chan)
- Mention group and project name in creation, update and deletion notices (Achilleas Pipinellis)
v 7.13.2 v 7.13.2
- Fix randomly failed spec - Fix randomly failed spec
......
...@@ -24,7 +24,7 @@ class GroupsController < Groups::ApplicationController ...@@ -24,7 +24,7 @@ class GroupsController < Groups::ApplicationController
if @group.save if @group.save
@group.add_owner(current_user) @group.add_owner(current_user)
redirect_to @group, notice: 'Group was successfully created.' redirect_to @group, notice: "Group '#{@group.name}' was successfully created."
else else
render action: "new" render action: "new"
end end
...@@ -75,7 +75,7 @@ class GroupsController < Groups::ApplicationController ...@@ -75,7 +75,7 @@ class GroupsController < Groups::ApplicationController
def update def update
if @group.update_attributes(group_params) if @group.update_attributes(group_params)
redirect_to edit_group_path(@group), notice: 'Group was successfully updated.' redirect_to edit_group_path(@group), notice: "Group '#{@group.name}' was successfully updated."
else else
render action: "edit" render action: "edit"
end end
...@@ -84,7 +84,7 @@ class GroupsController < Groups::ApplicationController ...@@ -84,7 +84,7 @@ class GroupsController < Groups::ApplicationController
def destroy def destroy
DestroyGroupService.new(@group, current_user).execute DestroyGroupService.new(@group, current_user).execute
redirect_to root_path, notice: 'Group was removed.' redirect_to root_path, alert: "Group '#{@group.name} was deleted."
end end
protected protected
......
...@@ -24,7 +24,7 @@ class ProjectsController < ApplicationController ...@@ -24,7 +24,7 @@ class ProjectsController < ApplicationController
if @project.saved? if @project.saved?
redirect_to( redirect_to(
project_path(@project), project_path(@project),
notice: 'Project was successfully created.' notice: "Project '#{@project.name}' was successfully created."
) )
else else
render 'new' render 'new'
...@@ -36,11 +36,11 @@ class ProjectsController < ApplicationController ...@@ -36,11 +36,11 @@ class ProjectsController < ApplicationController
respond_to do |format| respond_to do |format|
if status if status
flash[:notice] = 'Project was successfully updated.' flash[:notice] = "Project '#{@project.name}' was successfully updated."
format.html do format.html do
redirect_to( redirect_to(
edit_project_path(@project), edit_project_path(@project),
notice: 'Project was successfully updated.' notice: "Project '#{@project.name}' was successfully updated."
) )
end end
format.js format.js
...@@ -100,7 +100,7 @@ class ProjectsController < ApplicationController ...@@ -100,7 +100,7 @@ class ProjectsController < ApplicationController
return access_denied! unless can?(current_user, :remove_project, @project) return access_denied! unless can?(current_user, :remove_project, @project)
::Projects::DestroyService.new(@project, current_user, {}).execute ::Projects::DestroyService.new(@project, current_user, {}).execute
flash[:alert] = 'Project deleted.' flash[:alert] = "Project '#{@project.name}' was deleted."
if request.referer.include?('/admin') if request.referer.include?('/admin')
redirect_to admin_namespaces_projects_path redirect_to admin_namespaces_projects_path
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment