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
90cf135b
Commit
90cf135b
authored
Sep 17, 2021
by
Mark Florian
Committed by
Savas Vedova
Sep 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve i18n of ProjectFormGroup
parent
ef968c59
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
57 deletions
+53
-57
app/assets/javascripts/confidential_merge_request/components/project_form_group.vue
...fidential_merge_request/components/project_form_group.vue
+18
-19
locale/gitlab.pot
locale/gitlab.pot
+1
-4
spec/frontend/confidential_merge_request/components/__snapshots__/project_form_group_spec.js.snap
.../components/__snapshots__/project_form_group_spec.js.snap
+14
-12
spec/frontend/confidential_merge_request/components/project_form_group_spec.js
...ntial_merge_request/components/project_form_group_spec.js
+20
-22
No files found.
app/assets/javascripts/confidential_merge_request/components/project_form_group.vue
View file @
90cf135b
...
@@ -96,12 +96,23 @@ export default {
...
@@ -96,12 +96,23 @@ export default {
}
}
},
},
},
},
i18n
:
{
project
:
__
(
'
Project
'
),
privateForkSelected
:
__
(
"
To protect this issue's confidentiality, a private fork of this project was selected.
"
,
),
noForks
:
__
(
'
No forks are available to you.
'
),
forkTheProject
:
__
(
`To protect this issue's confidentiality, %{linkStart}fork this project%{linkEnd} and set the fork's visibility to private.`
,
),
readMore
:
__
(
'
Read more
'
),
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"confidential-merge-request-fork-group form-group"
>
<div
class=
"confidential-merge-request-fork-group form-group"
>
<label>
{{
__
(
'
Project
'
)
}}
</label>
<label>
{{
$options
.
i18n
.
project
}}
</label>
<div>
<div>
<dropdown
<dropdown
v-if=
"projects.length"
v-if=
"projects.length"
...
@@ -111,25 +122,13 @@ export default {
...
@@ -111,25 +122,13 @@ export default {
/>
/>
<p
class=
"text-muted mt-1 mb-0"
>
<p
class=
"text-muted mt-1 mb-0"
>
<template
v-if=
"projects.length"
>
<template
v-if=
"projects.length"
>
{{
{{
$options
.
i18n
.
privateForkSelected
}}
__
(
"
To protect this issue's confidentiality, a private fork of this project was selected.
"
,
)
}}
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
{{
__
(
'
No forks are available to you.
'
)
}}
<br
/>
{{
$options
.
i18n
.
noForks
}}
<br
/>
<gl-sprintf
<gl-sprintf
:message=
"$options.i18n.forkTheProject"
>
:message=
"
<template
#link
="
{ content }">
__(
<a
:href=
"newForkPath"
target=
"_blank"
class=
"help-link"
>
{{
content
}}
</a>
`To protect this issue's confidentiality, %
{forkLink} and set the fork's visibility to private.`,
)
"
>
<template
#forkLink
>
<a
:href=
"newForkPath"
target=
"_blank"
class=
"help-link"
>
{{
__
(
'
fork this project
'
)
}}
</a>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
</template>
</template>
...
@@ -138,7 +137,7 @@ export default {
...
@@ -138,7 +137,7 @@ export default {
class=
"w-auto p-0 d-inline-block text-primary bg-transparent"
class=
"w-auto p-0 d-inline-block text-primary bg-transparent"
target=
"_blank"
target=
"_blank"
>
>
<span
class=
"sr-only"
>
{{
__('Read more')
}}
</span>
<span
class=
"sr-only"
>
{{
$options.i18n.readMore
}}
</span>
<gl-icon
name=
"question-o"
/>
<gl-icon
name=
"question-o"
/>
</gl-link>
</gl-link>
</p>
</p>
...
...
locale/gitlab.pot
View file @
90cf135b
...
@@ -35223,7 +35223,7 @@ msgstr ""
...
@@ -35223,7 +35223,7 @@ msgstr ""
msgid "To preserve performance only %{strong_open}%{display_size} of %{real_size}%{strong_close} files are displayed."
msgid "To preserve performance only %{strong_open}%{display_size} of %{real_size}%{strong_close} files are displayed."
msgstr ""
msgstr ""
msgid "To protect this issue's confidentiality, %{
forkLink
} and set the fork's visibility to private."
msgid "To protect this issue's confidentiality, %{
linkStart}fork this project%{linkEnd
} and set the fork's visibility to private."
msgstr ""
msgstr ""
msgid "To protect this issue's confidentiality, a private fork of this project was selected."
msgid "To protect this issue's confidentiality, a private fork of this project was selected."
...
@@ -39836,9 +39836,6 @@ msgstr ""
...
@@ -39836,9 +39836,6 @@ msgstr ""
msgid "fork"
msgid "fork"
msgstr ""
msgstr ""
msgid "fork this project"
msgstr ""
msgid "from"
msgid "from"
msgstr ""
msgstr ""
...
...
spec/frontend/confidential_merge_request/components/__snapshots__/project_form_group_spec.js.snap
View file @
90cf135b
...
@@ -17,11 +17,15 @@ exports[`Confidential merge request project form group component renders empty s
...
@@ -17,11 +17,15 @@ exports[`Confidential merge request project form group component renders empty s
No forks are available to you.
No forks are available to you.
<br />
<br />
To protect this issue's confidentiality,
<gl-sprintf-stub
<a
message="To protect this issue's confidentiality, %{forkLink} and set the fork's visibility to private."
class="help-link"
/>
href="https://test.com"
target="_blank"
>
fork this project
</a>
and set the fork's visibility to private.
<gl-link-stub
<gl-link-stub
class="w-auto p-0 d-inline-block text-primary bg-transparent"
class="w-auto p-0 d-inline-block text-primary bg-transparent"
href="/help"
href="/help"
...
@@ -52,18 +56,16 @@ exports[`Confidential merge request project form group component renders fork dr
...
@@ -52,18 +56,16 @@ exports[`Confidential merge request project form group component renders fork dr
</label>
</label>
<div>
<div>
<!---->
<dropdown-stub
projects="[object Object],[object Object]"
selectedproject="[object Object]"
/>
<p
<p
class="text-muted mt-1 mb-0"
class="text-muted mt-1 mb-0"
>
>
No forks are available to you.
To protect this issue's confidentiality, a private fork of this project was selected.
<br />
<gl-sprintf-stub
message="To protect this issue's confidentiality, %{forkLink} and set the fork's visibility to private."
/>
<gl-link-stub
<gl-link-stub
class="w-auto p-0 d-inline-block text-primary bg-transparent"
class="w-auto p-0 d-inline-block text-primary bg-transparent"
...
...
spec/frontend/confidential_merge_request/components/project_form_group_spec.js
View file @
90cf135b
import
{
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
ProjectFormGroup
from
'
~/confidential_merge_request/components/project_form_group.vue
'
;
import
ProjectFormGroup
from
'
~/confidential_merge_request/components/project_form_group.vue
'
;
...
@@ -21,55 +22,52 @@ const mockData = [
...
@@ -21,55 +22,52 @@ const mockData = [
},
},
},
},
];
];
let
vm
;
let
wrapper
;
let
mock
;
let
mock
;
function
factory
(
projects
=
mockData
)
{
function
factory
(
projects
=
mockData
)
{
mock
=
new
MockAdapter
(
axios
);
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
/api
\/(
.*
)\/
projects
\/
gitlab-org%2Fgitlab-ce
\/
forks/
).
reply
(
200
,
projects
);
mock
.
onGet
(
/api
\/(
.*
)\/
projects
\/
gitlab-org%2Fgitlab-ce
\/
forks/
).
reply
(
200
,
projects
);
vm
=
shallowMount
(
ProjectFormGroup
,
{
wrapper
=
shallowMount
(
ProjectFormGroup
,
{
propsData
:
{
propsData
:
{
namespacePath
:
'
gitlab-org
'
,
namespacePath
:
'
gitlab-org
'
,
projectPath
:
'
gitlab-org/gitlab-ce
'
,
projectPath
:
'
gitlab-org/gitlab-ce
'
,
newForkPath
:
'
https://test.com
'
,
newForkPath
:
'
https://test.com
'
,
helpPagePath
:
'
/help
'
,
helpPagePath
:
'
/help
'
,
},
},
stubs
:
{
GlSprintf
},
});
});
return
axios
.
waitForAll
();
}
}
describe
(
'
Confidential merge request project form group component
'
,
()
=>
{
describe
(
'
Confidential merge request project form group component
'
,
()
=>
{
afterEach
(()
=>
{
afterEach
(()
=>
{
mock
.
restore
();
mock
.
restore
();
vm
.
destroy
();
wrapper
.
destroy
();
});
});
it
(
'
renders fork dropdown
'
,
()
=>
{
it
(
'
renders fork dropdown
'
,
async
()
=>
{
factory
();
await
factory
();
return
vm
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
element
).
toMatchSnapshot
();
expect
(
vm
.
element
).
toMatchSnapshot
();
});
});
});
it
(
'
sets selected project as first fork
'
,
()
=>
{
it
(
'
sets selected project as first fork
'
,
async
()
=>
{
factory
();
await
factory
();
return
vm
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
selectedProject
).
toEqual
({
expect
(
vm
.
vm
.
selectedProject
).
toEqual
({
id
:
1
,
id
:
1
,
name
:
'
root / gitlab-ce
'
,
name
:
'
root / gitlab-ce
'
,
pathWithNamespace
:
'
root/gitlab-ce
'
,
pathWithNamespace
:
'
root/gitlab-ce
'
,
namespaceFullpath
:
'
root
'
,
namespaceFullpath
:
'
root
'
,
});
});
});
});
});
it
(
'
renders empty state when response is empty
'
,
()
=>
{
it
(
'
renders empty state when response is empty
'
,
async
()
=>
{
factory
([]);
await
factory
([]);
return
vm
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
element
).
toMatchSnapshot
();
expect
(
vm
.
element
).
toMatchSnapshot
();
});
});
});
});
});
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