Skip to content
Snippets Groups Projects
Commit fa16ac91 authored by stevenchenwaiho@gmail.com's avatar stevenchenwaiho@gmail.com
Browse files

Change Schema and add Navbar to studentApplication

parent fc4be03a
No related branches found
No related tags found
6 merge requests!65Master,!50Change navigation buttons to reflect user feedback,!49Master,!47fix profuction sort button flickering issue,!43Recruiter: Add staring and evidence ;Student: add Dashboard Timeline; Add univseral navbar,!37Change Schema and add Navbar to studentApplication
Pipeline #423698 failed
......@@ -20,7 +20,6 @@
"react": "^18.2.0",
"react-bootstrap": "^2.7.4",
"react-dom": "^18.2.0",
"react-vertical-timeline-component": "^3.6.0",
"vertical-timeline-component-react": "^4.4.1"
},
"devDependencies": {
......
-- CreateTable
CREATE TABLE "Requirement" (
"postID" INTEGER NOT NULL,
"id" SERIAL NOT NULL,
CONSTRAINT "Requirement_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Requirement" ADD CONSTRAINT "Requirement_postID_fkey" FOREIGN KEY ("postID") REFERENCES "Post"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
/*
Warnings:
- Added the required column `requirementText` to the `Requirement` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Requirement" ADD COLUMN "requirementText" TEXT NOT NULL;
-- CreateTable
CREATE TABLE "Evidence" (
"postID" INTEGER NOT NULL,
"stdID" INTEGER NOT NULL,
"reqID" INTEGER NOT NULL,
"rating" INTEGER NOT NULL,
"evidenceText" TEXT NOT NULL,
CONSTRAINT "Evidence_pkey" PRIMARY KEY ("postID","reqID","stdID")
);
-- AddForeignKey
ALTER TABLE "Evidence" ADD CONSTRAINT "Evidence_postID_stdID_fkey" FOREIGN KEY ("postID", "stdID") REFERENCES "Application"("postID", "studentID") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Evidence" ADD CONSTRAINT "Evidence_reqID_fkey" FOREIGN KEY ("reqID") REFERENCES "Requirement"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
/*
Warnings:
- The primary key for the `Evidence` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `reqID` on the `Evidence` table. All the data in the column will be lost.
- You are about to drop the column `stdID` on the `Evidence` table. All the data in the column will be lost.
- The primary key for the `Requirement` table will be changed. If it partially fails, the table could be left without primary key constraint.
- Added the required column `requirementID` to the `Evidence` table without a default value. This is not possible if the table is not empty.
- Added the required column `studentID` to the `Evidence` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "Evidence" DROP CONSTRAINT "Evidence_postID_stdID_fkey";
-- DropForeignKey
ALTER TABLE "Evidence" DROP CONSTRAINT "Evidence_reqID_fkey";
-- AlterTable
ALTER TABLE "Evidence" DROP CONSTRAINT "Evidence_pkey",
DROP COLUMN "reqID",
DROP COLUMN "stdID",
ADD COLUMN "requirementID" INTEGER NOT NULL,
ADD COLUMN "studentID" INTEGER NOT NULL,
ADD CONSTRAINT "Evidence_pkey" PRIMARY KEY ("postID", "requirementID", "studentID");
-- AlterTable
ALTER TABLE "Requirement" DROP CONSTRAINT "Requirement_pkey",
ADD CONSTRAINT "Requirement_pkey" PRIMARY KEY ("postID", "id");
-- AddForeignKey
ALTER TABLE "Evidence" ADD CONSTRAINT "Evidence_postID_studentID_fkey" FOREIGN KEY ("postID", "studentID") REFERENCES "Application"("postID", "studentID") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Evidence" ADD CONSTRAINT "Evidence_postID_requirementID_fkey" FOREIGN KEY ("postID", "requirementID") REFERENCES "Requirement"("postID", "id") ON DELETE RESTRICT ON UPDATE CASCADE;
......@@ -16,7 +16,7 @@ model Student {
name String
language String
maths String
Application Application[]
applications Application[]
}
model Post {
......@@ -25,13 +25,38 @@ model Post {
status String
totalPlaces Int
applications Application[]
requirements Requirement[]
}
model Application {
post Post @relation(fields: [postID], references: [id])
postID Int
student Student @relation(fields: [studentID], references: [id])
studentID Int
post Post @relation(fields: [postID], references: [id])
postID Int
student Student @relation(fields: [studentID], references: [id])
studentID Int
evidences Evidence[]
@@id([postID, studentID])
}
model Requirement {
post Post @relation(fields: [postID], references: [id])
postID Int
id Int @default(autoincrement())
requirementText String
evidences Evidence[]
@@id([postID, id])
}
model Evidence {
app Application @relation(fields: [postID, studentID], references: [postID, studentID])
postID Int
studentID Int
requirement Requirement @relation(fields: [postID, requirementID], references: [postID, id])
requirementID Int
rating Int
evidenceText String
@@id([postID, requirementID, studentID])
}
......@@ -4,7 +4,10 @@ import Accordion from 'react-bootstrap/Accordion';
import Form from 'react-bootstrap/Form';
import Nav from 'react-bootstrap/Nav';
import Button from 'react-bootstrap/Button';
import Container from "react-bootstrap/Container";
import { useEffect, useState, useRef } from 'react';
import StudentNavbar from "../studentNavbar";
import { Card } from "react-bootstrap";
function StudentApplication() {
const langRef = useRef();
......@@ -33,17 +36,14 @@ function StudentApplication() {
return (
<main className="studentApplication">
<Nav fill className="justify-content-center" activeKey="/home">
<Nav.Item>
<h6>3 Requirements Matched </h6>
</Nav.Item>
<Nav.Item>
<h4>Your Application </h4>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="link-2">Upload CV</Nav.Link>
</Nav.Item>
</Nav>
<StudentNavbar></StudentNavbar>
<Container style={{ height: "80vh" }}>
<Card className="mt-4 h-100">
<Card.Header className="d-flex justify-content-between">
<Button>Filter</Button>
<h4>IT Intern</h4>
<Button>Upload CV</Button>
</Card.Header>
<Form onSubmit={handleSubmit}>
<Accordion defaultActiveKey={['0']} alwaysOpen>
......@@ -67,7 +67,10 @@ function StudentApplication() {
<Button variant="primary" type="submit">
Submit
</Button>
</Form>
</Form>
</Card>
</Container>
</main>
);
}
......
......@@ -8,8 +8,8 @@ studentDashboard {
}
.progressTimeline {
background-color: lightgrey;
margin-top: 30px;
background-color: lightgrey !important;
margin-top: 30px !important;
padding-left: 30px;
padding-right: 30px;
padding-top: 0px;
......
......@@ -17,7 +17,7 @@ function StudentNavbar() {
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="me-auto">
<Nav.Link href="/">Home</Nav.Link>
<Nav.Link href="./studentDashboard">Dashboard</Nav.Link>
</Nav>
</Navbar.Collapse>
</Container>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment