Commit 90114f0b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'vue-i18n-js-pages-directory-ee' into 'master'

EE Port Vue-i18n: app/assets/javascripts/pages directory

See merge request gitlab-org/gitlab-ee!14342
parents a053528e 18ce58b8
<script>
import projectFeatureToggle from '../../../../../vue_shared/components/toggle_button.vue';
import projectFeatureToggle from '~/vue_shared/components/toggle_button.vue';
import { featureAccessLevelNone } from '../constants';
export default {
components: {
......@@ -43,7 +44,7 @@ export default {
if (this.featureEnabled) {
return this.options;
}
return [[0, 'Enable feature to choose access level']];
return [featureAccessLevelNone];
},
displaySelectInput() {
......
<script>
import settingsMixin from 'ee_else_ce/pages/projects/shared/permissions/mixins/settings_pannel_mixin';
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,
......@@ -102,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;
},
......@@ -117,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;
},
......@@ -200,17 +208,17 @@ 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>
......
......@@ -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],
];
......@@ -4855,6 +4855,9 @@ msgstr ""
msgid "Enable error tracking"
msgstr ""
msgid "Enable feature to choose access level"
msgstr ""
msgid "Enable for this project"
msgstr ""
......@@ -5362,6 +5365,9 @@ msgstr ""
msgid "Everyone"
msgstr ""
msgid "Everyone With Access"
msgstr ""
msgid "Everyone can contribute"
msgstr ""
......@@ -9312,6 +9318,9 @@ msgstr ""
msgid "One or more of your dependency files are not supported, and the dependency list may be incomplete. Below is a list of supported file types."
msgstr ""
msgid "Only Project Members"
msgstr ""
msgid "Only admins"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment