mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-01-18 13:07:58 +00:00
DB/collection dropping bugfix
After dropping a collection or database, the hosttree was not reloaded correctly. Now, dropped databases and collections are correctly removed from the host tree.
This commit is contained in:
parent
b49faea073
commit
f33cac7f5c
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,14 +1,23 @@
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
New features:
|
||||||
|
|
||||||
* Added log view (#53, #54).
|
* Added log view (#53, #54).
|
||||||
* Added a shell script editor (#37), plus export/import feature.
|
* Added a shell script editor (#37), plus export/import feature.
|
||||||
* Added collection duplication feature (#63).
|
* Added collection duplication feature (#63).
|
||||||
* Find view: paste ID and press Enter (#55).
|
* Find view: paste ID and press Enter (#55).
|
||||||
|
|
||||||
|
Patches:
|
||||||
|
|
||||||
* Preserve state after switching to another tab (#56).
|
* Preserve state after switching to another tab (#56).
|
||||||
* Find view: ask for confirmation before negligently deleting documents when the user has clicked the '-' button (#58).
|
* Find view: ask for confirmation before negligently deleting documents when the user has clicked the '-' button (#58).
|
||||||
* Build script recreates the build output directory after it has been removed (#62).
|
|
||||||
* Set a deadline for counting documents, and added a button to count documents if the deadline has been exceeded.
|
* Set a deadline for counting documents, and added a button to count documents if the deadline has been exceeded.
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
|
||||||
|
* Build script recreates the build output directory after it has been removed (#62).
|
||||||
|
* After dropping a collection or database, the hosttree was not reloaded correctly. Now, dropped databases and collections are correctly removed from the host tree.
|
||||||
|
|
||||||
## [v0.2.2]
|
## [v0.2.2]
|
||||||
|
|
||||||
* Added Excel export format (#46).
|
* Added Excel export format (#46).
|
||||||
|
@ -32,7 +32,6 @@ import {
|
|||||||
TruncateCollection
|
TruncateCollection
|
||||||
} from '$wails/go/app/App';
|
} from '$wails/go/app/App';
|
||||||
|
|
||||||
|
|
||||||
const { set, subscribe } = writable({});
|
const { set, subscribe } = writable({});
|
||||||
const getValue = () => get({ subscribe });
|
const getValue = () => get({ subscribe });
|
||||||
let hostTreeInited = false;
|
let hostTreeInited = false;
|
||||||
@ -49,7 +48,14 @@ async function refresh() {
|
|||||||
host.uri = hostDetails.uri;
|
host.uri = hostDetails.uri;
|
||||||
|
|
||||||
host.open = async function() {
|
host.open = async function() {
|
||||||
const { databases: dbNames, status, statusError, systemInfo, systemInfoError } = await OpenConnection(hostKey);
|
const {
|
||||||
|
databases: dbNames,
|
||||||
|
status,
|
||||||
|
statusError,
|
||||||
|
systemInfo,
|
||||||
|
systemInfoError,
|
||||||
|
} = await OpenConnection(hostKey);
|
||||||
|
|
||||||
host.status = status;
|
host.status = status;
|
||||||
host.statusError = statusError;
|
host.statusError = statusError;
|
||||||
host.systemInfo = systemInfo;
|
host.systemInfo = systemInfo;
|
||||||
@ -184,6 +190,7 @@ async function refresh() {
|
|||||||
collection.drop = async function() {
|
collection.drop = async function() {
|
||||||
const success = await DropCollection(hostKey, dbKey, collKey);
|
const success = await DropCollection(hostKey, dbKey, collKey);
|
||||||
if (success) {
|
if (success) {
|
||||||
|
delete database.collections[collKey];
|
||||||
await refresh();
|
await refresh();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -276,14 +283,11 @@ async function refresh() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
database.drop = async function() {
|
database.drop = async function() {
|
||||||
const progress = startProgress(`Dropping database "${dbKey}"…`);
|
|
||||||
const success = await DropDatabase(hostKey, dbKey);
|
const success = await DropDatabase(hostKey, dbKey);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
|
delete host.databases[dbKey];
|
||||||
await refresh();
|
await refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
progress.end();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
database.newCollection = async function() {
|
database.newCollection = async function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user