mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #103 from appwrite/fix-qa-notifications
feat: add missing notification messages
This commit is contained in:
@@ -17,9 +17,13 @@
|
||||
const create = async () => {
|
||||
try {
|
||||
const database = await sdkForProject.databases.create(id ? id : 'unique()', name);
|
||||
name = id = null;
|
||||
showCreate = false;
|
||||
dispatch('created', database);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${name} has been created`
|
||||
});
|
||||
name = id = null;
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
+5
@@ -4,6 +4,7 @@
|
||||
import { Button, InputText, FormList, InputSelect } from '$lib/elements/forms';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
|
||||
export let showCreate = false;
|
||||
|
||||
@@ -14,6 +15,10 @@
|
||||
const created = async () => {
|
||||
invalidate(Dependencies.COLLECTION);
|
||||
showCreate = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `Attribute has been created`
|
||||
});
|
||||
};
|
||||
|
||||
$: if (selectedOption) {
|
||||
|
||||
+4
@@ -23,6 +23,10 @@
|
||||
);
|
||||
invalidate(Dependencies.COLLECTION);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `Attribute has been deleted`
|
||||
});
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/databases/database-${databaseId}/collection-${$page.params.collection}/attributes`
|
||||
);
|
||||
|
||||
+4
@@ -20,6 +20,10 @@
|
||||
$page.params.document
|
||||
);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `Document has been deleted`
|
||||
});
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/databases/database-${$page.params.database}/collection-${$page.params.collection}`
|
||||
);
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@
|
||||
);
|
||||
invalidate(Dependencies.COLLECTION);
|
||||
addNotification({
|
||||
message: 'Index created!',
|
||||
message: 'Index has been created',
|
||||
type: 'success'
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
+4
@@ -22,6 +22,10 @@
|
||||
selectedIndex.key
|
||||
);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `Index has been deleted`
|
||||
});
|
||||
dispatch('deleted');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
+4
@@ -16,6 +16,10 @@
|
||||
try {
|
||||
await sdkForProject.databases.deleteCollection(databaseId, $collection.$id);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$collection.name} has been deleted`
|
||||
});
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/databases/database/${$page.params.database}`
|
||||
);
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
try {
|
||||
await sdkForProject.databases.delete(databaseId);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$database.name} has been deleted`
|
||||
});
|
||||
await goto(`${base}/console/project-${$page.params.project}/databases`);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
await invalidate(Dependencies.FUNCTIONS);
|
||||
|
||||
addNotification({
|
||||
message: 'Function has been created',
|
||||
message: `${$createFunction.name} has been created`,
|
||||
type: 'success'
|
||||
});
|
||||
wizard.hide();
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
try {
|
||||
await sdkForProject.storage.deleteBucket($bucket.$id);
|
||||
showDelete = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$bucket.name} has been deleted`
|
||||
});
|
||||
await goto(`${base}/console/project-${$page.params.project}/storage`);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
await sdkForProject.storage.deleteFile(file.bucketId, file.$id);
|
||||
showDelete = false;
|
||||
dispatch('deleted', file);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${file.name} has been deleted`
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import { bucket } from './store';
|
||||
import { calculateSize } from '$lib/helpers/sizeConvertion';
|
||||
import { Permissions } from '$lib/components/permissions';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
|
||||
export let showCreate = false;
|
||||
|
||||
@@ -34,6 +35,10 @@
|
||||
showCustomId = false;
|
||||
uploader.addFile(file);
|
||||
dispatch('created');
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${file.name} has been created`
|
||||
});
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
}
|
||||
|
||||
+4
@@ -17,6 +17,10 @@
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/storage/bucket-${$file.bucketId}`
|
||||
);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$file.name} has been deleted`
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { Modal, CustomId } from '$lib/components';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { Button, InputText, FormList } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
@@ -20,6 +21,10 @@
|
||||
name = null;
|
||||
showCreate = false;
|
||||
dispatch('created', bucket);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${name} has been created`
|
||||
});
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user