Skip to content

Commit

Permalink
Merge branch 'branches/rudder/8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins CI committed Oct 9, 2024
2 parents e343798 + 50af04a commit 70a256c
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -852,3 +852,7 @@ function initBsTabs(){
});
});
}

function copy(value) {
navigator.clipboard.writeText(value).then(function(){ createInfoNotification("Copied to clipboard!") }, function() {createErrorNotification("Could not copy to clipboard")})
}
34 changes: 0 additions & 34 deletions webapp/sources/rudder/rudder-web/src/main/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webapp/sources/rudder/rudder-web/src/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"dependencies": {
"bootstrap": "^5.3.2",
"chart.js": "^3.7.1",
"clipboard": "^2.0.11",
"datatables.net": "^1.13.4",
"datatables.net-fixedheader": "^3.3.2",
"datatables.net-plugins": "^1.13.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ object DisplayNode extends Loggable {
{nodeStateIcon}
</div>
<div class="header-subtitle">
<a class="clipboard" title="Copy to clipboard" data-clipboard-text={sm.node.main.id.value}>
<a class="clipboard" title="Copy to clipboard" onclick={s"copy('${sm.node.main.id.value}')"}>
<span id="nodeHeaderId">{sm.node.main.id.value}</span>
<i class="ion ion-clipboard"></i>
</a>
Expand Down Expand Up @@ -1056,7 +1056,7 @@ object DisplayNode extends Loggable {
| }, 400);
|});
|app.ports.copy.subscribe(function(str) {
| navigator.clipboard.writeText(str);
| copy(str);
|});
|app.ports.initInputs.subscribe(function(str) {
| setTimeout(function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,19 @@ class Login extends DispatchSnippet with DefaultExtendableSnippet[Login] {
<span id="cmd-user" class="cmd-text">
rudder server create-user -u &lt;username&gt;
</span>
<button class="btn btn-cmd-user btn-clipboard" type="button" data-clipboard-text="rudder server create-user -u " data-bs-toggle="tooltip" data-bs-placement="bottom" title="Copy to clipboard">
<button class="btn btn-cmd-user btn-clipboard" type="button" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Copy to clipboard">
<i class="far fa-clipboard"></i>
</button>
</div>
<script type="text/javascript">
// <![CDATA[
window.setTimeout('location.reload()', 10000);
new ClipboardJS('.btn-clipboard');
var checked;
$('.btn-cmd-user').on('click', function(){
clearInterval(checked);
$('.btn-cmd-user .fa-clipboard').attr('class', 'fas fa-check') ;
checked = setInterval(function(){
$('.btn-cmd-user .fa-check').attr('class', 'far fa-clipboard') ;
},700);
});
$('.btn-clipboard').click(function(){
navigator.clipboard.writeText("rudder server create-user -u " ).then(function(){
$('.btn-clipboard').attr("title","Copied to clipboard!");
$('.btn-cmd-user .fa-clipboard').attr('class', 'fas fa-check') ;
}, function() {})
} );
// ]]>
</script>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ class Groups extends StatefulSnippet with DefaultExtendableSnippet[Groups] with
| }, 400);
| });
| app.ports.copy.subscribe(function(str) {
| navigator.clipboard.writeText(str);
| copy(str);
| });
| app.ports.initInputs.subscribe(function(str) {
| setTimeout(function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
});

app.ports.copy.subscribe(function (str) {
navigator.clipboard.writeText(str);
copy(str);
});
// Initialize tooltips
app.ports.initTooltips.subscribe(function (msg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
createSuccessNotification(message);
});
app.ports.copy.subscribe(function(str) {
navigator.clipboard.writeText(str);
copy(str);
});
</script>
</lift:surround>
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@
app.ports.errorNotification.subscribe(function(str) {
createErrorNotification(str)
});

app.ports.copy.subscribe(function(str) {
navigator.clipboard.writeText(str);
copy(str);
});

// Change the URL upon request, inform app of the change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
};
var app = Elm.Editor.init({node: main, flags: initValues});
app.ports.copy.subscribe(function(value) {
navigator.clipboard.writeText(value).then(function(){ }, function() {})
copy(value)
});

var baseUrl = contextPath ? contextPath : "/rudder";
Expand Down

0 comments on commit 70a256c

Please sign in to comment.