@scm-manager/ui-components 2.27.3 → 2.27.5-20211121-150210
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.
- package/package.json +7 -8
- package/src/Autocomplete.tsx +7 -6
- package/src/BranchSelector.tsx +2 -2
- package/src/Breadcrumb.tsx +1 -0
- package/src/CardColumnGroup.tsx +6 -6
- package/src/DangerZone.tsx +1 -0
- package/src/DateFromNow.tsx +2 -1
- package/src/DateShort.tsx +2 -1
- package/src/ErrorBoundary.tsx +2 -2
- package/src/Icon.tsx +4 -4
- package/src/Logo.stories.tsx +1 -0
- package/src/OverviewPageActions.tsx +2 -2
- package/src/SmallLoadingSpinner.stories.tsx +32 -0
- package/src/SmallLoadingSpinner.tsx +34 -0
- package/src/SplitAndReplace.tsx +3 -2
- package/src/SyntaxHighlighter.stories.tsx +1 -1
- package/src/Tooltip.tsx +1 -1
- package/src/__resources__/SearchHit.ts +97 -0
- package/src/__snapshots__/storyshots.test.ts.snap +1340 -2086
- package/src/buttons/Button.tsx +33 -34
- package/src/forms/FileInput.tsx +1 -1
- package/src/forms/FileUpload.tsx +1 -1
- package/src/forms/FilterInput.tsx +1 -0
- package/src/forms/InputField.tsx +2 -2
- package/src/forms/Select.tsx +4 -4
- package/src/forms/TriStateCheckbox.tsx +2 -2
- package/src/index.ts +4 -3
- package/src/languages.test.ts +1 -5
- package/src/languages.ts +1 -10
- package/src/layout/Footer.tsx +1 -1
- package/src/layout/Header.tsx +2 -2
- package/src/layout/SubSubtitle.tsx +41 -0
- package/src/layout/index.ts +2 -1
- package/src/modals/FullscreenModal.tsx +1 -1
- package/src/modals/Modal.tsx +6 -6
- package/src/navigation/RoutingProps.ts +3 -1
- package/src/navigation/SecondaryNavigation.stories.tsx +3 -3
- package/src/navigation/SecondaryNavigation.tsx +1 -1
- package/src/popover/Popover.tsx +7 -7
- package/src/repos/DiffFile.tsx +21 -15
- package/src/repos/HealthCheckFailureDetail.tsx +2 -2
- package/src/repos/RepositoryEntry.tsx +9 -6
- package/src/repos/RepositoryFlags.tsx +2 -2
- package/src/repos/TokenizedDiffView.tsx +20 -2
- package/src/repos/annotate/Annotate.stories.tsx +1 -1
- package/src/repos/annotate/Annotate.tsx +2 -2
- package/src/repos/annotate/AnnotateLine.tsx +1 -0
- package/src/repos/annotate/{Popover.tsx → AnnotatePopover.tsx} +2 -2
- package/src/repos/index.ts +2 -0
- package/src/repos/refractorAdapter.ts +11 -6
- package/src/search/HighlightedFragment.tsx +7 -4
- package/src/search/SyntaxHighlightedFragment.tsx +130 -0
- package/src/search/TextHitField.stories.tsx +69 -0
- package/src/search/TextHitField.tsx +58 -19
- package/src/styleConstants.ts +2 -1
- 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.
|
|
3
|
+
"version": "2.27.5-20211121-150210",
|
|
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.
|
|
28
|
+
"@scm-manager/ui-tests": "^2.27.5-20211121-150210",
|
|
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.
|
|
71
|
-
"@scm-manager/ui-extensions": "^2.27.
|
|
72
|
-
"@scm-manager/ui-types": "^2.27.
|
|
68
|
+
"@scm-manager/ui-api": "^2.27.5-20211121-150210",
|
|
69
|
+
"@scm-manager/ui-extensions": "^2.27.5-20211121-150210",
|
|
70
|
+
"@scm-manager/ui-types": "^2.27.5-20211121-150210",
|
|
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": "
|
|
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": {
|
package/src/Autocomplete.tsx
CHANGED
|
@@ -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(
|
|
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={
|
|
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}
|
package/src/BranchSelector.tsx
CHANGED
|
@@ -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(
|
|
65
|
-
onChange={
|
|
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}
|
package/src/Breadcrumb.tsx
CHANGED
package/src/CardColumnGroup.tsx
CHANGED
|
@@ -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(
|
|
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
|
-
<
|
|
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-
|
|
92
|
+
<Link to={url} className="has-text-secondary-more">
|
|
93
93
|
{name}
|
|
94
94
|
</Link>
|
|
95
95
|
) : (
|
|
96
96
|
name
|
|
97
97
|
)}
|
|
98
|
-
</
|
|
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" />
|
package/src/DangerZone.tsx
CHANGED
package/src/DateFromNow.tsx
CHANGED
|
@@ -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={
|
|
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={
|
|
41
|
+
<DateElement className={className} dateTime={dateTime} title={dateTime}>
|
|
41
42
|
{formatter.formatShort()}
|
|
42
43
|
</DateElement>
|
|
43
44
|
);
|
package/src/ErrorBoundary.tsx
CHANGED
|
@@ -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 = "
|
|
43
|
+
color = "secondary",
|
|
44
44
|
title,
|
|
45
45
|
name,
|
|
46
46
|
className,
|
|
47
47
|
onClick,
|
|
48
48
|
testId,
|
|
49
|
-
tabIndex
|
|
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={
|
|
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}
|
package/src/Logo.stories.tsx
CHANGED
|
@@ -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(
|
|
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;
|
package/src/SplitAndReplace.tsx
CHANGED
|
@@ -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
|
|
39
|
+
const defaultTextWrapper = (s: string) => {
|
|
39
40
|
const first = s.startsWith(" ") ? <> </> : "";
|
|
40
41
|
const last = s.endsWith(" ") ? <> </> : "";
|
|
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]}</>;
|
package/src/Tooltip.tsx
CHANGED
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
};
|
|
74
|
+
|
|
75
|
+
export const filenameXmlHit: Hit = {
|
|
76
|
+
score: 10.592262,
|
|
77
|
+
fields: {
|
|
78
|
+
content: {
|
|
79
|
+
highlighted: false,
|
|
80
|
+
value:
|
|
81
|
+
'<?xml version="1.0"?>\n<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\n\n <modelVersion>4.0.0</modelVersion>\n\n <parent>\n <artifactId>scm-clients</artifactId>\n <groupId>sonia.scm.clients</groupId>\n <version>2.0.0-SNAPSHOT</version>\n </parent>\n\n <artifactId>scm-cli-client</artifactId>\n <version>2.0.0-SNAPSHOT</version>\n <name>scm-cli-client</name>\n\n <dependencies>\n\n <!-- fix javadoc -->\n\n <dependency>\n <groupId>javax.servlet</groupId>\n <artifactId>javax.servlet-api</artifactId>\n <version>${servlet.version}</version>\n </dependency>\n\n <dependency>\n <groupId>javax.transaction</groupId>\n <artifactId>jta</artifactId>\n <version>1.1</version>\n <scope>provided</scope>\n </dependency>\n\n <dependency>\n <groupId>sonia.scm.clients</groupId>\n <artifactId>scm-client-impl</artifactId>\n <version>2.0.0-SNAPSHOT</version>\n </dependency>\n\n <dependency>\n <groupId>args4j</groupId>\n <artifactId>args4j</artifactId>\n <version>2.0.29</version>\n </dependency>\n\n <dependency>\n <groupId>ch.qos.logback</groupId>\n <artifactId>logback-classic</artifactId>\n <version>${logback.version}</version>\n </dependency>\n\n <dependency>\n <groupId>org.freemarker</groupId>\n <artifactId>freemarker</artifactId>\n <version>2.3.21</version>\n </dependency>\n\n </dependencies>\n\n <build>\n <plugins>\n\n <plugin>\n <groupId>com.mycila.maven-license-plugin</groupId>\n <artifactId>maven-license-plugin</artifactId>\n <version>1.9.0</version>\n <configuration>\n <header>http://download.scm-manager.org/licenses/mvn-license.txt</header>\n <includes>\n <include>src/**</include>\n <include>**/test/**</include>\n </includes>\n <excludes>\n <exclude>target/**</exclude>\n <exclude>.hg/**</exclude>\n <exclude>**/*.ftl</exclude>\n </excludes>\n <strictCheck>true</strictCheck>\n </configuration>\n </plugin>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-assembly-plugin</artifactId>\n <version>2.3</version>\n <configuration>\n <archive>\n <manifest>\n <mainClass>sonia.scm.cli.App</mainClass>\n </manifest>\n </archive>\n <descriptorRefs>\n <descriptorRef>jar-with-dependencies</descriptorRef>\n </descriptorRefs>\n </configuration>\n <executions>\n <execution>\n <phase>package</phase>\n <goals>\n <goal>single</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n\n </plugins>\n </build>\n\n <profiles>\n <profile>\n\n <id>it</id>\n\n <build>\n <plugins>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-dependency-plugin</artifactId>\n <version>2.4</version>\n <executions>\n <execution>\n <phase>package</phase>\n <goals>\n <goal>copy</goal>\n </goals>\n <configuration>\n <artifactItems>\n <artifactItem>\n <groupId>sonia.scm</groupId>\n <artifactId>scm-webapp</artifactId>\n <version>${project.version}</version>\n <type>war</type>\n <outputDirectory>${project.build.directory}/webapp</outputDirectory>\n <destFileName>scm-webapp.war</destFileName>\n </artifactItem>\n </artifactItems>\n </configuration>\n </execution>\n </executions>\n </plugin>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-failsafe-plugin</artifactId>\n <version>2.12</version>\n <configuration>\n <systemPropertyVariables>\n <scm.version>${project.version}</scm.version>\n </systemPropertyVariables>\n </configuration>\n <executions>\n <execution>\n <id>integration-test</id>\n <goals>\n <goal>integration-test</goal>\n </goals>\n </execution>\n <execution>\n <id>verify</id>\n <goals>\n <goal>verify</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n\n <plugin>\n <groupId>org.eclipse.jetty</groupId>\n <artifactId>jetty-maven-plugin</artifactId>\n <version>${jetty.maven.version}</version>\n <configuration>\n <stopPort>8085</stopPort>\n <stopKey>STOP</stopKey>\n <systemProperties>\n <systemProperty>\n <name>scm.home</name>\n <value>target/scm-it</value>\n </systemProperty>\n <systemProperty>\n <name>file.encoding</name>\n <value>UTF-8</value>\n </systemProperty>\n </systemProperties>\n <httpConnector>\n <port>8081</port>\n </httpConnector>\n <webApp>\n <contextPath>/scm</contextPath>\n </webApp>\n <war>${project.build.directory}/webapp/scm-webapp.war</war>\n <scanIntervalSeconds>0</scanIntervalSeconds>\n <daemon>true</daemon>\n </configuration>\n <executions>\n <execution>\n <id>start-jetty</id>\n <phase>pre-integration-test</phase>\n <goals>\n <goal>deploy-war</goal>\n </goals>\n </execution>\n <execution>\n <id>stop-jetty</id>\n <phase>post-integration-test</phase>\n <goals>\n <goal>stop</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n\n </plugins>\n </build>\n\n </profile>\n </profiles>\n\n</project>\n'
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
_links: {}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const pullRequestHit: Hit = {
|
|
88
|
+
score: 0.2837065,
|
|
89
|
+
fields: {
|
|
90
|
+
description: {
|
|
91
|
+
highlighted: false,
|
|
92
|
+
value:
|
|
93
|
+
"The Hitchhiker's Guide to the Galaxy (sometimes referred to as **HG2G**, **HHGTTG** or **H2G2**) is a comedy science fiction series created by Douglas Adams. Originally a radio comedy broadcast on BBC Radio 4 in 1978, it was later adapted to other formats, including stage shows, novels, comic books, a 1981 TV series, a 1984 video game, and 2005 feature film.\n\nThis fixes a SQL Injection, a Race condition and a XSS\n\nA prominent series in British popular culture, The Hitchhiker's Guide to the Galaxy has become an international multi-media phenomenon; the novels are the most widely distributed, having been translated into more than 30 languages by 2005. In 2017, BBC Radio 4 announced a 40th-anniversary celebration with Dirk Maggs, one of the original producers, in charge. This sixth series of the sci-fi spoof has been based on Eoin Colfer's book And Another Thing, with additional unpublished material by Douglas Adams. The first of six new episodes was broadcast on 8 March 2018."
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
_links: {}
|
|
97
|
+
};
|