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
34420f42
Commit
34420f42
authored
Jun 28, 2019
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved feature access arrays to constants
parent
0da58854
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
7 deletions
+41
-7
app/assets/javascripts/pages/projects/shared/permissions/components/project_feature_setting.vue
...shared/permissions/components/project_feature_setting.vue
+3
-3
app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
...projects/shared/permissions/components/settings_panel.vue
+11
-4
app/assets/javascripts/pages/projects/shared/permissions/constants.js
...avascripts/pages/projects/shared/permissions/constants.js
+27
-0
No files found.
app/assets/javascripts/pages/projects/shared/permissions/components/project_feature_setting.vue
View file @
34420f42
<
script
>
import
{
__
}
from
'
~/local
e
'
;
import
projectFeatureToggle
from
'
../../../../../vue_shared/components/toggle_button.vue
'
;
import
projectFeatureToggle
from
'
~/vue_shared/components/toggle_button.vu
e
'
;
import
{
featureAccessLevelNone
}
from
'
../constants
'
;
export
default
{
components
:
{
...
...
@@ -44,7 +44,7 @@ export default {
if
(
this
.
featureEnabled
)
{
return
this
.
options
;
}
return
[
[
0
,
__
(
'
Enable feature to choose access level
'
)]
];
return
[
featureAccessLevelNone
];
},
displaySelectInput
()
{
...
...
app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
View file @
34420f42
...
...
@@ -4,9 +4,16 @@ import { __ } from '~/locale';
import
projectFeatureSetting
from
'
./project_feature_setting.vue
'
;
import
projectFeatureToggle
from
'
~/vue_shared/components/toggle_button.vue
'
;
import
projectSettingRow
from
'
./project_setting_row.vue
'
;
import
{
visibilityOptions
,
visibilityLevelDescriptions
}
from
'
../constants
'
;
import
{
visibilityOptions
,
visibilityLevelDescriptions
,
featureAccessLevelMembers
,
featureAccessLevelEveryone
,
}
from
'
../constants
'
;
import
{
toggleHiddenClassBySelector
}
from
'
../external
'
;
const
PAGE_FEATURE_ACCESS_LEVEL
=
__
(
'
Everyone
'
);
export
default
{
components
:
{
projectFeatureSetting
,
...
...
@@ -103,9 +110,9 @@ export default {
computed
:
{
featureAccessLevelOptions
()
{
const
options
=
[
[
10
,
__
(
'
Only Project Members
'
)]
];
const
options
=
[
featureAccessLevelMembers
];
if
(
this
.
visibilityLevel
!==
visibilityOptions
.
PRIVATE
)
{
options
.
push
(
[
20
,
__
(
'
Everyone With Access
'
)]
);
options
.
push
(
featureAccessLevelEveryone
);
}
return
options
;
},
...
...
@@ -118,7 +125,7 @@ export default {
pagesFeatureAccessLevelOptions
()
{
if
(
this
.
visibilityLevel
!==
visibilityOptions
.
PUBLIC
)
{
return
this
.
featureAccessLevelOptions
.
concat
([[
30
,
__
(
'
Everyone
'
)
]]);
return
this
.
featureAccessLevelOptions
.
concat
([[
30
,
PAGE_FEATURE_ACCESS_LEVEL
]]);
}
return
this
.
featureAccessLevelOptions
;
},
...
...
app/assets/javascripts/pages/projects/shared/permissions/constants.js
View file @
34420f42
...
...
@@ -15,3 +15,30 @@ export const visibilityLevelDescriptions = {
'
The project can be accessed by anyone, regardless of authentication.
'
,
),
};
const
featureAccessLevel
=
{
NOT_ENABLED
:
0
,
PROJECT_MEMBERS
:
10
,
EVERYONE
:
20
,
};
const
featureAccessLevelDescriptions
=
{
[
featureAccessLevel
.
NOT_ENABLED
]:
__
(
'
Enable feature to choose access level
'
),
[
featureAccessLevel
.
PROJECT_MEMBERS
]:
__
(
'
Only Project Members
'
),
[
featureAccessLevel
.
EVERYONE
]:
__
(
'
Everyone With Access
'
),
};
export
const
featureAccessLevelNone
=
[
featureAccessLevel
.
NOT_ENABLED
,
featureAccessLevelDescriptions
[
featureAccessLevel
.
NOT_ENABLED
],
];
export
const
featureAccessLevelMembers
=
[
featureAccessLevel
.
PROJECT_MEMBERS
,
featureAccessLevelDescriptions
[
featureAccessLevel
.
PROJECT_MEMBERS
],
];
export
const
featureAccessLevelEveryone
=
[
featureAccessLevel
.
EVERYONE
,
featureAccessLevelDescriptions
[
featureAccessLevel
.
EVERYONE
],
];
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