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
e3272f4a
Commit
e3272f4a
authored
Mar 22, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove slot from copyable_field.vue
Instead, handle UI text creation within the component.
parent
81cfd79e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
29 deletions
+36
-29
app/assets/javascripts/vue_shared/components/sidebar/copyable_field.vue
...ascripts/vue_shared/components/sidebar/copyable_field.vue
+19
-10
ee/app/assets/javascripts/integrations/jira/issues_show/components/sidebar/jira_issues_sidebar_root.vue
...sues_show/components/sidebar/jira_issues_sidebar_root.vue
+1
-12
locale/gitlab.pot
locale/gitlab.pot
+9
-3
spec/frontend/vue_shared/components/sidebar/copyable_field_spec.js
...tend/vue_shared/components/sidebar/copyable_field_spec.js
+7
-4
No files found.
app/assets/javascripts/vue_shared/components/sidebar/copyable_field.vue
View file @
e3272f4a
<
script
>
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
/**
...
...
@@ -35,12 +35,23 @@ export default {
tooltipBoundary
:
'
viewport
'
,
tooltipPlacement
:
'
left
'
,
text
:
this
.
value
,
title
:
sprintf
(
__
(
'
Copy %{name}
'
)
,
{
name
:
this
.
name
}),
title
:
sprintf
(
this
.
$options
.
i18n
.
clipboardTooltip
,
{
name
:
this
.
name
}),
};
},
loadingIconLabel
()
{
return
sprintf
(
__
(
'
Loading %{name}
'
)
,
{
name
:
this
.
name
});
return
sprintf
(
this
.
$options
.
i18n
.
loadingIconLabel
,
{
name
:
this
.
name
});
},
templateText
()
{
return
sprintf
(
this
.
$options
.
i18n
.
templateText
,
{
name
:
this
.
name
,
value
:
this
.
value
,
});
},
},
i18n
:
{
loadingIconLabel
:
__
(
'
Loading %{name}
'
),
clipboardTooltip
:
__
(
'
Copy %{name}
'
),
templateText
:
s__
(
'
Sidebar|%{name}: %{value}
'
),
},
};
</
script
>
...
...
@@ -56,14 +67,12 @@ export default {
<div
class=
"gl-display-flex gl-align-items-center gl-justify-content-space-between hide-collapsed"
>
<gl-loading-icon
v-if=
"isLoading"
inline
:label=
"loadingIconLabel"
/>
<template
v-else
>
<span
class=
"gl-overflow-hidden gl-text-overflow-ellipsis gl-white-space-nowrap"
>
<slot></slot>
</span>
<span
class=
"gl-overflow-hidden gl-text-overflow-ellipsis gl-white-space-nowrap"
>
{{
templateText
}}
</span>
<clipboard-button
size=
"small"
v-bind=
"clipboardProps
"
/>
<
/
template
>
<gl-loading-icon
v-if=
"isLoading"
inline
:label=
"loadingIconLabel
"
/>
<
clipboard-button
v-else
size=
"small"
v-bind=
"clipboardProps"
/
>
</div>
</div>
</
template
>
ee/app/assets/javascripts/integrations/jira/issues_show/components/sidebar/jira_issues_sidebar_root.vue
View file @
e3272f4a
<
script
>
import
{
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
labelsFilterParam
}
from
'
ee/integrations/jira/issues_show/constants
'
;
import
{
__
}
from
'
~/locale
'
;
import
CopyableField
from
'
~/vue_shared/components/sidebar/copyable_field.vue
'
;
...
...
@@ -11,7 +10,6 @@ import IssueField from './issue_field.vue';
export
default
{
name
:
'
JiraIssuesSidebar
'
,
components
:
{
GlSprintf
,
Assignee
,
IssueDueDate
,
IssueField
,
...
...
@@ -46,7 +44,6 @@ export default {
i18n
:
{
statusTitle
:
__
(
'
Status
'
),
referenceName
:
__
(
'
Reference
'
),
referenceText
:
__
(
'
Reference: %{reference}
'
),
},
};
</
script
>
...
...
@@ -70,14 +67,6 @@ export default {
class=
"block"
:name=
"$options.i18n.referenceName"
:value=
"reference"
>
<span
class=
"cross-project-reference"
>
<gl-sprintf
:message=
"$options.i18n.referenceText"
>
<template
#reference
>
<cite>
{{
reference
}}
</cite>
</
template
>
</gl-sprintf>
</span>
</copyable-field>
/>
</div>
</
template
>
locale/gitlab.pot
View file @
e3272f4a
...
...
@@ -8497,6 +8497,9 @@ msgstr ""
msgid "Copy %{http_label} clone URL"
msgstr ""
msgid "Copy %{name}"
msgstr ""
msgid "Copy %{protocol} clone URL"
msgstr ""
...
...
@@ -18428,6 +18431,9 @@ msgstr ""
msgid "Loading"
msgstr ""
msgid "Loading %{name}"
msgstr ""
msgid "Loading contribution stats for group members"
msgstr ""
...
...
@@ -25189,9 +25195,6 @@ msgstr ""
msgid "Reference"
msgstr ""
msgid "Reference:"
msgstr ""
msgid "References"
msgstr ""
...
...
@@ -28091,6 +28094,9 @@ msgstr ""
msgid "Side-by-side"
msgstr ""
msgid "Sidebar|%{name}: %{value}"
msgstr ""
msgid "Sidebar|Assign health status"
msgstr ""
...
...
spec/frontend/vue_shared/components/sidebar/copyable_field_spec.js
View file @
e3272f4a
...
...
@@ -14,9 +14,6 @@ describe('SidebarCopyableField', () => {
const
createComponent
=
(
propsData
=
defaultProps
)
=>
{
wrapper
=
shallowMount
(
CopyableField
,
{
propsData
,
slots
:
{
default
:
'
Reference: Gl-1
'
,
},
});
};
...
...
@@ -51,12 +48,18 @@ describe('SidebarCopyableField', () => {
});
describe
(
'
when `isLoading` prop is `true`
'
,
()
=>
{
it
(
'
renders loading icon
'
,
()
=>
{
beforeEach
(
()
=>
{
createComponent
({
...
defaultProps
,
isLoading
:
true
});
});
it
(
'
renders loading icon
'
,
()
=>
{
expect
(
findLoadingIcon
().
exists
()).
toBe
(
true
);
expect
(
findLoadingIcon
().
props
(
'
label
'
)).
toBe
(
'
Loading Reference
'
);
});
it
(
'
does not render clipboard button
'
,
()
=>
{
expect
(
findClipboardButton
().
exists
()).
toBe
(
false
);
});
});
});
});
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