Commit 245737fc authored by Samantha Ming's avatar Samantha Ming

Add reviewer comment

- Move help path to provide/inject
- translate text
parent 9ee8db92
...@@ -14,18 +14,10 @@ export default { ...@@ -14,18 +14,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
newGroupPath: {
type: String,
required: true,
},
projectFullPath: { projectFullPath: {
type: String, type: String,
required: true, required: true,
}, },
visibilityHelpPath: {
type: String,
required: true,
},
projectId: { projectId: {
type: String, type: String,
required: true, required: true,
...@@ -68,9 +60,7 @@ export default { ...@@ -68,9 +60,7 @@ export default {
<div class="col-lg-9"> <div class="col-lg-9">
<fork-form <fork-form
:endpoint="endpoint" :endpoint="endpoint"
:new-group-path="newGroupPath"
:project-full-path="projectFullPath" :project-full-path="projectFullPath"
:visibility-help-path="visibilityHelpPath"
:project-id="projectId" :project-id="projectId"
:project-name="projectName" :project-name="projectName"
:project-path="projectPath" :project-path="projectPath"
......
...@@ -45,23 +45,23 @@ export default { ...@@ -45,23 +45,23 @@ export default {
GlFormRadioGroup, GlFormRadioGroup,
GlFormSelect, GlFormSelect,
}, },
inject: {
newGroupPath: {
default: '',
},
visibilityHelpPath: {
default: '',
},
},
props: { props: {
endpoint: { endpoint: {
type: String, type: String,
required: true, required: true,
}, },
newGroupPath: {
type: String,
required: true,
},
projectFullPath: { projectFullPath: {
type: String, type: String,
required: true, required: true,
}, },
visibilityHelpPath: {
type: String,
required: true,
},
projectId: { projectId: {
type: String, type: String,
required: true, required: true,
......
...@@ -21,6 +21,10 @@ if (gon.features.forkProjectForm) { ...@@ -21,6 +21,10 @@ if (gon.features.forkProjectForm) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el: mountElement, el: mountElement,
provide: {
newGroupPath,
visibilityHelpPath,
},
render(h) { render(h) {
return h(App, { return h(App, {
props: { props: {
......
- page_title _("ForkProject|Fork project") - page_title s_("ForkProject|Fork project")
- if Feature.enabled?(:fork_project_form) - if Feature.enabled?(:fork_project_form)
#fork-groups-mount-element{ data: { fork_illustration: image_path('illustrations/project-create-new-sm.svg'), #fork-groups-mount-element{ data: { fork_illustration: image_path('illustrations/project-create-new-sm.svg'),
...@@ -15,15 +15,15 @@ ...@@ -15,15 +15,15 @@
.row.gl-mt-3 .row.gl-mt-3
.col-lg-3 .col-lg-3
%h4.gl-mt-0 %h4.gl-mt-0
= _("Fork project") = s_("ForkProject|Fork project")
%p %p
= _("A fork is a copy of a project.") = s_("ForkProject|A fork is a copy of a project.")
%br %br
= _('Forking a repository allows you to make changes without affecting the original project.') = s_('ForkProject|Forking a repository allows you to make changes without affecting the original project.')
.col-lg-9 .col-lg-9
- if @own_namespace.present? - if @own_namespace.present?
.fork-thumbnail-container.js-fork-content .fork-thumbnail-container.js-fork-content
%h5.gl-mt-0.gl-mb-0.gl-ml-3.gl-mr-3 %h5.gl-mt-0.gl-mb-0.gl-ml-3.gl-mr-3
= _("Select a namespace to fork the project") = s_("ForkProject|Select a namespace to fork the project")
= render 'fork_button', namespace: @own_namespace = render 'fork_button', namespace: @own_namespace
#fork-groups-mount-element{ data: { endpoint: new_project_fork_path(@project, format: :json) } } #fork-groups-mount-element{ data: { endpoint: new_project_fork_path(@project, format: :json) } }
...@@ -1315,9 +1315,6 @@ msgstr "" ...@@ -1315,9 +1315,6 @@ msgstr ""
msgid "A file with '%{file_name}' already exists in %{branch} branch" msgid "A file with '%{file_name}' already exists in %{branch} branch"
msgstr "" msgstr ""
msgid "A fork is a copy of a project."
msgstr ""
msgid "A group is a collection of several projects" msgid "A group is a collection of several projects"
msgstr "" msgstr ""
...@@ -13306,6 +13303,9 @@ msgstr "" ...@@ -13306,6 +13303,9 @@ msgstr ""
msgid "ForkProject|Select a namespace" msgid "ForkProject|Select a namespace"
msgstr "" msgstr ""
msgid "ForkProject|Select a namespace to fork the project"
msgstr ""
msgid "ForkProject|The project can be accessed by any logged in user." msgid "ForkProject|The project can be accessed by any logged in user."
msgstr "" msgstr ""
...@@ -13324,9 +13324,6 @@ msgstr "" ...@@ -13324,9 +13324,6 @@ msgstr ""
msgid "ForkedFromProjectPath|Forked from an inaccessible project" msgid "ForkedFromProjectPath|Forked from an inaccessible project"
msgstr "" msgstr ""
msgid "Forking a repository allows you to make changes without affecting the original project."
msgstr ""
msgid "Forking in progress" msgid "Forking in progress"
msgstr "" msgstr ""
...@@ -26879,9 +26876,6 @@ msgstr "" ...@@ -26879,9 +26876,6 @@ msgstr ""
msgid "Select a label" msgid "Select a label"
msgstr "" msgstr ""
msgid "Select a namespace to fork the project"
msgstr ""
msgid "Select a new namespace" msgid "Select a new namespace"
msgstr "" msgstr ""
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import App from '~/pages/projects/forks/new/components/app.vue'; import App from '~/pages/projects/forks/new/components/app.vue';
jest.mock('~/flash');
describe('App component', () => { describe('App component', () => {
let wrapper; let wrapper;
const DEFAULT_PROPS = { const DEFAULT_PROPS = {
forkIllustration: 'illustrations/project-create-new-sm.svg', forkIllustration: 'illustrations/project-create-new-sm.svg',
endpoint: '/some/project-full-path/-/forks/new.json', endpoint: '/some/project-full-path/-/forks/new.json',
newGroupPath: 'some/groups/path',
projectFullPath: '/some/project-full-path', projectFullPath: '/some/project-full-path',
visibilityHelpPath: 'some/visibility/help/path',
projectId: '10', projectId: '10',
projectName: 'Project Name', projectName: 'Project Name',
projectPath: 'project-name', projectPath: 'project-name',
......
...@@ -30,9 +30,7 @@ describe('ForkForm component', () => { ...@@ -30,9 +30,7 @@ describe('ForkForm component', () => {
const DEFAULT_PROPS = { const DEFAULT_PROPS = {
endpoint: '/some/project-full-path/-/forks/new.json', endpoint: '/some/project-full-path/-/forks/new.json',
newGroupPath: 'some/groups/path',
projectFullPath: '/some/project-full-path', projectFullPath: '/some/project-full-path',
visibilityHelpPath: 'some/visibility/help/path',
projectId: '10', projectId: '10',
projectName: 'Project Name', projectName: 'Project Name',
projectPath: 'project-name', projectPath: 'project-name',
...@@ -46,6 +44,10 @@ describe('ForkForm component', () => { ...@@ -46,6 +44,10 @@ describe('ForkForm component', () => {
const createComponent = (props = {}, data = {}) => { const createComponent = (props = {}, data = {}) => {
wrapper = shallowMount(ForkForm, { wrapper = shallowMount(ForkForm, {
provide: {
newGroupPath: 'some/groups/path',
visibilityHelpPath: 'some/visibility/help/path',
},
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
...props, ...props,
......
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