diff mbox series

[bug#72281] Guix Packager: add copy feature for fetch command

Message ID 20240724222709.6417-1-jakob.kirsch@web.de
State New
Headers show
Series [bug#72281] Guix Packager: add copy feature for fetch command | expand

Commit Message

Jakob Kirsch July 24, 2024, 10:26 p.m. UTC
---
 src/components/inputs/SourceInput.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--
2.45.2

Comments

Ludovic Courtès Aug. 19, 2024, 12:53 p.m. UTC | #1
Hello,

(Cc: Philippe, the author of Guix Packager.)

Jakob Kirsch <jakob.kirsch@web.de> skribis:

> ---
>  src/components/inputs/SourceInput.tsx | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/components/inputs/SourceInput.tsx b/src/components/inputs/SourceInput.tsx
> index aa1b714..2f67425 100644
> --- a/src/components/inputs/SourceInput.tsx
> +++ b/src/components/inputs/SourceInput.tsx
> @@ -136,9 +136,12 @@ function HashHelp({ method, url, version }: {
>    method: Method, url: UrlType, version: string
>  }) {
>    return (
> -    <div>
> +    <div
> +      onClick={() => {
> +        navigator.clipboard.writeText(getFetchHelp(method, url, version))
> +      }}>
>        <Typography variant="body2">
> -        You may compute the sha256 by running the following command(s):
> +        You may compute the sha256 by running the following command(s) (click to copy):

I took the liberty to apply this patch and it’s now deployed:

  https://guix-hpc.gitlabpages.inria.fr/guix-packager/

Philippe, lemme know if anything needs to be tweaked.  :-)

Thanks for your contribution!

Ludo’.
Philippe Virouleau Aug. 26, 2024, 6:52 a.m. UTC | #2
Hi Ludo and Jakob,

Thanks a lot, that looks great to me :)

Regards,
Philippe

On 8/19/24 14:53, Ludovic Courtès wrote:
> Hello,
> 
> (Cc: Philippe, the author of Guix Packager.)
> 
> Jakob Kirsch <jakob.kirsch@web.de> skribis:
> 
>> ---
>>   src/components/inputs/SourceInput.tsx | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/components/inputs/SourceInput.tsx b/src/components/inputs/SourceInput.tsx
>> index aa1b714..2f67425 100644
>> --- a/src/components/inputs/SourceInput.tsx
>> +++ b/src/components/inputs/SourceInput.tsx
>> @@ -136,9 +136,12 @@ function HashHelp({ method, url, version }: {
>>     method: Method, url: UrlType, version: string
>>   }) {
>>     return (
>> -    <div>
>> +    <div
>> +      onClick={() => {
>> +        navigator.clipboard.writeText(getFetchHelp(method, url, version))
>> +      }}>
>>         <Typography variant="body2">
>> -        You may compute the sha256 by running the following command(s):
>> +        You may compute the sha256 by running the following command(s) (click to copy):
> 
> I took the liberty to apply this patch and it’s now deployed:
> 
>    https://guix-hpc.gitlabpages.inria.fr/guix-packager/
> 
> Philippe, lemme know if anything needs to be tweaked.  :-)
> 
> Thanks for your contribution!
> 
> Ludo’.
diff mbox series

Patch

diff --git a/src/components/inputs/SourceInput.tsx b/src/components/inputs/SourceInput.tsx
index aa1b714..2f67425 100644
--- a/src/components/inputs/SourceInput.tsx
+++ b/src/components/inputs/SourceInput.tsx
@@ -136,9 +136,12 @@  function HashHelp({ method, url, version }: {
   method: Method, url: UrlType, version: string
 }) {
   return (
-    <div>
+    <div
+      onClick={() => {
+        navigator.clipboard.writeText(getFetchHelp(method, url, version))
+      }}>
       <Typography variant="body2">
-        You may compute the sha256 by running the following command(s):
+        You may compute the sha256 by running the following command(s) (click to copy):
       </Typography>
       <SyntaxHighlighter
         text={getFetchHelp(method, url, version)}