2060 create a new api key (#2206)

* Add folder for api settings

* Init create api key page

* Update create api key page

* Implement api call to create apiKey

* Add create api key mutation

* Get id when creating apiKey

* Display created Api Key

* Add delete api key button

* Remove button from InputText

* Update stuff

* Add test for ApiDetail

* Fix type

* Use recoil instead of router state

* Remane route paths

* Remove online return

* Move and test date util

* Remove useless Component

* Rename ApiKeys paths

* Rename ApiKeys files

* Add input text info testing

* Rename hooks to webhooks

* Remove console error

* Add tests to reach minimum coverage
This commit is contained in:
martmull
2023-10-24 16:14:54 +02:00
committed by GitHub
parent b6e8fabbb1
commit d61511262e
55 changed files with 919 additions and 133 deletions

View File

@ -0,0 +1,27 @@
/*
Warnings:
- You are about to drop the `hooks` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "hooks" DROP CONSTRAINT "hooks_workspaceId_fkey";
-- DropTable
DROP TABLE "hooks";
-- CreateTable
CREATE TABLE "web_hooks" (
"id" TEXT NOT NULL,
"workspaceId" TEXT NOT NULL,
"targetUrl" TEXT NOT NULL,
"operation" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"deletedAt" TIMESTAMP(3),
CONSTRAINT "web_hooks_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "web_hooks" ADD CONSTRAINT "web_hooks_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "workspaces"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -179,7 +179,7 @@ model Workspace {
views View[]
viewSorts ViewSort[]
apiKeys ApiKey[]
hooks Hook[]
webHooks WebHook[]
/// @TypeGraphQL.omit(input: true, output: true)
deletedAt DateTime?
@ -910,7 +910,7 @@ model ApiKey {
@@map("api_keys")
}
model Hook {
model WebHook {
/// @Validator.IsString()
/// @Validator.IsOptional()
id String @id @default(uuid())
@ -925,5 +925,5 @@ model Hook {
/// @TypeGraphQL.omit(input: true, output: true)
deletedAt DateTime?
@@map("hooks")
@@map("web_hooks")
}