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
21d87023
Commit
21d87023
authored
Jun 27, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moves EE code into a mixin
parent
c30742e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
27 deletions
+55
-27
app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
...projects/shared/permissions/components/settings_panel.vue
+29
-27
app/assets/javascripts/pages/projects/shared/permissions/mixins/settings_pannel_mixin.js
...ojects/shared/permissions/mixins/settings_pannel_mixin.js
+26
-0
No files found.
app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
View file @
21d87023
<
script
>
import
settingsMixin
from
'
ee_else_ce/pages/projects/shared/permissions/mixins/settings_pannel_mixin
'
;
import
projectFeatureSetting
from
'
./project_feature_setting.vue
'
;
import
projectFeatureToggle
from
'
../../../../..
/vue_shared/components/toggle_button.vue
'
;
import
projectFeatureToggle
from
'
~
/vue_shared/components/toggle_button.vue
'
;
import
projectSettingRow
from
'
./project_setting_row.vue
'
;
import
{
visibilityOptions
,
visibilityLevelDescriptions
}
from
'
../constants
'
;
import
{
toggleHiddenClassBySelector
}
from
'
../external
'
;
...
...
@@ -11,6 +12,7 @@ export default {
projectFeatureToggle
,
projectSettingRow
,
},
mixins
:
[
settingsMixin
],
props
:
{
currentSettings
:
{
...
...
@@ -37,6 +39,11 @@ export default {
required
:
false
,
default
:
false
,
},
packagesAvailable
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
visibilityHelpPath
:
{
type
:
String
,
required
:
false
,
...
...
@@ -67,8 +74,12 @@ export default {
required
:
false
,
default
:
''
,
},
packagesHelpPath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
data
()
{
const
defaults
=
{
visibilityOptions
,
...
...
@@ -148,24 +159,6 @@ export default {
}
},
repositoryAccessLevel
(
value
,
oldValue
)
{
if
(
value
<
oldValue
)
{
// sub-features cannot have more premissive access level
this
.
mergeRequestsAccessLevel
=
Math
.
min
(
this
.
mergeRequestsAccessLevel
,
value
);
this
.
buildsAccessLevel
=
Math
.
min
(
this
.
buildsAccessLevel
,
value
);
if
(
value
===
0
)
{
this
.
containerRegistryEnabled
=
false
;
this
.
lfsEnabled
=
false
;
}
}
else
if
(
oldValue
===
0
)
{
this
.
mergeRequestsAccessLevel
=
value
;
this
.
buildsAccessLevel
=
value
;
this
.
containerRegistryEnabled
=
true
;
this
.
lfsEnabled
=
true
;
}
},
issuesAccessLevel
(
value
,
oldValue
)
{
if
(
value
===
0
)
toggleHiddenClassBySelector
(
'
.issues-feature
'
,
true
);
else
if
(
oldValue
===
0
)
toggleHiddenClassBySelector
(
'
.issues-feature
'
,
false
);
...
...
@@ -207,23 +200,20 @@ export default {
<option
:value=
"visibilityOptions.PRIVATE"
:disabled=
"!visibilityAllowed(visibilityOptions.PRIVATE)"
>
Private
</option
>
Private
</option>
<option
:value=
"visibilityOptions.INTERNAL"
:disabled=
"!visibilityAllowed(visibilityOptions.INTERNAL)"
>
Internal
</option
>
Internal
</option>
<option
:value=
"visibilityOptions.PUBLIC"
:disabled=
"!visibilityAllowed(visibilityOptions.PUBLIC)"
>
Public
</option
>
Public
</option>
</select>
<i
aria-hidden=
"true"
data-hidden=
"true"
class=
"fa fa-chevron-down"
>
</i>
<i
aria-hidden=
"true"
data-hidden=
"true"
class=
"fa fa-chevron-down"
></i>
</div>
</div>
<span
class=
"form-text text-muted"
>
{{
visibilityLevelDescription
}}
</span>
...
...
@@ -299,6 +289,18 @@ export default {
name=
"project[lfs_enabled]"
/>
</project-setting-row>
<project-setting-row
v-if=
"packagesAvailable"
:help-path=
"packagesHelpPath"
label=
"Packages"
help-text=
"Every project can have its own space to store its packages"
>
<project-feature-toggle
v-model=
"packagesEnabled"
:disabled-input=
"!repositoryEnabled"
name=
"project[packages_enabled]"
/>
</project-setting-row>
</div>
<project-setting-row
label=
"Wiki"
help-text=
"Pages for project documentation"
>
<project-feature-setting
...
...
app/assets/javascripts/pages/projects/shared/permissions/mixins/settings_pannel_mixin.js
0 → 100644
View file @
21d87023
export
default
{
data
()
{
return
{
packagesEnabled
:
false
,
};
},
watch
:
{
repositoryAccessLevel
(
value
,
oldValue
)
{
if
(
value
<
oldValue
)
{
// sub-features cannot have more premissive access level
this
.
mergeRequestsAccessLevel
=
Math
.
min
(
this
.
mergeRequestsAccessLevel
,
value
);
this
.
buildsAccessLevel
=
Math
.
min
(
this
.
buildsAccessLevel
,
value
);
if
(
value
===
0
)
{
this
.
containerRegistryEnabled
=
false
;
this
.
lfsEnabled
=
false
;
}
}
else
if
(
oldValue
===
0
)
{
this
.
mergeRequestsAccessLevel
=
value
;
this
.
buildsAccessLevel
=
value
;
this
.
containerRegistryEnabled
=
true
;
this
.
lfsEnabled
=
true
;
}
},
},
};
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