diff --git a/gradle/changelog/markdown-ast-plugins.yaml b/gradle/changelog/markdown-ast-plugins.yaml new file mode 100644 index 0000000000..27af250572 --- /dev/null +++ b/gradle/changelog/markdown-ast-plugins.yaml @@ -0,0 +1,2 @@ +- type: added + description: create api for markdown ast plugins ([#1578](https://github.com/scm-manager/scm-manager/pull/1578)) diff --git a/scm-ui/ui-api/src/ApiProvider.tsx b/scm-ui/ui-api/src/ApiProvider.tsx index 50e9a05cb2..8319f55cb5 100644 --- a/scm-ui/ui-api/src/ApiProvider.tsx +++ b/scm-ui/ui-api/src/ApiProvider.tsx @@ -39,9 +39,10 @@ const queryClient = new QueryClient({ type Props = LegacyContext & { index?: IndexResources; me?: Me; + devtools?: boolean; }; -const ApiProvider: FC = ({ children, index, me, onMeFetched, onIndexFetched }) => { +const ApiProvider: FC = ({ children, index, me, onMeFetched, onIndexFetched, devtools = true }) => { useEffect(() => { if (index) { queryClient.setQueryData("index", index); @@ -63,7 +64,7 @@ const ApiProvider: FC = ({ children, index, me, onMeFetched, onIndexFetch {children} - + {devtools ? : null} ); }; diff --git a/scm-ui/ui-components/.storybook/withApiProvider.js b/scm-ui/ui-components/.storybook/withApiProvider.js index 1ae78e15f9..8fc42f2f01 100644 --- a/scm-ui/ui-components/.storybook/withApiProvider.js +++ b/scm-ui/ui-components/.storybook/withApiProvider.js @@ -39,6 +39,7 @@ const withApiProvider = (storyFn) => { groups: [], _links: {} }, + devtools: false, children: storyFn() }); } diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index e6fb4a2832..f8fbf5f485 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -42,6 +42,7 @@ "@types/refractor": "^3.0.0", "@types/styled-components": "^5.1.0", "@types/to-camel-case": "^1.0.0", + "@types/unist": "^2.0.3", "css": "^3.0.0", "enzyme-context": "^1.1.2", "enzyme-context-react-router-4": "^2.0.0", 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 b89821b4cd..6edfcb550a 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -1,35 +1,58 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Storyshots Annotate Default 1`] = ` -Array [ +
-
-
-        
-          
-
-
- Arthur Dent -
- -
- -
- -
-
- 1 -
- -
- - - package - - - main - - - -
-
-
-
-
- 2 -
- -
- - - - -
-
-
-
-
- Tricia Marie McMillan -
- -
- -
- -
-
- 3 -
- -
- - - - - - import - - - - - - "fmt" - - - - - - -
-
-
-
-
- 4 -
- -
- - - - -
-
-
-
-
- Arthur Dent -
- -
- -
- -
-
- 5 -
- -
- - - - - - func - - - - - - main - - - ( - - - ) - - - - - - { - - - - - - -
-
-
-
-
- Ford Prefect -
- -
- -
- -
-
- 6 -
- -
- - - fmt - - - . - - - Println - - - ( - - - "Hello World" - - - ) - - - - - - -
-
-
-
-
- Arthur Dent -
- -
- -
- -
-
- 7 -
- -
- - - - - - } - - - - - - -
-
-
-
-
- 8 -
- -
- - - - -
-
- - - - -
-
-
-
, -