@scm-manager/ui-components 2.27.4 → 2.27.5-20211120-082922

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/package.json +7 -8
  2. package/src/Autocomplete.tsx +7 -6
  3. package/src/BranchSelector.tsx +2 -2
  4. package/src/Breadcrumb.tsx +1 -0
  5. package/src/CardColumnGroup.tsx +6 -6
  6. package/src/DangerZone.tsx +1 -0
  7. package/src/DateFromNow.tsx +2 -1
  8. package/src/DateShort.tsx +2 -1
  9. package/src/ErrorBoundary.tsx +2 -2
  10. package/src/Icon.tsx +4 -4
  11. package/src/Logo.stories.tsx +1 -0
  12. package/src/OverviewPageActions.tsx +2 -2
  13. package/src/SmallLoadingSpinner.stories.tsx +32 -0
  14. package/src/SmallLoadingSpinner.tsx +34 -0
  15. package/src/SplitAndReplace.tsx +3 -2
  16. package/src/SyntaxHighlighter.stories.tsx +1 -1
  17. package/src/Tooltip.tsx +1 -1
  18. package/src/__resources__/ContentSearchHit.ts +73 -0
  19. package/src/__snapshots__/storyshots.test.ts.snap +1068 -2086
  20. package/src/buttons/Button.tsx +33 -34
  21. package/src/forms/FileInput.tsx +1 -1
  22. package/src/forms/FileUpload.tsx +1 -1
  23. package/src/forms/FilterInput.tsx +1 -0
  24. package/src/forms/InputField.tsx +2 -2
  25. package/src/forms/Select.tsx +4 -4
  26. package/src/forms/TriStateCheckbox.tsx +2 -2
  27. package/src/index.ts +4 -3
  28. package/src/languages.test.ts +1 -5
  29. package/src/languages.ts +1 -10
  30. package/src/layout/Footer.tsx +1 -1
  31. package/src/layout/Header.tsx +2 -2
  32. package/src/layout/SubSubtitle.tsx +41 -0
  33. package/src/layout/index.ts +2 -1
  34. package/src/modals/FullscreenModal.tsx +1 -1
  35. package/src/modals/Modal.tsx +6 -6
  36. package/src/navigation/RoutingProps.ts +3 -1
  37. package/src/navigation/SecondaryNavigation.stories.tsx +3 -3
  38. package/src/navigation/SecondaryNavigation.tsx +1 -1
  39. package/src/popover/Popover.tsx +7 -7
  40. package/src/repos/DiffFile.tsx +21 -15
  41. package/src/repos/HealthCheckFailureDetail.tsx +2 -2
  42. package/src/repos/RepositoryEntry.tsx +9 -6
  43. package/src/repos/RepositoryFlags.tsx +2 -2
  44. package/src/repos/TokenizedDiffView.tsx +20 -2
  45. package/src/repos/annotate/Annotate.stories.tsx +1 -1
  46. package/src/repos/annotate/Annotate.tsx +2 -2
  47. package/src/repos/annotate/AnnotateLine.tsx +1 -0
  48. package/src/repos/annotate/{Popover.tsx → AnnotatePopover.tsx} +2 -2
  49. package/src/repos/index.ts +2 -0
  50. package/src/repos/refractorAdapter.ts +11 -6
  51. package/src/search/HighlightedFragment.tsx +7 -4
  52. package/src/search/SyntaxHighlightedFragment.tsx +130 -0
  53. package/src/search/TextHitField.stories.tsx +54 -0
  54. package/src/search/TextHitField.tsx +34 -18
  55. package/src/styleConstants.ts +2 -1
  56. package/src/syntax-highlighting.module.css +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/ui-components",
3
- "version": "2.27.4",
3
+ "version": "2.27.5-20211120-082922",
4
4
  "description": "UI Components for SCM-Manager and its plugins",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -25,7 +25,7 @@
25
25
  "@scm-manager/jest-preset": "^2.13.0",
26
26
  "@scm-manager/prettier-config": "^2.10.1",
27
27
  "@scm-manager/tsconfig": "^2.12.0",
28
- "@scm-manager/ui-tests": "^2.27.4",
28
+ "@scm-manager/ui-tests": "^2.27.5-20211120-082922",
29
29
  "@storybook/addon-actions": "^6.3.12",
30
30
  "@storybook/addon-storyshots": "^6.3.12",
31
31
  "@storybook/builder-webpack5": "^6.3.12",
@@ -37,7 +37,6 @@
37
37
  "@types/fetch-mock": "^7.3.1",
38
38
  "@types/jest": "^24.0.19",
39
39
  "@types/lowlight": "^0.0.0",
40
- "@types/query-string": "5",
41
40
  "@types/react": "^17.0.1",
42
41
  "@types/react-dom": "^17.0.1",
43
42
  "@types/react-router-dom": "^5.1.0",
@@ -61,22 +60,21 @@
61
60
  "sass-loader": "^12.3.0",
62
61
  "storybook-addon-i18next": "^1.3.0",
63
62
  "storybook-addon-themes": "^6.1.0",
64
- "tabbable": "^5.2.1",
65
63
  "to-camel-case": "^1.0.0",
66
64
  "webpack": "^5.61.0",
67
65
  "worker-plugin": "^3.2.0"
68
66
  },
69
67
  "dependencies": {
70
- "@scm-manager/ui-api": "^2.27.4",
71
- "@scm-manager/ui-extensions": "^2.27.4",
72
- "@scm-manager/ui-types": "^2.27.4",
68
+ "@scm-manager/ui-api": "^2.27.5-20211120-082922",
69
+ "@scm-manager/ui-extensions": "^2.27.5-20211120-082922",
70
+ "@scm-manager/ui-types": "^2.27.5-20211120-082922",
73
71
  "classnames": "^2.2.6",
74
72
  "date-fns": "^2.4.1",
75
73
  "deepmerge": "^4.2.2",
76
74
  "hast-util-sanitize": "^3.0.2",
77
75
  "lowlight": "^1.13.0",
78
76
  "prism-themes": "^1.4.0",
79
- "query-string": "5",
77
+ "query-string": "6.14.1",
80
78
  "react": "^17.0.1",
81
79
  "react-diff-view": "^2.4.1",
82
80
  "react-dom": "^17.0.1",
@@ -93,6 +91,7 @@
93
91
  "remark-gfm": "^1.0.0",
94
92
  "remark-parse": "^9.0.0",
95
93
  "remark-rehype": "^8.0.0",
94
+ "tabbable": "^5.2.1",
96
95
  "unified": "^9.2.1"
97
96
  },
98
97
  "babel": {
@@ -47,7 +47,7 @@ class Autocomplete extends React.Component<Props, State> {
47
47
  static defaultProps = {
48
48
  placeholder: "Type here",
49
49
  loadingMessage: "Loading...",
50
- noOptionsMessage: "No suggestion available",
50
+ noOptionsMessage: "No suggestion available"
51
51
  };
52
52
 
53
53
  handleInputChange = (newValue: ValueType<SelectValue>, action: ActionMeta) => {
@@ -64,7 +64,7 @@ class Autocomplete extends React.Component<Props, State> {
64
64
  selectValue: ValueType<SelectValue>,
65
65
  selectOptions: readonly SelectValue[]
66
66
  ): boolean => {
67
- const isNotDuplicated = !selectOptions.map((option) => option.label).includes(inputValue);
67
+ const isNotDuplicated = !selectOptions.map(option => option.label).includes(inputValue);
68
68
  const isNotEmpty = inputValue !== "";
69
69
  return isNotEmpty && isNotDuplicated;
70
70
  };
@@ -79,7 +79,7 @@ class Autocomplete extends React.Component<Props, State> {
79
79
  noOptionsMessage,
80
80
  loadSuggestions,
81
81
  creatable,
82
- className,
82
+ className
83
83
  } = this.props;
84
84
 
85
85
  return (
@@ -88,6 +88,7 @@ class Autocomplete extends React.Component<Props, State> {
88
88
  <div className="control">
89
89
  {creatable ? (
90
90
  <AsyncCreatable
91
+ className="autocomplete-entry"
91
92
  cacheOptions
92
93
  loadOptions={loadSuggestions}
93
94
  onChange={this.handleInputChange}
@@ -96,13 +97,13 @@ class Autocomplete extends React.Component<Props, State> {
96
97
  loadingMessage={() => loadingMessage}
97
98
  noOptionsMessage={() => noOptionsMessage}
98
99
  isValidNewOption={this.isValidNewOption}
99
- onCreateOption={(value) => {
100
+ onCreateOption={value => {
100
101
  this.selectValue({
101
102
  label: value,
102
103
  value: {
103
104
  id: value,
104
- displayName: value,
105
- },
105
+ displayName: value
106
+ }
106
107
  });
107
108
  }}
108
109
  aria-label={helpText || label}
@@ -61,8 +61,8 @@ const BranchSelector: FC<Props> = ({ branches, onSelectBranch, selectedBranch, l
61
61
  <MinWidthControl className="control">
62
62
  <Select
63
63
  className="is-fullwidth"
64
- options={branches.map((b) => ({ label: b.name, value: b.name }))}
65
- onChange={(branch) => onSelectBranch(branches.filter((b) => b.name === branch)[0])}
64
+ options={branches.map(b => ({ label: b.name, value: b.name }))}
65
+ onChange={branch => onSelectBranch(branches.filter(b => b.name === branch)[0])}
66
66
  disabled={!!disabled}
67
67
  value={selectedBranch}
68
68
  addValueToOptions={true}
@@ -110,6 +110,7 @@ const ActionBar = styled.div`
110
110
  }
111
111
  `;
112
112
 
113
+ // TODO ersetzen?
113
114
  const PrefixButton = styled.div`
114
115
  border-right: 1px solid lightgray;
115
116
  `;
@@ -41,13 +41,13 @@ class CardColumnGroup extends React.Component<Props, State> {
41
41
  constructor(props: Props) {
42
42
  super(props);
43
43
  this.state = {
44
- collapsed: false,
44
+ collapsed: false
45
45
  };
46
46
  }
47
47
 
48
48
  toggleCollapse = () => {
49
- this.setState((prevState) => ({
50
- collapsed: !prevState.collapsed,
49
+ this.setState(prevState => ({
50
+ collapsed: !prevState.collapsed
51
51
  }));
52
52
  };
53
53
 
@@ -84,18 +84,18 @@ class CardColumnGroup extends React.Component<Props, State> {
84
84
 
85
85
  return (
86
86
  <div className="mb-4">
87
- <h2>
87
+ <h3>
88
88
  <span className={classNames("is-size-4", "is-clickable")} onClick={this.toggleCollapse}>
89
89
  {icon}
90
90
  </span>{" "}
91
91
  {url ? (
92
- <Link to={url} className="has-text-dark">
92
+ <Link to={url} className="has-text-secondary-more">
93
93
  {name}
94
94
  </Link>
95
95
  ) : (
96
96
  name
97
97
  )}
98
- </h2>
98
+ </h3>
99
99
  <hr />
100
100
  <div className={classNames("columns", "card-columns", "is-multiline", "mx-3", "my-0")}>{content}</div>
101
101
  <div className="is-clearfix" />
@@ -40,6 +40,7 @@ export const DangerZone = styled.div`
40
40
  }
41
41
  }
42
42
 
43
+ // TODO ersetzen?
43
44
  > *:not(:last-child) {
44
45
  padding-bottom: 1.5rem;
45
46
  border-bottom: solid 2px whitesmoke;
@@ -36,8 +36,9 @@ const DateFromNow: FC<Props> = ({ className, ...dateProps }) => {
36
36
  return null;
37
37
  }
38
38
 
39
+ const dateTime = formatter.formatFull();
39
40
  return (
40
- <DateElement className={className} title={formatter.formatFull()}>
41
+ <DateElement className={className} dateTime={dateTime} title={dateTime}>
41
42
  {formatter.formatDistance()}
42
43
  </DateElement>
43
44
  );
package/src/DateShort.tsx CHANGED
@@ -36,8 +36,9 @@ const DateShort: FC<Props> = ({ className, ...dateProps }) => {
36
36
  return null;
37
37
  }
38
38
 
39
+ const dateTime = formatter.formatFull();
39
40
  return (
40
- <DateElement className={className} title={formatter.formatFull()}>
41
+ <DateElement className={className} dateTime={dateTime} title={dateTime}>
41
42
  {formatter.formatShort()}
42
43
  </DateElement>
43
44
  );
@@ -113,7 +113,7 @@ const ErrorDisplay: FC<ErrorDisplayProps> = ({ error, errorInfo, fallback: Fallb
113
113
 
114
114
  const fallbackProps = {
115
115
  error,
116
- errorInfo,
116
+ errorInfo
117
117
  };
118
118
 
119
119
  return <FallbackComponent {...fallbackProps} />;
@@ -135,7 +135,7 @@ class ErrorBoundary extends React.Component<Props, State> {
135
135
  componentDidCatch(error: Error, errorInfo: ErrorInfo) {
136
136
  this.setState({
137
137
  error,
138
- errorInfo,
138
+ errorInfo
139
139
  });
140
140
  }
141
141
 
package/src/Icon.tsx CHANGED
@@ -40,20 +40,20 @@ type Props = {
40
40
 
41
41
  const Icon: FC<Props> = ({
42
42
  iconStyle = "fas",
43
- color = "grey-light",
43
+ color = "secondary",
44
44
  title,
45
45
  name,
46
46
  className,
47
47
  onClick,
48
48
  testId,
49
- tabIndex = -1,
49
+ tabIndex,
50
50
  onEnter,
51
- alt = title,
51
+ alt = title
52
52
  }) => {
53
53
  return (
54
54
  <i
55
55
  onClick={onClick}
56
- onKeyPress={(event) => event.key === "Enter" && onEnter && onEnter(event)}
56
+ onKeyPress={event => event.key === "Enter" && onEnter && onEnter(event)}
57
57
  title={title}
58
58
  className={classNames(iconStyle, "fa-fw", "fa-" + name, `has-text-${color}`, className)}
59
59
  tabIndex={tabIndex}
@@ -26,6 +26,7 @@ import { storiesOf } from "@storybook/react";
26
26
  import styled from "styled-components";
27
27
  import Logo from "./Logo";
28
28
 
29
+ // TODO Ersetzen?
29
30
  const Wrapper = styled.div`
30
31
  padding: 2em;
31
32
  background-color: black;
@@ -52,7 +52,7 @@ const OverviewPageActions: FC<Props> = ({
52
52
  groupSelected,
53
53
  label,
54
54
  testId,
55
- searchPlaceholder,
55
+ searchPlaceholder
56
56
  }) => {
57
57
  const history = useHistory();
58
58
  const location = useLocation();
@@ -63,7 +63,7 @@ const OverviewPageActions: FC<Props> = ({
63
63
  <div className="column is-flex">
64
64
  <Select
65
65
  className="is-fullwidth"
66
- options={groups.map((g) => ({ value: g, label: g }))}
66
+ options={groups.map(g => ({ value: g, label: g }))}
67
67
  value={currentGroup}
68
68
  onChange={groupSelected}
69
69
  />
@@ -0,0 +1,32 @@
1
+ /*
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { storiesOf } from "@storybook/react";
25
+ import React from "react";
26
+ import SmallLoadingSpinner from "./SmallLoadingSpinner";
27
+
28
+ storiesOf("SmallLoading", module).add("Default", () => (
29
+ <div>
30
+ <SmallLoadingSpinner />
31
+ </div>
32
+ ));
@@ -0,0 +1,34 @@
1
+ /*
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import React, { FC } from "react";
25
+
26
+ const SmallLoadingSpinner: FC = () => {
27
+ return (
28
+ <div className="loader-wrapper">
29
+ <div className="loader is-loading" />
30
+ </div>
31
+ );
32
+ };
33
+
34
+ export default SmallLoadingSpinner;
@@ -33,9 +33,10 @@ export type Replacement = {
33
33
  type Props = {
34
34
  text: string;
35
35
  replacements: Replacement[];
36
+ textWrapper?: (s: string) => ReactNode;
36
37
  };
37
38
 
38
- const textWrapper = (s: string) => {
39
+ const defaultTextWrapper = (s: string) => {
39
40
  const first = s.startsWith(" ") ? <>&nbsp;</> : "";
40
41
  const last = s.endsWith(" ") ? <>&nbsp;</> : "";
41
42
  return (
@@ -47,7 +48,7 @@ const textWrapper = (s: string) => {
47
48
  );
48
49
  };
49
50
 
50
- const SplitAndReplace: FC<Props> = ({ text, replacements }) => {
51
+ const SplitAndReplace: FC<Props> = ({ text, replacements, textWrapper = defaultTextWrapper }) => {
51
52
  const parts = textSplitAndReplace<ReactNode>(text, replacements, textWrapper);
52
53
  if (parts.length === 0) {
53
54
  return <>{parts[0]}</>;
@@ -48,7 +48,7 @@ storiesOf("SyntaxHighlighter", module)
48
48
  ))
49
49
  .add("Go", () => (
50
50
  <Spacing>
51
- <SyntaxHighlighter language="golang" value={GoHttpServer} />
51
+ <SyntaxHighlighter language="go" value={GoHttpServer} />
52
52
  </Spacing>
53
53
  ))
54
54
  .add("Javascript", () => (
package/src/Tooltip.tsx CHANGED
@@ -36,7 +36,7 @@ export type TooltipLocation = "bottom" | "right" | "top" | "left";
36
36
 
37
37
  class Tooltip extends React.Component<Props> {
38
38
  static defaultProps = {
39
- location: "right",
39
+ location: "right"
40
40
  };
41
41
 
42
42
  render() {
@@ -0,0 +1,73 @@
1
+ /*
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present Cloudogu GmbH and Contributors
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import { Hit } from "@scm-manager/ui-types";
26
+
27
+ export const javaHit: Hit = {
28
+ score: 2.5,
29
+ fields: {
30
+ content: {
31
+ highlighted: true,
32
+ fragments: [
33
+ "import org.slf4j.LoggerFactory;\n\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.concurrent.TimeUnit;\n\n/**\n * Jwt implementation of {@link <|[[--AccessTokenBuilder--]]|>}.\n * \n * @author Sebastian Sdorra\n * @since 2.0.0\n */\npublic final class <|[[--JwtAccessTokenBuilder--]]|> implements <|[[--AccessTokenBuilder--]]|> {\n\n /**\n * the logger for <|[[--JwtAccessTokenBuilder--]]|>\n */\n private static final Logger LOG = LoggerFactory.getLogger(<|[[--JwtAccessTokenBuilder.class--]]|>);\n \n private final KeyGenerator keyGenerator; \n private final SecureKeyResolver keyResolver; \n \n private String subject;\n private String issuer;\n",
34
+ " private final Map<String,Object> custom = Maps.newHashMap();\n \n <|[[--JwtAccessTokenBuilder--]]|>(KeyGenerator keyGenerator, SecureKeyResolver keyResolver) {\n this.keyGenerator = keyGenerator;\n this.keyResolver = keyResolver;\n }\n\n @Override\n public <|[[--JwtAccessTokenBuilder--]]|> subject(String subject) {\n",
35
+ ' public <|[[--JwtAccessTokenBuilder--]]|> custom(String key, Object value) {\n Preconditions.checkArgument(!Strings.isNullOrEmpty(key), "null or empty value not allowed");\n Preconditions.checkArgument(value != null, "null or empty value not allowed");\n'
36
+ ],
37
+ matchesContentStart: false,
38
+ matchesContentEnd: false
39
+ }
40
+ },
41
+ _links: {}
42
+ };
43
+
44
+ export const bashHit: Hit = {
45
+ score: 2.5,
46
+ fields: {
47
+ content: {
48
+ highlighted: true,
49
+ fragments: [
50
+ '# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n#\n\n<|[[--getent--]]|> group scm >/dev/null || groupadd -r scm\n<|[[--getent--]]|> passwd scm >/dev/null || \\\n useradd -r -g scm -M \\\n -s /sbin/nologin -d /var/lib/scm \\\n -c "user for the scm-server process" scm\nexit 0\n\n'
51
+ ],
52
+ matchesContentStart: false,
53
+ matchesContentEnd: true
54
+ }
55
+ },
56
+ _links: {}
57
+ };
58
+
59
+ export const markdownHit: Hit = {
60
+ score: 2.5,
61
+ fields: {
62
+ content: {
63
+ highlighted: true,
64
+ fragments: [
65
+ "---\ntitle: SCM-Manager v2 Test <|[[--Cases--]]|>\n---\n\nDescribes the expected behaviour for SCMM v2 REST Resources using manual tests.\n\nThe following states general test <|[[--cases--]]|> per HTTP Method and en expected return code as well as exemplary curl calls.\nResource-specifics are stated \n\n## Test <|[[--Cases--]]|>\n\n### GET\n\n- Collection Resource (e.g. `/users`)\n - Without parameters -> 200\n - Parameters\n - `?pageSize=1` -> Only one embedded element, pageTotal reflects the correct number of pages, `last` link points to last page.\n - `?pageSize=1&page=1` -> `next` link points to page 0 ; `prev` link points to page 2\n - `?sortBy=admin` -> Sorted by `admin` field of embedded objects\n - `?sortBy=admin&desc=true` -> Invert sorting\n- Individual Resource (e.g. `/users/scmadmin`)\n - Exists -> 200\n",
66
+ "\n### DELETE\n\n- existing -> 204\n- not existing -> 204\n- without permission -> 401\n\n## Exemplary calls & Resource specific test <|[[--cases--]]|>\n\nIn order to extend those tests to other Resources, have a look at the rest docs. Note that the Content Type is specific to each resource as well.\n"
67
+ ],
68
+ matchesContentStart: true,
69
+ matchesContentEnd: false
70
+ }
71
+ },
72
+ _links: {}
73
+ };