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
ea99abb1
Commit
ea99abb1
authored
Feb 11, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
a9104a50
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
136 additions
and
36 deletions
+136
-36
app/assets/javascripts/boards/components/issue_card_inner.vue
...assets/javascripts/boards/components/issue_card_inner.vue
+8
-0
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+1
-0
app/assets/javascripts/lib/utils/http_status.js
app/assets/javascripts/lib/utils/http_status.js
+1
-0
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+4
-0
app/controllers/groups/boards_controller.rb
app/controllers/groups/boards_controller.rb
+5
-0
app/policies/group_policy.rb
app/policies/group_policy.rb
+1
-0
app/services/ci/create_cross_project_pipeline_service.rb
app/services/ci/create_cross_project_pipeline_service.rb
+1
-1
changelogs/unreleased/34723-visually-differentiate-blocked-issues.yml
...nreleased/34723-visually-differentiate-blocked-issues.yml
+5
-0
changelogs/unreleased/35546-child-epic-error-messages.yml
changelogs/unreleased/35546-child-epic-error-messages.yml
+5
-0
changelogs/unreleased/drop-bridge-on-any-pipeline-errors.yml
changelogs/unreleased/drop-bridge-on-any-pipeline-errors.yml
+5
-0
doc/administration/raketasks/project_import_export.md
doc/administration/raketasks/project_import_export.md
+4
-3
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+22
-1
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+5
-5
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+4
-4
doc/user/project/img/issue_boards_blocked_icon_v12_8.png
doc/user/project/img/issue_boards_blocked_icon_v12_8.png
+0
-0
doc/user/project/issue_board.md
doc/user/project/issue_board.md
+8
-0
doc/user/project/settings/import_export.md
doc/user/project/settings/import_export.md
+19
-15
lib/api/group_boards.rb
lib/api/group_boards.rb
+4
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/controllers/groups/boards_controller_spec.rb
spec/controllers/groups/boards_controller_spec.rb
+7
-3
spec/frontend/boards/issue_card_spec.js
spec/frontend/boards/issue_card_spec.js
+21
-1
spec/policies/group_policy_spec.rb
spec/policies/group_policy_spec.rb
+2
-2
spec/support/shared_contexts/policies/group_policy_shared_context.rb
...t/shared_contexts/policies/group_policy_shared_context.rb
+1
-1
No files found.
app/assets/javascripts/boards/components/issue_card_inner.vue
View file @
ea99abb1
...
@@ -161,6 +161,14 @@ export default {
...
@@ -161,6 +161,14 @@ export default {
<div>
<div>
<div
class=
"d-flex board-card-header"
dir=
"auto"
>
<div
class=
"d-flex board-card-header"
dir=
"auto"
>
<h4
class=
"board-card-title append-bottom-0 prepend-top-0"
>
<h4
class=
"board-card-title append-bottom-0 prepend-top-0"
>
<icon
v-if=
"issue.blocked"
v-gl-tooltip
name=
"issue-block"
:title=
"__('Blocked issue')"
class=
"issue-blocked-icon append-right-4"
:aria-label=
"__('Blocked issue')"
/>
<icon
<icon
v-if=
"issue.confidential"
v-if=
"issue.confidential"
v-gl-tooltip
v-gl-tooltip
...
...
app/assets/javascripts/boards/models/issue.js
View file @
ea99abb1
...
@@ -37,6 +37,7 @@ class ListIssue {
...
@@ -37,6 +37,7 @@ class ListIssue {
this
.
project_id
=
obj
.
project_id
;
this
.
project_id
=
obj
.
project_id
;
this
.
timeEstimate
=
obj
.
time_estimate
;
this
.
timeEstimate
=
obj
.
time_estimate
;
this
.
assignableLabelsEndpoint
=
obj
.
assignable_labels_endpoint
;
this
.
assignableLabelsEndpoint
=
obj
.
assignable_labels_endpoint
;
this
.
blocked
=
obj
.
blocked
;
if
(
obj
.
project
)
{
if
(
obj
.
project
)
{
this
.
project
=
new
IssueProject
(
obj
.
project
);
this
.
project
=
new
IssueProject
(
obj
.
project
);
...
...
app/assets/javascripts/lib/utils/http_status.js
View file @
ea99abb1
...
@@ -19,6 +19,7 @@ const httpStatusCodes = {
...
@@ -19,6 +19,7 @@ const httpStatusCodes = {
UNAUTHORIZED
:
401
,
UNAUTHORIZED
:
401
,
FORBIDDEN
:
403
,
FORBIDDEN
:
403
,
NOT_FOUND
:
404
,
NOT_FOUND
:
404
,
CONFLICT
:
409
,
GONE
:
410
,
GONE
:
410
,
UNPROCESSABLE_ENTITY
:
422
,
UNPROCESSABLE_ENTITY
:
422
,
SERVICE_UNAVAILABLE
:
503
,
SERVICE_UNAVAILABLE
:
503
,
...
...
app/assets/stylesheets/pages/boards.scss
View file @
ea99abb1
...
@@ -287,6 +287,10 @@
...
@@ -287,6 +287,10 @@
cursor
:
help
;
cursor
:
help
;
}
}
.issue-blocked-icon
{
color
:
$red-500
;
}
@include
media-breakpoint-down
(
md
)
{
@include
media-breakpoint-down
(
md
)
{
padding
:
$gl-padding-8
;
padding
:
$gl-padding-8
;
}
}
...
...
app/controllers/groups/boards_controller.rb
View file @
ea99abb1
...
@@ -4,6 +4,7 @@ class Groups::BoardsController < Groups::ApplicationController
...
@@ -4,6 +4,7 @@ class Groups::BoardsController < Groups::ApplicationController
include
BoardsActions
include
BoardsActions
include
RecordUserLastActivity
include
RecordUserLastActivity
before_action
:authorize_read_board!
,
only:
[
:index
,
:show
]
before_action
:assign_endpoint_vars
before_action
:assign_endpoint_vars
before_action
do
before_action
do
push_frontend_feature_flag
(
:multi_select_board
,
default_enabled:
true
)
push_frontend_feature_flag
(
:multi_select_board
,
default_enabled:
true
)
...
@@ -16,4 +17,8 @@ class Groups::BoardsController < Groups::ApplicationController
...
@@ -16,4 +17,8 @@ class Groups::BoardsController < Groups::ApplicationController
@namespace_path
=
group
.
to_param
@namespace_path
=
group
.
to_param
@labels_endpoint
=
group_labels_url
(
group
)
@labels_endpoint
=
group_labels_url
(
group
)
end
end
def
authorize_read_board!
access_denied!
unless
can?
(
current_user
,
:read_board
,
group
)
end
end
end
app/policies/group_policy.rb
View file @
ea99abb1
...
@@ -67,6 +67,7 @@ class GroupPolicy < BasePolicy
...
@@ -67,6 +67,7 @@ class GroupPolicy < BasePolicy
enable
:read_milestone
enable
:read_milestone
enable
:read_list
enable
:read_list
enable
:read_label
enable
:read_label
enable
:read_board
end
end
rule
{
has_access
}.
enable
:read_namespace
rule
{
has_access
}.
enable
:read_namespace
...
...
app/services/ci/create_cross_project_pipeline_service.rb
View file @
ea99abb1
...
@@ -30,7 +30,7 @@ module Ci
...
@@ -30,7 +30,7 @@ module Ci
end
end
downstream_pipeline
.
tap
do
|
pipeline
|
downstream_pipeline
.
tap
do
|
pipeline
|
@bridge
.
drop!
(
:downstream_pipeline_creation_failed
)
if
pipeline
.
has_yaml_errors
?
@bridge
.
drop!
(
:downstream_pipeline_creation_failed
)
if
pipeline
.
errors
.
any
?
end
end
end
end
...
...
changelogs/unreleased/34723-visually-differentiate-blocked-issues.yml
0 → 100644
View file @
ea99abb1
---
title
:
Add blocked icon on issue board card
merge_request
:
24420
author
:
type
:
added
changelogs/unreleased/35546-child-epic-error-messages.yml
0 → 100644
View file @
ea99abb1
---
title
:
Improve error messages when adding a child epic
merge_request
:
22688
author
:
type
:
fixed
changelogs/unreleased/drop-bridge-on-any-pipeline-errors.yml
0 → 100644
View file @
ea99abb1
---
title
:
Drop bridge on any downstream pipeline errors
merge_request
:
24735
author
:
type
:
fixed
doc/administration/raketasks/project_import_export.md
View file @
ea99abb1
...
@@ -32,9 +32,10 @@ bundle exec rake gitlab:import_export:data RAILS_ENV=production
...
@@ -32,9 +32,10 @@ bundle exec rake gitlab:import_export:data RAILS_ENV=production
Note the following:
Note the following:
-
Importing is not possible if the version of the import instance is older than that of the exporter.
-
Importing is only possible if the version of the import and export GitLab instances are
-
The project import option must be enabled in application settings
compatible as described in the
[
Version history
](
../../user/project/settings/import_export.md#version-history
)
.
(
`/admin/application_settings/general`
) under
**Import sources**
, which is available
-
The project import option must be enabled in
application settings (
`/admin/application_settings/general`
) under
**Import sources**
, which is available
under
**{admin}**
**Admin Area >**
**{settings}**
**Settings > Visibility and access controls**
.
under
**{admin}**
**Admin Area >**
**{settings}**
**Settings > Visibility and access controls**
.
-
The exports are stored in a temporary
[
shared directory
](
../../development/shared_files.md
)
-
The exports are stored in a temporary
[
shared directory
](
../../development/shared_files.md
)
and are deleted every 24 hours by a specific worker.
and are deleted every 24 hours by a specific worker.
doc/api/graphql/reference/gitlab_schema.graphql
View file @
ea99abb1
...
@@ -1986,7 +1986,20 @@ type Epic implements Noteable {
...
@@ -1986,7 +1986,20 @@ type Epic implements Noteable {
"""
"""
last
:
Int
last
:
Int
):
UserConnection
):
UserConnection
reference
(
full
:
Boolean
=
false
):
String
!
"""
Internal
reference
of
the
epic
.
Returned
in
shortened
format
by
default
"""
reference
(
"""
Indicates
if
the
reference
should
be
returned
in
full
"""
full
:
Boolean
=
false
):
String
!
"""
URI
path
of
the
epic
-
issue
relationship
"""
relationPath
:
String
relationPath
:
String
"""
"""
...
@@ -2043,7 +2056,15 @@ type Epic implements Noteable {
...
@@ -2043,7 +2056,15 @@ type Epic implements Noteable {
Permissions
for
the
current
user
on
the
resource
Permissions
for
the
current
user
on
the
resource
"""
"""
userPermissions
:
EpicPermissions
!
userPermissions
:
EpicPermissions
!
"""
Web
path
of
the
epic
"""
webPath
:
String
!
webPath
:
String
!
"""
Web
URL
of
the
epic
"""
webUrl
:
String
!
webUrl
:
String
!
}
}
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
ea99abb1
...
@@ -5013,11 +5013,11 @@
...
@@ -5013,11 +5013,11 @@
},
},
{
{
"name"
:
"reference"
,
"name"
:
"reference"
,
"description"
:
null
,
"description"
:
"Internal reference of the epic. Returned in shortened format by default"
,
"args"
:
[
"args"
:
[
{
{
"name"
:
"full"
,
"name"
:
"full"
,
"description"
:
null
,
"description"
:
"Indicates if the reference should be returned in full"
,
"type"
:
{
"type"
:
{
"kind"
:
"SCALAR"
,
"kind"
:
"SCALAR"
,
"name"
:
"Boolean"
,
"name"
:
"Boolean"
,
...
@@ -5040,7 +5040,7 @@
...
@@ -5040,7 +5040,7 @@
},
},
{
{
"name"
:
"relationPath"
,
"name"
:
"relationPath"
,
"description"
:
null
,
"description"
:
"URI path of the epic-issue relationship"
,
"args"
:
[
"args"
:
[
],
],
...
@@ -5224,7 +5224,7 @@
...
@@ -5224,7 +5224,7 @@
},
},
{
{
"name"
:
"webPath"
,
"name"
:
"webPath"
,
"description"
:
null
,
"description"
:
"Web path of the epic"
,
"args"
:
[
"args"
:
[
],
],
...
@@ -5242,7 +5242,7 @@
...
@@ -5242,7 +5242,7 @@
},
},
{
{
"name"
:
"webUrl"
,
"name"
:
"webUrl"
,
"description"
:
null
,
"description"
:
"Web URL of the epic"
,
"args"
:
[
"args"
:
[
],
],
...
...
doc/api/graphql/reference/index.md
View file @
ea99abb1
...
@@ -295,8 +295,8 @@ Represents an epic.
...
@@ -295,8 +295,8 @@ Represents an epic.
|
`id`
| ID! | ID of the epic |
|
`id`
| ID! | ID of the epic |
|
`iid`
| ID! | Internal ID of the epic |
|
`iid`
| ID! | Internal ID of the epic |
|
`parent`
| Epic | Parent epic of the epic |
|
`parent`
| Epic | Parent epic of the epic |
|
`reference`
| String! | |
|
`reference`
| String! |
Internal reference of the epic. Returned in shortened format by default
|
|
`relationPath`
| String | |
|
`relationPath`
| String |
URI path of the epic-issue relationship
|
|
`relativePosition`
| Int | The relative position of the epic in the epic tree |
|
`relativePosition`
| Int | The relative position of the epic in the epic tree |
|
`startDate`
| Time | Start date of the epic |
|
`startDate`
| Time | Start date of the epic |
|
`startDateFixed`
| Time | Fixed start date of the epic |
|
`startDateFixed`
| Time | Fixed start date of the epic |
...
@@ -308,8 +308,8 @@ Represents an epic.
...
@@ -308,8 +308,8 @@ Represents an epic.
|
`updatedAt`
| Time | Timestamp of the epic's last activity |
|
`updatedAt`
| Time | Timestamp of the epic's last activity |
|
`upvotes`
| Int! | Number of upvotes the epic has received |
|
`upvotes`
| Int! | Number of upvotes the epic has received |
|
`userPermissions`
| EpicPermissions! | Permissions for the current user on the resource |
|
`userPermissions`
| EpicPermissions! | Permissions for the current user on the resource |
|
`webPath`
| String! | |
|
`webPath`
| String! |
Web path of the epic
|
|
`webUrl`
| String! | |
|
`webUrl`
| String! |
Web URL of the epic
|
## EpicDescendantCount
## EpicDescendantCount
...
...
doc/user/project/img/issue_boards_blocked_icon_v12_8.png
0 → 100644
View file @
ea99abb1
64.8 KB
doc/user/project/issue_board.md
View file @
ea99abb1
...
@@ -303,6 +303,14 @@ Different issue board features are available in different [GitLab tiers](https:/
...
@@ -303,6 +303,14 @@ Different issue board features are available in different [GitLab tiers](https:/
| Premium / Silver | Multiple | Multiple | Yes | Yes |
| Premium / Silver | Multiple | Multiple | Yes | Yes |
| Ultimate / Gold | Multiple | Multiple | Yes | Yes |
| Ultimate / Gold | Multiple | Multiple | Yes | Yes |
## Blocked issues
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/34723) in GitLab 12.8.
If an issue is blocked by another issue, an icon will display next to its title to differentiate it from unblocked issues.
![
Blocked issues
](
img/issue_boards_blocked_icon_v12_8.png
)
## Actions you can take on an Issue Board
## Actions you can take on an Issue Board
-
[
Create a new list
](
#creating-a-new-list
)
.
-
[
Create a new list
](
#creating-a-new-list
)
.
...
...
doc/user/project/settings/import_export.md
View file @
ea99abb1
...
@@ -6,28 +6,30 @@
...
@@ -6,28 +6,30 @@
Existing projects running on any GitLab instance or GitLab.com can be exported with all their related
Existing projects running on any GitLab instance or GitLab.com can be exported with all their related
data and be moved into a new GitLab instance.
data and be moved into a new GitLab instance.
The
**GitLab import/export**
button is displayed if the project import option is enabled.
See also:
See also:
-
[
Project import/export API
](
../../../api/project_import_export.md
)
.
-
[
Project import/export API
](
../../../api/project_import_export.md
)
-
[
Project import/export administration rake tasks
](
../../../administration/raketasks/project_import_export.md
)
.
**(CORE ONLY)**
-
[
Project import/export administration rake tasks
](
../../../administration/raketasks/project_import_export.md
)
**(CORE ONLY)**
To set up a project import/export:
1.
Navigate to
**{admin}**
**Admin Area >**
**{settings}**
**Settings > Visibility and access controls**
.
1.
Scroll to
**Import sources**
1.
Enable desired
**Import sources**
## Important notes
## Important notes
Note the following:
Note the following:
-
Importing is not possible if the import instance version differs from
-
Imports will fail unless the import and export GitLab instances are
that of the exporter.
compatible as described in the
[
Version history
](
#version-history
)
.
-
The project import option must be enabled in application settings
-
Exports are stored in a temporary
[
shared directory
](
../../../development/shared_files.md
)
(
`/admin/application_settings/general`
) under
**Import sources**
, which is
available under
**{admin}**
**Admin Area >**
**{settings}**
**Settings > Visibility and access controls**
.
Ask your administrator if you don't see the
**GitLab export**
button when
creating a new project.
-
The exports are stored in a temporary
[
shared directory
](
../../../development/shared_files.md
)
and are deleted every 24 hours by a specific worker.
and are deleted every 24 hours by a specific worker.
-
Group members are exported as project members, as long as the user has
-
Group members are exported as project members, as long as the user has
maintainer or admin access to the group where the exported project lives. An admin
maintainer or admin access to the group where the exported project lives. Import admins should map users by email address.
in the import side is required to map the users, based on email.
Otherwise, a supplementary comment is left to mention that the original author and
Otherwise, a supplementary comment is left to mention the original author and
the MRs, notes, or issues will be owned by the importer.
the MRs, notes, or issues will be owned by the importer.
-
Project members with owner access will be imported as maintainers.
-
Project members with owner access will be imported as maintainers.
-
If an imported project contains merge requests originating from forks,
-
If an imported project contains merge requests originating from forks,
...
@@ -39,7 +41,7 @@ Note the following:
...
@@ -39,7 +41,7 @@ Note the following:
The following table lists updates to Import/Export:
The following table lists updates to Import/Export:
| GitLab version | Import/Export version |
| GitLab version | Import/Export
schema
version |
| ---------------- | --------------------- |
| ---------------- | --------------------- |
| 11.1 to current | 0.2.4 |
| 11.1 to current | 0.2.4 |
| 10.8 | 0.2.3 |
| 10.8 | 0.2.3 |
...
@@ -56,7 +58,9 @@ The following table lists updates to Import/Export:
...
@@ -56,7 +58,9 @@ The following table lists updates to Import/Export:
| 8.9.5 | 0.1.1 |
| 8.9.5 | 0.1.1 |
| 8.9.0 | 0.1.0 |
| 8.9.0 | 0.1.0 |
For example, 8.10.3 and 8.11 will have the same Import/Export version (0.1.3)
Projects can be exported and imported only between versions of GitLab with matching Import/Export versions.
For example, 8.10.3 and 8.11 have the same Import/Export version (0.1.3)
and the exports between them will be compatible.
and the exports between them will be compatible.
## Exported contents
## Exported contents
...
...
lib/api/group_boards.rb
View file @
ea99abb1
...
@@ -28,6 +28,7 @@ module API
...
@@ -28,6 +28,7 @@ module API
success
::
API
::
Entities
::
Board
success
::
API
::
Entities
::
Board
end
end
get
'/:board_id'
do
get
'/:board_id'
do
authorize!
(
:read_board
,
user_group
)
present
board
,
with:
::
API
::
Entities
::
Board
present
board
,
with:
::
API
::
Entities
::
Board
end
end
...
@@ -39,6 +40,7 @@ module API
...
@@ -39,6 +40,7 @@ module API
use
:pagination
use
:pagination
end
end
get
'/'
do
get
'/'
do
authorize!
(
:read_board
,
user_group
)
present
paginate
(
board_parent
.
boards
.
with_associations
),
with:
Entities
::
Board
present
paginate
(
board_parent
.
boards
.
with_associations
),
with:
Entities
::
Board
end
end
end
end
...
@@ -55,6 +57,7 @@ module API
...
@@ -55,6 +57,7 @@ module API
use
:pagination
use
:pagination
end
end
get
'/lists'
do
get
'/lists'
do
authorize!
(
:read_board
,
user_group
)
present
paginate
(
board_lists
),
with:
Entities
::
List
present
paginate
(
board_lists
),
with:
Entities
::
List
end
end
...
@@ -66,6 +69,7 @@ module API
...
@@ -66,6 +69,7 @@ module API
requires
:list_id
,
type:
Integer
,
desc:
'The ID of a list'
requires
:list_id
,
type:
Integer
,
desc:
'The ID of a list'
end
end
get
'/lists/:list_id'
do
get
'/lists/:list_id'
do
authorize!
(
:read_board
,
user_group
)
present
board_lists
.
find
(
params
[
:list_id
]),
with:
Entities
::
List
present
board_lists
.
find
(
params
[
:list_id
]),
with:
Entities
::
List
end
end
...
...
locale/gitlab.pot
View file @
ea99abb1
...
@@ -2768,6 +2768,9 @@ msgstr ""
...
@@ -2768,6 +2768,9 @@ msgstr ""
msgid "Blocked"
msgid "Blocked"
msgstr ""
msgstr ""
msgid "Blocked issue"
msgstr ""
msgid "Blocks"
msgid "Blocks"
msgstr ""
msgstr ""
...
...
spec/controllers/groups/boards_controller_spec.rb
View file @
ea99abb1
...
@@ -27,7 +27,8 @@ describe Groups::BoardsController do
...
@@ -27,7 +27,8 @@ describe Groups::BoardsController do
context
'with unauthorized user'
do
context
'with unauthorized user'
do
before
do
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
false
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_board
,
group
).
and_return
(
false
)
end
end
it
'returns a not found 404 response'
do
it
'returns a not found 404 response'
do
...
@@ -70,7 +71,8 @@ describe Groups::BoardsController do
...
@@ -70,7 +71,8 @@ describe Groups::BoardsController do
context
'with unauthorized user'
do
context
'with unauthorized user'
do
before
do
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
false
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_board
,
group
).
and_return
(
false
)
end
end
it
'returns a not found 404 response'
do
it
'returns a not found 404 response'
do
...
@@ -105,7 +107,8 @@ describe Groups::BoardsController do
...
@@ -105,7 +107,8 @@ describe Groups::BoardsController do
context
'with unauthorized user'
do
context
'with unauthorized user'
do
before
do
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
false
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_board
,
group
).
and_return
(
false
)
end
end
it
'returns a not found 404 response'
do
it
'returns a not found 404 response'
do
...
@@ -142,6 +145,7 @@ describe Groups::BoardsController do
...
@@ -142,6 +145,7 @@ describe Groups::BoardsController do
context
'with unauthorized user'
do
context
'with unauthorized user'
do
before
do
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
false
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_group
,
group
).
and_return
(
false
)
end
end
...
...
spec/frontend/boards/issue_card_spec.js
View file @
ea99abb1
...
@@ -66,7 +66,11 @@ describe('Issue card component', () => {
...
@@ -66,7 +66,11 @@ describe('Issue card component', () => {
});
});
it
(
'
does not render confidential icon
'
,
()
=>
{
it
(
'
does not render confidential icon
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.fa-eye-flash
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
'
.confidential-icon
'
).
exists
()).
toBe
(
false
);
});
it
(
'
does not render blocked icon
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.issue-blocked-icon
'
).
exists
()).
toBe
(
false
);
});
});
it
(
'
renders confidential icon
'
,
done
=>
{
it
(
'
renders confidential icon
'
,
done
=>
{
...
@@ -324,4 +328,20 @@ describe('Issue card component', () => {
...
@@ -324,4 +328,20 @@ describe('Issue card component', () => {
.
catch
(
done
.
fail
);
.
catch
(
done
.
fail
);
});
});
});
});
describe
(
'
blocked
'
,
()
=>
{
beforeEach
(
done
=>
{
wrapper
.
setProps
({
issue
:
{
...
wrapper
.
props
(
'
issue
'
),
blocked
:
true
,
},
});
wrapper
.
vm
.
$nextTick
(
done
);
});
it
(
'
renders blocked icon if issue is blocked
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.issue-blocked-icon
'
).
exists
()).
toBe
(
true
);
});
});
});
});
spec/policies/group_policy_spec.rb
View file @
ea99abb1
...
@@ -438,7 +438,7 @@ describe GroupPolicy do
...
@@ -438,7 +438,7 @@ describe GroupPolicy do
end
end
end
end
context
"create_projects"
do
context
'create_projects'
do
context
'when group has no project creation level set'
do
context
'when group has no project creation level set'
do
before_all
do
before_all
do
group
.
update
(
project_creation_level:
nil
)
group
.
update
(
project_creation_level:
nil
)
...
@@ -560,7 +560,7 @@ describe GroupPolicy do
...
@@ -560,7 +560,7 @@ describe GroupPolicy do
end
end
end
end
context
"create_subgroup"
do
context
'create_subgroup'
do
context
'when group has subgroup creation level set to owner'
do
context
'when group has subgroup creation level set to owner'
do
before_all
do
before_all
do
group
.
update
(
subgroup_creation_level:
::
Gitlab
::
Access
::
OWNER_SUBGROUP_ACCESS
)
group
.
update
(
subgroup_creation_level:
::
Gitlab
::
Access
::
OWNER_SUBGROUP_ACCESS
)
...
...
spec/support/shared_contexts/policies/group_policy_shared_context.rb
View file @
ea99abb1
...
@@ -16,7 +16,7 @@ RSpec.shared_context 'GroupPolicy context' do
...
@@ -16,7 +16,7 @@ RSpec.shared_context 'GroupPolicy context' do
read_group_merge_requests
read_group_merge_requests
]
]
end
end
let
(
:read_group_permissions
)
{
%i[read_label read_list read_milestone]
}
let
(
:read_group_permissions
)
{
%i[read_label read_list read_milestone
read_board
]
}
let
(
:reporter_permissions
)
{
%i[admin_label read_container_image]
}
let
(
:reporter_permissions
)
{
%i[admin_label read_container_image]
}
let
(
:developer_permissions
)
{
[
:admin_milestone
]
}
let
(
:developer_permissions
)
{
[
:admin_milestone
]
}
let
(
:maintainer_permissions
)
do
let
(
:maintainer_permissions
)
do
...
...
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