diff --git a/helm-quarry/values.yaml b/helm-quarry/values.yaml index 3cbae97e..c01f42a7 100644 --- a/helm-quarry/values.yaml +++ b/helm-quarry/values.yaml @@ -1,6 +1,6 @@ web: repository: 'quay.io/wikimedia-quarry/quarry' - tag: pr-96 # web tag managed by github actions + tag: pr-99 # web tag managed by github actions resources: requests: memory: "300Mi" @@ -11,7 +11,7 @@ web: worker: repository: 'quay.io/wikimedia-quarry/quarry' - tag: pr-96 # worker tag managed by github actions + tag: pr-99 # worker tag managed by github actions resources: requests: memory: "400Mi" diff --git a/quarry/web/static/css/query/view.css b/quarry/web/static/css/query/view.css index c47876dd..15890ff9 100644 --- a/quarry/web/static/css/query/view.css +++ b/quarry/web/static/css/query/view.css @@ -95,6 +95,22 @@ table#query-results-sampled { margin-bottom: 12px; } +.copy-link-status { + float: left; + margin-right: 8px; + line-height: 22px; + font-size: 12px; + white-space: nowrap; + opacity: 0; + transition: opacity 1.5s ease-out; +} + +.copy-link-status.copy-link-status-shown { + opacity: 1; + /* Appear at once, fade away slowly. */ + transition: none; +} + div.dataTables_info { margin: 0 0 10.5px; } diff --git a/quarry/web/static/js/query/view.js b/quarry/web/static/js/query/view.js index 29800a9f..c540049b 100644 --- a/quarry/web/static/js/query/view.js +++ b/quarry/web/static/js/query/view.js @@ -151,6 +151,22 @@ $( () => { } ); } + /* Copy an absolute result URL to the clipboard instead of downloading it. */ + $( '#query-result' ).on( 'click', '.copy-link-menu a', function ( event ) { + event.preventDefault(); + const $status = $( this ).closest( '.btn-toolbar' ).find( '.copy-link-status' ); + navigator.clipboard.writeText( this.href ).then( () => { + $status.text( ' ✅️ Copied to clipboard' ).addClass( 'copy-link-status-shown' ); + setTimeout( () => { + // Empty it once faded, so it stops taking up room in the header. + $status.one( 'transitionend', () => $status.text( '' ) ) + .removeClass( 'copy-link-status-shown' ); + }, 3000 ); + }, ( err ) => { + console.log( 'Could not copy result link to clipboard', err ); + } ); + } ); + $( '#togglehl' ).on( 'click', () => { if ( editor === null ) { editor = makeEditor(); diff --git a/quarry/web/static/templates/compiled.js b/quarry/web/static/templates/compiled.js index 15db4197..c693a9f0 100644 --- a/quarry/web/static/templates/compiled.js +++ b/quarry/web/static/templates/compiled.js @@ -18,7 +18,7 @@ output += "\n "; } output += "\n ("; output += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "rowcount"), env.opts.autoescape); -output += " rows)\n \n