diff --git a/src/commons/application/ApplicationTypes.ts b/src/commons/application/ApplicationTypes.ts index 9aad11f2db..fe9393a1df 100644 --- a/src/commons/application/ApplicationTypes.ts +++ b/src/commons/application/ApplicationTypes.ts @@ -405,19 +405,6 @@ export const defaultWorkspaceManager: WorkspaceManagerState = { currentQuestion: undefined, hasUnsavedChanges: false }, - teamFormation: { - ...createDefaultWorkspace('teamFormation'), - teamFormationTableFilters: { - columnFilters: [], - globalFilter: null - } - }, - groundControl: { - ...createDefaultWorkspace('groundControl'), - GroundControlTableFilters: { - columnFilters: [] - } - }, playground: { ...createDefaultWorkspace('playground'), usingSubst: false, @@ -554,8 +541,6 @@ export const defaultSideContentManager: SideContentManagerState = { assessment: defaultSideContent, grading: defaultSideContent, playground: defaultSideContent, - groundControl: defaultSideContent, - teamFormation: defaultSideContent, sicp: defaultSideContent, sourcecast: defaultSideContent, sourcereel: defaultSideContent, diff --git a/src/commons/workspace/WorkspaceActions.ts b/src/commons/workspace/WorkspaceActions.ts index 00df1326f4..0968bab4fd 100644 --- a/src/commons/workspace/WorkspaceActions.ts +++ b/src/commons/workspace/WorkspaceActions.ts @@ -34,7 +34,6 @@ import { EVAL_EDITOR_AND_TESTCASES, EVAL_REPL, EVAL_TESTCASE, - GroundControlTableFilters, MOVE_CURSOR, NAV_DECLARATION, PLAYGROUND_EXTERNAL_SELECT, @@ -51,7 +50,6 @@ import { SET_TOKEN_COUNT, SHIFT_EDITOR_TAB, SubmissionsTableFilters, - TeamFormationsTableFilters, TOGGLE_EDITOR_AUTORUN, TOGGLE_FOLDER_MODE, TOGGLE_UPDATE_CSE, @@ -65,7 +63,6 @@ import { UPDATE_CURRENTSTEP, UPDATE_EDITOR_BREAKPOINTS, UPDATE_EDITOR_VALUE, - UPDATE_GROUND_CONTROL_TABLE_FILTERS, UPDATE_HAS_UNSAVED_CHANGES, UPDATE_LAST_DEBUGGER_RESULT, UPDATE_LAST_NON_DET_RESULT, @@ -73,7 +70,6 @@ import { UPDATE_STEPSTOTAL, UPDATE_SUBLANGUAGE, UPDATE_SUBMISSIONS_TABLE_FILTERS, - UPDATE_TEAM_FORMATIONS_TABLE_FILTERS, UPDATE_WORKSPACE, WorkspaceLocation, WorkspaceLocationsWithTools, @@ -404,16 +400,6 @@ export const updateSubmissionsTableFilters = createAction( (filters: SubmissionsTableFilters) => ({ payload: { filters } }) ); -export const updateTeamFormationsTableFilters = createAction( - UPDATE_TEAM_FORMATIONS_TABLE_FILTERS, - (filters: TeamFormationsTableFilters) => ({ payload: { filters } }) -); - -export const updateGroundControlTableFilters = createAction( - UPDATE_GROUND_CONTROL_TABLE_FILTERS, - (filters: GroundControlTableFilters) => ({ payload: { filters } }) -); - export const updateCurrentAssessmentId = createAction( UPDATE_CURRENT_ASSESSMENT_ID, (assessmentId: number, questionId: number) => ({ payload: { assessmentId, questionId } }) diff --git a/src/commons/workspace/WorkspaceReducer.ts b/src/commons/workspace/WorkspaceReducer.ts index a9bd133761..40e341b480 100644 --- a/src/commons/workspace/WorkspaceReducer.ts +++ b/src/commons/workspace/WorkspaceReducer.ts @@ -89,7 +89,6 @@ import { UPDATE_STEPSTOTAL, UPDATE_SUBLANGUAGE, UPDATE_SUBMISSIONS_TABLE_FILTERS, - UPDATE_TEAM_FORMATIONS_TABLE_FILTERS, UPDATE_WORKSPACE, WorkspaceLocation, WorkspaceManagerState @@ -627,14 +626,6 @@ const oldWorkspaceReducer: Reducer = ( submissionsTableFilters: action.payload.filters } }; - case UPDATE_TEAM_FORMATIONS_TABLE_FILTERS: - return { - ...state, - teamFormation: { - ...state.teamFormation, - teamFormationTableFilters: action.payload.filters - } - }; case UPDATE_CURRENT_ASSESSMENT_ID: return { ...state, diff --git a/src/commons/workspace/WorkspaceTypes.ts b/src/commons/workspace/WorkspaceTypes.ts index 7656f6fc67..f2d4397a2f 100644 --- a/src/commons/workspace/WorkspaceTypes.ts +++ b/src/commons/workspace/WorkspaceTypes.ts @@ -39,8 +39,6 @@ export const TOGGLE_USING_SUBST = 'TOGGLE_USING_SUBST'; export const TOGGLE_USING_CSE = 'TOGGLE_USING_CSE'; export const TOGGLE_UPDATE_CSE = 'TOGGLE_UPDATE_CSE'; export const UPDATE_SUBMISSIONS_TABLE_FILTERS = 'UPDATE_SUBMISSIONS_TABLE_FILTERS'; -export const UPDATE_TEAM_FORMATIONS_TABLE_FILTERS = 'UPDATE_TEAM_FORMATIONS_TABLE_FILTERS'; -export const UPDATE_GROUND_CONTROL_TABLE_FILTERS = 'UPDATE_GROUND_CONTROL_TABLE_FILTERS'; export const UPDATE_CURRENT_ASSESSMENT_ID = 'UPDATE_CURRENT_ASSESSMENT_ID'; export const UPDATE_CURRENT_SUBMISSION_ID = 'UPDATE_CURRENT_SUBMISSION_ID'; export const TOGGLE_FOLDER_MODE = 'TOGGLE_FOLDER_MODE'; @@ -84,19 +82,8 @@ type GradingWorkspaceAttr = { readonly hasUnsavedChanges: boolean; }; -type TeamFormationWorkspaceAttr = { - readonly teamFormationTableFilters: TeamFormationsTableFilters; -}; - type GradingWorkspaceState = GradingWorkspaceAttr & WorkspaceState; -type TeamFormationWorkspaceState = TeamFormationWorkspaceAttr & WorkspaceState; - -type GroundControlWorkspaceAttr = { - readonly GroundControlTableFilters: GroundControlTableFilters; -}; -type GroundControlWorkspaceState = GroundControlWorkspaceAttr & WorkspaceState; - type PlaygroundWorkspaceAttr = { readonly usingSubst: boolean; readonly usingCse: boolean; @@ -112,8 +99,6 @@ export type SicpWorkspaceState = PlaygroundWorkspaceState; export type WorkspaceManagerState = { readonly assessment: AssessmentWorkspaceState; readonly grading: GradingWorkspaceState; - readonly teamFormation: TeamFormationWorkspaceState; - readonly groundControl: GroundControlWorkspaceState; readonly playground: PlaygroundWorkspaceState; readonly sourcecast: SourcecastWorkspaceState; readonly sourcereel: SourcereelWorkspaceState; @@ -188,7 +173,3 @@ export type TeamFormationsTableFilters = { columnFilters: { id: string; value: unknown }[]; globalFilter: string | null; }; - -export type GroundControlTableFilters = { - columnFilters: { id: string; value: unknown }[]; -}; diff --git a/src/commons/workspace/__tests__/WorkspaceReducer.ts b/src/commons/workspace/__tests__/WorkspaceReducer.ts index f8c2843a03..7620ec2a09 100644 --- a/src/commons/workspace/__tests__/WorkspaceReducer.ts +++ b/src/commons/workspace/__tests__/WorkspaceReducer.ts @@ -116,14 +116,6 @@ function generateDefaultWorkspace(payload: any = {}): WorkspaceManagerState { stories: { ...defaultWorkspaceManager.stories, ...cloneDeep(payload) - }, - teamFormation: { - ...defaultWorkspaceManager.teamFormation, - ...cloneDeep(payload) - }, - groundControl: { - ...defaultWorkspaceManager.groundControl, - ...cloneDeep(payload) } }; } diff --git a/src/pages/academy/groundControl/GroundControl.tsx b/src/pages/academy/groundControl/GroundControl.tsx index d4319429ba..e740c88168 100644 --- a/src/pages/academy/groundControl/GroundControl.tsx +++ b/src/pages/academy/groundControl/GroundControl.tsx @@ -1,47 +1,23 @@ +import 'ag-grid-community/styles/ag-grid.css'; +import 'ag-grid-community/styles/ag-theme-balham.css'; + import { Button, Collapse, Divider, - Icon as BpIcon, Intent, NonIdealState, Spinner, SpinnerSize } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { - Column, - ColumnFilter, - ColumnFiltersState, - createColumnHelper, - flexRender, - getCoreRowModel, - getFilteredRowModel, - getPaginationRowModel, - useReactTable -} from '@tanstack/react-table'; -import { - Flex, - Table, - TableBody, - TableCell, - TableHead, - TableHeaderCell, - TableRow, - Text -} from '@tremor/react'; -import React, { useEffect, useState } from 'react'; -import { useDispatch } from 'react-redux'; -import { useSession, useTypedSelector } from 'src/commons/utils/Hooks'; -import { updateGroundControlTableFilters } from 'src/commons/workspace/WorkspaceActions'; +import { ColDef, GridApi, GridReadyEvent } from 'ag-grid-community'; +import { AgGridReact } from 'ag-grid-react'; +import React, { useState } from 'react'; +import { useSession } from 'src/commons/utils/Hooks'; -import { - AssessmentConfiguration, - AssessmentOverview -} from '../../../commons/assessment/AssessmentTypes'; +import { AssessmentOverview } from '../../../commons/assessment/AssessmentTypes'; import ContentDisplay from '../../../commons/ContentDisplay'; -import { AssessmentTypeBadge } from '../grading/subcomponents/GradingBadges'; -import GroundControlFilters from './GroundControlFilters'; import DefaultChapterSelect from './subcomponents/DefaultChapterSelect'; import DeleteCell from './subcomponents/GroundControlDeleteCell'; import Dropzone from './subcomponents/GroundControlDropzone'; @@ -49,7 +25,7 @@ import EditCell from './subcomponents/GroundControlEditCell'; import EditTeamSizeCell from './subcomponents/GroundControlEditTeamSizeCell'; import PublishCell from './subcomponents/GroundControlPublishCell'; -export type GroundControlProps = DispatchProps & StateProps; +type Props = DispatchProps; export type DispatchProps = { handleAssessmentOverviewFetch: () => void; @@ -61,113 +37,129 @@ export type DispatchProps = { handleFetchCourseConfigs: () => void; }; -export type StateProps = { - assessmentOverviews?: AssessmentOverview[]; - assessmentConfigurations?: AssessmentConfiguration[]; -}; - -const columnHelper = createColumnHelper(); - -const GroundControl: React.FC = props => { +const GroundControl: React.FC = props => { const [showDropzone, setShowDropzone] = useState(false); + const { assessmentOverviews, assessmentConfigurations } = useSession(); - const dispatch = useDispatch(); + let gridApi: GridApi | undefined; - const tableFilters = useTypedSelector( - state => state.workspaces.groundControl.GroundControlTableFilters - ); + const onGridReady = (params: GridReadyEvent) => { + gridApi = params.api; + gridApi.sizeColumnsToFit(); - const [columnFilters, setColumnFilters] = useState([ - ...tableFilters.columnFilters - ]); + // Sort assessments by opening date, breaking ties by later of closing dates + gridApi.applyColumnState({ + state: [ + { colId: 'openAt', sort: 'desc' }, + { colId: 'closeAt', sort: 'desc' } + ] + }); + }; - const { assessmentOverviews } = useSession(); + const resizeGrid = () => { + if (gridApi) { + gridApi.sizeColumnsToFit(); + } + }; const toggleDropzone = () => { setShowDropzone(!showDropzone); }; - useEffect(() => { - dispatch(updateGroundControlTableFilters({ columnFilters })); - }, [columnFilters, dispatch]); - - const columns = [ - columnHelper.accessor('id', { - header: 'ID', - cell: info => {info.getValue()} - }), - columnHelper.accessor('title', { - header: 'Title', - cell: info => {info.getValue()}, - enableSorting: true, - sortingFn: 'alphanumeric' - }), - columnHelper.accessor('type', { - header: 'Category', - cell: info => ( - - - - ), - enableSorting: true - }), - columnHelper.accessor('openAt', { - header: 'Open Date', - cell: info => ( - - ), - enableSorting: true - }), - columnHelper.accessor('closeAt', { - header: 'Close Date', - cell: info => ( - - ), - enableSorting: true - }), - - columnHelper.accessor('maxTeamSize', { - header: 'Max Team Size', - cell: info => ( - { - props.handleAssessmentChangeTeamSize(id, newTeamSize); - }} - data={info.row.original} - /> - ) - }), - columnHelper.accessor('isPublished', { - header: 'Publish', - cell: info => ( - - ), - enableSorting: false - }), - columnHelper.display({ - header: 'Delete', - size: 100, - cell: info => ( - - ), - enableSorting: false - }) + const columnDefs: ColDef[] = [ + { + field: 'number', + headerName: 'ID', + width: 50 + }, + { + headerName: 'Title', + field: 'title' + }, + { + headerName: 'Category', + field: 'type', + width: 100 + }, + { + headerName: 'Open Date', + field: 'openAt', + filter: 'agDateColumnFilter', + filterParams: { + comparator: dateFilterComparator, + inRangeInclusive: true + }, + sortingOrder: ['desc', 'asc', null], + cellRenderer: EditCell, + cellRendererParams: { + handleAssessmentChangeDate: props.handleAssessmentChangeDate, + forOpenDate: true + }, + width: 150 + }, + { + headerName: 'Close Date', + field: 'closeAt', + filter: 'agDateColumnFilter', + filterParams: { + comparator: dateFilterComparator, + inRangeInclusive: true + }, + sortingOrder: ['desc', 'asc', null], + cellRenderer: EditCell, + cellRendererParams: { + handleAssessmentChangeDate: props.handleAssessmentChangeDate, + forOpenDate: false + }, + width: 150 + }, + { + headerName: 'Max Team Size', + field: 'maxTeamSize', + cellRenderer: EditTeamSizeCell, + cellRendererParams: { + onTeamSizeChange: props.handleAssessmentChangeTeamSize + }, + width: 100 + }, + { + headerName: 'Publish', + field: 'placeholderPublish' as any, + cellRenderer: PublishCell, + cellRendererParams: { + handlePublishAssessment: props.handlePublishAssessment + }, + width: 100, + filter: false, + resizable: false, + sortable: false, + cellStyle: { + padding: 0 + } + }, + { + headerName: 'Delete', + field: 'placeholderDelete' as any, + cellRenderer: DeleteCell, + cellRendererParams: { + handleDeleteAssessment: props.handleDeleteAssessment + }, + width: 100, + filter: false, + resizable: false, + sortable: false, + cellStyle: { + padding: 0 + } + } ]; + const defaultColumnDefs = { + filter: true, + resizable: true, + sortable: true + }; + const controls = (
- ); +/* + * Reference: https://www.ag-grid.com/javascript-grid-filter-date/#date-filter-comparator + */ +const dateFilterComparator = (filterDate: Date, cellValue: string) => { + const cellDate = new Date(cellValue); + return cellDate < filterDate ? -1 : cellDate > filterDate ? 1 : 0; }; export default GroundControl; diff --git a/src/pages/academy/groundControl/GroundControlContainer.ts b/src/pages/academy/groundControl/GroundControlContainer.ts index 687120648e..14cb19a8a1 100644 --- a/src/pages/academy/groundControl/GroundControlContainer.ts +++ b/src/pages/academy/groundControl/GroundControlContainer.ts @@ -13,12 +13,9 @@ import { publishAssessment, uploadAssessment } from '../../../features/groundControl/GroundControlActions'; -import GroundControl, { DispatchProps, StateProps } from './GroundControl'; +import GroundControl, { DispatchProps } from './GroundControl'; -const mapStateToProps: MapStateToProps = state => ({ - assessmentOverviews: state.session.assessmentOverviews, - assessmentConfigurations: state.session.assessmentConfigurations -}); +const mapStateToProps: MapStateToProps<{}, {}, OverallState> = state => ({}); const mapDispatchToProps: MapDispatchToProps = (dispatch: Dispatch) => bindActionCreators( diff --git a/src/pages/academy/groundControl/GroundControlFilters.tsx b/src/pages/academy/groundControl/GroundControlFilters.tsx deleted file mode 100644 index ba831bad50..0000000000 --- a/src/pages/academy/groundControl/GroundControlFilters.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { ColumnFilter, ColumnFiltersState } from '@tanstack/react-table'; -import { Flex } from '@tremor/react'; - -import { FilterBadge } from '../grading/subcomponents/GradingBadges'; - -type GroundControlFiltersProps = { - filters: ColumnFiltersState; - onFilterRemove: (filter: ColumnFilter) => void; -}; - -const GroundControlFilters: React.FC = ({ filters, onFilterRemove }) => { - return ( - - {filters.map(filter => ( - - ))} - - ); -}; - -export default GroundControlFilters; diff --git a/src/pages/academy/teamFormation/subcomponents/TeamFormationActions.tsx b/src/pages/academy/teamFormation/subcomponents/TeamFormationActions.tsx index c116d16c3d..6677c040b6 100644 --- a/src/pages/academy/teamFormation/subcomponents/TeamFormationActions.tsx +++ b/src/pages/academy/teamFormation/subcomponents/TeamFormationActions.tsx @@ -1,26 +1,27 @@ import { Icon as BpIcon } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import { Flex, Icon } from '@tremor/react'; +import React, { useCallback } from 'react'; import { useDispatch } from 'react-redux'; import { Link } from 'react-router-dom'; import { deleteTeam } from 'src/commons/application/actions/SessionActions'; import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper'; -import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { useSession } from 'src/commons/utils/Hooks'; -type TeamFormationActionsProps = { +type Props = { teamId: number; }; -const TeamFormationActions: React.FC = ({ teamId }) => { +const TeamFormationActions: React.FC = ({ teamId }) => { const dispatch = useDispatch(); - const courseId = useTypedSelector(store => store.session.courseId); + const { courseId } = useSession(); - const handleDeleteTeamClick = async () => { + const handleDeleteTeamClick = useCallback(async () => { const confirm = await showSimpleConfirmDialog({ contents: ( <>

Delete this team?

-

Note: All progress made will be lost.

+

Note: All submissions made by the team will be lost.

), positiveIntent: 'danger', @@ -29,7 +30,7 @@ const TeamFormationActions: React.FC = ({ teamId }) = if (confirm) { dispatch(deleteTeam(teamId)); } - }; + }, [dispatch, teamId]); return ( diff --git a/src/pages/academy/teamFormation/subcomponents/TeamFormationDashboard.tsx b/src/pages/academy/teamFormation/subcomponents/TeamFormationDashboard.tsx index 30ec3fd77a..9e5a7fdae5 100644 --- a/src/pages/academy/teamFormation/subcomponents/TeamFormationDashboard.tsx +++ b/src/pages/academy/teamFormation/subcomponents/TeamFormationDashboard.tsx @@ -1,8 +1,9 @@ import '@tremor/react/dist/esm/tremor.css'; -import { Button, Card, Col, ColGrid, Flex, Title } from '@tremor/react'; +import { Button as BpButton } from '@blueprintjs/core'; +import { Card, Flex, Title } from '@tremor/react'; import { useNavigate } from 'react-router'; -import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { useSession } from 'src/commons/utils/Hooks'; import { TeamFormationOverview } from 'src/features/teamFormation/TeamFormationTypes'; import TeamFormationTable from './TeamFormationTable'; @@ -12,8 +13,7 @@ type TeamFormationDashboardProps = { }; const TeamFormationDashboard: React.FC = ({ teams }) => { - const group = useTypedSelector(state => state.session.group); - const { courseId } = useTypedSelector(state => state.session); + const { courseId, group } = useSession(); const navigate = useNavigate(); const createTeam = () => { @@ -26,21 +26,16 @@ const TeamFormationDashboard: React.FC = ({ teams } const teamData = teams; return ( - - - - - - Teams - - -   - - - - - - + + + Teams + + Create Team + Import Team + + + + ); }; diff --git a/src/pages/academy/teamFormation/subcomponents/TeamFormationForm.tsx b/src/pages/academy/teamFormation/subcomponents/TeamFormationForm.tsx index a1bda1eeaf..4bee6f29e6 100644 --- a/src/pages/academy/teamFormation/subcomponents/TeamFormationForm.tsx +++ b/src/pages/academy/teamFormation/subcomponents/TeamFormationForm.tsx @@ -1,5 +1,6 @@ import '@tremor/react/dist/esm/tremor.css'; +import { Button } from '@blueprintjs/core'; import React, { useEffect, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router'; @@ -8,7 +9,7 @@ import Select, { ActionMeta, MultiValue } from 'react-select'; import { createTeam, updateTeam } from 'src/commons/application/actions/SessionActions'; import { User } from 'src/commons/application/types/SessionTypes'; import { AssessmentOverview } from 'src/commons/assessment/AssessmentTypes'; -import { useTypedSelector } from 'src/commons/utils/Hooks'; +import { useSession } from 'src/commons/utils/Hooks'; import { TeamFormationOverview } from 'src/features/teamFormation/TeamFormationTypes'; import classes from 'src/styles/TeamFormation.module.scss'; @@ -19,8 +20,7 @@ export type OptionType = { const TeamFormationForm: React.FC = () => { const { teamId } = useParams(); // Retrieve the team ID from the URL - const assessmentOverviews = useTypedSelector(state => state.session.assessmentOverviews); - const { courseId, students, teamFormationOverviews } = useTypedSelector(state => state.session); + const { courseId, students, assessmentOverviews, teamFormationOverviews } = useSession(); const dispatch = useDispatch(); const [selectedAssessment, setSelectedAssessment] = useState( undefined @@ -140,7 +140,7 @@ const TeamFormationForm: React.FC = () => {
{selectedAssessment && (
- + {
))} {!teamId ? ( - + ) : null}
- + -
- +
diff --git a/src/pages/academy/teamFormation/subcomponents/TeamFormationImport.tsx b/src/pages/academy/teamFormation/subcomponents/TeamFormationImport.tsx index 74b37660a1..2e8fa53b74 100644 --- a/src/pages/academy/teamFormation/subcomponents/TeamFormationImport.tsx +++ b/src/pages/academy/teamFormation/subcomponents/TeamFormationImport.tsx @@ -1,5 +1,6 @@ import '@tremor/react/dist/esm/tremor.css'; +import { Button } from '@blueprintjs/core'; import { useState } from 'react'; import { FileUploader } from 'react-drag-drop-files'; import { useDispatch } from 'react-redux'; @@ -93,14 +94,14 @@ const TeamFormationImport: React.FC = () => {

{file ? `File name: ${file.name}` : 'No file uploaded'}

- + -
- +
diff --git a/src/pages/academy/teamFormation/subcomponents/TeamFormationTable.tsx b/src/pages/academy/teamFormation/subcomponents/TeamFormationTable.tsx index 28b0131de3..33dcaf4756 100644 --- a/src/pages/academy/teamFormation/subcomponents/TeamFormationTable.tsx +++ b/src/pages/academy/teamFormation/subcomponents/TeamFormationTable.tsx @@ -27,11 +27,7 @@ import { Text, TextInput } from '@tremor/react'; -import React from 'react'; -import { useEffect, useState } from 'react'; -import { useDispatch } from 'react-redux'; -import { useTypedSelector } from 'src/commons/utils/Hooks'; -import { updateTeamFormationsTableFilters } from 'src/commons/workspace/WorkspaceActions'; +import React, { useState } from 'react'; import { TeamFormationOverview } from 'src/features/teamFormation/TeamFormationTypes'; import { AssessmentTypeBadge } from '../../teamFormation/subcomponents/TeamFormationBadges'; @@ -85,25 +81,16 @@ type TeamFormationTableProps = { }; const TeamFormationTable: React.FC = ({ group, teams }) => { - const dispatch = useDispatch(); - const tableFilters = useTypedSelector( - state => state.workspaces.teamFormation.teamFormationTableFilters - ); - const defaultFilters = []; - if (group && !tableFilters.columnFilters.find(filter => filter.id === 'groupName')) { + if (group) { defaultFilters.push({ id: 'groupName', value: group }); } - const [columnFilters, setColumnFilters] = useState([ - ...tableFilters.columnFilters, - ...defaultFilters - ]); - - const [globalFilter, setGlobalFilter] = useState(tableFilters.globalFilter); + const [columnFilters, setColumnFilters] = useState([...defaultFilters]); + const [globalFilter, setGlobalFilter] = useState(null); const globalFilterFn = ( row: Row, @@ -147,15 +134,6 @@ const TeamFormationTable: React.FC = ({ group, teams }) setColumnFilters(newFilters); }; - useEffect(() => { - dispatch( - updateTeamFormationsTableFilters({ - columnFilters, - globalFilter - }) - ); - }, [columnFilters, globalFilter, dispatch]); - return ( <> diff --git a/src/pages/fileSystem/createInBrowserFileSystem.ts b/src/pages/fileSystem/createInBrowserFileSystem.ts index 28bb2279f1..ab175213bc 100644 --- a/src/pages/fileSystem/createInBrowserFileSystem.ts +++ b/src/pages/fileSystem/createInBrowserFileSystem.ts @@ -16,8 +16,6 @@ import { EditorTabState, WorkspaceManagerState } from '../../commons/workspace/W export const WORKSPACE_BASE_PATHS: Record = { assessment: '', grading: '', - teamFormation: '', - groundControl: '', playground: '/playground', sicp: '/sicp', sourcecast: '', diff --git a/src/styles/TeamFormation.module.scss b/src/styles/TeamFormation.module.scss index 8de4aec72f..100169e1d2 100644 --- a/src/styles/TeamFormation.module.scss +++ b/src/styles/TeamFormation.module.scss @@ -51,195 +51,6 @@ align-items: center; } -/* Submit button container */ -.submit-button-container { - margin-left: auto; /* Pushes the container to the right */ -} - -/* Submit button */ -.submit-button { - cursor: pointer; - position: relative; - padding: 6px 12px; - color: rgb(39, 223, 57); - border: 2px solid rgb(39, 223, 57); - border-radius: 4px; - background-color: transparent; - font-weight: 600; - transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); - overflow: hidden; -} - -.submit-button::before { - content: ''; - position: absolute; - inset: 0; - margin: auto; - width: 50px; - height: 50px; - border-radius: inherit; - scale: 0; - z-index: -1; - background-color: rgb(39, 223, 57); - transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); -} - -.submit-button:hover::before { - scale: 3; -} - -.submit-button:hover { - color: #ffffff; - scale: 1.1; - box-shadow: 0 0px 20px rgba(98, 193, 138, 0.4); -} - -.submit-button:active { - scale: 1; -} - -/* Back button */ -.back-button { - cursor: pointer; - position: relative; - padding: 6px 12px; - color: rgb(226, 0, 0); - border: 2px solid rgb(226, 0, 0); - border-radius: 4px; - background-color: transparent; - font-weight: 600; - transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); - overflow: hidden; -} - -.back-button::before { - content: ''; - position: absolute; - inset: 0; - margin: auto; - width: 50px; - height: 50px; - border-radius: inherit; - scale: 0; - z-index: -1; - background-color: rgb(226, 0, 0); - transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); -} - -.back-button:hover::before { - scale: 3; -} - -.back-button:hover { - color: #ffffff; - scale: 1.1; - box-shadow: 0 0px 20px rgba(98, 193, 138, 0.4); -} - -.back-button:active { - scale: 1; -} - -/* Add button */ -.add-button { - cursor: pointer; - position: relative; - padding: 6px 12px; - color: #3b82f6; - border: 2px solid #3b82f6; - border-radius: 4px; - background-color: transparent; - font-weight: 600; - transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); - overflow: hidden; -} - -.add-button::before { - content: ''; - position: absolute; - inset: 0; - margin: auto; - width: 50px; - height: 50px; - border-radius: inherit; - scale: 0; - z-index: -1; - background-color: #3b82f6; - transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); -} - -.add-button:hover::before { - scale: 3; -} - -.add-button:hover { - color: #ffffff; - scale: 1.1; - box-shadow: 0 0px 20px rgba(98, 193, 138, 0.4); -} - -.add-button:active { - scale: 1; -} - -/* Remove button */ -.remove-button { - cursor: pointer; - position: relative; - padding: 6px 12px; - color: rgb(255, 60, 60); - border: 2px solid rgb(255, 60, 60); - border-radius: 4px; - background-color: transparent; - font-weight: 600; - margin-left: 10px; - transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); - overflow: hidden; -} - -.remove-button::before { - content: ''; - position: absolute; - inset: 0; - margin: auto; - width: 50px; - height: 50px; - border-radius: inherit; - scale: 0; - z-index: -1; - background-color: rgb(255, 60, 60); - transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); -} - -.remove-button:hover::before { - scale: 3; -} - -.remove-button:hover { - color: #ffffff; - scale: 1.1; - box-shadow: 0 0px 20px rgba(98, 193, 138, 0.4); -} - -.remove-button:active { - scale: 1; -} - -/* Drag and Drop field*/ -#drag-drop-area { - border: 2px dashed #ccc; - padding: 40px; - text-align: center; -} - -#drag-drop-area p { - margin: 0; -} - -#drag-drop-area:hover { - outline: 2px solid lightblue; -} - .form-field-row { display: flex; align-items: center;