Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
738fef17
Commit
738fef17
authored
Jan 29, 2019
by
Jaden
Browse files
Add a "Copy Path" button to copy path to clipboard
Closes
#104
parent
29b4de1d
Pipeline
#26418
passed with stages
in 49 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
conda/js/src/components/EntityDetail.jsx
View file @
738fef17
...
...
@@ -12,6 +12,7 @@ import {
Input
,
InputGroupAddon
,
InputGroup
,
Button
,
}
from
'
reactstrap
'
;
import
{
connect
}
from
'
react-redux
'
;
...
...
@@ -100,7 +101,7 @@ export class EntityDetail extends React.Component<Props, State> {
const
usern
=
segs
.
shift
();
const
expn
=
segs
.
pop
();
const
tcn
=
segs
.
join
(
'
/
'
);
expName
=
<
span
>
{
usern
}
/
<
Link
to
=
{
`/toolchain/
${
tcn
}
`
}
>
{
tcn
}
</
Link
>
/
{
expn
}
</
span
>
expName
=
<
span
>
{
usern
}
/
<
Link
to
=
{
`/toolchain/
${
tcn
}
`
}
>
{
tcn
}
</
Link
>
/
{
expn
}
</
span
>
;
}
return
(
<
Container
>
...
...
@@ -121,10 +122,26 @@ export class EntityDetail extends React.Component<Props, State> {
<
InputGroup
>
<
InputGroupAddon
addonType
=
'prepend'
>
Path:
</
InputGroupAddon
>
<
Input
id
=
'objectPath'
readOnly
width
=
'80'
value
=
{
`
${
this
.
props
.
prefix
}
/
${
pluralize
(
this
.
props
.
entity
)
}
/
${
name
}
`
}
/>
<
InputGroupAddon
addonType
=
'append'
>
<
Button
outline
color
=
'secondary'
title
=
{
`Copy the object's path to the clipboard`
}
onClick
=
{
(
e
)
=>
{
const
toCopy
=
document
.
querySelector
(
'
#objectPath
'
);
toCopy
.
select
();
document
.
execCommand
(
'
copy
'
);
}
}
>
{
/*UTF8 char for the clipboard: 📋*/
}
Copy Path
</
Button
>
</
InputGroupAddon
>
</
InputGroup
>
</
Col
>
</
Row
>
...
...
Write
Preview
Supports
Markdown
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