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
3987423c
Commit
3987423c
authored
Mar 29, 2019
by
Phil Hughes
Committed by
Bob Van Landuyt
Apr 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added permissions check to design management
parent
39d2f9bc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
6 deletions
+25
-6
ee/app/assets/javascripts/design_management/components/upload/form.vue
.../javascripts/design_management/components/upload/form.vue
+5
-0
ee/app/assets/javascripts/design_management/graphql.js
ee/app/assets/javascripts/design_management/graphql.js
+1
-0
ee/app/assets/javascripts/design_management/pages/index.vue
ee/app/assets/javascripts/design_management/pages/index.vue
+13
-1
ee/app/assets/javascripts/design_management/queries/canUploadDesignPermission.graphql
...sign_management/queries/canUploadDesignPermission.graphql
+3
-0
ee/app/assets/javascripts/pages/projects/issues/show/index.js
...pp/assets/javascripts/pages/projects/issues/show/index.js
+1
-1
ee/app/controllers/ee/projects/issues_controller.rb
ee/app/controllers/ee/projects/issues_controller.rb
+0
-3
ee/app/models/license.rb
ee/app/models/license.rb
+1
-0
ee/app/views/projects/issues/_discussion.html.haml
ee/app/views/projects/issues/_discussion.html.haml
+1
-1
No files found.
ee/app/assets/javascripts/design_management/components/upload/form.vue
View file @
3987423c
...
...
@@ -11,6 +11,10 @@ export default {
type
:
Boolean
,
required
:
true
,
},
canUploadDesign
:
{
type
:
Boolean
,
required
:
true
,
},
},
methods
:
{
openFileUpload
()
{
...
...
@@ -27,6 +31,7 @@ export default {
<header
class=
"row-content-block border-top-0 p-2 d-flex"
>
<div>
<gl-button
v-if=
"canUploadDesign"
:disabled=
"isSaving"
variant=
"primary"
class=
"btn-inverted"
...
...
ee/app/assets/javascripts/design_management/graphql.js
View file @
3987423c
...
...
@@ -30,6 +30,7 @@ const designsStore = [
const
defaultClient
=
createDefaultClient
({
defaults
:
{
designs
:
designsStore
,
canUploadDesign
:
true
,
},
resolvers
:
{
Query
:
{
...
...
ee/app/assets/javascripts/design_management/pages/index.vue
View file @
3987423c
...
...
@@ -6,6 +6,7 @@ import DesignList from '../components/list/index.vue';
import
UploadForm
from
'
../components/upload/form.vue
'
;
import
allDesignsQuery
from
'
../queries/allDesigns.graphql
'
;
import
uploadDesignQuery
from
'
../queries/uploadDesign.graphql
'
;
import
canUploadDesignPermission
from
'
../queries/canUploadDesignPermission.graphql
'
;
export
default
{
components
:
{
...
...
@@ -20,10 +21,14 @@ export default {
this
.
error
=
true
;
},
},
canUploadDesign
:
{
query
:
canUploadDesignPermission
,
},
},
data
()
{
return
{
designs
:
[],
canUploadDesign
:
false
,
error
:
false
,
isSaving
:
false
,
};
...
...
@@ -35,6 +40,8 @@ export default {
},
methods
:
{
onUploadDesign
(
files
)
{
if
(
!
this
.
canUploadDesign
)
return
null
;
const
optimisticResponse
=
[...
files
].
map
(
file
=>
({
__typename
:
'
Design
'
,
id
:
-
1
,
...
...
@@ -80,7 +87,12 @@ export default {
<
template
>
<div>
<upload-form
:is-saving=
"isSaving"
@
upload=
"onUploadDesign"
/>
<upload-form
v-if=
"canUploadDesign"
:can-upload-design=
"canUploadDesign"
:is-saving=
"isSaving"
@
upload=
"onUploadDesign"
/>
<div
class=
"mt-4"
>
<gl-loading-icon
v-if=
"isLoading"
size=
"md"
/>
<div
v-else-if=
"error"
class=
"alert alert-danger"
>
...
...
ee/app/assets/javascripts/design_management/queries/canUploadDesignPermission.graphql
0 → 100644
View file @
3987423c
query
canUploadDesign
{
canUploadDesign
@client
}
ee/app/assets/javascripts/pages/projects/issues/show/index.js
View file @
3987423c
...
...
@@ -8,7 +8,7 @@ document.addEventListener('DOMContentLoaded', () => {
initSidebarBundle
();
initRelatedIssues
();
if
(
gon
.
features
.
versionedDesigns
)
{
if
(
document
.
getElementById
(
'
js-design-management
'
)
)
{
import
(
/* webpackChunkName: 'design_management' */
'
ee/design_management
'
)
.
then
(
module
=>
module
.
default
())
.
catch
(()
=>
{});
...
...
ee/app/controllers/ee/projects/issues_controller.rb
View file @
3987423c
...
...
@@ -16,9 +16,6 @@ module EE
before_action
:check_export_issues_available!
,
only:
[
:export_csv
]
before_action
:check_service_desk_available!
,
only:
[
:service_desk
]
before_action
:whitelist_query_limiting_ee
,
only:
[
:update
]
before_action
only: :show
do
push_frontend_feature_flag
(
:versioned_designs
)
end
end
override
:issue_except_actions
...
...
ee/app/models/license.rb
View file @
3987423c
...
...
@@ -75,6 +75,7 @@ class License < ApplicationRecord
batch_comments
issues_analytics
merge_pipelines
design_management
]
EEP_FEATURES
.
freeze
...
...
ee/app/views/projects/issues/_discussion.html.haml
View file @
3987423c
-
if
Feature
.
enabled?
(
:versioned_designs
)
-
if
@project
.
feature_available?
(
:design_management
,
current_user
)
&&
Feature
.
enabled?
(
:design_management
)
%ul
.nav-tabs.nav.nav-links
{
role:
'tablist'
}
%li
=
link_to
'#discussion-tab'
,
class:
'active js-issue-tabs'
,
id:
'discussion'
,
role:
'tab'
,
'aria-controls'
:
'js-discussion'
,
'aria-selected'
:
'true'
,
data:
{
toggle:
'tab'
,
target:
'#discussion-tab'
}
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