Skip to content

125 create semester course components #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5716400
semester and course components. no functionality yet
nbottari9 Apr 8, 2024
6e8a7bf
started adding interactivity to semester and course components. creat…
nbottari9 Apr 10, 2024
de83a8f
Merge branch 'main' into 125-create-semester-course-components
nbottari9 Apr 18, 2024
4aaca92
fixing type errors
nbottari9 Apr 18, 2024
388cbed
Merge branch '125-create-semester-course-components' of https://githu…
nbottari9 Apr 18, 2024
3c53468
fixing more errors
nbottari9 Apr 18, 2024
36ca72e
fixing amplify errors
nbottari9 Apr 18, 2024
99b1cbb
trying more stuff
nbottari9 Apr 18, 2024
9a99ab9
rewrote semester components with grid v2 and moved away from using ta…
nbottari9 May 25, 2024
c44591c
reworked some stuff and finally figured out the bug in the drag drop …
nbottari9 May 27, 2024
373b6d6
fixed dark mode styling issues + spacing in semester footer
nbottari9 May 27, 2024
964e93c
debugging
nbottari9 May 31, 2024
6e95ec7
update nextg config to turn off strict mode
nbottari9 May 31, 2024
28e1b2e
finally fixed dnd bug. it now fully works!
nbottari9 Jun 4, 2024
b0ee434
implenting amplify data
nbottari9 Jun 4, 2024
9db6552
gonna have to wait on the data fetching. it seems like there is a bug…
nbottari9 Jun 4, 2024
98948fc
starting to add more interactivity to semesters
nbottari9 Jun 8, 2024
55e33c9
Merge branch 'main' into 125-create-semester-course-components
nbottari9 Jun 8, 2024
4bf50ff
fix::left in unimplemented code
nbottari9 Jun 8, 2024
32f738b
fix::type errors
nbottari9 Jun 8, 2024
26a5244
fix:: getting random nextjs errors
nbottari9 Jun 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 47 additions & 38 deletions amplify/data/resource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ClientSchema, a, defineData } from '@aws-amplify/backend';
import { type ClientSchema, a, defineData } from "@aws-amplify/backend";

/*== STEP 1 ===============================================================
The section below creates a Todo database table with a "content" field. Try
Expand All @@ -8,49 +8,58 @@ specify that owners, authenticated via your Auth resource can "create",
authenticated via an API key, can only "read" records.
=========================================================================*/
const schema = a.schema({
Organization: a.model({
name: a.string(),
courses: a.hasMany('Course'),
pathways: a.hasMany('Pathway'),
admins: a.hasMany('User')
}).authorization([a.allow.owner(), a.allow.public().to(['read'])]),
User: a.model({
name: a.string(),
courses: a.hasMany('Course'),
pathways: a.hasMany('Pathway')
}).authorization([a.allow.owner(), a.allow.public().to(['read'])]),
Course: a.model({
name: a.string(),
code: a.string(),
credits: a.integer(),
grade: a.string()
}).authorization([a.allow.owner(), a.allow.public().to(['read'])]),
Pathway: a.model({
name: a.string(),
degree: a.string(),
yog: a.string(),
institution: a.string(),
degreeLevel: a.string(),
semesters: a.hasMany('Semester')
}).authorization([a.allow.owner(), a.allow.public().to(['read'])]),
Semester: a.model({
name: a.string(),
courses: a.hasMany('Course')
}).authorization([a.allow.owner(), a.allow.public().to(['read'])])
Organization: a
.model({
name: a.string(),
courses: a.hasMany("Course"),
pathways: a.hasMany("Pathway"),
admins: a.hasMany("User"),
})
.authorization([a.allow.owner(), a.allow.public().to(["read"])]),
User: a
.model({
name: a.string(),
courses: a.hasMany("Course"),
pathways: a.hasMany("Pathway"),
})
.authorization([a.allow.owner(), a.allow.public().to(["read"])]),
Course: a
.model({
name: a.string(),
code: a.string(),
credits: a.integer(),
grade: a.string(),
})
.authorization([a.allow.owner(), a.allow.public().to(["read"])]),
Pathway: a
.model({
name: a.string(),
degree: a.string(),
yog: a.string(),
institution: a.string(),
degreeLevel: a.string(),
semesters: a.hasMany("Semester"),
})
.authorization([a.allow.owner(), a.allow.public().to(["read"])]),
Semester: a
.model({
name: a.string(),
courses: a.hasMany("Course"),
})
.authorization([a.allow.owner(), a.allow.public().to(["read"])]),
});


export type Schema = ClientSchema<typeof schema>;

export const data = defineData({
schema,
authorizationModes: {
defaultAuthorizationMode: 'apiKey',
// API Key is used for a.allow.public() rules
apiKeyAuthorizationMode: {
expiresInDays: 30,
},
schema,
authorizationModes: {
defaultAuthorizationMode: "apiKey",
// API Key is used for a.allow.public() rules
apiKeyAuthorizationMode: {
expiresInDays: 30,
},
},
});

/*== STEP 2 ===============================================================
Expand Down
39 changes: 19 additions & 20 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
modularizeImports: {
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'source.unsplash.com',
port: '',
pathname: '/random',
},
],
reactStrictMode: false,
swcMinify: true,
modularizeImports: {
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
};

module.exports = nextConfig;

},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'source.unsplash.com',
port: '',
pathname: '/random',
},
],
},
};

module.exports = nextConfig;
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
"@aws-amplify/adapter-nextjs": "^1.0.21",
"@aws-amplify/cli": "^12.7.1",
"@aws-amplify/ui-react": "^6.0.3",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@hello-pangea/dnd": "^16.6.0",
"@mui/icons-material": "^5.14.18",
"@mui/material": "^5.14.18",
"@mui/material-nextjs": "^5.15.7",
Expand All @@ -31,6 +34,7 @@
"@aws-amplify/backend-cli": "^0.10.0",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "^18",
"aws-cdk": "^2.126.0",
"aws-cdk-lib": "^2.126.0",
Expand Down
6 changes: 4 additions & 2 deletions src/app/(auth)/layout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// React
import React from 'react';
import React, { Suspense } from 'react';

// Material UI
import Box from '@mui/material/Box';
Expand All @@ -17,7 +17,9 @@ export default function AuthLayout({ children }) {
p: 3,
}}
>
{children}
<Suspense>
{children}
</Suspense>
</Box>
);
}
4 changes: 3 additions & 1 deletion src/app/(home)/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ export default function Layout({ children }) {
/>

{/* Children */}
<Box sx={{ mt: "3.5em", mb: "3em", overflow: "auto !important", height: "94%", width: "100%" }}>{children}</Box>

<Box sx={{ mt: "3.5em", mb: "3em", height: "94%", width: "100%" }}>{children}</Box>

</Box>
<BottomNavigation />
</Box>
Expand Down
Loading
Loading