Skip to content

Commit e9ced17

Browse files
siddharthkpchristianalfoniCompuIvesSaraVieira
authored
Comments (codesandbox#3600)
* duplicate header * get all the pieces ther * move Actions into a file * delete dead code * move usermenu container styles to usermenu * make avatar wrap not take extra spac * align avatar with buttons * vertical align menubar * redesign menu + sandbox name * get the right logos top left * adjust alignment * remove debug line * fixed margin issues * overmind-graphql * UI * UI * fix * More UI * Add change link permissions * Add resubscribing * Fix type * Fix link update * Update CircleCI scripts * refactored to effect and cleaned up (codesandbox#3537) * refactored to effect and cleaned up * clean and add disposeWhere * New changes * Set right connection places * Push * fix effects proxy * WIP * WIP * Polish * Update GraphQL typings * Typing changes * return promise on mutations * Fix ts issues * fix typing * Change prop order * Fixes * Deduplicate yarn.lock * Update cases * Update schema * Quickfix * use endpoint instead of url * fix weird event typing * Move collaborators queries to own folder * move collaborators to folder and add overmind package * try catch loading colalborators * initial graphql data and state * show comments data * list start * add bottom form * add delete * add edit mitation * add ui * default is open * default is open * default is open * simply bottom alignment with space-between * make the comment header prettier * refactor * select comment * bring the scroll back * center the empty block * margin bottoms + reply string * sorry, changed the name * replace input with autosize textarea for add comment * use icons and icon buttons * make empty screen prettier * oops forgot to remove debug statement * get the more icon to align to the right * add a clipped edges border * clean? * fix comments in old sidebar * add toggle in dev * small eslint fix * fix eslint * fix ts * prevent loading comments unless on * fix if server down * fix if server down * move to new version of overmind graphql * refactor a tiny bit Co-authored-by: Christian Alfoni <[email protected]> Co-authored-by: Ives van Hoorne <[email protected]> Co-authored-by: Sara Vieira <[email protected]>
1 parent 626931c commit e9ced17

File tree

33 files changed

+986
-348
lines changed

33 files changed

+986
-348
lines changed

packages/app/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
"gulp-rev": "^7.1.2",
138138
"hash-sum": "^1.0.2",
139139
"http-browserify": "^1.7.0",
140+
"http-proxy-middleware": "^1.0.0",
140141
"https-browserify": "^1.0.0",
141142
"humps": "CompuIves/humps",
142143
"ignore": "^5.1.4",
@@ -167,10 +168,10 @@
167168
"normalizr": "^3.2.3",
168169
"onigasm": "^2.2.1",
169170
"ot": "^0.0.15",
170-
"overmind": "^23.0.0-1582285704974",
171+
"overmind": "^23.0.2-1583315924305",
171172
"overmind-devtools": "^19.0.0",
172-
"overmind-graphql": "^3.0.0-1582705151381",
173-
"overmind-react": "^24.0.0-1582285704974",
173+
"overmind-graphql": "^3.1.0-1583324447920",
174+
"overmind-react": "^24.0.2-1583315924305",
174175
"phoenix": "^1.4.11",
175176
"postcss": "^7.0.26",
176177
"postcss-selector-parser": "^2.2.3",

packages/app/scripts/start.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var historyApiFallback = require('connect-history-api-fallback');
1010
var execSync = require('child_process').execSync;
1111
var opn = require('opn');
1212
var http = require('http');
13-
var proxy = require('http-proxy-middleware');
13+
var { createProxyMiddleware } = require('http-proxy-middleware');
1414
var path = require('path');
1515
var httpProxy = require('http-proxy');
1616
const { platform } = require('os');
@@ -230,7 +230,7 @@ function addMiddleware(devServer, index) {
230230
credentials: true,
231231
})
232232
);
233-
wsProxy = proxy({
233+
wsProxy = createProxyMiddleware({
234234
target: PROXY_DOMAIN.replace('https', 'wss'),
235235
changeOrigin: true,
236236
ws: true,
@@ -243,7 +243,7 @@ function addMiddleware(devServer, index) {
243243
devServer.use('/socket', wsProxy);
244244
devServer.use(
245245
'/api',
246-
proxy({
246+
createProxyMiddleware({
247247
target: PROXY_DOMAIN,
248248
changeOrigin: true,
249249
})
@@ -252,7 +252,7 @@ function addMiddleware(devServer, index) {
252252
if (process.env.VSCODE) {
253253
devServer.use(
254254
['/vscode**', '/node_modules**', '/monaco**'],
255-
proxy({
255+
createProxyMiddleware({
256256
target: 'http://localhost:8080',
257257
changeOrigin: true,
258258
})

packages/app/src/app/overmind/dependencies/overmind-graphql.ts

Lines changed: 0 additions & 247 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import gql from 'graphql-tag';
2+
import { Query } from 'overmind-graphql';
3+
4+
export const addComment: Query<any, any> = gql`
5+
mutation AddComment(
6+
$sandboxId: String!
7+
$comment: String!
8+
$username: String!
9+
) {
10+
addComment(sandboxId: $sandboxId, comment: $comment, username: $username) {
11+
id
12+
isResolved
13+
originalMessage {
14+
id
15+
content
16+
author {
17+
id
18+
avatarUrl
19+
username
20+
}
21+
}
22+
replies {
23+
id
24+
}
25+
insertedAt
26+
updatedAt
27+
}
28+
}
29+
`;
30+
31+
export const deleteComment: Query<any, any> = gql`
32+
mutation DeleteComment($id: String!) {
33+
deleteComment(id: $id) {
34+
id
35+
}
36+
}
37+
`;
38+
39+
export const updateComment: Query<any, any> = gql`
40+
mutation UpdateComment($id: String!, $comment: String, $isResolved: Boolean) {
41+
updateComment(
42+
id: $id
43+
data: { comment: $comment, isResolved: $isResolved }
44+
) {
45+
id
46+
isResolved
47+
originalMessage {
48+
id
49+
content
50+
}
51+
}
52+
}
53+
`;

0 commit comments

Comments
 (0)