Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
JSON view does not show whole collection
Browse files Browse the repository at this point in the history
support Control(CMD) + C,V
  • Loading branch information
deptno committed Apr 7, 2018
1 parent e06350c commit c1da209
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dynamon",
"version": "0.1.2",
"version": "0.1.3",
"description": "dynamodb GUI client",
"repository": "https://github.com/deptno/dynamon.git",
"author": "Bonggyun Lee <[email protected]>",
Expand Down
12 changes: 4 additions & 8 deletions packages/dynamon-fe/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export class HomeComponent extends React.Component<Props, State> {
{tables.map(({TableName}) => <option key={TableName} value={TableName}>{TableName}</option>)}
</SelectComponent>
</div>
<JsonComponent src={this.state.json || records} onEdit={this.handleJsonEdit}/>
{records.length > 0
?
<JsonComponent src={this.state.json} onEdit={this.handleJsonEdit}/>
{records
?
<StackableJsonTableComponent
collection={records}
onItemSelected={this.handleOnItemSelected}
Expand All @@ -56,10 +56,7 @@ export class HomeComponent extends React.Component<Props, State> {
<div className="pt-non-ideal-state-visual pt-non-ideal-state-icon">
<span className="pt-icon pt-icon-th"></span>
</div>
<h4 className="pt-non-ideal-state-title">Table is empty.</h4>
<div className="pt-non-ideal-state-description">
Select table or Refresh
</div>
<h4 className="pt-non-ideal-state-title">Select Table</h4>
</div>
)
}
Expand Down Expand Up @@ -98,7 +95,6 @@ export class HomeComponent extends React.Component<Props, State> {
handleOnTableChange = async ev => {
const value = ev.target.value

console.log('what')
if (!value.startsWith('__')) {
this.props.setTable(value)
await this.props.readRecords(value)
Expand Down
24 changes: 13 additions & 11 deletions packages/dynamon-fe/components/Json.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ export class JsonComponent extends React.Component<Props, State> {
onClick={this.handleSize}
/>
</label>
<RJV
src={src}
name={null}
theme="ocean"
iconStyle="circle"
indentWidth={2}
displayDataTypes={false}
onEdit={this.props.onEdit && this.handleEdit}
onAdd={this.props.onEdit && this.handleEdit}
onDelete={this.props.onEdit && this.handleEdit}
/>
{src && (
<RJV
src={src}
name={null}
theme="ocean"
iconStyle="circle"
indentWidth={2}
displayDataTypes={false}
onEdit={this.props.onEdit && this.handleEdit}
onAdd={this.props.onEdit && this.handleEdit}
onDelete={this.props.onEdit && this.handleEdit}
/>
)}
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dynamon-fe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dynamon-fe",
"version": "0.1.2",
"version": "0.1.3",
"description": "dynamon frontend",
"main": "index.js",
"repository": "https://github.com/deptno/dynamon.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/dynamon-fe/redux/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ItemList = DocumentClient.ItemList
const defaultState: RootState = Object.freeze({
endpoints: [],
tables: [],
records: [],
records: null,
table : null,
loadingEndpoints: false
})
Expand Down
25 changes: 25 additions & 0 deletions packages/dynamon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,29 @@ function createWindow() {

mainWindow.loadURL(process.env.ELECTRON_URL || 'file://' + __dirname + '/client/index.html')
mainWindow.on('closed', () => (mainWindow = null))

const template = [{
label : 'Application',
submenu: [
{label: 'About Dynamon', selector: 'orderFrontStandardAboutPanel:'},
{
label: 'Quit', accelerator: 'Command+Q', click() {
app.quit()
},
},
],
}, {
label : 'Edit',
submenu: [
{label: 'Undo', accelerator: 'CmdOrCtrl+Z', selector: 'undo:'},
{label: 'Redo', accelerator: 'Shift+CmdOrCtrl+Z', selector: 'redo:'},
{label: 'Cut', accelerator: 'CmdOrCtrl+X', selector: 'cut:'},
{label: 'Copy', accelerator: 'CmdOrCtrl+C', selector: 'copy:'},
{label: 'Paste', accelerator: 'CmdOrCtrl+V', selector: 'paste:'},
{label: 'Select All', accelerator: 'CmdOrCtrl+A', selector: 'selectAll:'},
],
},
]

Menu.setApplicationMenu(Menu.buildFromTemplate(template))
}
11 changes: 10 additions & 1 deletion packages/dynamon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dynamon",
"version": "0.1.2",
"version": "0.1.3",
"description": "dynamodb GUI client",
"main": "index.js",
"repository": "https://github.com/deptno/dynamon.git",
Expand All @@ -25,5 +25,14 @@
"dynamon-engine": "*",
"dynamodb-localhost": "^0.0.5",
"mkdirp": "^0.5.1"
},
"build": {
"appId": "com.dynamon",
"productName": "Dynamon",
"mac": {
"category": "public.app-category.developer-tools",
"compression": "store",
"files": ["!builds/*", "!*.log", "!**/*.ts"]
}
}
}

0 comments on commit c1da209

Please sign in to comment.