Skip to content

Commit 3fdc0b1

Browse files
authored
Merge pull request #842 from integer32llc/ts-type-errors
2 parents de7d6a0 + 872bec0 commit 3fdc0b1

27 files changed

+2131
-1815
lines changed

tests/spec/features/compilation_targets_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
end
4343
end
4444

45-
context "when AT&T syntax is selected" do
45+
context "when AT&T syntax is selected", :assembly do
4646
before do
4747
in_config_menu { choose("AT&T") }
4848
end
@@ -59,7 +59,7 @@
5959
end
6060
end
6161

62-
context "when Intel syntax is selected" do
62+
context "when Intel syntax is selected", :assembly do
6363
before do
6464
in_config_menu { choose("Intel") }
6565
end

tests/spec/features/navigation_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
expect(page).to be_at_url('/')
4545
end
4646

47-
scenario "Navigating to help changes the URL" do
47+
scenario "Navigating to help changes the URL", :flaky do
4848
visit '/'
4949
expect(page).to have_content('RUN')
5050

ui/frontend/Icon.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ export const MoreOptionsIcon = () => (
3131

3232
export const MoreOptionsActiveIcon = () => (
3333
<svg className={styles.icon} height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg">
34-
<g fillRule="evenodd" fill="#428bca">
35-
36-
<path d="M4,5 h16 a3,3 0 0,1 3,3 v8 a3,3 0 0,1 -3,3 h-16 a3,3 0 0,1 -3,-3 v-8 a3,3 0 0,1 3,-3 Z
37-
M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
38-
</g>
34+
{/* eslint-disable-next-line react/no-unknown-property */}
35+
<path fillRule="evenodd" fill="#428bca" d="M4,5 h16 a3,3 0 0,1 3,3 v8 a3,3 0 0,1 -3,3 h-16 a3,3 0 0,1 -3,-3 v-8 a3,3 0 0,1 3,-3 Z M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
3936
</svg>
4037
);
4138

ui/frontend/Output/Gist.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface CopiedState {
2929
}
3030

3131
class Copied extends React.PureComponent<CopiedProps, CopiedState> {
32-
public constructor(props) {
32+
public constructor(props: CopiedProps) {
3333
super(props);
3434
this.state = { copied: false };
3535
}

ui/frontend/Playground.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ const ResizableArea: React.FC = () => {
4444
const dispatch = useDispatch();
4545
const resizeComplete = useCallback(() => dispatch(actions.splitRatioChanged()), [dispatch]);
4646

47-
const grid = useRef(null);
47+
const grid = useRef<HTMLDivElement | null>(null);
4848
const dragHandle = useRef(null);
4949

5050
// Reset styles left on the grid from split-grid when we change orientation or focus.
5151
useEffect(() => {
52-
grid.current.style['grid-template-columns'] = null;
53-
grid.current.style['grid-template-rows'] = null;
52+
if (grid.current) {
53+
grid.current.style.removeProperty('grid-template-columns');
54+
grid.current.style.removeProperty('grid-template-rows');
55+
}
5456

5557
resizeComplete();
5658
}, [orientation, isFocused, resizeComplete])

ui/frontend/PopButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ const PopButton: React.FC<NewPopProps> = ({ Button, Menu }) => {
3333
return;
3434
}
3535

36-
const handleClickOutside = (event) => {
36+
const handleClickOutside = (event: MouseEvent) => {
37+
if (!(event.target instanceof Node)) { return; }
38+
3739
if (referenceElement && referenceElement.contains(event.target)) {
3840
// They are clicking on the button, so let that go ahead and close us.
3941
return;

ui/frontend/Router.tsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
import React from 'react';
22

3-
import { createBrowserHistory as createHistory } from 'history';
4-
import { createRouter } from './uss-router';
3+
import { createBrowserHistory as createHistory, Path, Location } from 'history';
4+
import { createRouter, PlainOrThunk } from './uss-router';
55
import UssRouter from './uss-router/Router';
66

77
import qs from 'qs';
88
import Route from 'route-parser';
99

1010
import * as actions from './actions';
11+
import State from './state';
12+
import { Channel, Edition, Mode, Page } from './types';
1113

1214
const homeRoute = new Route('/');
1315
const helpRoute = new Route('/help');
1416

15-
const stateSelector = ({ page, configuration: { channel, mode, edition } }) => ({
17+
interface Substate {
18+
page: Page;
19+
configuration: {
20+
channel: Channel;
21+
mode: Mode;
22+
edition: Edition;
23+
}
24+
}
25+
26+
const stateSelector = ({ page, configuration: { channel, mode, edition } }: State): Substate => ({
1627
page,
1728
configuration: {
1829
channel,
@@ -21,7 +32,7 @@ const stateSelector = ({ page, configuration: { channel, mode, edition } }) => (
2132
},
2233
});
2334

24-
const stateToLocation = ({ page, configuration }) => {
35+
const stateToLocation = ({ page, configuration }: Substate): Partial<Path> => {
2536
switch (page) {
2637
case 'help': {
2738
return {
@@ -42,7 +53,7 @@ const stateToLocation = ({ page, configuration }) => {
4253
}
4354
};
4455

45-
const locationToAction = location => {
56+
const locationToAction = (location: Location): PlainOrThunk<State, actions.Action> | null => {
4657
const matchedHelp = helpRoute.match(location.pathname);
4758

4859
if (matchedHelp) {
@@ -61,7 +72,7 @@ const locationToAction = location => {
6172
export default class Router extends React.Component<RouterProps> {
6273
private router: any;
6374

64-
public constructor(props) {
75+
public constructor(props: RouterProps) {
6576
super(props);
6677

6778
const history = createHistory();

0 commit comments

Comments
 (0)