diff --git a/src/lib/commandCenter/commands.ts b/src/lib/commandCenter/commands.ts
index 1f53c9b73..134f38233 100644
--- a/src/lib/commandCenter/commands.ts
+++ b/src/lib/commandCenter/commands.ts
@@ -258,6 +258,7 @@ export const commandGroupRanks = derived(groupRankTransformations, ($groupRankTr
const initialRanks = {
...Object.fromEntries(groups.map((group) => [group, 0])),
ungrouped: 9999,
+ users: 1,
help: -1
} as CommandGroupRanks;
diff --git a/src/lib/commandCenter/panels/organizations.svelte b/src/lib/commandCenter/panels/organizations.svelte
index 6baf6234c..3401f6b18 100644
--- a/src/lib/commandCenter/panels/organizations.svelte
+++ b/src/lib/commandCenter/panels/organizations.svelte
@@ -1,31 +1,11 @@
-
+
{option.label}
diff --git a/src/lib/commandCenter/searchers/index.ts b/src/lib/commandCenter/searchers/index.ts
index b74b64501..cf2d247f2 100644
--- a/src/lib/commandCenter/searchers/index.ts
+++ b/src/lib/commandCenter/searchers/index.ts
@@ -1,2 +1,3 @@
export * from './databases';
export * from './users';
+export * from './organizations';
diff --git a/src/lib/commandCenter/searchers/organizations.ts b/src/lib/commandCenter/searchers/organizations.ts
new file mode 100644
index 000000000..df72d77b2
--- /dev/null
+++ b/src/lib/commandCenter/searchers/organizations.ts
@@ -0,0 +1,18 @@
+import { goto } from '$app/navigation';
+import { sdk } from '$lib/stores/sdk';
+import type { Searcher } from '../commands';
+
+export const orgSearcher = (async (query: string) => {
+ const { teams } = await sdk.forConsole.teams.list();
+ return teams
+ .filter((organization) => organization.name.toLowerCase().includes(query.toLowerCase()))
+ .map((organization) => {
+ return {
+ label: organization.name,
+ callback: () => {
+ goto(`/console/organization-${organization.$id}`);
+ },
+ group: 'organizations'
+ } as const;
+ });
+}) satisfies Searcher;
diff --git a/src/lib/commandCenter/searchers/users.ts b/src/lib/commandCenter/searchers/users.ts
index 5c99ff18e..ebd725c32 100644
--- a/src/lib/commandCenter/searchers/users.ts
+++ b/src/lib/commandCenter/searchers/users.ts
@@ -4,6 +4,7 @@ import { project } from '$routes/console/project-[project]/store';
import { get } from 'svelte/store';
import type { Command, Searcher } from '../commands';
import type { Models } from '@appwrite.io/console';
+import { promptDeleteUser } from '$routes/console/project-[project]/auth/user-[user]/dangerZone.svelte';
const getUserCommand = (user: Models.User, projectId: string) =>
({
@@ -22,6 +23,14 @@ export const userSearcher = (async (query: string) => {
if (users.length === 1) {
return [
getUserCommand(users[0], projectId),
+ {
+ label: 'Delete user',
+ callback: () => {
+ promptDeleteUser(users[0].$id);
+ },
+ group: 'users',
+ icon: 'trash'
+ },
{
label: 'Go to activity',
callback: () => {
diff --git a/src/routes/console/+layout.svelte b/src/routes/console/+layout.svelte
index 645ea9ea7..4ca6c0a87 100644
--- a/src/routes/console/+layout.svelte
+++ b/src/routes/console/+layout.svelte
@@ -17,10 +17,11 @@
import { goto } from '$app/navigation';
- import { CommandCenter, registerCommands } from '$lib/commandCenter';
+ import { CommandCenter, registerCommands, registerSearcher } from '$lib/commandCenter';
import { AIPanel, OrganizationsPanel } from '$lib/commandCenter/panels';
import { addSubPanel } from '$lib/commandCenter/subPanels';
import { openMigrationWizard } from './(migration-wizard)';
+ import { orgSearcher } from '$lib/commandCenter/searchers';
$: $registerCommands([
{
@@ -107,6 +108,8 @@
$: if ($requestedMigration) {
openMigrationWizard();
}
+
+ $registerSearcher(orgSearcher);
diff --git a/src/routes/console/project-[project]/auth/user-[user]/dangerZone.svelte b/src/routes/console/project-[project]/auth/user-[user]/dangerZone.svelte
index 8fa2ff05d..727bfa053 100644
--- a/src/routes/console/project-[project]/auth/user-[user]/dangerZone.svelte
+++ b/src/routes/console/project-[project]/auth/user-[user]/dangerZone.svelte
@@ -1,10 +1,22 @@
+
+
@@ -46,8 +58,8 @@
-
+
-
+