diff --git a/src/components/voiceChannel/voiceChatMain.component.jsx b/src/components/voiceChannel/voiceChatMain.component.jsx
index 4bcb656..f2da5a9 100644
--- a/src/components/voiceChannel/voiceChatMain.component.jsx
+++ b/src/components/voiceChannel/voiceChatMain.component.jsx
@@ -54,7 +54,7 @@ class VoiceChatMainComponent extends React.Component {
}
render() {
- return (
+ return (
{this.state.socket && }
)
}
diff --git a/src/context/GlobalContext.jsx b/src/context/GlobalContext.jsx
index 9ec4da9..b155f90 100644
--- a/src/context/GlobalContext.jsx
+++ b/src/context/GlobalContext.jsx
@@ -1,5 +1,5 @@
-import React, { Component } from 'react'
-import { findChildParentId, isNodeFolder, generateUUID } from '../utils/utils';
+import React, {Component} from 'react'
+import {findChildParentId, generateUUID, isNodeFolder} from '../utils/utils';
import EditorData from "../utils/editorData"
import axios from "axios"
import cookie from 'react-cookies'
@@ -7,316 +7,319 @@ import cookie from 'react-cookies'
const GlobalContext = React.createContext()
class GlobalProvider extends Component {
- constructor(props) {
- super(props);
- // Context state
- this.state = {
- rtModel: null,
- folderMarkedForDeletion: null,
- editors: [],
- activeEditor: null,
- modelService: null,
- collectionId: null,
- username: null,
- selectedId: null,
- activeKey: null,
- ws: null,
- termFileModel: null,
- termFileName: null,
- roomUrl: ''
+ constructor(props) {
+ super(props);
+ // Context state
+ this.state = {
+ rtModel: null,
+ folderMarkedForDeletion: null,
+ editors: [],
+ activeEditor: null,
+ modelService: null,
+ collectionId: null,
+ username: null,
+ selectedId: null,
+ activeKey: null,
+ ws: null,
+ termFileModel: null,
+ termFileName: null,
+ roomUrl: ''
+ }
}
- }
- setInitStates = (rtModel) => {
- this.setState({ modelService: rtModel.session().domain().models(), collectionId: "files", username: rtModel.session().user().username, rtModel: rtModel })
- }
+ setInitStates = (rtModel) => {
+ this.setState({
+ modelService: rtModel.session().domain().models(),
+ collectionId: "files",
+ username: rtModel.session().user().username,
+ rtModel: rtModel
+ })
+ }
+ dispose = () => {
+
+ this.setState({
+ editors: [],
+ activeEditor: null,
+ modelService: null,
+ collectionId: null,
+ username: null,
+ rtModel: null,
+ selectedId: null,
+ activeKey: null,
+ termFileModel: null,
+ termFileName: null,
+ roomUrl: ''
+ })
+ }
- dispose = () => {
- this.setState({
- editors: [],
- activeEditor: null,
- modelService: null,
- collectionId: null,
- username: null,
- rtModel: null,
- selectedId: null,
- activeKey: null,
- termFileModel: null,
- termFileName: null,
- roomUrl:''
- })
- }
+ setWS = (ws, roomUrl) => {
+ this.setState({ws: ws, roomUrl: roomUrl})
+ }
+ setTerm = (model, fileName) => {
+ this.setState({termFileModel: model, termFileName: fileName})
+ console.log(this.state)
+ }
- setWS = (ws, roomUrl) => {
- this.setState({ ws: ws, roomUrl: roomUrl })
- }
+ runTerminal = () => {
+ console.log(this.state)
- setTerm = (model, fileName) => {
- this.setState({ termFileModel: model, termFileName: fileName })
- console.log(this.state)
- }
+ let data = this.state.termFileModel.root().get('content').value()
+ data = btoa(data)
- runTerminal = () => {
- console.log(this.state)
+ const type = this.state.termFileName.split(".")[1]
+ console.log(type)
+ axios
+ .post(
+ `${this.state.roomUrl}/file?token=${cookie.load('jwt')}`,
+ {data: data, fileName: this.state.termFileName},
+ {"Content-Type": "application/json"}
+ )
+ .then((res) => {
+ console.log(res.data);
- let data = this.state.termFileModel.root().get('content').value()
- data = btoa(data)
- const type = this.state.termFileName.split(".")[1]
- console.log(type)
- axios
- .post(
- `${this.state.roomUrl}/file?token=${cookie.load('jwt')}`,
- { data: data, fileName: this.state.termFileName },
- { "Content-Type": "application/json" }
- )
- .then((res) => {
- console.log(res.data);
+ this.state.ws.send("\x03"); // Simulate ^C to terminate previously running command if any
+ this.state.ws.send("clear\n"); // Clear Console
+ if (type === 'py') {
- this.state.ws.send("\x03"); // Simulate ^C to terminate previously running command if any
- this.state.ws.send("clear\n"); // Clear Console
+ this.state.ws.send(`python3 ${this.state.termFileName}\n`);
+ } else if (type === 'js') {
+ this.state.ws.send(`node ${this.state.termFileName}\n`)
- if (type === 'py') {
+ } else if (type === 'c') {
- this.state.ws.send(`python3 ${this.state.termFileName}\n`);
+ this.state.ws.send(`gcc ${this.state.termFileName} && ./a.out\n`)
- } else if (type === 'js') {
+ } else if (type === 'cpp') {
- this.state.ws.send(`node ${this.state.termFileName}\n`)
+ this.state.ws.send(`g++ ${this.state.termFileName} && ./a.out\n`)
- } else if (type === 'c') {
+ } else {
+ this.state.ws.send('echo "FileNotSupported" ')
+ }
- this.state.ws.send(`gcc ${this.state.termFileName} && ./a.out\n`)
+ })
+ .catch((e) => {
+ console.log(e, 'term error');
+ });
- } else if (type === 'cpp') {
+ }
- this.state.ws.send(`g++ ${this.state.termFileName} && ./a.out\n`)
- } else {
- this.state.ws.send('echo "FileNotSupported" ')
+ getStateFromContext = () => {
+ return {editors: this.state.editors, activeEditor: this.state.activeEditor}
+ }
+
+ // Method to update state
+ createEditor = (id, model, historical) => {
+ console.log("create editor")
+ const editor = new EditorData(id, this.getFileName(id), model, historical);
+ let editors = this.state.editors;
+ editors.push(editor);
+ console.log(editors[0].modelId)
+ this.setState({activeEditor: editor, editors})
+ }
+
+
+ getFileName = (fileId) => {
+ console.log(this.state.rtModel)
+ return this.state.rtModel.elementAt(['tree', 'nodes', fileId]).get('name').value();
+ }
+
+ createModel = (id) => {
+ return this.state.modelService.create({
+ collection: this.state.collectionId,
+ id,
+ data: {
+ content: ''
+ }
+ });
+ }
+
+
+ openModel = (modelId) => {
+ return this.state.modelService.open(modelId);
+ }
+
+
+ //CREATE_FILE
+ CreateFile = (name, parentId) => {
+ const uuid = generateUUID()
+
+ const nodes = this.state.rtModel.elementAt(['tree', 'nodes']);
+ nodes.set(uuid, {name});
+ const parentFolder = this.state.rtModel.elementAt(['tree', 'nodes', parentId, 'children']);
+ parentFolder.push(uuid);
+
+ return new Promise((resolve, reject) => {
+ this.createModel(uuid).then(() => {
+ return this.openModel(uuid);
+ }).then(model => {
+ this.createEditor(uuid, model, false);
+ resolve({id: uuid})
+ });
+ })
+ }
+
+
+ CreateFolder(name, parentId) {
+ const newId = generateUUID()
+ const nodes = this.getNodes();
+ nodes.set(newId, {name: name, children: []});
+ nodes.elementAt([parentId, 'children']).push(newId);
+ }
+
+
+ isFileOpen = (id) => {
+ return this.state.editors.some(editor => {
+ return editor.modelId === id && editor.historical === false;
+ });
+ }
+
+ openFile = (id) => {
+ if (!this.isFileOpen(id)) {
+ this.openModel(id).then(model => {
+ this.createEditor(id, model, false);
+ this.setState({activeKey: id})
+ });
}
+ }
- })
- .catch((e) => {
- console.log(e, 'term error');
- });
-
- }
-
-
- getStateFromContext = () => {
- return { editors: this.state.editors, activeEditor: this.state.activeEditor }
- }
-
- // Method to update state
- createEditor = (id, model, historical) => {
- console.log("create editor")
- const editor = new EditorData(id, this.getFileName(id), model, historical);
- let editors = this.state.editors;
- editors.push(editor);
- console.log(editors[0].modelId)
- this.setState({ activeEditor: editor, editors })
- }
-
-
- getFileName = (fileId) => {
- console.log(this.state.rtModel)
- return this.state.rtModel.elementAt(['tree', 'nodes', fileId]).get('name').value();
- }
-
- createModel = (id) => {
- return this.state.modelService.create({
- collection: this.state.collectionId,
- id,
- data: {
- content: ''
- }
- });
- }
-
-
- openModel = (modelId) => {
- return this.state.modelService.open(modelId);
- }
-
-
- //CREATE_FILE
- CreateFile = (name, parentId) => {
- const uuid = generateUUID()
-
- const nodes = this.state.rtModel.elementAt(['tree', 'nodes']);
- nodes.set(uuid, { name });
- const parentFolder = this.state.rtModel.elementAt(['tree', 'nodes', parentId, 'children']);
- parentFolder.push(uuid);
-
- return new Promise((resolve, reject) => {
- this.createModel(uuid).then(() => {
- return this.openModel(uuid);
- }).then(model => {
- this.createEditor(uuid, model, false);
- resolve({ id: uuid })
- });
- })
- }
-
-
- CreateFolder(name, parentId) {
- const newId = generateUUID()
- const nodes = this.getNodes();
- nodes.set(newId, { name: name, children: [] });
- nodes.elementAt([parentId, 'children']).push(newId);
- }
-
-
- isFileOpen = (id) => {
- return this.state.editors.some(editor => {
- return editor.modelId === id && editor.historical === false;
- });
- }
-
- openFile = (id) => {
- if (!this.isFileOpen(id)) {
- this.openModel(id).then(model => {
- this.createEditor(id, model, false);
- this.setState({ activeKey: id })
- });
+ setActiveKey = (id) => {
+ this.setState({activeKey: id})
}
- }
- setActiveKey = (id) => {
- this.setState({ activeKey: id })
- }
+ tabRemove = (id) => {
- tabRemove = (id) => {
+ let editors = this.state.editors;
+ editors = editors.filter(editor => editor.modelId !== id);
+ this.setState({activeKey: editors.length > 0 ? editors[0].modelId : null, editors})
+
+ }
- let editors = this.state.editors;
- editors = editors.filter(editor => editor.modelId !== id);
- this.setState({ activeKey: editors.length > 0 ? editors[0].modelId : null, editors })
- }
+ // -----------------Tree---------------------
+ getTreeState = () => {
+ return {
+ selectedId: this.state.selectedId,
+ newNode: this.newNode,
+ folderMarkedForDeletion: this.state.folderMarkedForDeletion
+ };
+ }
+ addNewNode = (type, nodeId, fileName) => {
+ console.log("1")
+ const nodes = this.getNodes();
+ console.log("2")
- // -----------------Tree---------------------
+ nodeId = nodeId || "root";
+ let parentFolderId = nodeId;
+ if (!isNodeFolder(nodes, nodeId)) {
+ console.log("3")
- getTreeState = () => {
- return {
- selectedId: this.state.selectedId,
- newNode: this.newNode,
- folderMarkedForDeletion: this.state.folderMarkedForDeletion
- };
- }
+ parentFolderId = findChildParentId(nodes, nodeId);
+ }
+ console.log("5")
+ let name = fileName
+ if (type === "file") {
+ this.CreateFile(name, parentFolderId).then((data) => {
+ console.log(data.id)
+ this.openFile(data.id)
+ this.setActiveKey(data.id)
+ })
+ } else {
+ this.CreateFolder(fileName, parentFolderId)
+ }
+ }
- addNewNode = (type, nodeId, fileName) => {
- console.log("1")
- const nodes = this.getNodes();
- console.log("2")
- nodeId = nodeId || "root";
- let parentFolderId = nodeId;
- if (!isNodeFolder(nodes, nodeId)) {
- console.log("3")
+ setSelectedId = (id) => {
+ console.log(id)
- parentFolderId = findChildParentId(nodes, nodeId);
+ this.setState({selectedId: id})
+ console.log(this.state.selectedId)
}
- console.log("5")
- let name = fileName
- if (type === "file") {
- this.CreateFile(name, parentFolderId).then((data) => {
- console.log(data.id)
- this.openFile(data.id)
- this.setActiveKey(data.id)
- })
- } else {
- this.CreateFolder(fileName, parentFolderId)
+
+ markFolderForDelete = (id) => {
+ this.setState({folderMarkedForDeletion: id})
}
- }
+ deleteNode = (id) => {
+ const nodes = this.getNodes();
+ const parent = findChildParentId(nodes, id);
- setSelectedId = (id) => {
- console.log(id)
+ // delete the parent's reference to this node
+ const parentsChildren = nodes.get(parent).get('children');
+ const childIndex = parentsChildren.findIndex(childId => childId.value() === id);
+ parentsChildren.remove(childIndex);
- this.setState({ selectedId: id })
- console.log(this.state.selectedId)
- }
+ // delete the node
+ nodes.remove(id);
- markFolderForDelete = (id) => {
- this.setState({ folderMarkedForDeletion: id })
- }
+ if (this.state.selectedId === id) {
+ this.setState({selectedId: null})
+ }
+ }
- deleteNode = (id) => {
- const nodes = this.getNodes();
- const parent = findChildParentId(nodes, id);
- // delete the parent's reference to this node
- const parentsChildren = nodes.get(parent).get('children');
- const childIndex = parentsChildren.findIndex(childId => childId.value() === id);
- parentsChildren.remove(childIndex);
+ getNodes = () => {
+ return this.state.rtModel.elementAt(['tree', 'nodes']);
+ }
+
+ getNode = (id) => {
+ return this.state.rtModel.elementAt(['tree', 'nodes', id]);
+ }
- // delete the node
- nodes.remove(id);
- if (this.state.selectedId === id) {
- this.setState({ selectedId: null })
+ render() {
+ const {children} = this.props
+ const {rtModel, editors, activeEditor, selectedId, activeKey, termFileModel, ws, termFileName, roomUrl} = this.state
+ const {
+ dispose, setInitStates, getNodes, getNode, getTreeState, addNewNode, markFolderForDelete,
+ deleteNode, createEditor, CreateFile, getStateFromContext, setSelectedId, openFile,
+ setActiveKey, tabRemove, setWS, setTerm, runTerminal
+ } = this
+
+ return (
{children} )
}
- }
-
-
- getNodes = () => {
- return this.state.rtModel.elementAt(['tree', 'nodes']);
- }
-
- getNode = (id) => {
- return this.state.rtModel.elementAt(['tree', 'nodes', id]);
- }
-
-
- render() {
- const { children } = this.props
- const { rtModel, editors, activeEditor, selectedId, activeKey, termFileModel, ws, termFileName, roomUrl } = this.state
- const { dispose, setInitStates, getNodes, getNode, getTreeState, addNewNode, markFolderForDelete,
- deleteNode, createEditor, CreateFile, getStateFromContext, setSelectedId, openFile,
- setActiveKey, tabRemove, setWS, setTerm, runTerminal } = this
-
- return (
{children} )
- }
}
export default GlobalContext
-export { GlobalProvider }
\ No newline at end of file
+export {GlobalProvider}
\ No newline at end of file
diff --git a/src/context/UserContext.jsx b/src/context/UserContext.jsx
index 8a699ef..1c5e5b1 100644
--- a/src/context/UserContext.jsx
+++ b/src/context/UserContext.jsx
@@ -1,4 +1,4 @@
-import React, { Component } from "react";
+import React, {Component} from "react";
const UserContext = React.createContext();
@@ -12,29 +12,29 @@ class UserProvider extends Component {
// Method to update state
setUser = (user) => {
- this.setState({ user });
+ this.setState({user});
};
setDomain = (domain) => {
- this.setState({ domain });
+ this.setState({domain});
};
setProjectData = (projectData) => {
- this.setState({ projectData });
+ this.setState({projectData});
};
dispose = () => {
this.setState({
- user:{},
+ user: {},
domain: null,
projectData: null
})
}
render() {
- const { children } = this.props;
- const { user, domain, projectData } = this.state;
- const { setUser, setDomain, setProjectData, dispose } = this;
+ const {children} = this.props;
+ const {user, domain, projectData} = this.state;
+ const {setUser, setDomain, setProjectData, dispose} = this;
return (
-
-
-
+
+
+
+
-
-
-
-
-
- ,
- document.getElementById('root')
+
+
+
+
+
+ ,
+ document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
diff --git a/src/pages/callback/callback.page.jsx b/src/pages/callback/callback.page.jsx
index be9c0b5..6dca6f9 100644
--- a/src/pages/callback/callback.page.jsx
+++ b/src/pages/callback/callback.page.jsx
@@ -10,8 +10,8 @@ const Callback = () => {
// close the popup
window.close();
}
- },[]);
- return(
+ }, []);
+ return (
Redirecting Please wait...
diff --git a/src/pages/editor/AceBinder.js b/src/pages/editor/AceBinder.js
index af7b310..8ab0d4d 100644
--- a/src/pages/editor/AceBinder.js
+++ b/src/pages/editor/AceBinder.js
@@ -1,5 +1,10 @@
-import { Range } from 'ace-builds/';
-import { AceMultiSelectionManager, AceRadarView, AceViewportUtil, AceMultiCursorManager } from '@convergence/ace-collab-ext';
+import {Range} from 'ace-builds/';
+import {
+ AceMultiCursorManager,
+ AceMultiSelectionManager,
+ AceRadarView,
+ AceViewportUtil
+} from '@convergence/ace-collab-ext';
import colorAssigner from '../../utils/color-util';
const cursorKey = "cursor";
@@ -71,7 +76,7 @@ export default class AceBinder {
this._suppressEvents = false;
});
- this._model.on("value", function(e) {
+ this._model.on("value", function (e) {
this._suppressEvents = true;
doc.setValue(e.value);
this._suppressEvents = false;
@@ -103,7 +108,7 @@ export default class AceBinder {
this._cursorManager = new AceMultiCursorManager(this._editor.getSession());
this._cursorReference = this._model.indexReference(cursorKey);
- const references = this._model.references({ key: cursorKey });
+ const references = this._model.references({key: cursorKey});
references.forEach((reference) => {
if (!reference.isLocal()) {
this._addCursor(reference);
@@ -158,7 +163,7 @@ export default class AceBinder {
this._session.selection.on('changeSelection', () => this._setLocalSelection());
- const references = this._model.references({ key: selectionKey });
+ const references = this._model.references({key: selectionKey});
references.forEach((reference) => {
if (!reference.isLocal()) {
this._addSelection(reference);
@@ -178,7 +183,7 @@ export default class AceBinder {
const indexRanges = aceRanges.map((aceRagne) => {
const start = this._document.positionToIndex(aceRagne.start, 0);
const end = this._document.positionToIndex(aceRagne.end, 0);
- return { start: start, end: end };
+ return {start: start, end: end};
});
this._selectionReference.set(indexRanges);
@@ -228,7 +233,7 @@ export default class AceBinder {
this._radarView = new AceRadarView(this._radarViewElement, this._editor);
this._viewReference = this._model.rangeReference(viewKey);
- const references = this._model.references({ key: viewKey });
+ const references = this._model.references({key: viewKey});
references.forEach((reference) => {
if (!reference.isLocal()) {
this._addView(reference);
@@ -253,7 +258,7 @@ export default class AceBinder {
_setLocalView() {
const viewportIndices = AceViewportUtil.getVisibleIndexRange(this._editor);
- this._viewReference.set({ start: viewportIndices.start, end: viewportIndices.end });
+ this._viewReference.set({start: viewportIndices.start, end: viewportIndices.end});
}
_addView(reference) {
diff --git a/src/pages/editor/editor.component.jsx b/src/pages/editor/editor.component.jsx
index a17cd6e..77dd189 100644
--- a/src/pages/editor/editor.component.jsx
+++ b/src/pages/editor/editor.component.jsx
@@ -14,19 +14,19 @@ export default class EditorComponent extends React.Component {
constructor(props) {
super(props);
- console.log(props)
-
-
+ console.log(props)
+
+
this.state = {
- cursor: {
- row: 0,
- column: 0
- },
- participants: []
+ cursor: {
+ row: 0,
+ column: 0
+ },
+ participants: []
};
- }
+ }
- componentDidMount() {
+ componentDidMount() {
console.log(this.props.fileName)
// if (!this.props.historical) {
@@ -39,29 +39,29 @@ export default class EditorComponent extends React.Component {
// const modeList = ace.require("ace/ext/modelist");
// const mode = modeList.getModeForPath(this.props.fileName);
- this.context.setTerm( this.props.fileModel , this.props.fileName )
+ this.context.setTerm(this.props.fileModel, this.props.fileName)
this.initEditor();
- }
+ }
- componentWillUnmount() {
+ componentWillUnmount() {
if (this._participantsSubscription !== undefined) {
- this._participantsSubscription.unsubscribe();
+ this._participantsSubscription.unsubscribe();
}
- }
+ }
- handleCursorMove = (cursor) => {
- console.log(cursor , this.state.cursor)
+ handleCursorMove = (cursor) => {
+ console.log(cursor, this.state.cursor)
this.setState({cursor: cursor});
- };
+ };
- initEditor() {
+ initEditor() {
const contentModel = this.props.fileModel.root().get('content');
console.log(contentModel)
-
+
this._editor = ace.edit(this._container);
this._editor.setTheme("ace/theme/vibrant_ink");
@@ -71,35 +71,34 @@ export default class EditorComponent extends React.Component {
this._editor.getSession().setMode(mode.mode);
this._editor.getSession().setValue(contentModel.value());
-
+
this._editor.getSession().selection.on('changeCursor', () => {
- const cursorPosition = this._editor.getCursorPosition();
- this.handleCursorMove(cursorPosition);
+ const cursorPosition = this._editor.getCursorPosition();
+ this.handleCursorMove(cursorPosition);
});
-
+
this._editor.setReadOnly(this.props.historical);
-
+
const aceBinder = new AceBinder(this._editor, contentModel, !this.props.historical, this._radarViewElement);
aceBinder.bind();
- }
-
-
- render(){
-
-
-
- return (
- this.props.fileModel !== undefined ?
-
-
{
- this._container = div;
- }} />
-
{
- this._radarViewElement = div;
- }} />
- {/*
RUN
*/}
-
:
-
loading...
- );
+ }
+
+
+ render() {
+
+
+ return (
+ this.props.fileModel !== undefined ?
+
+
{
+ this._container = div;
+ }}/>
+
{
+ this._radarViewElement = div;
+ }}/>
+ {/*
RUN
*/}
+
:
+
loading...
+ );
}
}
\ No newline at end of file
diff --git a/src/pages/editor/editor.css b/src/pages/editor/editor.css
index b4bd61d..80cdc03 100644
--- a/src/pages/editor/editor.css
+++ b/src/pages/editor/editor.css
@@ -3,7 +3,7 @@
display: flex;
}
-.editor-container>.radar-view {
+.editor-container > .radar-view {
min-width: 20px;
}
diff --git a/src/pages/editor/editorGroup.component.jsx b/src/pages/editor/editorGroup.component.jsx
index 83d2565..8d09ed5 100644
--- a/src/pages/editor/editorGroup.component.jsx
+++ b/src/pages/editor/editorGroup.component.jsx
@@ -6,10 +6,10 @@ export default class EditorGoupComponent extends React.Component {
static contextType = GlobalContext
- constructor(props){
+ constructor(props) {
super(props)
this.state = {
- loading: false
+ loading: false
}
//----------USE GLOBAL STATES---------
@@ -18,43 +18,42 @@ export default class EditorGoupComponent extends React.Component {
// this.state = this.context.getStateFromContext()
// console.log(props.rtModel)
- }
+ }
- componentWillMount() {
+ componentWillMount() {
- // this.store.addChangeListener(this.onChange);
- this.loadData()
-
- }
+ // this.store.addChangeListener(this.onChange);
+ this.loadData()
- loadData = async ()=>{
- await this.context.setInitStates(this.props.rtModel);
- await this.setState({loading: true })
- }
+ }
-
+ loadData = async () => {
+ await this.context.setInitStates(this.props.rtModel);
+ await this.setState({loading: true})
+ }
- componentWillUnmount() {
- // this.store.removeChangeListener(this.onChange);
- this.context.dispose();
- }
+
+ componentWillUnmount() {
+ // this.store.removeChangeListener(this.onChange);
+ this.context.dispose();
+ }
// onChange = () => {
// this.setState(this.context.getStateFromContext());
// };
- render(){
- const loading = this.state.loading
-
- return(
- loading?
-
-
:
-
-
- )
+ /> :
+
+
+ )
}
}
\ No newline at end of file
diff --git a/src/pages/editor/editorTabs.component.jsx b/src/pages/editor/editorTabs.component.jsx
index 935d7d8..9dfeb8d 100644
--- a/src/pages/editor/editorTabs.component.jsx
+++ b/src/pages/editor/editorTabs.component.jsx
@@ -1,13 +1,12 @@
import React from "react";
-import { Tabs } from "antd";
+import {Result, Tabs} from "antd";
import GlobalContext from "../../context/GlobalContext";
import Editor from "./editor.component";
-import { Result } from "antd";
import newFile from "../../assets/file.svg";
-const { TabPane } = Tabs;
+const {TabPane} = Tabs;
export default class EditorTabsComponent extends React.Component {
static contextType = GlobalContext;
@@ -35,7 +34,7 @@ export default class EditorTabsComponent extends React.Component {
this.context
.CreateFile()
.then(() => {
- const { panes } = this.state;
+ const {panes} = this.state;
const activeKey = `newTab${this.newTabIndex}`;
panes.push({
@@ -59,7 +58,7 @@ export default class EditorTabsComponent extends React.Component {
});
this.newTabIndex++;
- this.setState({ panes, activeKey });
+ this.setState({panes, activeKey});
})
.catch((e) => {
console.log(e);
@@ -73,7 +72,7 @@ export default class EditorTabsComponent extends React.Component {
render() {
console.log(
this.context.editors &&
- this.context.editors.map((pane) => pane.modelId)
+ this.context.editors.map((pane) => pane.modelId)
);
return (
@@ -87,24 +86,24 @@ export default class EditorTabsComponent extends React.Component {
type="editable-card"
onEdit={this.onEdit}>
{this.context.editors &&
- this.context.editors.map((pane) => (
-
(
+
+
-
-
- ))}
+ />
+
+ ))}
) : (
}
+ icon={
}
/>
)}
>
diff --git a/src/pages/editor/fileManager.component.jsx b/src/pages/editor/fileManager.component.jsx
index 3ae34dd..b30a42d 100644
--- a/src/pages/editor/fileManager.component.jsx
+++ b/src/pages/editor/fileManager.component.jsx
@@ -1,9 +1,10 @@
import React from "react"
import GlobalContext from '../../context/GlobalContext'
-import { isNodeFolder } from '../../utils/utils';
-import { Button, Popconfirm, message, Tree,Space, Input, Modal } from 'antd';
-import { QuestionCircleOutlined, FileAddOutlined,DeleteOutlined, CaretRightOutlined } from "@ant-design/icons";
-const { DirectoryTree } = Tree;
+import {isNodeFolder} from '../../utils/utils';
+import {Button, Input, message, Modal, Popconfirm, Space, Tree} from 'antd';
+import {CaretRightOutlined, DeleteOutlined, FileAddOutlined, QuestionCircleOutlined} from "@ant-design/icons";
+
+const {DirectoryTree} = Tree;
export default class FileManagerComponent extends React.Component {
@@ -24,12 +25,15 @@ export default class FileManagerComponent extends React.Component {
componentDidMount() {
this.context.setInitStates(this.props.rtModel)
if (this.context.rtModel) {
- this.setState({ treeNodes: this.props.rtModel.elementAt(['tree', 'nodes']), treeState: this.context.getTreeState() })
+ this.setState({
+ treeNodes: this.props.rtModel.elementAt(['tree', 'nodes']),
+ treeState: this.context.getTreeState()
+ })
}
}
componentWillMount() {
- this.setState({ isLoading: false })
+ this.setState({isLoading: false})
}
handleNewFile = () => {
@@ -52,18 +56,18 @@ export default class FileManagerComponent extends React.Component {
// TODO: delete & remove tab recursively
this.context.deleteNode(id);
} else {
-
+
this.context.deleteNode(id);
this.context.tabRemove(id)
message.success('File Deleted !!');
- }
+ }
}
getFileTreeObject = (root = null, rootId) => {
const nodes = this.props.rtModel.elementAt(['tree', 'nodes']); // == treeNodes of convergence code
- if (!root){
+ if (!root) {
root = nodes.get("root")
rootId = "root"
}
@@ -77,7 +81,7 @@ export default class FileManagerComponent extends React.Component {
let node = nodes.get(id);
if (node.hasKey('children'))
children.push(this.getFileTreeObject(node, id))
- else
+ else
children.push({
title: node.get('name').value(), // Convert to string
key: id, // Convert to string
@@ -103,7 +107,7 @@ export default class FileManagerComponent extends React.Component {
this.context.setSelectedId(keys[0])
- if((!isNodeFolder(this.props.rtModel.elementAt(['tree', 'nodes']), keys[0]))){
+ if ((!isNodeFolder(this.props.rtModel.elementAt(['tree', 'nodes']), keys[0]))) {
this.context.openFile(keys[0])
}
};
@@ -121,7 +125,7 @@ export default class FileManagerComponent extends React.Component {
};
changeNewName = (e) => {
- this.setState({ newName: e.target.value })
+ this.setState({newName: e.target.value})
}
render() {
@@ -136,25 +140,30 @@ export default class FileManagerComponent extends React.Component {
loading ?
:
-
+
)
}
diff --git a/src/pages/editor/workspace.page.jsx b/src/pages/editor/workspace.page.jsx
index 125da1e..93a3a83 100644
--- a/src/pages/editor/workspace.page.jsx
+++ b/src/pages/editor/workspace.page.jsx
@@ -1,15 +1,15 @@
import React from "react";
import UserContext from "../../context/UserContext";
-import { Convergence } from "@convergence/convergence";
+import {Convergence} from "@convergence/convergence";
import SplitPane from "react-split-pane";
import EditorGoupComponent from "./editorGroup.component";
import ChatComponent from "../../components/chatComponent/chat.component";
-import { Spin, Col, Row, notification } from "antd";
+import {Col, notification, Row, Spin} from "antd";
import TerminalComponent from "../../components/terminalComponent/terminal.component";
import FileManagerComponent from "./fileManager.component";
import ParticipantsList from "../../components/participantsList/participantsList.component";
import RoomInfo from "../../components/roomInfo/roomInfo.component";
-import { withRouter } from "react-router-dom";
+import {withRouter} from "react-router-dom";
class WorkspacePage extends React.Component {
static contextType = UserContext;
@@ -51,7 +51,7 @@ class WorkspacePage extends React.Component {
// const data = this.props.history.location.state
// console.log(this.props)
if (typeof this.props.history.location.state !== "undefined") {
- const { user } = this.context;
+ const {user} = this.context;
// console.log(user)
this.tryAutoLogin(user);
}
@@ -65,7 +65,7 @@ class WorkspacePage extends React.Component {
JSON.stringify(user)
).then((d) => {
// console.log(d)
- this.setState({ domain: d });
+ this.setState({domain: d});
this.context.setDomain(d);
this.createOrJoinProject(d);
});
@@ -132,12 +132,12 @@ class WorkspacePage extends React.Component {
chatRoom,
user: projectModel.session().user(),
};
- this.setState({ projectData });
+ this.setState({projectData});
console.log(this.state.projectData, "11lkjasl");
this.context.setProjectData(projectData);
})
.then(() => {
- this.setState({ isLoading: false });
+ this.setState({isLoading: false});
})
.catch((e) => {
console.error(e);
@@ -149,15 +149,15 @@ class WorkspacePage extends React.Component {
return (
{loading ? (
-
-
+
+
) : (
+ style={{position: "relative"}}>
{
+ checkCookie = async () => {
const token = await cookie.load('jwt')
- if(token){
+ if (token) {
//verify token
- axios.get(`${process.env.REACT_APP_MAIN_SERVER}/auth/verify`,{
+ axios.get(`${process.env.REACT_APP_MAIN_SERVER}/auth/verify`, {
headers: {
'x-api-key': token
}
})
- .then((res)=>{
+ .then((res) => {
//if successfull then store user details in global state
console.log(res.data)
this.context.setUser(res.data)
})
- .catch(()=>{
+ .catch(() => {
this.props.history.push('/login')
})
- }else{
+ } else {
this.props.history.push('/login')
}
}
render() {
- return(
+ return (
Home Page
)
}
diff --git a/src/pages/join/join.page.jsx b/src/pages/join/join.page.jsx
index fb9ef50..7eecf07 100644
--- a/src/pages/join/join.page.jsx
+++ b/src/pages/join/join.page.jsx
@@ -1,8 +1,8 @@
import React from "react";
-import { withRouter } from "react-router-dom";
+import {withRouter} from "react-router-dom";
import queryString from "query-string";
import validator from "validator";
-import { Spin, Result, Button, notification } from "antd";
+import {Button, notification, Result, Spin} from "antd";
import axios from "axios";
import cookie from "react-cookies";
@@ -12,7 +12,7 @@ class JoinPage extends React.Component {
this.inviteCode = queryString.parse(this.props.history.location.search);
console.log(queryString.parse(this.props.history.location.search)
- .inviteCode)
+ .inviteCode)
axios.defaults.headers.common["x-api-key"] = cookie.load("jwt");
axios.defaults.headers.common["Content-Type"] =
"application/x-www-form-urlencoded";
@@ -36,7 +36,7 @@ class JoinPage extends React.Component {
.get(`${process.env.REACT_APP_MAIN_SERVER}/auth/verify`)
.then((res) => {
//if successfull then store user details in global state
-
+
this.checkInviteCode(
queryString.parse(this.props.history.location.search).inviteCode
);
@@ -65,7 +65,7 @@ class JoinPage extends React.Component {
checkInviteCode = async (inviteCode) => {
console.log(inviteCode)
- if (validator.isUUID(this.inviteCode.inviteCode) && typeof this.inviteCode.inviteCode !=="undefined") {
+ if (validator.isUUID(this.inviteCode.inviteCode) && typeof this.inviteCode.inviteCode !== "undefined") {
//send put request and then redirect to workspace
console.log('check invite')
await axios
@@ -98,17 +98,17 @@ class JoinPage extends React.Component {
});
this.props.history.push("/rooms");
}
- this.setState({ isValid: false });
+ this.setState({isValid: false});
});
} else {
- this.setState({ isValid: false });
+ this.setState({isValid: false});
}
};
render() {
return this.state.isValid ? (
-
+
) : (
diff --git a/src/pages/rooms/rooms.page.jsx b/src/pages/rooms/rooms.page.jsx
index e648d68..152a3ed 100644
--- a/src/pages/rooms/rooms.page.jsx
+++ b/src/pages/rooms/rooms.page.jsx
@@ -2,19 +2,10 @@ import React from "react";
import axios from "axios";
import cookie from "react-cookies";
import RoomCardComponent from "../../components/roomCard/roomCard.component";
-import {
- Row,
- Col,
- Button,
- Space,
- Input,
- Modal,
- notification,
- Typography,
-} from "antd";
-import { PlusOutlined, CodeOutlined } from "@ant-design/icons";
+import {Button, Col, Input, Modal, notification, Row, Space, Typography,} from "antd";
+import {CodeOutlined, PlusOutlined} from "@ant-design/icons";
import qs from "querystring";
-import { withRouter } from "react-router-dom";
+import {withRouter} from "react-router-dom";
import validator from "validator";
class RoomPage extends React.Component {
@@ -33,7 +24,7 @@ class RoomPage extends React.Component {
componentDidMount() {
axios.get(`${process.env.REACT_APP_MAIN_SERVER}/rooms`).then((res) => {
- this.setState({ rooms: res.data.rooms });
+ this.setState({rooms: res.data.rooms});
});
}
@@ -71,7 +62,7 @@ class RoomPage extends React.Component {
message: "Room Created",
description: `Room ${res.data.roomName} was created successfully, Now invite paritcipants using invite link`,
});
- this.setState({ joinRoomData: "" });
+ this.setState({joinRoomData: ""});
return res.data;
})
.then((data) => {
@@ -97,7 +88,7 @@ class RoomPage extends React.Component {
message: "Duplicate Room Name",
description: `Please enter new room name`,
});
- this.setState({ visible: true });
+ this.setState({visible: true});
} else {
notification.error({
message: "Error",
@@ -115,11 +106,11 @@ class RoomPage extends React.Component {
};
changeRoomName = (e) => {
- this.setState({ roomName: e.target.value });
+ this.setState({roomName: e.target.value});
};
changeJoinRoomName = (e) => {
- this.setState({ joinRoomData: e.target.value });
+ this.setState({joinRoomData: e.target.value});
};
joinRoom = () => {
@@ -172,13 +163,13 @@ class RoomPage extends React.Component {
render() {
const rooms = this.state.rooms;
return (
-
-
+
+
Rooms
-
-
+
+
{rooms.length > 4 ? (
@@ -189,11 +180,11 @@ class RoomPage extends React.Component {
{
- this.setState({ visible: true });
+ this.setState({visible: true});
}}
type="primary"
size="large"
- icon={ }
+ icon={ }
disabled={rooms.length > 4}>
Create Room
@@ -201,7 +192,7 @@ class RoomPage extends React.Component {
@@ -210,16 +201,16 @@ class RoomPage extends React.Component {
onClick={this.joinRoom}
type="primary"
size="large"
- icon={ }>
+ icon={ }>
Join Room
-
-
-
-
+
+
+
+
{rooms.map((x) => (
diff --git a/src/pages/sign-in/signIn.page.jsx b/src/pages/sign-in/signIn.page.jsx
index c367567..6f916e8 100644
--- a/src/pages/sign-in/signIn.page.jsx
+++ b/src/pages/sign-in/signIn.page.jsx
@@ -1,14 +1,14 @@
import React from "react";
import ReactHtmlParser from "react-html-parser";
-import { withRouter } from "react-router-dom";
+import {withRouter} from "react-router-dom";
import cookie from "react-cookies";
-import { Card, Col, Row, Space, Typography } from "antd";
+import {Card, Col, Row, Space, Typography} from "antd";
import GoogleButton from "react-google-button";
import "./signIn.styles.css";
const queryString = require("query-string");
-const { Title } = Typography;
+const {Title} = Typography;
// import v from "../../assets/video.mp4"
class SignIn extends React.Component {
@@ -70,16 +70,16 @@ class SignIn extends React.Component {
false
);
// assign the previous URL
- this.setState({ previousUrl: url });
+ this.setState({previousUrl: url});
};
receiveMessage = async (event) => {
- const { data } = event;
+ const {data} = event;
if (data.source !== "react-devtools-bridge") {
const token = await queryString.parse(data).token;
console.log(data);
- await cookie.save("jwt", token, { path: "/" });
+ await cookie.save("jwt", token, {path: "/"});
//If Joinning with with InviteLink and not loogedIn
if (typeof this.props.history.location.state !== "undefined") {
@@ -100,14 +100,14 @@ class SignIn extends React.Component {
{`< Execute It />`}
-
+
{ReactHtmlParser(`
+ style={{position: "relative"}}>
-
+
Realtime Code Collaboration Platform
-
-
-
+
+
+
{" "}
{
+const TestPage = () => {
const userContext = useContext(UserContext)
const {projectData, domain} = userContext
- return(
+ return (
-
+
)
}
diff --git a/src/serviceWorker.js b/src/serviceWorker.js
index b04b771..e583a40 100644
--- a/src/serviceWorker.js
+++ b/src/serviceWorker.js
@@ -11,131 +11,131 @@
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
- window.location.hostname === 'localhost' ||
+ window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
+ /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
- if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
- // The URL constructor is available in all browsers that support SW.
- const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
- if (publicUrl.origin !== window.location.origin) {
- // Our service worker won't work if PUBLIC_URL is on a different origin
- // from what our page is served on. This might happen if a CDN is used to
- // serve assets; see https://github.com/facebook/create-react-app/issues/2374
- return;
- }
+ if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
+ // The URL constructor is available in all browsers that support SW.
+ const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
+ if (publicUrl.origin !== window.location.origin) {
+ // Our service worker won't work if PUBLIC_URL is on a different origin
+ // from what our page is served on. This might happen if a CDN is used to
+ // serve assets; see https://github.com/facebook/create-react-app/issues/2374
+ return;
+ }
- window.addEventListener('load', () => {
- const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
+ window.addEventListener('load', () => {
+ const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
- if (isLocalhost) {
- // This is running on localhost. Let's check if a service worker still exists or not.
- checkValidServiceWorker(swUrl, config);
+ if (isLocalhost) {
+ // This is running on localhost. Let's check if a service worker still exists or not.
+ checkValidServiceWorker(swUrl, config);
- // Add some additional logging to localhost, pointing developers to the
- // service worker/PWA documentation.
- navigator.serviceWorker.ready.then(() => {
- console.log(
- 'This web app is being served cache-first by a service ' +
- 'worker. To learn more, visit https://bit.ly/CRA-PWA'
- );
+ // Add some additional logging to localhost, pointing developers to the
+ // service worker/PWA documentation.
+ navigator.serviceWorker.ready.then(() => {
+ console.log(
+ 'This web app is being served cache-first by a service ' +
+ 'worker. To learn more, visit https://bit.ly/CRA-PWA'
+ );
+ });
+ } else {
+ // Is not localhost. Just register service worker
+ registerValidSW(swUrl, config);
+ }
});
- } else {
- // Is not localhost. Just register service worker
- registerValidSW(swUrl, config);
- }
- });
- }
+ }
}
function registerValidSW(swUrl, config) {
- navigator.serviceWorker
- .register(swUrl)
- .then(registration => {
- registration.onupdatefound = () => {
- const installingWorker = registration.installing;
- if (installingWorker == null) {
- return;
- }
- installingWorker.onstatechange = () => {
- if (installingWorker.state === 'installed') {
- if (navigator.serviceWorker.controller) {
- // At this point, the updated precached content has been fetched,
- // but the previous service worker will still serve the older
- // content until all client tabs are closed.
- console.log(
- 'New content is available and will be used when all ' +
- 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
- );
+ navigator.serviceWorker
+ .register(swUrl)
+ .then(registration => {
+ registration.onupdatefound = () => {
+ const installingWorker = registration.installing;
+ if (installingWorker == null) {
+ return;
+ }
+ installingWorker.onstatechange = () => {
+ if (installingWorker.state === 'installed') {
+ if (navigator.serviceWorker.controller) {
+ // At this point, the updated precached content has been fetched,
+ // but the previous service worker will still serve the older
+ // content until all client tabs are closed.
+ console.log(
+ 'New content is available and will be used when all ' +
+ 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
+ );
- // Execute callback
- if (config && config.onUpdate) {
- config.onUpdate(registration);
- }
- } else {
- // At this point, everything has been precached.
- // It's the perfect time to display a
- // "Content is cached for offline use." message.
- console.log('Content is cached for offline use.');
+ // Execute callback
+ if (config && config.onUpdate) {
+ config.onUpdate(registration);
+ }
+ } else {
+ // At this point, everything has been precached.
+ // It's the perfect time to display a
+ // "Content is cached for offline use." message.
+ console.log('Content is cached for offline use.');
- // Execute callback
- if (config && config.onSuccess) {
- config.onSuccess(registration);
- }
- }
- }
- };
- };
- })
- .catch(error => {
- console.error('Error during service worker registration:', error);
- });
+ // Execute callback
+ if (config && config.onSuccess) {
+ config.onSuccess(registration);
+ }
+ }
+ }
+ };
+ };
+ })
+ .catch(error => {
+ console.error('Error during service worker registration:', error);
+ });
}
function checkValidServiceWorker(swUrl, config) {
- // Check if the service worker can be found. If it can't reload the page.
- fetch(swUrl, {
- headers: { 'Service-Worker': 'script' },
- })
- .then(response => {
- // Ensure service worker exists, and that we really are getting a JS file.
- const contentType = response.headers.get('content-type');
- if (
- response.status === 404 ||
- (contentType != null && contentType.indexOf('javascript') === -1)
- ) {
- // No service worker found. Probably a different app. Reload the page.
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister().then(() => {
- window.location.reload();
- });
- });
- } else {
- // Service worker found. Proceed as normal.
- registerValidSW(swUrl, config);
- }
+ // Check if the service worker can be found. If it can't reload the page.
+ fetch(swUrl, {
+ headers: {'Service-Worker': 'script'},
})
- .catch(() => {
- console.log(
- 'No internet connection found. App is running in offline mode.'
- );
- });
+ .then(response => {
+ // Ensure service worker exists, and that we really are getting a JS file.
+ const contentType = response.headers.get('content-type');
+ if (
+ response.status === 404 ||
+ (contentType != null && contentType.indexOf('javascript') === -1)
+ ) {
+ // No service worker found. Probably a different app. Reload the page.
+ navigator.serviceWorker.ready.then(registration => {
+ registration.unregister().then(() => {
+ window.location.reload();
+ });
+ });
+ } else {
+ // Service worker found. Proceed as normal.
+ registerValidSW(swUrl, config);
+ }
+ })
+ .catch(() => {
+ console.log(
+ 'No internet connection found. App is running in offline mode.'
+ );
+ });
}
export function unregister() {
- if ('serviceWorker' in navigator) {
- navigator.serviceWorker.ready
- .then(registration => {
- registration.unregister();
- })
- .catch(error => {
- console.error(error.message);
- });
- }
+ if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.ready
+ .then(registration => {
+ registration.unregister();
+ })
+ .catch(error => {
+ console.error(error.message);
+ });
+ }
}
diff --git a/src/setupTests.js b/src/setupTests.js
index f5a6052..e89f709 100644
--- a/src/setupTests.js
+++ b/src/setupTests.js
@@ -5,15 +5,15 @@
import '@testing-library/jest-dom/extend-expect';
Object.defineProperty(window, 'matchMedia', {
- writable: true,
- value: jest.fn().mockImplementation(query => ({
- matches: false,
- media: query,
- onchange: null,
- addListener: jest.fn(), // deprecated
- removeListener: jest.fn(), // deprecated
- addEventListener: jest.fn(),
- removeEventListener: jest.fn(),
- dispatchEvent: jest.fn(),
- })),
+ writable: true,
+ value: jest.fn().mockImplementation(query => ({
+ matches: false,
+ media: query,
+ onchange: null,
+ addListener: jest.fn(), // deprecated
+ removeListener: jest.fn(), // deprecated
+ addEventListener: jest.fn(),
+ removeEventListener: jest.fn(),
+ dispatchEvent: jest.fn(),
+ })),
});
\ No newline at end of file
diff --git a/src/utils/editorData.js b/src/utils/editorData.js
index b218bc8..b424ba1 100644
--- a/src/utils/editorData.js
+++ b/src/utils/editorData.js
@@ -1,12 +1,12 @@
export default class EditorData {
- constructor( modelId, title, model, historical) {
- this.modelId = modelId;
- this.title = title;
- this.model = model;
- this.historical = historical;
- }
+ constructor(modelId, title, model, historical) {
+ this.modelId = modelId;
+ this.title = title;
+ this.model = model;
+ this.historical = historical;
+ }
- setModel(model) {
- this.model = model;
- }
+ setModel(model) {
+ this.model = model;
+ }
}
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 4967fa0..bf7e079 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1,5 +1,5 @@
export function generateUUID() {
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
let r = Math.random() * 16 | 0;
// eslint-disable-next-line
let v = c === 'x' ? r : (r & 0x3 | 0x8);
@@ -20,7 +20,9 @@ export function findChildParentId(folders, childId) {
let folder = folders.get(folderIds[i]);
if (folder.hasKey('children')) {
// fixme this is super inefficient
- let found = folder.get('children').value().some(id => { return id === childId; });
+ let found = folder.get('children').value().some(id => {
+ return id === childId;
+ });
if (found) {
return folderIds[i];
}
diff --git a/src/utils/uuid.js b/src/utils/uuid.js
index 4967fa0..bf7e079 100644
--- a/src/utils/uuid.js
+++ b/src/utils/uuid.js
@@ -1,5 +1,5 @@
export function generateUUID() {
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
let r = Math.random() * 16 | 0;
// eslint-disable-next-line
let v = c === 'x' ? r : (r & 0x3 | 0x8);
@@ -20,7 +20,9 @@ export function findChildParentId(folders, childId) {
let folder = folders.get(folderIds[i]);
if (folder.hasKey('children')) {
// fixme this is super inefficient
- let found = folder.get('children').value().some(id => { return id === childId; });
+ let found = folder.get('children').value().some(id => {
+ return id === childId;
+ });
if (found) {
return folderIds[i];
}
diff --git a/yarn.lock b/yarn.lock
index f369169..ed4e7d5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -13812,6 +13812,11 @@ xterm-addon-attach@^0.6:
resolved "https://registry.yarnpkg.com/xterm-addon-attach/-/xterm-addon-attach-0.6.0.tgz#220c23addd62ab88c9914e2d4c06f7407e44680e"
integrity sha512-Mo8r3HTjI/EZfczVCwRU6jh438B4WLXxdFO86OB7bx0jGhwh2GdF4ifx/rP+OB+Cb2vmLhhVIZ00/7x3YSP3dg==
+xterm-addon-fit@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.4.0.tgz#06e0c5d0a6aaacfb009ef565efa1c81e93d90193"
+ integrity sha512-p4BESuV/g2L6pZzFHpeNLLnep9mp/DkF3qrPglMiucSFtD8iJxtMufEoEJbN8LZwB4i+8PFpFvVuFrGOSpW05w==
+
xterm-for-react@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/xterm-for-react/-/xterm-for-react-1.0.4.tgz#6b35b9b037a0f9d979e7b57bb1d7c6ab7565b380"