diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml deleted file mode 100644 index 137e34dc7..000000000 --- a/.github/workflows/deploy-production.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Deploy Production -on: - release: - types: [created] - branches: [master] -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} - - name: Built, test, and deploy app - uses: STEM-C/auto/build-test-deploy@v0.7.2 - with: - image_tag: ${{ steps.get_version.outputs.VERSION }} - app_name: casmm - github_token: ${{ secrets.GITHUB_TOKEN }} - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_TOKEN }} - - name: Create Sentry release - uses: getsentry/action-release@v1 - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: engaging-learning-lab-uf - SENTRY_PROJECT: casmm - with: - environment: production diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml deleted file mode 100644 index dad64ed4d..000000000 --- a/.github/workflows/deploy-staging.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Deploy Staging -on: - push: - branches: ['release/v[0-9].[0-9]'] -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF#refs/heads/release/} - - name: Built, test, and deploy app - uses: STEM-C/auto/build-test-deploy@v0.7.2 - with: - image_tag: staging-${{ steps.get_version.outputs.VERSION }} - app_name: casmm-staging - github_token: ${{ secrets.GITHUB_TOKEN }} - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_TOKEN }} diff --git a/.github/workflows/end-review.yml b/.github/workflows/end-review.yml deleted file mode 100644 index 23c89aeeb..000000000 --- a/.github/workflows/end-review.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Delete Review App -on: - pull_request: - branches: [develop] - types: [closed] -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Delete review app - id: app - uses: STEM-C/auto/review@v0.7.2 - with: - base: review - pipeline: ${{ secrets.PIPELINE_ID }} - token: ${{ secrets.HEROKU_TOKEN }} diff --git a/.github/workflows/start-review.yml b/.github/workflows/start-review.yml deleted file mode 100644 index 59cfaba8f..000000000 --- a/.github/workflows/start-review.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Create Review App -on: - pull_request: - branches: [develop] - types: [opened, reopened] -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - name: Create review app - id: app - uses: STEM-C/auto/review@v0.7.2 - with: - base: review - pipeline: ${{ secrets.PIPELINE_ID }} - token: ${{ secrets.HEROKU_TOKEN }} - - name: Import development database - run: ./scripts/init_db.sh - env: - ENVIRONMENT: development - DATABASE_URL: ${{ steps.app.outputs.database_url }} - SCRIPT_PATH: ./scripts - - name: Built, test, and deploy app - uses: STEM-C/auto/build-test-deploy@v0.7.2 - with: - image_tag: ${{ steps.app.outputs.app_name }} - app_name: ${{ steps.app.outputs.app_name }} - github_token: ${{ secrets.GITHUB_TOKEN }} - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_TOKEN }} - - uses: chrnorm/deployment-action@releases/v1 - name: Create GitHub deployment - if: success() - id: deployment - with: - initial_status: 'success' - token: ${{ github.token }} - target_url: https://${{ steps.app.outputs.app_name }}.herokuapp.com - environment: ${{ steps.app.outputs.app_name }} diff --git a/.github/workflows/tag-master.yml b/.github/workflows/tag-master.yml deleted file mode 100644 index 9172abf7a..000000000 --- a/.github/workflows/tag-master.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Tag New Master Release -on: - pull_request: - branches: - - master - types: [closed] -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Tag Master - uses: STEM-C/auto/tag@v0.7.2 - with: - repo_token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/update-review.yml b/.github/workflows/update-review.yml deleted file mode 100644 index 07fb38cc2..000000000 --- a/.github/workflows/update-review.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Update Review App -on: - pull_request: - branches: [develop] - types: [synchronize] -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - name: Get review app name - id: get_name - run: echo ::set-output name=NAME::review-pr-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') - - name: Built, test, and deploy app - uses: STEM-C/auto/build-test-deploy@v0.7.2 - with: - image_tag: ${{ steps.get_name.outputs.NAME }} - app_name: ${{ steps.get_name.outputs.NAME }} - github_token: ${{ secrets.GITHUB_TOKEN }} - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_TOKEN }} diff --git a/.gitignore b/.gitignore index 2b895f211..b1a3efb1d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,7 @@ yarn-error.log* node_modules/ build/ server/public/client/* -!server/public/client/.gitkeep \ No newline at end of file +!server/public/client/.gitkeep + +client/package-lock.json +.github/worflows/ \ No newline at end of file diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index 483a9c42c..000000000 --- a/client/.gitignore +++ /dev/null @@ -1 +0,0 @@ -package-lock.json \ No newline at end of file diff --git a/client/package.json b/client/package.json index 5a7735fa2..de9f341bd 100644 --- a/client/package.json +++ b/client/package.json @@ -2,6 +2,7 @@ "name": "client", "version": "0.1.0", "private": true, + "start": "WATCHPACK_POLLING=true vite", "dependencies": { "@loadable/component": "^5.15.2", "antd": "^4.24.8", diff --git a/client/src/App.jsx b/client/src/App.jsx index 3efe80918..9710631c9 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -7,6 +7,7 @@ import BugReport from './views/BugReport/BugReport'; import ContentCreator from './views/ContentCreator/ContentCreator'; import Home from './views/Home/Home'; import Classroom from './views/Mentor/Classroom/Classroom'; +import Inbox from './views/Mentor/Inbox/inbox'; import Dashboard from './views/Mentor/Dashboard/Dashboard'; import NotFound from './views/NotFound'; import Replay from './views/Replay/Replay'; @@ -87,6 +88,14 @@ const App = () => { } + /> + + + + } /> auth: true, error: 'Unable to retrive classroom workspaces', }); + + export const shareLesson = async (id, add) => + makeRequest({ + method: PUT, + path: `${server}/mentors/${id}`, + auth: true, + data: { + add + }, + error: 'Unable to send lesson', + }); \ No newline at end of file diff --git a/client/src/components/MentorSubHeader/MentorSubHeader.jsx b/client/src/components/MentorSubHeader/MentorSubHeader.jsx index 054d88b81..db986cba7 100644 --- a/client/src/components/MentorSubHeader/MentorSubHeader.jsx +++ b/client/src/components/MentorSubHeader/MentorSubHeader.jsx @@ -24,6 +24,7 @@ export default function MentorSubHeader(props) { + ) : null} {addUserActive ? ( -
Welcome {user.username}
+
Welcome {user.username} hello
+

hello

@@ -64,4 +65,4 @@ export default function Dashboard() {
); -} +} \ No newline at end of file diff --git a/client/src/views/Home/HomeJoin.jsx b/client/src/views/Home/HomeJoin.jsx index a262149e4..7d120eed5 100644 --- a/client/src/views/Home/HomeJoin.jsx +++ b/client/src/views/Home/HomeJoin.jsx @@ -30,12 +30,14 @@ export default function HomeJoin(props) { if (e.key === 'Enter') handleLogin(); }} > + setJoinCode(e.target.value)} /> + + + + + + + ); diff --git a/client/src/views/Mentor/Classroom/Home/Home.jsx b/client/src/views/Mentor/Classroom/Home/Home.jsx index a51c87a1f..83abec932 100644 --- a/client/src/views/Mentor/Classroom/Home/Home.jsx +++ b/client/src/views/Mentor/Classroom/Home/Home.jsx @@ -6,6 +6,7 @@ import { getLessonModuleActivities, } from '../../../../Utils/requests'; import MentorSubHeader from '../../../../components/MentorSubHeader/MentorSubHeader'; +import '../../Dashboard/Dashboard.less' import DisplayCodeModal from './DisplayCodeModal'; import MentorActivityDetailModal from './MentorActivityDetailModal'; import LessonModuleModal from './LessonModuleSelect/LessonModuleModal'; @@ -17,7 +18,6 @@ export default function Home({ classroomId, viewing }) { const [activities, setActivities] = useState([]); const [gradeId, setGradeId] = useState(null); const [activeLessonModule, setActiveLessonModule] = useState(null); - const [activityDetailsVisible, setActivityDetailsVisible] = useState(false) const navigate = useNavigate(); const SCIENCE = 1; @@ -32,7 +32,7 @@ export default function Home({ classroomId, viewing }) { setClassroom(classroom); setGradeId(classroom.grade.id); classroom.selections.forEach(async (selection) => { - if (selection.current) { + if (selection.current ) { const lsRes = await getLessonModule( selection.lesson_module ); @@ -53,6 +53,7 @@ export default function Home({ classroomId, viewing }) { }; fetchData(); }, [classroomId]); + const handleViewActivity = (activity, name) => { activity.lesson_module_name = name; @@ -102,6 +103,7 @@ export default function Home({ classroomId, viewing }) {

{`Learning Standard - ${activeLessonModule.name}`}

{ + setActivityName(''); + setDescription(''); + setStandards(''); + setTable(''); + setClassroomMaterials([]); + setStudentMaterials([]); + setArduinoComponents([]); + }; + + //all the fields of an activity +const AddActivity = ({ visible, onCancel, setUpdatedActivities }) => { + const [activityName, setActivityName] = useState(''); + const [descriptionName, setDescription] = useState(''); + const [standardsName, setStandards] = useState(''); + const [tableName, setTable] = useState(''); + const [classroomMaterialsTag, setClassroomMaterials] = useState([]); + const [studentMaterialsTag, setStudentMaterials] = useState([]); + const [arduinoComponentsTag, setArduinoComponents] = useState([]); + //add more if needed + + const handleOk = async () => { + // Check if required fields are filled + if (!activityName) { + message.error('Please enter an activity name'); + return; + } + // Call the API to create a new activity + const res = await createActivity({ + name: activityName, + description: descriptionName, + standards: standardsName, + tablechart: tableName, + ClassroomMaterials: classroomMaterialsTag, + studentMaterials: studentMaterialsTag, + arduinoComponents: arduinoComponentsTag, + }); + + if (res.data) { //successful creation + message.success(`Activity '${activityName}' created successfully`); + setUpdatedActivities(true); + onCancel(); + resetFormFields( + setActivityName, + setDescription, + setStandards, + setTable, + setClassroomMaterials, + setStudentMaterials, + setArduinoComponents + ); + } else { + message.error(`Failed to create activity: ${res.err}`); + } + }; + + + return ( + {onCancel(); + resetFormFields( + setActivityName, + setDescription, + setStandards, + setTable, + setClassroomMaterials, + setStudentMaterials, + setArduinoComponents + );}} + footer={[ + , + , + ]} + > +
+

Enter Activity Name:

+ setActivityName(e.target.value)} + className="form-input" + /> +
+
+

Enter Description:

+