Add open storage documentation command, hide functions view (#3)

This commit is contained in:
Alex Weininger 2021-04-29 22:41:33 -07:00 committed by GitHub
parent 3a9795060a
commit 0ae802ccf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 19 deletions

View file

@ -164,6 +164,11 @@
"command": "vscode-appwrite.refreshStorage", "command": "vscode-appwrite.refreshStorage",
"title": "Refresh storage", "title": "Refresh storage",
"icon": "$(refresh)" "icon": "$(refresh)"
},
{
"command": "vscode-appwrite.openStorageDocumentation",
"title": "Open storage documentation",
"icon": "$(book)"
} }
], ],
"views": { "views": {
@ -180,10 +185,6 @@
"id": "Storage", "id": "Storage",
"name": "Storage" "name": "Storage"
}, },
{
"id": "Functions",
"name": "Functions"
},
{ {
"id": "Health", "id": "Health",
"name": "Health" "name": "Health"
@ -242,6 +243,11 @@
"command": "vscode-appwrite.refreshStorage", "command": "vscode-appwrite.refreshStorage",
"when": "view == Storage", "when": "view == Storage",
"group": "navigation" "group": "navigation"
},
{
"command": "vscode-appwrite.openStorageDocumentation",
"when": "view == Storage",
"group": "navigation"
} }
], ],
"view/item/context": [ "view/item/context": [

View file

@ -4,7 +4,8 @@ const documentationLinks = {
home: 'https://appwrite.io/docs', home: 'https://appwrite.io/docs',
users: 'https://appwrite.io/docs/server/users', users: 'https://appwrite.io/docs/server/users',
database: 'https://appwrite.io/docs/client/database', database: 'https://appwrite.io/docs/client/database',
health: 'https://appwrite.io/docs/server/health' health: 'https://appwrite.io/docs/server/health',
storage: 'https://appwrite.io/docs/client/storage'
}; };
type DocsPage = keyof typeof documentationLinks; type DocsPage = keyof typeof documentationLinks;

View file

@ -3,11 +3,11 @@ import { AppwriteTree, ext } from "../extensionVariables";
import { refreshTree } from "../utils/refreshTree"; import { refreshTree } from "../utils/refreshTree";
import { connectAppwrite } from "./connectAppwrite"; import { connectAppwrite } from "./connectAppwrite";
import { createCollection } from "./database/createCollection"; import { createCollection } from "./database/createCollection";
import { createPermission } from './database/permissions/createPermission'; import { createPermission } from "./database/permissions/createPermission";
import { createRule } from "./database/createRule"; import { createRule } from "./database/createRule";
import { deleteCollection } from "./database/deleteCollection"; import { deleteCollection } from "./database/deleteCollection";
import { deleteDocument } from "./database/deleteDocument"; import { deleteDocument } from "./database/deleteDocument";
import { deletePermission } from './database/permissions/deletePermission'; import { deletePermission } from "./database/permissions/deletePermission";
import { viewDocumentAsJson } from "./database/openDocument"; import { viewDocumentAsJson } from "./database/openDocument";
import { refreshCollection } from "./database/refreshCollection"; import { refreshCollection } from "./database/refreshCollection";
import { refreshCollectionsList } from "./database/refreshCollectionsList"; import { refreshCollectionsList } from "./database/refreshCollectionsList";
@ -23,7 +23,7 @@ import { getUserLogs } from "./users/getUserLogs";
import { openUserInConsole } from "./users/openUserInConsole"; import { openUserInConsole } from "./users/openUserInConsole";
import { refreshUsersList } from "./users/refreshUsersList"; import { refreshUsersList } from "./users/refreshUsersList";
import { viewUserPrefs } from "./users/viewUserPrefs"; import { viewUserPrefs } from "./users/viewUserPrefs";
import { editPermission } from './database/permissions/editPermission'; import { editPermission } from "./database/permissions/editPermission";
class CommandRegistrar { class CommandRegistrar {
constructor(private readonly context: ExtensionContext) {} constructor(private readonly context: ExtensionContext) {}
@ -45,7 +45,10 @@ export function registerCommands(context: ExtensionContext): void {
}); });
}; };
/** General **/
registerCommand("Connect", connectAppwrite); registerCommand("Connect", connectAppwrite);
/** Users **/
registerCommand("openUserInConsole", openUserInConsole); registerCommand("openUserInConsole", openUserInConsole);
registerCommand("viewUserPrefs", viewUserPrefs); registerCommand("viewUserPrefs", viewUserPrefs);
registerCommand("copyUserId", copyUserId); registerCommand("copyUserId", copyUserId);
@ -53,22 +56,29 @@ export function registerCommands(context: ExtensionContext): void {
registerCommand("CreateUser", createUser); registerCommand("CreateUser", createUser);
registerCommand("refreshUsersList", refreshUsersList); registerCommand("refreshUsersList", refreshUsersList);
registerCommand("DeleteUser", deleteUser); registerCommand("DeleteUser", deleteUser);
registerCommand("OpenUsersDocumentation", () => openDocumentation('users')); registerCommand("OpenUsersDocumentation", () => openDocumentation("users"));
registerCommand("OpenDatabaseDocumentation", () => openDocumentation('database'));
registerCommand("GetUserLogs", getUserLogs); registerCommand("GetUserLogs", getUserLogs);
/** Database **/
registerCommand("OpenDatabaseDocumentation", () => openDocumentation("database"));
registerCommand("viewDocumentAsJson", viewDocumentAsJson); registerCommand("viewDocumentAsJson", viewDocumentAsJson);
registerCommand("viewCollectionAsJson", viewCollectionAsJson); registerCommand("viewCollectionAsJson", viewCollectionAsJson);
registerCommand("createRule", createRule); registerCommand("createRule", createRule);
registerCommand("removeRule", removeRule); registerCommand("removeRule", removeRule);
registerCommand("deleteDocument", deleteDocument, 'database'); registerCommand("deleteDocument", deleteDocument, "database");
registerCommand("deleteCollection", deleteCollection, 'database'); registerCommand("deleteCollection", deleteCollection, "database");
registerCommand("refreshCollection", refreshCollection); registerCommand("refreshCollection", refreshCollection);
registerCommand("refreshCollectionsList", refreshCollectionsList); registerCommand("refreshCollectionsList", refreshCollectionsList);
registerCommand("createCollection", createCollection, 'database'); registerCommand("createCollection", createCollection, "database");
registerCommand("createPermission", createPermission, 'database'); registerCommand("createPermission", createPermission, "database");
registerCommand("deletePermission", deletePermission, 'database'); registerCommand("deletePermission", deletePermission, "database");
registerCommand("refreshHealth", () => {}, 'health'); registerCommand("editPermission", editPermission, "database");
registerCommand("openHealthDocumentation", () => openDocumentation('health'));
registerCommand("editPermission", editPermission, 'database'); /** Health **/
registerCommand("refreshStorage", () => {}, 'storage'); registerCommand("refreshHealth", () => {}, "health");
registerCommand("openHealthDocumentation", () => openDocumentation("health"));
/** Storage **/
registerCommand("refreshStorage", () => {}, "storage");
registerCommand("openStorageDocumentation", () => openDocumentation("storage"));
} }