Skip to content

Commit

Permalink
Merge pull request #11 from antwaremx/ic/fix-descriptions
Browse files Browse the repository at this point in the history
Fix: Update information in local storage
  • Loading branch information
diavrank authored Jun 28, 2021
2 parents 798a411 + 1b8f594 commit dc305d6
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"vue-router": "^3.0.1",
"vue-simplemde": "^2.0.0",
"vue-split-panel": "^1.0.4",
"vuetify": "^2.4.6",
"vuetify": "^2.5.5",
"vuex": "^3.0.1",
"vuex-electron": "^1.0.3",
"ws": "^7.3.1"
Expand Down
11 changes: 7 additions & 4 deletions src/renderer/components/Collections/CollectionOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<vue-simplemde v-model="endpoint.description" :configs="{placeholder:'Endpoint description (Optional)'}"
class="markdown-editor"/>
</modal-question>

<a id="downloadCollection" style="display:none"></a>
</div>
</template>

Expand Down Expand Up @@ -144,10 +146,11 @@ export default {
},
exportCollection() {
console.log('Export collection');
let link = document.createElement('a');
link.href = 'data:application/json;charset=UTF-8,' + escape(JSON.stringify(this.element));
link.download = this.element.name + '.json';
link.click();
const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(this.element));
const downloadElement = document.getElementById('downloadCollection');
downloadElement.setAttribute('href', dataStr);
downloadElement.setAttribute('download', this.element.name + '.json');
downloadElement.click();
},
removeCollection() {
if (this.$parent.level === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Collections/ImportCollections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ export default {

<style scoped>
</style>
</style>
5 changes: 4 additions & 1 deletion src/renderer/components/DdpClient/DdpEndpoint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ export default {
},
openSaveEndpoint() {
this.$refs.saveEndpointRef.title = 'Save endpoint';
this.$refs.folderSelectedRef.initializeCurrentLocation(this.endpoint.id);
this.$refs.saveEndpointRef.dialog = true;
setTimeout(() => {
this.$refs.folderSelectedRef.initializeCurrentLocation(this.endpoint.id);
}, 100);
},
validateEndpointToBeSaved() {
let isValid = true;
Expand All @@ -269,6 +271,7 @@ export default {
},
saveEndpoint() {
if (this.validateEndpointToBeSaved()) {//TODO: Implement vee-validate
this.saveDescription();
this.saveOpenEndpointInCollection({
connectionName: this.ddpConnection.title,
openEndpoint: this.endpoint,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Utilities/Modals/ModalQuestion.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog id="modalQuestion" max-width="500px" v-model="dialog" eager>
<v-dialog id="modalQuestion" max-width="500px" v-model="dialog">
<v-card>
<v-card-title class="black text-h5 d-flex justify-space-between">
<div class="text-h6 white--text">{{ title }}</div>
Expand Down
22 changes: 20 additions & 2 deletions src/renderer/layouts/shared/AsideView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,29 @@ export default {
}),
methods: {
...mapMutations(['openEndpointFromCollection']),
searchTree(element, elementId) {
if (element.id === elementId) {
return element;
} else if (element.children != null) {
let result = null;
for (let i = 0; result == null && i < element.children.length; i++) {
result = this.searchTree(element.children[i], elementId);
}
return result;
}
return null;
},
activeItem(item) {
const itemSelected = item[0];
if (itemSelected && itemSelected.type === 'endpoint') {
let endpointTemp = null;
for (const collection of this.connection.collections) {
endpointTemp = this.searchTree(collection, itemSelected.id);
if (endpointTemp) break;
}
this.openEndpointFromCollection({
connectionName: this.connection.title,
endpoint: itemSelected
endpoint: endpointTemp
});
this.$root.$emit('updateSelectedTab', { ...itemSelected });
}
Expand All @@ -77,7 +94,8 @@ export default {
.v-treeview-node__prepend {
min-width: auto;
}
.v-application--is-ltr .v-treeview-node__prepend {
margin-right: 0;
}
</style>
</style>
2 changes: 1 addition & 1 deletion src/renderer/store/modules/Connections/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ export {
removeArgOfOpenEndpoint,
saveOpenEndpointInCollection,
openEndpointFromCollection
};
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9973,10 +9973,10 @@ vue@^2.2.6, vue@^2.5.16, vue@^2.6.12:
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123"
integrity sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==

vuetify@^2.4.6:
version "2.4.6"
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-2.4.6.tgz#127b37bd36c7a63f61615e0cd6f97e8b203e7a07"
integrity sha512-oqAWKAin07ip/QuT/p4bL1LegE3MYPbfojrOcj80RATZDSnJyco2PZD8QuIzd0RhYfdAuSTkY8elvHsLu90RuQ==
vuetify@^2.5.5:
version "2.5.5"
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-2.5.5.tgz#66d4058209e1d70e9c742d37384f3ae63add7b04"
integrity sha512-WsW+WaueqjgCvx0rB3m/pd8MZiLJKBWGwLxMMGhoA7i1OBWCzNwAAVOjoaW1Fcz0Sbn5qHOUOYnz4Vqlu43AbA==

vuex-electron@^1.0.3:
version "1.0.3"
Expand Down

0 comments on commit dc305d6

Please sign in to comment.