Skip to content

Commit

Permalink
feat Create session functionality & design
Browse files Browse the repository at this point in the history
  • Loading branch information
NTElissa committed Nov 28, 2023
1 parent 626dc20 commit 8a6a1c9
Show file tree
Hide file tree
Showing 14 changed files with 768 additions and 847 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
coverageThreshold: {
global: {
lines: 80,
functions: 60,
functions: 50,
branches: 60,
statements: 80,
},
Expand Down
57 changes: 57 additions & 0 deletions src/Mutations/session.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { gql } from '@apollo/client';

// Query to get a single session by ID
export const GET_SESSION = gql`
query GetSession($ID: ID!) {
getSession(id: $ID) {
id
Sessionname
description
platform
duration
organizer
}
}
`;

// Query to get a list of all sessions
export const GET_SESSIONS = gql`
query GetSessions {
getAllSessions {
id
Sessionname
description
platform
duration
organizer
}
}
`;

// Mutation to create a new session
export const CREATE_SESSION = gql`
mutation CreateSession($sessionInput: SessionInput) {
createSession(sessionInput: $sessionInput) {
id
Sessionname
description
platform
duration
organizer
}
}
`;

// Mutation to delete a session by ID
export const DELETE_SESSION = gql`
mutation DeleteSession($ID: ID!) {
deleteSession(ID: $ID)
}
`;

// Mutation to edit/update a session by ID
export const EDIT_SESSION = gql`
mutation EditSession($ID: ID!, $editSessionInput: EditSessionInput) {
editSession(id: $ID, editSessionInput: $editSessionInput)
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,92 @@ Array [
</div>
</div>
</div>,
<div
className="h-screen w-screen z-20 bg-black bg-opacity-30 backdrop-blur-sm fixed flex items-center justify-center px-4 top-0 left-0 hidden"
>
<div
className="w-full p-4 pb-8 bg-white rounded-lg dark:bg-dark-bg sm:w-3/4 xl:w-4/12"
>
<div
className="flex flex-wrap items-center justify-center w-full card-title"
>
<h3
className="w-11/12 text-sm font-bold text-center dark:text-white"
>
Drop Trainee
</h3>
<hr
className="w-full my-3 border-b bg-primary"
/>
</div>
<div
className="card-body"
>
<form
className="px-8 py-3"
>
<div
className="mb-4"
>
<label
className="block text-sm font-bold text-gray-700 dark:text-white"
htmlFor="reason"
>
Reason
</label>
<input
className="mt-1 px-3 py-2 w-full border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-primary dark:bg-dark-bg dark:text-white"
id="reason"
name="reason"
onChange={[Function]}
type="text"
value=""
/>
</div>
<div
className="mb-4"
>
<label
className="block text-sm font-bold text-gray-700 dark:text-white"
htmlFor="date"
>
Date
</label>
<input
className="mt-1 px-3 py-2 w-full border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-primary dark:bg-dark-bg dark:text-white"
id="date"
name="date"
readOnly={true}
type="text"
value="2023-11-28"
/>
</div>
<div
className="flex justify-between w-full"
>
<button
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans"
data-testid="dropModel"
disabled={false}
onClick={[Function]}
type="button"
>
Cancel
</button>
<button
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans"
data-testid="dropMemberFromCohort"
disabled={false}
onClick={[Function]}
type="button"
>
Drop Trainee
</button>
</div>
</form>
</div>
</div>
</div>,
<div
className="h-screen w-screen z-20 bg-black bg-opacity-30 backdrop-blur-sm fixed top-0 left-0 flex items-center justify-center px-4 hidden"
>
Expand Down Expand Up @@ -823,7 +909,7 @@ Array [
<h2
className="text-xl font-semibold text-gray-800 dark:text-white "
>
Trainees list
Trainee list
</h2>
<input
className="px-5 py-2 mt-4 font-sans text-xs border border-primary rounded outline-none dark:bg-neutral-600 dark:text-white w-52 md:w-96"
Expand Down Expand Up @@ -944,7 +1030,7 @@ Array [
}
title="Toggle SortBy"
>
View
Status
</th>
<th
className=" thead"
Expand Down Expand Up @@ -1004,7 +1090,7 @@ Array [
className="bg-black text-white rounded-xl px-3"
onClick={[Function]}
>
View
view
</button>
</div>
</td>
Expand All @@ -1018,6 +1104,7 @@ Array [
<span />
<span />
<span />
<span />
</div>
</td>
</tr>
Expand Down
11 changes: 0 additions & 11 deletions src/components/tests/__snapshots__/ProfileCoverpage.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ exports[`<ProfileTabs/> Renders Profile Tabs 1`] = `
className="hidden md:block"
>
Edit
</span>
</span>
<input
Expand Down Expand Up @@ -84,16 +83,6 @@ exports[`<ProfileTabs/> Renders Profile Tabs 1`] = `
strokeLinejoin="round"
/>
</svg>
<span
className=" dark:text-dark-text-fill"
>
<span
className="hidden md:block"
>
Change Picture
</span>
</span>
<input
className="hidden"
data-testid="upload-cover"
Expand Down
56 changes: 10 additions & 46 deletions src/components/tests/__snapshots__/ProfileTabs.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,11 @@ Object {
</svg>
</div>
<div
class="flex py-4 "
class="flex py-4"
>
<svg
aria-hidden="true"
class="w-6 mr-2 dark:text-dark-text-fill"
fill="none"
stroke="currentColor"
stroke-width="2"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<a
rel="noopener noreferrer"
target="_blank"
>
View Resume
</a>
<p>
No Resume uploaded yet
</p>
</div>
</div>
<div
Expand Down Expand Up @@ -451,7 +433,7 @@ Object {
</div>
</div>
</div>
<div
class="h-screen w-screen z-20 bg-black bg-opacity-30 backdrop-blur-sm absolute flex items-center justify-center px-4 top-0 left-0 bottom-0 hidden"
>
Expand Down Expand Up @@ -781,29 +763,11 @@ Object {
</svg>
</div>
<div
class="flex py-4 "
class="flex py-4"
>
<svg
aria-hidden="true"
class="w-6 mr-2 dark:text-dark-text-fill"
fill="none"
stroke="currentColor"
stroke-width="2"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<a
rel="noopener noreferrer"
target="_blank"
>
View Resume
</a>
<p>
No Resume uploaded yet
</p>
</div>
</div>
<div
Expand Down Expand Up @@ -1095,7 +1059,7 @@ Object {
</div>
</div>
</div>
<div
class="h-screen w-screen z-20 bg-black bg-opacity-30 backdrop-blur-sm absolute flex items-center justify-center px-4 top-0 left-0 bottom-0 hidden"
>
Expand Down
4 changes: 3 additions & 1 deletion src/containers/DashRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const ManagersCards = React.lazy(() => import('../components/ManagerCard'));
const CoordinatorCards = React.lazy(
() => import('../components/CoordinatorCard'),
);
const AdminSission = React.lazy(() => import('./admin-dashBoard/Sessions'));



function DashRoutes() {
Expand Down Expand Up @@ -122,7 +124,7 @@ function DashRoutes() {
<Route path="/cohorts" element={<AdminCohorts />} />
<Route path="/phases" element={<AdminPhases />} />
<Route path="/programs" element={<AdminPrograms />} />
<Route path="/sessions" element={<AdminSession />} />
<Route path="/sessions" element={<AdminSission />} />
<Route path="/manage" element={<AdminManageRoles />} />
<Route path="/grading" element={<GradingSystem />} />
<Route
Expand Down
Loading

0 comments on commit 8a6a1c9

Please sign in to comment.