Skip to content

Commit d278307

Browse files
committed
Fix #107
1 parent 2461cb1 commit d278307

File tree

7 files changed

+47
-12
lines changed

7 files changed

+47
-12
lines changed

packages/graphql-playground-electron/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"release": "npm run build && electron-builder -lmw",
2020
"library": "rm -rf .happypack && NODE_ENV=production webpack --config webpack.library.js -p",
2121
"lint": "tslint \"src/**/*.ts{,x}\" && lint-staged",
22-
"start": "yarn run compile && concurrently 'yarn react-start' 'wait-on http://localhost:4040/ && yarn electron-start'",
22+
"start": "yarn build-ts && concurrently 'yarn react-start' 'wait-on http://localhost:4040/ && yarn electron-start'",
2323
"react-start": "webpack-dev-server --hot --profile --history-api-fallback --host 0.0.0.0 --port 4040",
2424
"electron-start": "electron lib/main",
2525
"stats": "NODE_ENV=production webpack --config webpack.library.js --profile --json > stats.json",
@@ -127,7 +127,7 @@
127127
"extract-text-webpack-plugin": "^2.0.0-beta.3",
128128
"file-loader": "^0.11.2",
129129
"fork-ts-checker-webpack-plugin": "^0.1.5",
130-
"graphql-playground": "0.1.13",
130+
"graphql-playground": "0.1.15",
131131
"happypack": "^3.1.0",
132132
"html-webpack-plugin": "^2.30.1",
133133
"identity-obj-proxy": "^3.0.0",

packages/graphql-playground-electron/src/ElectronApp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export default class ElectronApp extends React.Component<{}, State> {
190190
`}</style>
191191
<style jsx={true}>{`
192192
.root {
193-
@p: .flex, .flexColumn, .bgDarkestBlue;
193+
@p: .flex, .flexColumn, .bgDarkestBlue, .overflowHidden;
194194
}
195195
.root.light {
196196
background-color: #dbdee0;
@@ -327,7 +327,7 @@ export default class ElectronApp extends React.Component<{}, State> {
327327
})
328328
.then(res => res.json())
329329
.then(res => {
330-
const shareUrl = `https://graphqlbin.com/${res.data.addSession.id}`
330+
const shareUrl = `https://graphql-bin.com/${res.data.addSession.id}`
331331
// const shareUrl = `${location.origin}/${res.data.addSession.id}`
332332
this.setState({ shareUrl })
333333
})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
overflow: hidden;
3+
}

packages/graphql-playground-electron/src/root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import * as ReactDOM from 'react-dom'
33
import App from './ElectronApp'
44
import 'graphql-playground/playground.css'
55
import 'graphcool-styles/dist/styles.css'
6+
import './index.css'
67

78
ReactDOM.render(<App />, document.getElementById('root'))

packages/graphql-playground-electron/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3246,9 +3246,9 @@ [email protected]:
32463246
graphql "^0.10.1"
32473247
graphql-language-service-types "0.0.21"
32483248

3249-
3250-
version "0.1.13"
3251-
resolved "https://registry.yarnpkg.com/graphql-playground/-/graphql-playground-0.1.13.tgz#3b354b5fdc3cac3134624eac5e5b0e755a2e3877"
3249+
3250+
version "0.1.15"
3251+
resolved "https://registry.yarnpkg.com/graphql-playground/-/graphql-playground-0.1.15.tgz#36425a4ef8f328eae89a2d7fec6ac700ec122245"
32523252
dependencies:
32533253
calculate-size "^1.1.1"
32543254
classnames "^2.2.5"

packages/graphql-playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "graphql-playground",
3-
"version": "0.1.13",
3+
"version": "0.1.15",
44
"main": "./lib/Playground.js",
55
"typings": "./lib/index.d.ts",
66
"scripts": {
77
"start": "node scripts/start.js",
8-
"prepublish-only": "yarn build",
8+
"prepublish": "yarn build",
99
"copy-styles": "cat src/styles/*.css > playground.css",
1010
"build": "rm -rf lib; yarn build-app; yarn build-package; yarn build-middleware; yarn copy-styles",
1111
"build-package": "rm -rf lib; tsc -p tsconfig.build.json --noUnusedLocals --noUnusedParameters; babel lib -d lib; cp -r ./src/assets/ ./lib/assets/; cd lib && rm -rf *.jsx;",

packages/graphql-playground/src/components/Playground.tsx

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
getDeeperType,
3838
} from './Playground/DocExplorer/utils'
3939
import { setStacks } from '../actions/graphiql-docs'
40-
import { isEqual } from 'lodash'
40+
import { isEqual, mapValues } from 'lodash'
4141
import Share from './Share'
4242

4343
export type Theme = 'dark' | 'light'
@@ -1237,14 +1237,45 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
12371237
}
12381238

12391239
private toggleShareHistory = () => {
1240-
this.setState(state => ({ ...state, shareHisotry: !state.shareHistory }))
1240+
this.setState(state => ({ ...state, shareHistory: !state.shareHistory }))
12411241
}
12421242

12431243
private share = () => {
12441244
this.saveSessions()
12451245
this.saveHistory()
12461246
this.storage.saveProject()
1247-
this.props.share(this.storage.project)
1247+
let sharingProject: any = this.storage.project
1248+
1249+
if (!this.state.shareHttpHeaders) {
1250+
sharingProject = {
1251+
...sharingProject,
1252+
sessions: mapValues(sharingProject.sessions, (session: Session) => {
1253+
session.headers = []
1254+
return session
1255+
}),
1256+
}
1257+
}
1258+
1259+
if (!this.state.shareAllTabs) {
1260+
const currentSession: Session = this.state.sessions[
1261+
this.state.selectedSessionIndex
1262+
]
1263+
sharingProject = {
1264+
...sharingProject,
1265+
sessions: {
1266+
[currentSession.id]: currentSession,
1267+
},
1268+
}
1269+
}
1270+
1271+
if (!this.state.shareHistory) {
1272+
sharingProject = {
1273+
...sharingProject,
1274+
history: [],
1275+
}
1276+
}
1277+
1278+
this.props.share(sharingProject)
12481279
this.setState({ changed: false })
12491280
}
12501281
}

0 commit comments

Comments
 (0)