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
\n
\n \n
\n
\n
\n \n
\n \n
    \n "; frame = frame.push(); var t_3 = {"tsv": "TSV","json": "JSON","json-lines": "JSON Lines","csv": "CSV","wikitable": "Wikitable","html": "HTML"}; if(t_3) {var t_1; @@ -36,23 +36,15 @@ frame.set("loop.revindex0", t_2 - t_1 - 1); frame.set("loop.first", t_1 === 0); frame.set("loop.last", t_1 === t_2 - 1); frame.set("loop.length", t_2); -output += "\n
  • "; output += runtime.suppressValue(t_5, env.opts.autoescape); -output += "
  • \n "; +output += "\n "; ; } } else { @@ -70,12 +62,44 @@ frame.set("loop.revindex0", t_2 - t_1 - 1); frame.set("loop.first", t_1 === 0); frame.set("loop.last", t_1 === t_2 - 1); frame.set("loop.length", t_2); -output += "\n
  • "; +output += runtime.suppressValue(t_7, env.opts.autoescape); +output += "
  • \n "; +; +} +} +} +frame = frame.pop(); +output += "\n
\n
\n
\n \n
    \n "; +frame = frame.push(); +var t_10 = {"tsv": "TSV","json": "JSON","json-lines": "JSON Lines","csv": "CSV","wikitable": "Wikitable","html": "HTML"}; +if(t_10) {var t_8; +if(runtime.isArray(t_10)) { +var t_9 = t_10.length; +for(t_8=0; t_8 < t_10.length; t_8++) { +var t_11 = t_10[t_8][0] +frame.set("format", t_10[t_8][0]); +var t_12 = t_10[t_8][1] +frame.set("formatname", t_10[t_8][1]); +frame.set("loop.index", t_8 + 1); +frame.set("loop.index0", t_8); +frame.set("loop.revindex", t_9 - t_8); +frame.set("loop.revindex0", t_9 - t_8 - 1); +frame.set("loop.first", t_8 === 0); +frame.set("loop.last", t_8 === t_9 - 1); +frame.set("loop.length", t_9); +output += "\n
  • "; -output += runtime.suppressValue(t_7, env.opts.autoescape); -output += "
  • \n "; +output += runtime.suppressValue(t_12, env.opts.autoescape); +output += "\n "; +; +} +} else { +t_8 = -1; +var t_9 = runtime.keys(t_10).length; +for(var t_13 in t_10) { +t_8++; +var t_14 = t_10[t_13]; +frame.set("format", t_13); +frame.set("formatname", t_14); +frame.set("loop.index", t_8 + 1); +frame.set("loop.index0", t_8); +frame.set("loop.revindex", t_9 - t_8); +frame.set("loop.revindex0", t_9 - t_8 - 1); +frame.set("loop.first", t_8 === 0); +frame.set("loop.last", t_8 === t_9 - 1); +frame.set("loop.length", t_9); +output += "\n
  • "; +output += runtime.suppressValue(t_14, env.opts.autoescape); +output += "
  • \n "; ; } } } frame = frame.pop(); -output += "\n
\n
\n
\n
\n
\n
\n"; +output += "\n \n \n \n \n \n
\n\n"; if(parentTemplate) { parentTemplate.rootRenderFunc(env, context, frame, runtime, cb); } else { diff --git a/quarry/web/static/templates/query-resultset.html b/quarry/web/static/templates/query-resultset.html index cc18caf2..554ea209 100644 --- a/quarry/web/static/templates/query-resultset.html +++ b/quarry/web/static/templates/query-resultset.html @@ -9,22 +9,42 @@ ({{rowcount}} rows)
-
- - +
+ +
+ + +
+
+ + +