diff options
Diffstat (limited to 'app/assets/javascripts/pages/projects/shared/permissions')
2 files changed, 40 insertions, 8 deletions
diff --git a/app/assets/javascripts/pages/projects/shared/permissions/components/project_feature_setting.vue b/app/assets/javascripts/pages/projects/shared/permissions/components/project_feature_setting.vue index 0f145dbc170..242c58c4981 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/components/project_feature_setting.vue +++ b/app/assets/javascripts/pages/projects/shared/permissions/components/project_feature_setting.vue @@ -94,11 +94,7 @@ export default { {{ optionName }} </option> </select> - <gl-icon - name="chevron-down" - aria-hidden="true" - class="gl-absolute gl-top-3 gl-right-3 gl-text-gray-500" - /> + <gl-icon name="chevron-down" class="gl-absolute gl-top-3 gl-right-3 gl-text-gray-500" /> </div> </div> </template> diff --git a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue index e50add3b0a4..be197a50775 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue +++ b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue @@ -14,6 +14,7 @@ import { featureAccessLevel, } from '../constants'; import { toggleHiddenClassBySelector } from '../external'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; const PAGE_FEATURE_ACCESS_LEVEL = s__('ProjectSettings|Everyone'); @@ -27,7 +28,7 @@ export default { GlLink, GlFormCheckbox, }, - mixins: [settingsMixin], + mixins: [settingsMixin, glFeatureFlagsMixin()], props: { currentSettings: { @@ -137,6 +138,7 @@ export default { snippetsAccessLevel: featureAccessLevel.EVERYONE, pagesAccessLevel: featureAccessLevel.EVERYONE, metricsDashboardAccessLevel: featureAccessLevel.PROJECT_MEMBERS, + analyticsAccessLevel: featureAccessLevel.EVERYONE, requirementsAccessLevel: featureAccessLevel.EVERYONE, containerRegistryEnabled: true, lfsEnabled: true, @@ -240,6 +242,10 @@ export default { featureAccessLevel.PROJECT_MEMBERS, this.metricsDashboardAccessLevel, ); + this.analyticsAccessLevel = Math.min( + featureAccessLevel.PROJECT_MEMBERS, + this.analyticsAccessLevel, + ); this.requirementsAccessLevel = Math.min( featureAccessLevel.PROJECT_MEMBERS, this.requirementsAccessLevel, @@ -265,6 +271,8 @@ export default { this.snippetsAccessLevel = featureAccessLevel.EVERYONE; if (this.pagesAccessLevel === featureAccessLevel.PROJECT_MEMBERS) this.pagesAccessLevel = featureAccessLevel.EVERYONE; + if (this.analyticsAccessLevel > featureAccessLevel.NOT_ENABLED) + this.analyticsAccessLevel = featureAccessLevel.EVERYONE; if (this.metricsDashboardAccessLevel === featureAccessLevel.PROJECT_MEMBERS) this.metricsDashboardAccessLevel = featureAccessLevel.EVERYONE; if (this.requirementsAccessLevel === featureAccessLevel.PROJECT_MEMBERS) @@ -341,7 +349,6 @@ export default { </select> <gl-icon name="chevron-down" - aria-hidden="true" data-hidden="true" class="gl-absolute gl-top-3 gl-right-3 gl-text-gray-500" /> @@ -495,6 +502,17 @@ export default { </project-setting-row> </div> <project-setting-row + ref="analytics-settings" + :label="s__('ProjectSettings|Analytics')" + :help-text="s__('ProjectSettings|View project analytics')" + > + <project-feature-setting + v-model="analyticsAccessLevel" + :options="featureAccessLevelOptions" + name="project[project_feature_attributes][analytics_access_level]" + /> + </project-setting-row> + <project-setting-row v-if="requirementsAvailable" ref="requirements-settings" :label="s__('ProjectSettings|Requirements')" @@ -573,7 +591,6 @@ export default { </select> <gl-icon name="chevron-down" - aria-hidden="true" data-hidden="true" class="gl-absolute gl-top-3 gl-right-3 gl-text-gray-500" /> @@ -611,5 +628,24 @@ export default { }}</template> </gl-form-checkbox> </project-setting-row> + <project-setting-row + v-if="glFeatures.allowEditingCommitMessages" + ref="allow-editing-commit-messages" + class="gl-mb-4" + > + <input + :value="allowEditingCommitMessages" + type="hidden" + name="project[project_setting_attributes][allow_editing_commit_messages]" + /> + <gl-form-checkbox v-model="allowEditingCommitMessages"> + {{ s__('ProjectSettings|Allow editing commit messages') }} + <template #help>{{ + s__( + 'ProjectSettings|When enabled, commit authors will be able to edit commit messages on unprotected branches.', + ) + }}</template> + </gl-form-checkbox> + </project-setting-row> </div> </template> |