@scm-manager/ui-components 2.33.1-20220411-113741 → 2.34.0

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 (74) hide show
  1. package/package.json +5 -5
  2. package/src/Autocomplete.tsx +11 -11
  3. package/src/BranchSelector.tsx +2 -2
  4. package/src/Breadcrumb.stories.tsx +2 -2
  5. package/src/Breadcrumb.tsx +4 -4
  6. package/src/CardColumnGroup.tsx +3 -3
  7. package/src/ErrorBoundary.tsx +2 -2
  8. package/src/Help.tsx +7 -2
  9. package/src/Icon.tsx +2 -2
  10. package/src/OverviewPageActions.tsx +2 -2
  11. package/src/Paginator.test.tsx +2 -1
  12. package/src/ProtectedRoute.tsx +4 -4
  13. package/src/Tag.tsx +2 -2
  14. package/src/Tooltip.tsx +2 -2
  15. package/src/__resources__/SearchHit.ts +0 -1
  16. package/src/__resources__/changesets.tsx +1 -1
  17. package/src/buttons/Button.tsx +2 -2
  18. package/src/buttons/DownloadButton.tsx +2 -2
  19. package/src/buttons/RemoveEntryOfTableButton.tsx +1 -1
  20. package/src/comparators.test.ts +3 -3
  21. package/src/config/Configuration.tsx +1 -1
  22. package/src/devBuild.ts +1 -0
  23. package/src/forms/AddKeyValueEntryToTableField.tsx +1 -1
  24. package/src/forms/FileInput.tsx +1 -1
  25. package/src/forms/FileUpload.tsx +1 -1
  26. package/src/forms/FilterInput.tsx +1 -1
  27. package/src/forms/PasswordConfirmation.tsx +1 -1
  28. package/src/forms/Select.tsx +2 -2
  29. package/src/forms/Textarea.stories.tsx +1 -0
  30. package/src/languages.test.ts +1 -0
  31. package/src/layout/Page.tsx +2 -2
  32. package/src/markdown/LazyMarkdownView.tsx +8 -8
  33. package/src/markdown/MarkdownCodeRenderer.tsx +1 -1
  34. package/src/markdown/MarkdownHeadingRenderer.test.ts +1 -0
  35. package/src/markdown/MarkdownView.stories.tsx +4 -4
  36. package/src/markdown/MarkdownView.tsx +1 -1
  37. package/src/markdown/createComponentList.ts +5 -2
  38. package/src/markdown/createMdastPlugin.ts +3 -4
  39. package/src/modals/ConfirmAlert.stories.tsx +7 -7
  40. package/src/modals/ConfirmAlert.tsx +1 -1
  41. package/src/modals/CreateTagModal.tsx +4 -4
  42. package/src/modals/Modal.stories.tsx +5 -5
  43. package/src/modals/Modal.tsx +7 -7
  44. package/src/navigation/MenuContext.tsx +1 -3
  45. package/src/navigation/PrimaryNavigation.tsx +2 -2
  46. package/src/navigation/SecondaryNavigation.stories.tsx +4 -4
  47. package/src/navigation/useActiveMatch.ts +2 -2
  48. package/src/popover/Popover.tsx +12 -8
  49. package/src/popover/usePopover.ts +6 -8
  50. package/src/repos/Diff.stories.tsx +10 -6
  51. package/src/repos/Diff.tsx +2 -2
  52. package/src/repos/DiffFile.tsx +1 -1
  53. package/src/repos/DiffTypes.ts +1 -1
  54. package/src/repos/HunkExpandDivider.tsx +1 -1
  55. package/src/repos/HunkExpandLink.tsx +1 -1
  56. package/src/repos/LazyDiffFile.tsx +20 -14
  57. package/src/repos/RepositoryEntry.tsx +1 -1
  58. package/src/repos/TokenizedDiffView.tsx +1 -1
  59. package/src/repos/annotate/Annotate.tsx +1 -1
  60. package/src/repos/annotate/AnnotateLine.tsx +1 -1
  61. package/src/repos/changesets/ChangesetAuthor.tsx +1 -1
  62. package/src/repos/changesets/ChangesetList.tsx +1 -1
  63. package/src/repos/changesets/ChangesetRow.tsx +1 -1
  64. package/src/repos/changesets/Changesets.stories.tsx +1 -1
  65. package/src/repos/changesets/SignatureIcon.tsx +1 -1
  66. package/src/repos/changesets/changesets.ts +1 -1
  67. package/src/repos/index.ts +2 -2
  68. package/src/repositories.test.ts +18 -18
  69. package/src/storyshots.test.ts +4 -4
  70. package/src/styleConstants.ts +1 -1
  71. package/src/table/Column.tsx +1 -1
  72. package/src/table/Table.tsx +1 -1
  73. package/src/table/TextColumn.tsx +1 -1
  74. package/src/validation.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-manager/ui-components",
3
- "version": "2.33.1-20220411-113741",
3
+ "version": "2.34.0",
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.13.0",
28
- "@scm-manager/ui-tests": "^2.33.1-20220411-113741",
28
+ "@scm-manager/ui-tests": "^2.34.0",
29
29
  "@storybook/addon-actions": "^6.4.20",
30
30
  "@storybook/addon-essentials": "^6.4.20",
31
31
  "@storybook/addon-interactions": "^6.4.20",
@@ -64,9 +64,9 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@headlessui/react": "^1.4.3",
67
- "@scm-manager/ui-api": "^2.33.1-20220411-113741",
68
- "@scm-manager/ui-extensions": "^2.33.1-20220411-113741",
69
- "@scm-manager/ui-types": "^2.33.1-20220411-113741",
67
+ "@scm-manager/ui-api": "^2.34.0",
68
+ "@scm-manager/ui-extensions": "^2.34.0",
69
+ "@scm-manager/ui-types": "^2.34.0",
70
70
  "classnames": "^2.2.6",
71
71
  "date-fns": "^2.4.1",
72
72
  "deepmerge": "^4.2.2",
@@ -26,7 +26,7 @@ import classNames from "classnames";
26
26
  import { Async, AsyncCreatable } from "react-select";
27
27
  import { SelectValue } from "@scm-manager/ui-types";
28
28
  import LabelWithHelpIcon from "./forms/LabelWithHelpIcon";
29
- import { ValueType } from "react-select/lib/types";
29
+ import { ActionMeta, ValueType } from "react-select/lib/types";
30
30
 
31
31
  type Props = {
32
32
  loadSuggestions: (p: string) => Promise<SelectValue[]>;
@@ -44,16 +44,16 @@ type Props = {
44
44
  disabled?: boolean;
45
45
  };
46
46
 
47
- type State = unknown;
47
+ type State = {};
48
48
 
49
49
  class Autocomplete extends React.Component<Props, State> {
50
50
  static defaultProps = {
51
51
  placeholder: "Type here",
52
52
  loadingMessage: "Loading...",
53
- noOptionsMessage: "No suggestion available",
53
+ noOptionsMessage: "No suggestion available"
54
54
  };
55
55
 
56
- handleInputChange = (newValue: ValueType<SelectValue>) => {
56
+ handleInputChange = (newValue: ValueType<SelectValue>, action: ActionMeta) => {
57
57
  this.selectValue(newValue as SelectValue);
58
58
  };
59
59
 
@@ -64,10 +64,10 @@ class Autocomplete extends React.Component<Props, State> {
64
64
  // We overwrite this to avoid running into a bug (https://github.com/JedWatson/react-select/issues/2944)
65
65
  isValidNewOption = (
66
66
  inputValue: string,
67
- _selectValue: ValueType<SelectValue>,
67
+ selectValue: ValueType<SelectValue>,
68
68
  selectOptions: readonly SelectValue[]
69
69
  ): boolean => {
70
- const isNotDuplicated = !selectOptions.map((option) => option.label).includes(inputValue);
70
+ const isNotDuplicated = !selectOptions.map(option => option.label).includes(inputValue);
71
71
  const isNotEmpty = inputValue !== "";
72
72
  return isNotEmpty && isNotDuplicated;
73
73
  };
@@ -85,7 +85,7 @@ class Autocomplete extends React.Component<Props, State> {
85
85
  informationMessage,
86
86
  creatable,
87
87
  className,
88
- disabled,
88
+ disabled
89
89
  } = this.props;
90
90
 
91
91
  const asyncProps = {
@@ -99,7 +99,7 @@ class Autocomplete extends React.Component<Props, State> {
99
99
  loadingMessage: () => loadingMessage,
100
100
  noOptionsMessage: () => noOptionsMessage,
101
101
  isDisabled: disabled,
102
- "aria-label": helpText || label,
102
+ "aria-label": helpText || label
103
103
  };
104
104
 
105
105
  return (
@@ -110,13 +110,13 @@ class Autocomplete extends React.Component<Props, State> {
110
110
  <AsyncCreatable
111
111
  {...asyncProps}
112
112
  isValidNewOption={this.isValidNewOption}
113
- onCreateOption={(newValue) => {
113
+ onCreateOption={newValue => {
114
114
  this.selectValue({
115
115
  label: newValue,
116
116
  value: {
117
117
  id: newValue,
118
- displayName: newValue,
119
- },
118
+ displayName: newValue
119
+ }
120
120
  });
121
121
  }}
122
122
  />
@@ -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}
@@ -49,8 +49,8 @@ const prefix = (
49
49
  );
50
50
 
51
51
  storiesOf("BreadCrumb", module)
52
- .addDecorator((story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
53
- .addDecorator((storyFn) => <Wrapper>{storyFn()}</Wrapper>)
52
+ .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
53
+ .addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
54
54
  .add("Default", () => (
55
55
  <Breadcrumb
56
56
  repository={repository}
@@ -117,7 +117,7 @@ const BreadcrumbNode: FC<{ clickable: boolean; text: string; url: string; curren
117
117
  clickable,
118
118
  text,
119
119
  url,
120
- current,
120
+ current
121
121
  }) => {
122
122
  if (clickable) {
123
123
  return (
@@ -144,7 +144,7 @@ const Breadcrumb: FC<Props> = ({
144
144
  sources,
145
145
  permalink,
146
146
  preButtons,
147
- clickable = true,
147
+ clickable = true
148
148
  }) => {
149
149
  const location = useLocation();
150
150
  const history = useHistory();
@@ -231,7 +231,7 @@ const Breadcrumb: FC<Props> = ({
231
231
  </li>
232
232
  {pathSection()}
233
233
  </ul>
234
- <PermaLinkWrapper tabIndex={0} onKeyDown={(e) => e.key === "Enter" && copySource()}>
234
+ <PermaLinkWrapper tabIndex={0} onKeyDown={e => e.key === "Enter" && copySource()}>
235
235
  {copying ? (
236
236
  <Icon name="spinner fa-spin" alt={t("breadcrumb.loading")} />
237
237
  ) : (
@@ -250,7 +250,7 @@ const Breadcrumb: FC<Props> = ({
250
250
  branch: branch ? branch : defaultBranch,
251
251
  path,
252
252
  sources,
253
- repository,
253
+ repository
254
254
  };
255
255
 
256
256
  const renderExtensionPoints = () => {
@@ -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
 
@@ -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/Help.tsx CHANGED
@@ -34,13 +34,18 @@ type Props = {
34
34
  };
35
35
 
36
36
  const Help: FC<Props> = ({ message, multiline, className, id }) => (
37
- <Tooltip className={classNames("is-inline-block", "pl-1", className)} message={message} id={id} multiline={multiline}>
37
+ <Tooltip
38
+ className={classNames("is-inline-block", "pl-1", className)}
39
+ message={message}
40
+ id={id}
41
+ multiline={multiline}
42
+ >
38
43
  <HelpIcon />
39
44
  </Tooltip>
40
45
  );
41
46
 
42
47
  Help.defaultProps = {
43
- multiline: true,
48
+ multiline: true
44
49
  };
45
50
 
46
51
  export default Help;
package/src/Icon.tsx CHANGED
@@ -48,12 +48,12 @@ const Icon: FC<Props> = ({
48
48
  testId,
49
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}
@@ -54,7 +54,7 @@ const OverviewPageActions: FC<Props> = ({
54
54
  label,
55
55
  testId,
56
56
  searchPlaceholder,
57
- groupAriaLabelledby,
57
+ groupAriaLabelledby
58
58
  }) => {
59
59
  const history = useHistory();
60
60
  const location = useLocation();
@@ -66,7 +66,7 @@ const OverviewPageActions: FC<Props> = ({
66
66
  <Select
67
67
  ariaLabelledby={groupAriaLabelledby}
68
68
  className="is-fullwidth"
69
- options={groups.map((g) => ({ value: g, label: g }))}
69
+ options={groups.map(g => ({ value: g, label: g }))}
70
70
  value={currentGroup}
71
71
  onChange={groupSelected}
72
72
  />
@@ -21,8 +21,9 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- import { mount, shallow } from "@scm-manager/ui-tests";
25
24
  import React from "react";
25
+ import { mount, shallow } from "@scm-manager/ui-tests/enzyme-router";
26
+ import "@scm-manager/ui-tests/i18n";
26
27
  import Paginator from "./Paginator";
27
28
 
28
29
  xdescribe("paginator rendering tests", () => {
@@ -37,12 +37,12 @@ class ProtectedRoute extends Component<Props> {
37
37
  };
38
38
  }
39
39
 
40
- renderRoute = (MyComponent: any) => {
40
+ renderRoute = (Component: any) => {
41
41
  const { authenticated } = this.props;
42
42
 
43
- return (routeProps: RouteProps) => {
44
- if (authenticated && MyComponent) {
45
- return <MyComponent {...routeProps} />;
43
+ return (routeProps: any) => {
44
+ if (authenticated) {
45
+ return <Component {...routeProps} />;
46
46
  } else {
47
47
  return (
48
48
  <Redirect
package/src/Tag.tsx CHANGED
@@ -52,7 +52,7 @@ const Tag: FC<Props> = ({
52
52
  title,
53
53
  onClick,
54
54
  onRemove,
55
- children,
55
+ children
56
56
  }) => {
57
57
  const [t] = useTranslation("commons");
58
58
 
@@ -81,7 +81,7 @@ const Tag: FC<Props> = ({
81
81
  {
82
82
  "is-outlined": outlined,
83
83
  "is-rounded": rounded,
84
- "is-clickable": onClick,
84
+ "is-clickable": onClick
85
85
  },
86
86
  size === "small" && smallClassNames
87
87
  )}
package/src/Tooltip.tsx CHANGED
@@ -92,7 +92,7 @@ const Arrow = {
92
92
  bottom: ArrowBottom,
93
93
  left: ArrowLeft,
94
94
  right: ArrowRight,
95
- top: ArrowTop,
95
+ top: ArrowTop
96
96
  };
97
97
 
98
98
  const TooltipContainerBase = styled.div<{ multiline?: boolean }>`
@@ -136,7 +136,7 @@ const Container = {
136
136
  bottom: TooltipContainerBottom,
137
137
  left: TooltipContainerLeft,
138
138
  right: TooltipContainerRight,
139
- top: TooltipContainerTop,
139
+ top: TooltipContainerTop
140
140
  };
141
141
 
142
142
  type Props = {
@@ -78,7 +78,6 @@ export const filenameXmlHit: Hit = {
78
78
  content: {
79
79
  highlighted: false,
80
80
  value:
81
- // eslint-disable-next-line no-template-curly-in-string
82
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 </project>\n',
83
82
  },
84
83
  },
@@ -22,7 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { Changeset, ChangesetCollection } from "@scm-manager/ui-types";
25
+ import { Changeset, ChangesetCollection, PagedCollection } from "@scm-manager/ui-types";
26
26
 
27
27
  const one: Changeset = {
28
28
  id: "a88567ef1e9528a700555cad8c4576b72fc7c6dd",
@@ -67,7 +67,7 @@ const Button: FC<InnerProps> = ({
67
67
  disabled,
68
68
  action,
69
69
  color = "default",
70
- innerRef,
70
+ innerRef
71
71
  }) => {
72
72
  const renderIcon = () => {
73
73
  return (
@@ -119,7 +119,7 @@ const Button: FC<InnerProps> = ({
119
119
  type={type}
120
120
  title={title}
121
121
  disabled={disabled}
122
- onClick={(event) => action && action(event)}
122
+ onClick={event => action && action(event)}
123
123
  className={classes}
124
124
  ref={innerRef}
125
125
  {...createAttributesForTesting(testId)}
@@ -33,11 +33,11 @@ type Props = {
33
33
  class DownloadButton extends React.Component<Props> {
34
34
  render() {
35
35
  const { displayName, url, disabled, onClick } = this.props;
36
- const onClickOrDefault = !!onClick ? onClick : () => null;
36
+ const onClickOrDefault = !!onClick ? onClick : () => {};
37
37
  return (
38
38
  <>
39
39
  {/*
40
- we have to ignore the next line,
40
+ we have to ignore the next line,
41
41
  because jsx a does not the custom disabled attribute
42
42
  but bulma does.
43
43
  // @ts-ignore */}
@@ -32,7 +32,7 @@ type Props = {
32
32
  label: string;
33
33
  };
34
34
 
35
- type State = unknown;
35
+ type State = {};
36
36
 
37
37
  class RemoveEntryOfTableButton extends React.Component<Props, State> {
38
38
  render() {
@@ -56,7 +56,7 @@ describe("key comparator tests", () => {
56
56
  });
57
57
 
58
58
  it("should not fail if item is undefined", () => {
59
- const array: unknown[] = createObjects("key", ["a"]);
59
+ const array: any[] = createObjects("key", ["a"]);
60
60
  array.push(undefined);
61
61
  array.push(createObject("key", "z"));
62
62
  array.sort(byKey("key"));
@@ -86,7 +86,7 @@ describe("length comparator tests", () => {
86
86
  });
87
87
 
88
88
  it("should not fail if item is undefined", () => {
89
- const array: unknown[] = createObjects("key", ["."]);
89
+ const array: any[] = createObjects("key", ["."]);
90
90
  array.push(undefined);
91
91
  array.push(createObject("key", ".."));
92
92
  array.sort(byValueLength("key"));
@@ -141,7 +141,7 @@ describe("nested key comparator tests", () => {
141
141
  });
142
142
 
143
143
  it("should not fail if item is undefined", () => {
144
- const array: unknown[] = createObjects("key", "nested", ["a"]);
144
+ const array: any[] = createObjects("key", "nested", ["a"]);
145
145
  array.push(undefined);
146
146
  array.push(createObject("key", "nested", "z"));
147
147
  array.sort(byNestedKeys("key", "nested"));
@@ -34,7 +34,7 @@ type RenderProps = {
34
34
 
35
35
  type Props = {
36
36
  link: string;
37
- render: (props: RenderProps) => JSX.Element;
37
+ render: (props: RenderProps) => any; // ???
38
38
  };
39
39
 
40
40
  const Configuration: FC<Props> = ({ link, render }) => {
package/src/devBuild.ts CHANGED
@@ -22,6 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
25
26
  // @ts-ignore scmStage is set on the index page
26
27
  export const isDevBuild = () => (window.scmStage || "").toUpperCase() === "DEVELOPMENT";
27
28
 
@@ -63,7 +63,7 @@ const AddKeyValueEntryToTableField: FC<Props> = ({
63
63
  valueHelpText,
64
64
  validateEntry,
65
65
  errorMessage,
66
- addEntry,
66
+ addEntry
67
67
  }) => {
68
68
  const [key, setKey] = useState("");
69
69
  const [value, setValue] = useState("");
@@ -59,7 +59,7 @@ const FileInput: FC<Props> = ({
59
59
  const [file, setFile] = useState<File | null>(null);
60
60
 
61
61
  const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
62
- const uploadedFile = event?.target.files?.[0];
62
+ const uploadedFile = event?.target?.files![0];
63
63
  // @ts-ignore the uploaded file doesn't match our types
64
64
  setFile(uploadedFile);
65
65
 
@@ -44,7 +44,7 @@ const FileUpload: FC<Props> = ({ handleFile, filenamePlaceholder = "", disabled
44
44
  name="resume"
45
45
  disabled={disabled}
46
46
  onChange={(event: ChangeEvent<HTMLInputElement>) => {
47
- const uploadedFile = event?.target?.files?.[0];
47
+ const uploadedFile = event?.target?.files![0];
48
48
  // @ts-ignore the uploaded file doesn't match our types
49
49
  setFile(uploadedFile);
50
50
  // @ts-ignore the uploaded file doesn't match our types
@@ -74,7 +74,7 @@ const FilterInput: FC<Props> = ({ filter, value, testId, placeholder, autoFocus,
74
74
  type="search"
75
75
  placeholder={placeholder || t("filterEntries")}
76
76
  value={stateValue}
77
- onChange={(event) => setStateValue(event.target.value)}
77
+ onChange={event => setStateValue(event.target.value)}
78
78
  autoFocus={autoFocus || false}
79
79
  aria-describedby={id}
80
80
  aria-label={t("filterEntries")}
@@ -76,7 +76,7 @@ const PasswordConfirmation: FC<InnerProps> = ({ passwordChanged, passwordValidat
76
76
  <InputField
77
77
  label={t("password.newPassword")}
78
78
  type="password"
79
- onChange={(event) => handlePasswordChange(event)}
79
+ onChange={event => handlePasswordChange(event)}
80
80
  value={password}
81
81
  validationError={!passwordValid}
82
82
  errorMessage={t("password.passwordInvalid")}
@@ -69,7 +69,7 @@ const InnerSelect: FC<FieldProps<BaseProps, HTMLSelectElement, string>> = ({
69
69
  const field = useInnerRef(props.innerRef);
70
70
 
71
71
  let opts = options;
72
- if (value && addValueToOptions && !options.some((o) => o.value === value)) {
72
+ if (value && addValueToOptions && !options.some(o => o.value === value)) {
73
73
  opts = [{ label: value, value }, ...options];
74
74
  }
75
75
 
@@ -128,7 +128,7 @@ const InnerSelect: FC<FieldProps<BaseProps, HTMLSelectElement, string>> = ({
128
128
  aria-describedby={helpText ? helpId : undefined}
129
129
  {...createAttributesForTesting(testId)}
130
130
  >
131
- {opts.map((opt) => {
131
+ {opts.map(opt => {
132
132
  return (
133
133
  <option value={opt.value} key={"KEY_" + opt.value}>
134
134
  {opt.label}
@@ -29,6 +29,7 @@ import Button from "../buttons/Button";
29
29
  import { useForm } from "react-hook-form";
30
30
  import { SubmitButton } from "../buttons";
31
31
  import { MemoryRouter } from "react-router-dom";
32
+ import InputField from "./InputField";
32
33
 
33
34
  const Spacing = styled.div`
34
35
  padding: 2em;
@@ -44,4 +44,5 @@ describe("syntax highlighter", () => {
44
44
  const lang = determineLanguage("");
45
45
  expect(lang).toBe("text");
46
46
  });
47
+
47
48
  });
@@ -85,7 +85,7 @@ export default class Page extends React.Component<Props> {
85
85
 
86
86
  let pageActions = null;
87
87
  let pageActionsExists = false;
88
- React.Children.forEach(children, (child) => {
88
+ React.Children.forEach(children, child => {
89
89
  if (child && !error) {
90
90
  if (this.isPageAction(child)) {
91
91
  pageActions = (
@@ -141,7 +141,7 @@ export default class Page extends React.Component<Props> {
141
141
  }
142
142
 
143
143
  const content: ReactNode[] = [];
144
- React.Children.forEach(children, (child) => {
144
+ React.Children.forEach(children, child => {
145
145
  if (child) {
146
146
  if (!this.isPageAction(child)) {
147
147
  content.push(child);
@@ -100,13 +100,13 @@ class LazyMarkdownView extends React.Component<Props, State> {
100
100
 
101
101
  static defaultProps: Partial<Props> = {
102
102
  enableAnchorHeadings: false,
103
- skipHtml: false,
103
+ skipHtml: false
104
104
  };
105
105
 
106
106
  constructor(props: Props) {
107
107
  super(props);
108
108
  this.state = {
109
- contentRef: null,
109
+ contentRef: null
110
110
  };
111
111
  }
112
112
 
@@ -150,7 +150,7 @@ class LazyMarkdownView extends React.Component<Props, State> {
150
150
  basePath,
151
151
  permalink,
152
152
  t,
153
- mdastPlugins = [],
153
+ mdastPlugins = []
154
154
  } = this.props;
155
155
 
156
156
  const rendererFactory = this.context.getExtension("markdown-renderer-factory");
@@ -207,25 +207,25 @@ class LazyMarkdownView extends React.Component<Props, State> {
207
207
  sanitize,
208
208
  merge(gh, {
209
209
  attributes: {
210
- code: ["className"], // Allow className for code elements, this is necessary to extract the code language
210
+ code: ["className"] // Allow className for code elements, this is necessary to extract the code language
211
211
  },
212
212
  clobberPrefix: "", // Do not prefix user-provided ids and class names,
213
213
  protocols: {
214
- href: Object.keys(protocolLinkRendererExtensions),
215
- },
214
+ href: Object.keys(protocolLinkRendererExtensions)
215
+ }
216
216
  })
217
217
  )
218
218
  .use(rehype2react, {
219
219
  createElement: React.createElement,
220
220
  passNode: true,
221
- components: createComponentList(remarkRendererList, { permalink }),
221
+ components: createComponentList(remarkRendererList, { permalink })
222
222
  });
223
223
 
224
224
  const renderedMarkdown: any = processor.processSync(content).result;
225
225
 
226
226
  return (
227
227
  <ErrorBoundary fallback={MarkdownErrorNotification}>
228
- <div ref={(el) => this.setState({ contentRef: el })} className="content is-word-break">
228
+ <div ref={el => this.setState({ contentRef: el })} className="content is-word-break">
229
229
  {renderedMarkdown}
230
230
  </div>
231
231
  </ErrorBoundary>
@@ -32,7 +32,7 @@ type Props = {
32
32
  value: string;
33
33
  };
34
34
 
35
- const MarkdownCodeRenderer: FC<Props> = (props) => {
35
+ const MarkdownCodeRenderer: FC<Props> = props => {
36
36
  const binder = useBinder();
37
37
  const indexLinks = useIndexLinks();
38
38
  const { language } = props;
@@ -22,6 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
+ import React from "react";
25
26
  import { headingToAnchorId } from "./MarkdownHeadingRenderer";
26
27
 
27
28
  describe("headingToAnchorId tests", () => {