Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 6559d67

Browse files
authored
Merge pull request #18 from Arattian/dev-feature
Database delete modal added. Table boolean values display fixed.
2 parents f6d02a6 + 125334a commit 6559d67

7 files changed

Lines changed: 35 additions & 9 deletions

File tree

‎package-lock.json‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@vue/cli-service": "3.3.1",
3939
"@vue/test-utils": "^1.0.0-beta.28",
4040
"babel-core": "^7.0.0-bridge.0",
41-
"electron": "^4.0.1",
41+
"electron": "^4.0.2",
4242
"element-theme-dark": "^1.0.2",
4343
"pug": "^2.0.3",
4444
"pug-plain-loader": "^1.0.0",

‎src/App.vue‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,18 @@
171171
background #2c323a !important
172172
color #fff !important
173173
174+
.jsoneditor-tree input[type='checkbox']
175+
display none !important
176+
174177
.jsoneditor-search div.jsoneditor-frame
175178
background #2c323a !important
176179
color #fff !important
177180
border-radius 2px !important
178181
border 1px solid #121820 !important
179182
183+
.el-table__fixed::before, .el-table__fixed-right::before
184+
background-color #222932 !important
185+
180186
.jsoneditor-next
181187
display none !important
182188

‎src/components/ConnectDatabase.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
el-option(v-for="(region, index) in regionList" :key="index" :label="region" :value="region")
1313
el-form-item(label="Access Key Id" required)
1414
el-input(v-model="configs.accessKeyId" placeholder="AWS access key id")
15-
el-form-item(label="Secret Access Key" required)
15+
el-form-item(label="Secret Access Key" @keyup.enter.native="submitRemoteForm" required)
1616
el-input(v-model="configs.secretAccessKey" placeholder="AWS secret access key")
1717
ActionButtons(
1818
:cancelHandler="setToDefault"
@@ -27,7 +27,7 @@
2727
template(slot="append")
2828
el-color-picker(v-model="submitForm.color" size="mini")
2929
el-form-item(label="Localhost Port" required)
30-
el-input(placeholder="port" v-model="submitForm.port")
30+
el-input(placeholder="port" @keyup.enter.native="submitLocalForm" v-model="submitForm.port")
3131
template(slot="prepend") http://localhost:
3232
ActionButtons(
3333
:cancelHandler="setToDefault"

‎src/components/SidebarDatabases.vue‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,29 @@
99
.item-content(@click='elementHandler(db.name)')
1010
v-icon(name="database" class="db-icon")
1111
span {{db.name}}
12-
.item-delete(@click="removeHandler(db)")
12+
.item-delete(@click="toggleDeleteModal(db)")
1313
i(class="el-icon-delete delete")
1414
</template>
1515

1616
<script lang="ts">
1717
import { Vue, Component, Prop } from 'vue-property-decorator';
1818
@Component
1919
export default class SidebarDatabases extends Vue {
20+
public $confirm: any = this.$confirm;
2021
@Prop(Function) private removeHandler: any;
2122
@Prop(Function) private elementHandler: any;
2223
@Prop(Array) private databaseList!: any[];
24+
private toggleDeleteModal(db: any) {
25+
this.$confirm('Are you sure, you want to delete database from list?', 'Warning', {
26+
confirmButtonText: 'Delete',
27+
cancelButtonText: 'Cancel',
28+
type: 'warning',
29+
confirmButtonClass: 'el-button el-button--danger is-plain',
30+
cancelButtonClass: 'el-button el-button--primary is-plain',
31+
}).then(() => {
32+
this.removeHandler(db);
33+
}).catch(() => true);
34+
}
2335
}
2436
</script>
2537

‎src/store/modules/records/actions.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ async function removeSelected({
124124
return;
125125
}
126126
// If there was unprocessed items, retry deleting.
127-
// console.log(response.UnprocessedItems);
128127
if (state.retry < 5 && response.UnprocessedItems.currentTable) {
129128
commit('setGroupDeleteItems', response.UnprocessedItems.currentTable);
130129
dispatch('removeSelected');

‎src/store/modules/records/mutations.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ async function selectRows(state: RecordModuleState, val: any) {
5656
}
5757
newSelection.push(requestItem);
5858
}
59+
/*
60+
Splitting selected rows, into arrays of maximum 25 rows, for sending them
61+
with batchWrite function.
62+
*/
5963
const chunk = 25;
6064
for (let i = 0; i < newSelection.length; i += chunk) {
6165
state.groupDelete.push(newSelection.slice(i, i + chunk));
@@ -89,6 +93,11 @@ function setHeader(state: RecordModuleState) {
8993
}
9094
if (typeof row[key] === 'object') {
9195
row[key] = JSON.stringify(row[key]);
96+
} else if (
97+
typeof row[key] === 'boolean' ||
98+
typeof row[key] === 'undefined'
99+
) {
100+
row[key] += '';
92101
}
93102
}
94103
}

0 commit comments

Comments
 (0)