Skip to content

Commit 9791f3c

Browse files
author
Ives van Hoorne
committed
Use forking for new sandboxes
1 parent 8dfeddd commit 9791f3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+101
-205
lines changed

src/app/pages/SandboxView/Sandbox/Editor/Content/Header/Action.js renamed to src/app/pages/Sandbox/Editor/Content/Header/Action.js

File renamed without changes.

src/app/pages/SandboxView/Sandbox/Editor/Content/Header/index.js renamed to src/app/pages/Sandbox/Editor/Content/Header/index.js

File renamed without changes.

src/app/pages/SandboxView/Sandbox/Editor/Content/index.js renamed to src/app/pages/Sandbox/Editor/Content/index.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@ import { bindActionCreators } from 'redux';
55
import { connect } from 'react-redux';
66
import { preferencesSelector } from 'app/store/preferences/selectors';
77
import type { Preferences } from 'app/store/preferences/reducer';
8+
import type { Sandbox } from 'app/store/entities/sandboxes/entity';
9+
import moduleActionCreators from 'app/store/entities/sandboxes/modules/actions';
10+
import sandboxActionCreators from 'app/store/entities/sandboxes/actions';
11+
import {
12+
isMainModule,
13+
getModulePath,
14+
} from 'app/store/entities/sandboxes/modules/selectors';
815

916
import SplitPane from 'react-split-pane';
1017

1118
import CodeEditor from './subviews/CodeEditor';
1219
import Preview from './subviews/Preview';
1320

14-
import type { Sandbox } from '../../../../../store/entities/sandboxes/entity';
15-
import moduleActionCreators
16-
from '../../../../../store/entities/sandboxes/modules/actions';
17-
import sandboxActionCreators
18-
from '../../../../../store/entities/sandboxes/actions';
19-
import {
20-
isMainModule,
21-
getModulePath,
22-
} from '../../../../../store/entities/sandboxes/modules/selectors';
2321
import Header from './Header';
2422

2523
type Props = {

src/app/pages/SandboxView/Sandbox/Editor/Content/subviews/CodeEditor/Header.js renamed to src/app/pages/Sandbox/Editor/Content/subviews/CodeEditor/Header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import styled from 'styled-components';
3-
import Tooltip from 'app/components/Tooltip';
43

5-
import Button from '../../../../../../../components/buttons/Button';
4+
import Tooltip from 'app/components/Tooltip';
5+
import Button from 'app/components/buttons/Button';
66

77
const Container = styled.div`
88
display: flex;

src/app/pages/SandboxView/Sandbox/Editor/Content/subviews/CodeEditor/index.js renamed to src/app/pages/Sandbox/Editor/Content/subviews/CodeEditor/index.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ const handleError = (cm, currentError, nextError, nextCode, nextId) => {
7070
export default class CodeEditor extends React.PureComponent {
7171
props: Props;
7272

73-
componentDidMount() {
74-
window.addEventListener('keydown', (event: KeyboardEvent) => {
75-
if (event.ctrlKey || event.metaKey) {
76-
if (event.key === 's' || event.keyCode === 83) {
77-
this.handleSaveCode();
78-
event.preventDefault();
79-
return false;
80-
}
81-
}
82-
return true;
83-
});
84-
}
85-
8673
shouldComponentUpdate(nextProps: Props) {
8774
return nextProps.id !== this.props.id ||
8875
nextProps.error !== this.props.error ||
@@ -135,7 +122,7 @@ export default class CodeEditor extends React.PureComponent {
135122
this.codemirror.setCursor(pos);
136123
}
137124

138-
componentDidUpdate(prevProps) {
125+
componentDidUpdate(prevProps: Props) {
139126
if (this.codemirror) {
140127
if (this.props.preferences !== prevProps.preferences) {
141128
this.setCodeMirrorPreferences();
@@ -266,6 +253,7 @@ export default class CodeEditor extends React.PureComponent {
266253
};
267254

268255
handleSaveCode = async () => {
256+
console.log('nog een keer');
269257
const { saveCode, preferences } = this.props;
270258
if (preferences.prettifyOnSaveEnabled) {
271259
await this.prettify();
@@ -278,7 +266,7 @@ export default class CodeEditor extends React.PureComponent {
278266
server: typeof CodeMirror.TernServer;
279267

280268
render() {
281-
const { error, title, canSave, modulePath } = this.props;
269+
const { title, canSave, modulePath } = this.props;
282270

283271
return (
284272
<Container>

src/app/pages/SandboxView/Sandbox/Editor/Content/subviews/Preview/AddressBar.js renamed to src/app/pages/Sandbox/Editor/Content/subviews/Preview/AddressBar.js

File renamed without changes.

src/app/pages/SandboxView/Sandbox/Editor/Content/subviews/Preview/Editor.js renamed to src/app/pages/Sandbox/Editor/Content/subviews/Preview/Editor.js

File renamed without changes.

src/app/pages/SandboxView/Sandbox/Editor/Content/subviews/Preview/Message.js renamed to src/app/pages/Sandbox/Editor/Content/subviews/Preview/Message.js

File renamed without changes.

src/app/pages/SandboxView/Sandbox/Editor/Content/subviews/Preview/Navigator.js renamed to src/app/pages/Sandbox/Editor/Content/subviews/Preview/Navigator.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import LeftIcon from 'react-icons/lib/fa/angle-left';
55
import RightIcon from 'react-icons/lib/fa/angle-right';
66
import RefreshIcon from 'react-icons/lib/md/refresh';
77

8-
import AddressBar from './AddressBar';
98
import Switch from 'app/components/Switch';
10-
import Tooltip from '../../../../../../../components/Tooltip';
9+
import Tooltip from 'app/components/Tooltip';
10+
11+
import AddressBar from './AddressBar';
1112

1213
const Container = styled.div`
1314
display: flex;
@@ -27,7 +28,8 @@ const Icons = styled.div`
2728

2829
const Icon = styled.div`
2930
display: inline-block;
30-
color: ${props => props.disabled ? props.theme.gray : props.theme.gray.darken(0.3)};
31+
color: ${props =>
32+
props.disabled ? props.theme.gray : props.theme.gray.darken(0.3)};
3133
font-size: 1.5rem;
3234
line-height: 0.5;
3335
margin: 0 0.1rem;

src/app/pages/SandboxView/Sandbox/Editor/Content/subviews/Preview/index.js renamed to src/app/pages/Sandbox/Editor/Content/subviews/Preview/index.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,15 @@ import styled from 'styled-components';
55
import { debounce } from 'lodash';
66
import type { Preferences } from 'app/store/preferences/reducer';
77

8-
import type {
9-
Module,
10-
} from '../../../../../../../store/entities/sandboxes/modules/entity';
11-
import type {
12-
Sandbox,
13-
} from '../../../../../../../store/entities/sandboxes/entity';
8+
import type { Module } from 'app/store/entities/sandboxes/modules/entity';
9+
import type { Sandbox } from 'app/store/entities/sandboxes/entity';
1410
import type {
1511
Directory,
16-
} from '../../../../../../../store/entities/sandboxes/directories/entity';
17-
import { frameUrl } from '../../../../../../../utils/url-generator';
18-
import {
19-
isMainModule,
20-
} from '../../../../../../../store/entities/sandboxes/modules/validator';
12+
} from 'app/store/entities/sandboxes/directories/entity';
13+
import { frameUrl } from 'app/utils/url-generator';
14+
import { isMainModule } from 'app/store/entities/sandboxes/modules/validator';
2115
import defaultBoilerplates
22-
from '../../../../../../../store/entities/sandboxes/boilerplates/default-boilerplates';
16+
from 'app/store/entities/sandboxes/boilerplates/default-boilerplates';
2317

2418
import Navigator from './Navigator';
2519
import Message from './Message';

0 commit comments

Comments
 (0)