From f51011c87bcd75c4d0fe97249dcab145b8da8dc5 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Mon, 7 Dec 2020 14:34:16 +0100 Subject: SONAR-12872 Rename Markdown Syntax to Formatting Syntax --- .../src/main/js/app/components/FormattingHelp.tsx | 145 ++++++++++++++ .../src/main/js/app/components/MarkdownHelp.tsx | 147 -------------- .../components/__tests__/FormattingHelp-test.tsx | 27 +++ .../__snapshots__/FormattingHelp-test.tsx.snap | 220 +++++++++++++++++++++ 4 files changed, 392 insertions(+), 147 deletions(-) create mode 100644 server/sonar-web/src/main/js/app/components/FormattingHelp.tsx delete mode 100644 server/sonar-web/src/main/js/app/components/MarkdownHelp.tsx create mode 100644 server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx create mode 100644 server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/FormattingHelp-test.tsx.snap (limited to 'server/sonar-web/src/main/js/app/components') diff --git a/server/sonar-web/src/main/js/app/components/FormattingHelp.tsx b/server/sonar-web/src/main/js/app/components/FormattingHelp.tsx new file mode 100644 index 00000000000..a6e29c00405 --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/FormattingHelp.tsx @@ -0,0 +1,145 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; + +export default function FormattingHelp() { + return ( +
+

Formatting Syntax

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Write:To display:
*this text is bold* + this text is bold +
https://sonarqube.org + https://sonarqube.org +
[SonarQube™ Home Page](https://www.sonarqube.org) + SonarQube™ Home Page +
+ * first item +
* second item +
+
    +
  • first item
  • +
  • second item
  • +
+
+ 1. first item +
+ 1. second item +
+
    +
  1. first item
  2. +
  3. second item
  4. +
+
+ = Heading Level 1
+ == Heading Level 2
+ === Heading Level 3
+ ==== Heading Level 4
+ ===== Heading Level 5
+ ====== Heading Level 6
+
+

Heading Level 1

+

Heading Level 2

+

Heading Level 3

+

Heading Level 4

+
Heading Level 5
+
Heading Level 6
+
``Lists#newArrayList()`` + Lists#newArrayList() +
+ `` +
+ {'// code on multiple lines'} +
+ {'public void foo() {'} +
+    + {'// do some logic here'} +
+ {'}'} +
+ `` +
+
+                {'// code on multiple lines\npublic void foo() {\n  // do some logic here\n}'}
+              
+
+ Standard text +
+ > Blockquoted text +
+ > that spans multiple lines +
+
+

Standard text

+
+ Blockquoted text +
+ that spans multiple lines +
+
+
+
+ ); +} diff --git a/server/sonar-web/src/main/js/app/components/MarkdownHelp.tsx b/server/sonar-web/src/main/js/app/components/MarkdownHelp.tsx deleted file mode 100644 index 278d742295c..00000000000 --- a/server/sonar-web/src/main/js/app/components/MarkdownHelp.tsx +++ /dev/null @@ -1,147 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; - -export default function MarkdownHelp() { - return ( -
-

Markdown Syntax

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Write:To display:
*this text is bold* - this text is bold -
http://sonarqube.org - http://sonarqube.org -
[SonarQube™ Home Page](http://www.sonarqube.org) - - SonarQube™ Home Page - -
- * first item -
* second item -
-
    -
  • first item
  • -
  • second item
  • -
-
- 1. first item -
- 1. second item -
-
    -
  1. first item
  2. -
  3. second item
  4. -
-
- = Heading Level 1
- == Heading Level 2
- === Heading Level 3
- ==== Heading Level 4
- ===== Heading Level 5
- ====== Heading Level 6
-
-

Heading Level 1

-

Heading Level 2

-

Heading Level 3

-

Heading Level 4

-
Heading Level 5
-
Heading Level 6
-
``Lists#newArrayList()`` - Lists#newArrayList() -
- `` -
- {'// code on multiple lines'} -
- {'public void foo() {'} -
-    - {'// do some logic here'} -
- {'}'} -
- `` -
-
-                {'// code on multiple lines\npublic void foo() {\n  // do some logic here\n}'}
-              
-
- Standard text -
- > Blockquoted text -
- > that spans multiple lines -
-
-

Standard text

-
- Blockquoted text -
- that spans multiple lines -
-
-
-
- ); -} diff --git a/server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx new file mode 100644 index 00000000000..e5cd6729a2c --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx @@ -0,0 +1,27 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import { shallow } from 'enzyme'; +import * as React from 'react'; +import FormattingHelp from '../FormattingHelp'; + +it('should render correctly', () => { + expect(shallow()).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/FormattingHelp-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/FormattingHelp-test.tsx.snap new file mode 100644 index 00000000000..031748e845e --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/FormattingHelp-test.tsx.snap @@ -0,0 +1,220 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +
+

+ Formatting Syntax +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Write: + + To display: +
+ *this text is bold* + + + this text is bold + +
+ https://sonarqube.org + + + https://sonarqube.org + +
+ [SonarQube™ Home Page](https://www.sonarqube.org) + + + SonarQube™ Home Page + +
+ * first item +
+ * second item +
+
    +
  • + first item +
  • +
  • + second item +
  • +
+
+ 1. first item +
+ 1. second item +
+
    +
  1. + first item +
  2. +
  3. + second item +
  4. +
+
+ = Heading Level 1 +
+ == Heading Level 2 +
+ === Heading Level 3 +
+ ==== Heading Level 4 +
+ ===== Heading Level 5 +
+ ====== Heading Level 6 +
+
+

+ Heading Level 1 +

+

+ Heading Level 2 +

+

+ Heading Level 3 +

+

+ Heading Level 4 +

+
+ Heading Level 5 +
+
+ Heading Level 6 +
+
+ \`\`Lists#newArrayList()\`\` + + + Lists#newArrayList() + +
+ \`\` +
+ // code on multiple lines +
+ public void foo() { +
+    + // do some logic here +
+ } +
+ \`\` +
+
+            // code on multiple lines
+public void foo() {
+  // do some logic here
+}
+          
+
+ Standard text +
+ > Blockquoted text +
+ > that spans multiple lines +
+
+

+ Standard text +

+
+ Blockquoted text +
+ that spans multiple lines +
+
+
+
+`; -- cgit v1.2.3