diff --git a/docs/de/user/repo/assets/repository-code-fileAnnotate.png b/docs/de/user/repo/assets/repository-code-fileAnnotate.png new file mode 100644 index 0000000000..1d6f202e9b Binary files /dev/null and b/docs/de/user/repo/assets/repository-code-fileAnnotate.png differ diff --git a/docs/de/user/repo/assets/repository-code-fileHistory.png b/docs/de/user/repo/assets/repository-code-fileHistory.png index 3c6b21d1e9..120d83d7f3 100644 Binary files a/docs/de/user/repo/assets/repository-code-fileHistory.png and b/docs/de/user/repo/assets/repository-code-fileHistory.png differ diff --git a/docs/de/user/repo/assets/repository-code-fileViewer.png b/docs/de/user/repo/assets/repository-code-fileViewer.png index f141c07920..4afa726c01 100644 Binary files a/docs/de/user/repo/assets/repository-code-fileViewer.png and b/docs/de/user/repo/assets/repository-code-fileViewer.png differ diff --git a/docs/de/user/repo/code.md b/docs/de/user/repo/code.md index 991a932dad..9ec3f29938 100644 --- a/docs/de/user/repo/code.md +++ b/docs/de/user/repo/code.md @@ -42,6 +42,11 @@ Nach einem Klick auf eine Datei in den Sources landet man in der Detailansicht d ![Repository-Code-FileDetails](assets/repository-code-fileViewer.png) +### Datei Annotate +Ergänzt jede Codezeile mit entsprechenden Informationen, wann und von welchem Autor diese zuletzt geändert wurde. Mit einem Hover auf der linken Seite erscheint ein Popover mit Changeset und weiteren Informationen. + +![Repository-Code-FileAnnotate](assets/repository-code-fileAnnotate.png) + ### Datei Historie Bei der Datei Details Ansicht kann man über einen Switch oben rechts auf die Historien-Ansicht wechseln. Dort werden die Commits aufgelistet, die diese Datei verändert haben. diff --git a/docs/en/user/repo/assets/repository-code-fileAnnotate.png b/docs/en/user/repo/assets/repository-code-fileAnnotate.png new file mode 100644 index 0000000000..932cac778c Binary files /dev/null and b/docs/en/user/repo/assets/repository-code-fileAnnotate.png differ diff --git a/docs/en/user/repo/assets/repository-code-fileHistory.png b/docs/en/user/repo/assets/repository-code-fileHistory.png index d386c8291a..4260af9e39 100644 Binary files a/docs/en/user/repo/assets/repository-code-fileHistory.png and b/docs/en/user/repo/assets/repository-code-fileHistory.png differ diff --git a/docs/en/user/repo/assets/repository-code-fileViewer.png b/docs/en/user/repo/assets/repository-code-fileViewer.png index 622e7b0045..c484b2e962 100644 Binary files a/docs/en/user/repo/assets/repository-code-fileViewer.png and b/docs/en/user/repo/assets/repository-code-fileViewer.png differ diff --git a/docs/en/user/repo/code.md b/docs/en/user/repo/code.md index 7f3e1dc3da..b0a8995c88 100644 --- a/docs/en/user/repo/code.md +++ b/docs/en/user/repo/code.md @@ -43,6 +43,11 @@ After clicking on a file in the sources, the details of the file are shown. Depe ![Repository-Code-FileDetails](assets/repository-code-fileViewer.png) +### File Annotate +Supplements each line of code with the relevant information when and by which author it was last modified. With a hover on the left side a popover with changeset and further information appears. + +![Repository-Code-FileAnnotate](assets/repository-code-fileAnnotate.png) + ### File History In the detailed file view there is a switch button in the upper right corner which allows to switch to the history view. The history shows all commits that changed the file. diff --git a/scm-ui/ui-components/src/SyntaxHighlighter.stories.tsx b/scm-ui/ui-components/src/SyntaxHighlighter.stories.tsx index 305d8dc2c8..7f458e4784 100644 --- a/scm-ui/ui-components/src/SyntaxHighlighter.stories.tsx +++ b/scm-ui/ui-components/src/SyntaxHighlighter.stories.tsx @@ -55,4 +55,9 @@ storiesOf("SyntaxHighlighter", module) + )) + .add("Without line numbers", () => ( + + + )); diff --git a/scm-ui/ui-components/src/SyntaxHighlighter.tsx b/scm-ui/ui-components/src/SyntaxHighlighter.tsx index bcbf05d53d..a8a06ac29d 100644 --- a/scm-ui/ui-components/src/SyntaxHighlighter.tsx +++ b/scm-ui/ui-components/src/SyntaxHighlighter.tsx @@ -30,13 +30,15 @@ import { arduinoLight } from "react-syntax-highlighter/dist/cjs/styles/hljs"; type Props = { language?: string; value: string; + showLineNumbers?: boolean; }; const defaultLanguage = "text"; class SyntaxHighlighter extends React.Component { static defaultProps: Partial = { - language: defaultLanguage + language: defaultLanguage, + showLineNumbers: true }; getLanguage = () => { @@ -48,9 +50,10 @@ class SyntaxHighlighter extends React.Component { }; render() { + const { showLineNumbers } = this.props; const language = this.getLanguage(); return ( - + {this.props.value} ); diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index 295104f72f..58725b1514 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -39474,6 +39474,22 @@ exports[`Storyshots MarkdownView Code without Lang 1`] = ` } > + + + 1 + + + @@ -40194,6 +40210,120 @@ Deserunt officia esse aliquip consectetur duis ut labore laborum commodo aliquip } } > + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + package main @@ -40466,6 +40596,176 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = ` } > + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + + 16 + + + + 17 + + + + 18 + + + + 19 + + + + 20 + + + + 21 + + + + 22 + + + + 23 + + + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + + 16 + + + + 17 + + + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + + 16 + + + + 17 + + + + 18 + + + + 19 + + + + 20 + + + + 21 + + + + 22 + + + + 23 + + + + 24 + + + + 25 + + + + 26 + + + + 27 + + + + 28 + + + + 29 + + + + 30 + + + + 31 + + + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + + 16 + + + + 17 + + + + 18 + + + + 19 + + + + 20 + + + + + +`; + +exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = ` +
+
+    
+      
+        package
+      
+      
+         com.example;
+
+      
+      
+
+      
+        
+      
+      
+        import
+      
+      
+         java.io.IOException;
+
+      
+      
+        
+      
+      
+        import
+      
+      
+         java.io.OutputStream;
+
+      
+      
+        
+      
+      
+        import
+      
+      
+         java.net.InetSocketAddress;
+
+      
+      
+
+      
+        
+      
+      
+        import
+      
+      
+         com.sun.net.httpserver.HttpExchange;
+
+      
+      
+        
+      
+      
+        import
+      
+      
+         com.sun.net.httpserver.HttpHandler;
+
+      
+      
+        
+      
+      
+        import
+      
+      
+         com.sun.net.httpserver.HttpServer;
+
+      
+      
+
+      
+        
+      
+      
+        public
+      
+      
+         
+      
+      
+        class
+      
+      
+         
+      
+      
+        Test
+      
+      
+         
+      
+      
+        {
+
+      
+      
+
+      
+          
+      
+      
+        public
+      
+      
+         
+      
+      
+        static
+      
+      
+         
+      
+      
+        void
+      
+      
+         
+      
+      
+        main
+      
+      
+        (String[] args)
+      
+      
+         
+      
+      
+        throws
+      
+      
+         Exception 
+      
+      
+        {
+
+      
+      
+            HttpServer server = HttpServer.create(
+      
+      
+        new
+      
+      
+         InetSocketAddress(
+      
+      
+        8000
+      
+      
+        ), 
+      
+      
+        0
+      
+      
+        );
+
+      
+      
+            server.createContext(
+      
+      
+        "/test"
+      
+      
+        , 
+      
+      
+        new
+      
+      
+         MyHandler());
+
+      
+      
+            server.setExecutor(
+      
+      
+        null
+      
+      
+        ); 
+      
+      
+        // creates a default executor
+      
+      
+        
+
+      
+          server.start();
+
+        }
+
+      
+
+      
+          
+      
+      
+        static
+      
+      
+         
+      
+      
+        class
+      
+      
+         
+      
+      
+        MyHandler
+      
+      
+         
+      
+      
+        implements
+      
+      
+         
+      
+      
+        HttpHandler
+      
+      
+         
+      
+      
+        {
+
+      
+      
+            
+      
+      
+        @Override
+      
+      
+        
+
+      
+      
+            
+      
+      
+        public
+      
+      
+         
+      
+      
+        void
+      
+      
+         
+      
+      
+        handle
+      
+      
+        (HttpExchange t)
+      
+      
+         
+      
+      
+        throws
+      
+      
+         IOException 
+      
+      
+        {
+
+      
+      
+              String response = 
+      
+      
+        "This is the response"
+      
+      
+        ;
+
+      
+      
+              t.sendResponseHeaders(
+      
+      
+        200
+      
+      
+        , response.length());
+
+      
+            OutputStream os = t.getResponseBody();
+
+            os.write(response.getBytes());
+
+            os.close();
+
+          }
+
+        }
+
+      
+
+      }
+
+      
+