Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1916935 - Add Copy file path button to file header bar in Differential/Diffusion #43

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -233,6 +233,22 @@ public function render() {
$show_directory_uri = phutil_string_cast($show_directory_uri);
}

Javelin::initBehavior('phabricator-clipboard-copy');
$path_copy_button = id(new PHUIButtonView())
->setTag('a')
->setColor(PHUIButtonView::GREY)
->setIcon('fa-clipboard')
->setHref('#')
->addSigil('clipboard-copy')
->addSigil('has-tooltip')
->setMetadata(
array(
'tip' => pht('Copy file path'),
'text' => $display_filename,
'successMessage' => pht('File path copied.'),
'errorMessage' => pht('Copy of file path failed.'),
));

return javelin_tag(
'div',
array(
@@ -278,7 +294,16 @@ public function render() {
'sigil' => 'changeset-header',
),
array(
$icon,
javelin_tag(
'span',
array(
'class' => 'differential-changeset-path-copy-button',
'meta' => array(
'selectID' => $display_filename,
'once' => true,
),
),
$path_copy_button),
javelin_tag(
'span',
array(
11 changes: 10 additions & 1 deletion webroot/rsrc/css/application/differential/changeset-view.css
Original file line number Diff line number Diff line change
@@ -339,7 +339,7 @@ td.cov-I {

.differential-file-icon-header .phui-icon-view {
display: inline-block;
margin: 0 6px 2px 0;
margin: 0 0 2px 0;
vertical-align: middle;
font-size: 14px;
}
@@ -348,6 +348,15 @@ td.cov-I {
display: none;
}

.differential-changeset-path-copy-button {
margin-right: 0;
padding-right: 10px;
}

.device-phone .differential-changeset-path-copy-button {
display: none;
}

.differential-changeset-buttons {
float: right;
margin-top: 16px;