diff --git a/my-app/package-lock.json b/my-app/package-lock.json index a5f489c..e109eb4 100644 --- a/my-app/package-lock.json +++ b/my-app/package-lock.json @@ -16,7 +16,7 @@ "@fortawesome/free-brands-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/react-fontawesome": "^0.2.2", - "@prisma/client": "^5.14.0", + "@prisma/client": "^5.16.1", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", @@ -28,6 +28,7 @@ "chokidar": "^3.6.0", "dotenv": "^16.4.5", "next": "14.2.3", + "prisma": "^5.16.1", "react": "^18", "react-dom": "^18", "react-router-dom": "^6.23.1", @@ -2022,9 +2023,9 @@ } }, "node_modules/@prisma/client": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.14.0.tgz", - "integrity": "sha512-akMSuyvLKeoU4LeyBAUdThP/uhVP3GuLygFE3MlYzaCb3/J8SfsYBE5PkaFuLuVpLyA6sFoW+16z/aPhNAESqg==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.16.1.tgz", + "integrity": "sha512-wM9SKQjF0qLxdnOZIVAIMKiz6Hu7vDt4FFAih85K1dk/Rr2mdahy6d3QP41K62N9O0DJJA//gUDA3Mp49xsKIg==", "hasInstallScript": true, "engines": { "node": ">=16.13" @@ -2038,6 +2039,46 @@ } } }, + "node_modules/@prisma/debug": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.16.1.tgz", + "integrity": "sha512-JsNgZAg6BD9RInLSrg7ZYzo11N7cVvYArq3fHGSD89HSgtN0VDdjV6bib7YddbcO6snzjchTiLfjeTqBjtArVQ==" + }, + "node_modules/@prisma/engines": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.16.1.tgz", + "integrity": "sha512-KkyF3eIUtBIyp5A/rJHCtwQO18OjpGgx18PzjyGcJDY/+vNgaVyuVd+TgwBgeq6NLdd1XMwRCI+58vinHsAdfA==", + "hasInstallScript": true, + "dependencies": { + "@prisma/debug": "5.16.1", + "@prisma/engines-version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "@prisma/fetch-engine": "5.16.1", + "@prisma/get-platform": "5.16.1" + } + }, + "node_modules/@prisma/engines-version": { + "version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303.tgz", + "integrity": "sha512-HkT2WbfmFZ9WUPyuJHhkiADxazHg8Y4gByrTSVeb3OikP6tjQ7txtSUGu9OBOBH0C13dPKN2qqH12xKtHu/Hiw==" + }, + "node_modules/@prisma/fetch-engine": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.16.1.tgz", + "integrity": "sha512-oOkjaPU1lhcA/Rvr4GVfd1NLJBwExgNBE36Ueq7dr71kTMwy++a3U3oLd2ZwrV9dj9xoP6LjCcky799D9nEt4w==", + "dependencies": { + "@prisma/debug": "5.16.1", + "@prisma/engines-version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "@prisma/get-platform": "5.16.1" + } + }, + "node_modules/@prisma/get-platform": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.16.1.tgz", + "integrity": "sha512-R4IKnWnMkR2nUAbU5gjrPehdQYUUd7RENFD2/D+xXTNhcqczp0N+WEGQ3ViyI3+6mtVcjjNIMdnUTNyu3GxIgA==", + "dependencies": { + "@prisma/debug": "5.16.1" + } + }, "node_modules/@radix-ui/colors": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@radix-ui/colors/-/colors-3.0.0.tgz", @@ -11598,6 +11639,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/prisma": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.16.1.tgz", + "integrity": "sha512-Z1Uqodk44diztImxALgJJfNl2Uisl9xDRvqybMKEBYJLNKNhDfAHf+ZIJbZyYiBhLMbKU9cYGdDVG5IIXEnL2Q==", + "hasInstallScript": true, + "dependencies": { + "@prisma/engines": "5.16.1" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", diff --git a/my-app/package.json b/my-app/package.json index 0bbf239..cd73a74 100644 --- a/my-app/package.json +++ b/my-app/package.json @@ -17,7 +17,7 @@ "@fortawesome/free-brands-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/react-fontawesome": "^0.2.2", - "@prisma/client": "^5.14.0", + "@prisma/client": "^5.16.1", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", @@ -29,6 +29,7 @@ "chokidar": "^3.6.0", "dotenv": "^16.4.5", "next": "14.2.3", + "prisma": "^5.16.1", "react": "^18", "react-dom": "^18", "react-router-dom": "^6.23.1", diff --git a/my-app/prisma/migrations/20240528233831_schema_migration/migration.sql b/my-app/prisma/migrations/20240528233831_schema_migration/migration.sql deleted file mode 100644 index f606e1a..0000000 --- a/my-app/prisma/migrations/20240528233831_schema_migration/migration.sql +++ /dev/null @@ -1,19 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[detail]` on the table `Experience` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[scale_type]` on the table `Scale` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[detail]` on the table `Scale` will be added. If there are existing duplicate values, this will fail. - -*/ --- DropIndex -DROP INDEX "Architect_experience_id_key"; - --- CreateIndex -CREATE UNIQUE INDEX "Experience_detail_key" ON "Experience"("detail"); - --- CreateIndex -CREATE UNIQUE INDEX "Scale_scale_type_key" ON "Scale"("scale_type"); - --- CreateIndex -CREATE UNIQUE INDEX "Scale_detail_key" ON "Scale"("detail"); diff --git a/my-app/prisma/migrations/20240605051404_new_column/migration.sql b/my-app/prisma/migrations/20240605051404_new_column/migration.sql deleted file mode 100644 index 090cae1..0000000 --- a/my-app/prisma/migrations/20240605051404_new_column/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Architect" ADD COLUMN "social_type" TEXT; diff --git a/my-app/prisma/migrations/20240606013557_new_model/migration.sql b/my-app/prisma/migrations/20240606013557_new_model/migration.sql deleted file mode 100644 index 8f236eb..0000000 --- a/my-app/prisma/migrations/20240606013557_new_model/migration.sql +++ /dev/null @@ -1,23 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `social_media` on the `Architect` table. All the data in the column will be lost. - - You are about to drop the column `social_type` on the `Architect` table. All the data in the column will be lost. - -*/ --- AlterTable -ALTER TABLE "Architect" DROP COLUMN "social_media", -DROP COLUMN "social_type"; - --- CreateTable -CREATE TABLE "ArchitectNetworks" ( - "id" SERIAL NOT NULL, - "architect_id" INTEGER NOT NULL, - "social_type" TEXT NOT NULL, - "social_media" TEXT NOT NULL, - - CONSTRAINT "ArchitectNetworks_pkey" PRIMARY KEY ("id") -); - --- AddForeignKey -ALTER TABLE "ArchitectNetworks" ADD CONSTRAINT "ArchitectNetworks_architect_id_fkey" FOREIGN KEY ("architect_id") REFERENCES "Architect"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/my-app/prisma/migrations/20240528010626_schema_migration/migration.sql b/my-app/prisma/migrations/20240709040543_init/migration.sql similarity index 74% rename from my-app/prisma/migrations/20240528010626_schema_migration/migration.sql rename to my-app/prisma/migrations/20240709040543_init/migration.sql index 41cc6d6..c2467b1 100644 --- a/my-app/prisma/migrations/20240528010626_schema_migration/migration.sql +++ b/my-app/prisma/migrations/20240709040543_init/migration.sql @@ -7,12 +7,22 @@ CREATE TABLE "Architect" ( "city" TEXT NOT NULL, "address" TEXT, "website" TEXT, - "social_media" TEXT, + "description" TEXT, "experience_id" INTEGER NOT NULL, CONSTRAINT "Architect_pkey" PRIMARY KEY ("id") ); +-- CreateTable +CREATE TABLE "ArchitectNetworks" ( + "id" SERIAL NOT NULL, + "architect_id" INTEGER NOT NULL, + "social_type" TEXT NOT NULL, + "social_media" TEXT NOT NULL, + + CONSTRAINT "ArchitectNetworks_pkey" PRIMARY KEY ("id") +); + -- CreateTable CREATE TABLE "Experience" ( "id" SERIAL NOT NULL, @@ -57,11 +67,20 @@ CREATE UNIQUE INDEX "Architect_phone_key" ON "Architect"("phone"); CREATE UNIQUE INDEX "Architect_name_key" ON "Architect"("name"); -- CreateIndex -CREATE UNIQUE INDEX "Architect_experience_id_key" ON "Architect"("experience_id"); +CREATE UNIQUE INDEX "Experience_detail_key" ON "Experience"("detail"); + +-- CreateIndex +CREATE UNIQUE INDEX "Scale_scale_type_key" ON "Scale"("scale_type"); + +-- CreateIndex +CREATE UNIQUE INDEX "Scale_detail_key" ON "Scale"("detail"); -- AddForeignKey ALTER TABLE "Architect" ADD CONSTRAINT "Architect_experience_id_fkey" FOREIGN KEY ("experience_id") REFERENCES "Experience"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +-- AddForeignKey +ALTER TABLE "ArchitectNetworks" ADD CONSTRAINT "ArchitectNetworks_architect_id_fkey" FOREIGN KEY ("architect_id") REFERENCES "Architect"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + -- AddForeignKey ALTER TABLE "ArchitectScales" ADD CONSTRAINT "ArchitectScales_architect_id_fkey" FOREIGN KEY ("architect_id") REFERENCES "Architect"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/my-app/prisma/migrations/20240709043031_deleted_experiences/migration.sql b/my-app/prisma/migrations/20240709043031_deleted_experiences/migration.sql new file mode 100644 index 0000000..5154336 --- /dev/null +++ b/my-app/prisma/migrations/20240709043031_deleted_experiences/migration.sql @@ -0,0 +1,11 @@ +/* + Warnings: + + - You are about to drop the `Experience` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "Architect" DROP CONSTRAINT "Architect_experience_id_fkey"; + +-- DropTable +DROP TABLE "Experience"; diff --git a/my-app/prisma/migrations/20240709044905_deleted_scale_model/migration.sql b/my-app/prisma/migrations/20240709044905_deleted_scale_model/migration.sql new file mode 100644 index 0000000..6a99a14 --- /dev/null +++ b/my-app/prisma/migrations/20240709044905_deleted_scale_model/migration.sql @@ -0,0 +1,11 @@ +/* + Warnings: + + - You are about to drop the `Scale` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "ArchitectScales" DROP CONSTRAINT "ArchitectScales_scale_id_fkey"; + +-- DropTable +DROP TABLE "Scale"; diff --git a/my-app/prisma/schema.prisma b/my-app/prisma/schema.prisma index 4837f16..f749a44 100644 --- a/my-app/prisma/schema.prisma +++ b/my-app/prisma/schema.prisma @@ -1,9 +1,3 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? -// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init - generator client { provider = "prisma-client-js" } @@ -14,55 +8,41 @@ datasource db { } model Architect { - id Int @id @default(autoincrement()) - email String @unique - phone String @unique - name String @unique + id Int @id @default(autoincrement()) + email String @unique + phone String @unique + name String @unique city String - address String? + description String? + address String? website String? experience_id Int - experience Experience @relation(fields: [experience_id], references: [id]) + networks ArchitectNetworks[] scales ArchitectScales[] images Image[] - networks ArchitectNetworks[] } model ArchitectNetworks { - id Int @id @default(autoincrement()) - architect_id Int - social_type String - social_media String - architect Architect @relation(fields: [architect_id], references: [id]) + id Int @id @default(autoincrement()) + architect_id Int + social_type String + social_media String + architect Architect @relation(fields: [architect_id], references: [id]) } -model Experience { - id Int @id @default(autoincrement()) - detail String @unique - - architect Architect[] -} - -model Scale { - id Int @id @default(autoincrement()) - scale_type String @unique - detail String @unique - architectScales ArchitectScales[] -} model ArchitectScales { - architect_id Int - scale_id Int - architect Architect @relation(fields: [architect_id], references: [id]) - scale Scale @relation(fields: [scale_id], references: [id]) + architect_id Int + scale_id Int + architect Architect @relation(fields: [architect_id], references: [id]) @@id([architect_id, scale_id]) } model Image { - id Int @id @default(autoincrement()) - url String - architect_id Int - architect Architect @relation(fields: [architect_id], references: [id]) -} \ No newline at end of file + id Int @id @default(autoincrement()) + url String + architect_id Int + architect Architect @relation(fields: [architect_id], references: [id]) +} diff --git a/my-app/src/app/profile.css b/my-app/src/app/profile.css index d8f9bd3..7ec22cb 100644 --- a/my-app/src/app/profile.css +++ b/my-app/src/app/profile.css @@ -185,3 +185,11 @@ border-width: 1px; border-color: grey; } + +.descriptionContainer{ + max-width: 40vh; + max-height: 80%; + text-align: center; + font-style: italic; + font-size: 0.85rem; +} diff --git a/my-app/src/app/styles.css b/my-app/src/app/styles.css index 5652011..3b1daf9 100644 --- a/my-app/src/app/styles.css +++ b/my-app/src/app/styles.css @@ -234,4 +234,26 @@ height: 13vh; height: 13vh; object-fit: cover; border-radius: 5px; - } \ No newline at end of file + } + + + +.descriptionInput{ + height: 30rem; + width: 15rem; + text-align: center; +} + +textarea:focus { + outline: none; + border: none +} + +.descriptionInputEdit{ + margin-left: auto; + width: clamp(200px, 30vw, 300px); + max-height: 7rem; + border-bottom: 1px solid gray; + text-align: center; + font-size: 0.8rem; +} \ No newline at end of file diff --git a/my-app/src/components/form/description_form.tsx b/my-app/src/components/form/description_form.tsx new file mode 100644 index 0000000..33354c8 --- /dev/null +++ b/my-app/src/components/form/description_form.tsx @@ -0,0 +1,23 @@ +import React, { useState } from "react"; + +export default function DescriptionForm({ + description, + setDescription,}: + { onNext: () => void, onBack: () => void, description: string, setDescription: (description: string) => void}) { + + return( +