Skip to content

Commit

Permalink
Merge pull request #310 from connect-foundation/cocode
Browse files Browse the repository at this point in the history
Cocode 1.3.0 배포 준비
  • Loading branch information
YukJiSoo authored Dec 19, 2019
2 parents 9164a0a + 1305c15 commit cefea85
Show file tree
Hide file tree
Showing 90 changed files with 1,836 additions and 604 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- stage: Deploy
if: branch = master AND type = pull_request
before_install:
- openssl aes-256-cbc -K $encrypted_278d2d9eb060_key -iv $encrypted_278d2d9eb060_iv -in env.tar.enc -out env.tar -d
- openssl aes-256-cbc -K $encrypted_0395e9fbd9ff_key -iv $encrypted_0395e9fbd9ff_iv -in env.tar.enc -out env.tar -d
- tar xvf env.tar
install:
- sudo apt-get install sshpass
Expand Down
7 changes: 7 additions & 0 deletions cocode/dev.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SKIP_PREFLIGHT_CHECK=true

DEV_API_SERVER_IP=
PROD_API_SERVER_IP=

Expand All @@ -7,3 +8,9 @@ DEV_DEPENDENCY_SERVER_IP=

PROD_COCONUT_SERVER_IP=
DEV_COCONUT_SERVER_IP=

PROD_LIVE_SERVER_IP=
DEV_LIVE_SERVER_IP=

PROD_COCODE_SERVER_IP=
DEV_COCODE_SERVER_IP=
1 change: 1 addition & 0 deletions cocode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"react-router-dom": "^5.1.2",
"react-scripts": "^3.2.0",
"react-style-proptype": "^3.2.2",
"socket.io-client": "^2.3.0",
"styled-components": "^4.4.1",
"webpack": "^4.41.2",
"worker-loader": "^2.0.0"
Expand Down
Binary file added cocode/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions cocode/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<html lang="en">
<head>
<title>cocode! - the SaaS IDE</title>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon-16x16.png"
/>
<meta charset="utf-8" />
<meta
name="viewport"
Expand Down
21 changes: 13 additions & 8 deletions cocode/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import { ThemeProvider } from 'styled-components';

import { DEFAULT_THEME } from 'constants/theme';

import GlobalStyle from 'components/Common/GlobalStyle';

import { Home, DashBoard, Project, History, NotFound } from 'pages';

import UserContext from 'contexts/UserContext';
import { UserContext } from 'contexts';
import useFetch from 'hooks/useFetch';
import { getUserAPICreator } from 'apis/User';
import { LiveStore } from 'stores';

import GlobalStyle from 'components/Common/GlobalStyle';
import { Home, DashBoard, Project, NotFound, Live, SignIn, Empty } from 'pages';

function App() {
const [user, setUser] = useState(null);
Expand All @@ -21,15 +20,21 @@ function App() {
}, [data]);

return (
<UserContext.Provider value={{ user }}>
<UserContext.Provider value={{ user, setUser }}>
<Router>
<ThemeProvider theme={DEFAULT_THEME}>
<GlobalStyle />
<Switch>
<Route exact path="/" component={Home} />
<Route path="/dashboard" component={DashBoard} />
<Route path="/project/:projectId" component={Project} />
<Route path="/history" component={History} />
<Route path="/live/:projectId">
<LiveStore>
<Live />
</LiveStore>
</Route>
<Route path="/signin" component={SignIn} />
<Route path="/empty" component={Empty} />
<Route component={NotFound} />
</Switch>
</ThemeProvider>
Expand Down
17 changes: 6 additions & 11 deletions cocode/src/actions/Live.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
import {
FETCH_LIVE,
LIVE_ON,
LIVE_OFF,
LIVE_JOIN_USER,
LIVE_LEFT_USER
LIVE_LEAVE_USER
} from './types';

function fetchLiveActionCreator(payload) {
return { type: FETCH_LIVE, payload };
}
function liveOnActionCreator(payload) {
return { type: LIVE_ON, payload };
}
function liveOffActionCreator(payload) {
return { type: LIVE_OFF, payload };
function liveOffActionCreator() {
return { type: LIVE_OFF };
}
function liveJoinUserActionCreator(payload) {
return { type: LIVE_JOIN_USER, payload };
}
function liveLeftUserActionCreator(payload) {
return { type: LIVE_LEFT_USER, payload };
function liveLeaveUserActionCreator(payload) {
return { type: LIVE_LEAVE_USER, payload };
}

export {
fetchLiveActionCreator,
liveOnActionCreator,
liveOffActionCreator,
liveJoinUserActionCreator,
liveLeftUserActionCreator
liveLeaveUserActionCreator
};
5 changes: 5 additions & 0 deletions cocode/src/actions/Project.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
UPDATE_PROJECT_INFO,
UPDATE_CODE,
UPDATE_CODE_FROM_FILE_ID,
FETCH_PROJECT,
SELECT_FILE,
UPDATE_FILE_NAME,
Expand All @@ -23,6 +24,9 @@ function fetchProjectActionCreator(payload) {
function updateCodeActionCreator(payload) {
return { type: UPDATE_CODE, payload };
}
function updateCodeFromFileIdActionCreator(payload) {
return { type: UPDATE_CODE_FROM_FILE_ID, payload };
}

function selectFileActionCreator(payload) {
return { type: SELECT_FILE, payload };
Expand Down Expand Up @@ -59,6 +63,7 @@ function saveFileActionCreator(payload) {
export {
updateProjectInfoActionCreator,
updateCodeActionCreator,
updateCodeFromFileIdActionCreator,
fetchProjectActionCreator,
selectFileActionCreator,
updateFileNameActionCreator,
Expand Down
8 changes: 4 additions & 4 deletions cocode/src/actions/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const API_FAIL = 'API_FAILURE';
// Project
const UPDATE_PROJECT_INFO = 'updateProjectInfo';
const UPDATE_CODE = 'updateCode';
const UPDATE_CODE_FROM_FILE_ID = 'updateCodeFromFileId';
const FETCH_PROJECT = 'fetchProject';
const SELECT_FILE = 'selectFile';
const CREATE_FILE = 'createFile';
Expand All @@ -23,11 +24,10 @@ const UPDATE_COCONUT_NAME = 'updateCoconutName';
const DELETE_COCONUT = 'deleteCoconut';

//Live
const FETCH_LIVE = 'fetchLive';
const LIVE_ON = 'liveOn';
const LIVE_OFF = 'liveOff';
const LIVE_JOIN_USER = 'liveJoinUser';
const LIVE_LEFT_USER = 'liveLeftUser';
const LIVE_LEAVE_USER = 'liveLeaveUser';

export {
API_READY,
Expand All @@ -36,6 +36,7 @@ export {
API_FAIL,
UPDATE_PROJECT_INFO,
UPDATE_CODE,
UPDATE_CODE_FROM_FILE_ID,
FETCH_PROJECT,
SELECT_FILE,
UPDATE_FILE_NAME,
Expand All @@ -47,10 +48,9 @@ export {
FETCH_COCONUT,
UPDATE_COCONUT_NAME,
DELETE_COCONUT,
FETCH_LIVE,
LIVE_ON,
LIVE_OFF,
LIVE_JOIN_USER,
LIVE_LEFT_USER,
LIVE_LEAVE_USER,
SAVE_FILE
};
14 changes: 0 additions & 14 deletions cocode/src/apis/Dependency.js

This file was deleted.

2 changes: 1 addition & 1 deletion cocode/src/components/Common/DropZone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function DropZone({ draggableComponentOverColor, ...props }) {
onDragLeave={handleDragLeave}
onDrop={handleDrop}
{...props}
></Styled.DropZone>
/>
);
}

Expand Down
5 changes: 4 additions & 1 deletion cocode/src/components/Common/LoginModalBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { API } from 'config';
import Github from './github.svg';

function LoginModalBody() {
const handleClickLoginButton = () => (window.location.href = API.login);
const handleClickLoginButton = () => {
window.location.href = API.login;
localStorage.setItem('redirectURL', window.location.href);
};

return (
<Styled.LoginModalBody>
Expand Down
1 change: 1 addition & 0 deletions cocode/src/components/Common/Modal/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import styled from 'styled-components';

const ModalBackGround = styled.div`
& {
z-index: 10;
position: fixed;
top: 0;
left: 0;
Expand Down
2 changes: 1 addition & 1 deletion cocode/src/components/DashBoard/ProjectCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
updateCoconutNameActionCreator,
deleteCoconutActionCreator
} from 'actions/Dashboard';
import DashBoardContext from 'contexts/DashBoardContext';
import { DashBoardContext } from 'contexts';
import useFetch from 'hooks/useFetch';
import {
updateCoconutsAPICreator,
Expand Down
1 change: 1 addition & 0 deletions cocode/src/components/DashBoard/ProjectCard/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ProjectArticle = styled.article`
background-color: ${PROJECT_CARD_THEME.cardBackgroundColor};
border-radius: 1rem;
cursor: pointer;
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ function LiveUserProfile({ username, avatar }) {
);
}

function LiveUsers({ owner: { username, avatar }, participants = [] }) {
function LiveUsers({ owner, participants }) {
if (!participants.length) participants = [];

return (
<>
<Styled.Container>
<Styled.Title>OWNERS</Styled.Title>
<LiveUserProfile username={username} avatar={avatar} />
<LiveUserProfile username={owner.username} avatar={owner.avatar} />
<Styled.Title>USERS</Styled.Title>
{participants.map(({ username, avatar }, index) => {
return (
Expand All @@ -31,7 +33,7 @@ function LiveUsers({ owner: { username, avatar }, participants = [] }) {
/>
);
})}
</>
</Styled.Container>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import styled from 'styled-components';
import { TAB_CONTAINER_THEME, LIVE_TAB_THEME } from 'constants/theme';

const Container = styled.div`
& {
margin: 1rem 0;
}
`;

const Title = styled.h1`
& {
color: ${TAB_CONTAINER_THEME.tabContainerTitleColor};
Expand All @@ -12,13 +18,14 @@ const Title = styled.h1`
const UserProfile = styled.div`
& {
display: flex;
margin: 0.7rem 0;
}
`;

const UserName = styled.div`
& {
align-self: center;
margin-left: 0.4rem;
margin-left: 0.5rem;
font-weight: 100;
font-size: 1rem;
}
Expand All @@ -38,4 +45,11 @@ const SelfLabel = styled(UserName)`
}
`;

export { Title, UserProfile, UserName, UserAvatar, SelfLabel };
export {
Container,
Title,
UserProfile,
UserName,
UserAvatar,
SelfLabel
};
63 changes: 0 additions & 63 deletions cocode/src/components/Project/BrowserV1/index.js

This file was deleted.

Loading

0 comments on commit cefea85

Please sign in to comment.