Skip to content

Commit

Permalink
Bump major versions of dependencies (#2742)
Browse files Browse the repository at this point in the history
* Update dependency @testing-library/jest-dom to v6

* Fix testing library breaking changes

* Update dependency husky to v9

* Update husky format for v9

Though husky v9 is backwards-compatible with v8, it is still a good
practice to update the formats regardless.

* Update dependency prettier to v3

* Freeze prettier to 3.0 minor version

Done due to indentation changes to ternaries in minor version 3.1.

* Reformat files post-prettier version upgrade

* Update ag-grid monorepo to v31

* Fix `ag-grid` breaking changes

* Rename `cellRendererFramework` to `cellRenderer`
* Rename `suppressCellSelection` to `suppressCellFocus`

Also added some type imports for better type-safety.

* Fix warning when starting dev server

Caused by missing transitive
`@babel/plugin-proposal-private-property-in-object` dependency belonging
to CRA, which is not maintained anymore.

Thus, we manually add it as a devDependency here.

* Fix `ag-grid` incorrect CSS import paths

This was left out after the migration and thus resulted in a runtime
error previously.

* Fix format

* Revert "Fix format"

This reverts commit 41457f3.

* Fix format

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
RichDom2185 and renovate[bot] authored Jan 31, 2024
1 parent 0ba2fc4 commit acafed3
Show file tree
Hide file tree
Showing 20 changed files with 153 additions and 224 deletions.
3 changes: 0 additions & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

bash scripts/test.sh
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test-coveralls": "./scripts/test-coveralls.sh",
"update-ui-snapshots": "jest --updateSnapshot",
"eslint": "eslint --ext \".js,.jsx,.ts,.tsx\" src",
"prepare": "husky install"
"prepare": "husky"
},
"dependencies": {
"@blueprintjs/core": "^4.20.1",
Expand All @@ -40,8 +40,8 @@
"@tremor/react": "^1.8.2",
"ace-builds": "^1.4.14",
"acorn": "^8.9.0",
"ag-grid-community": "^28.0.2",
"ag-grid-react": "^28.0.0",
"ag-grid-community": "^31.0.0",
"ag-grid-react": "^31.0.0",
"array-move": "^4.0.0",
"browserfs": "^1.4.3",
"classnames": "^2.3.2",
Expand Down Expand Up @@ -93,9 +93,10 @@
"yareco": "^0.1.5"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@craco/craco": "^7.1.0",
"@svgr/webpack": "^8.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/acorn": "^6.0.0",
Expand Down Expand Up @@ -131,11 +132,11 @@
"cross-env": "^7.0.3",
"eslint-plugin-simple-import-sort": "^10.0.0",
"https-browserify": "^1.0.0",
"husky": "^8.0.2",
"husky": "^9.0.0",
"npm-run-all": "^4.1.5",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"prettier": "^2.8.8",
"prettier": "~3.0.0",
"process": "^0.11.10",
"react-error-overlay": "^6.0.11",
"react-scripts": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/commons/achievement/utils/AchievementBackender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const frontendifyAchievementGoal = (goal: any) =>
count: goal.count,
targetCount: goal.targetCount,
completed: goal.count >= goal.targetCount
} as AchievementGoal);
}) as AchievementGoal;

export const frontendifyAchievementItem = (achievement: any) =>
({
Expand All @@ -51,7 +51,7 @@ export const frontendifyAchievementItem = (achievement: any) =>
completionText: achievement.view.completionText || '',
description: achievement.view.description || ''
}
} as AchievementItem);
}) as AchievementItem;

export const backendifyAchievementItem = (achievement: AchievementItem) => ({
...achievement,
Expand Down
8 changes: 4 additions & 4 deletions src/commons/sourceRecorder/SourceRecorderTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'ag-grid-community/dist/styles/ag-grid.css';
import 'ag-grid-community/styles/ag-grid.css';

import {
Divider,
Expand Down Expand Up @@ -56,7 +56,7 @@ class SourcecastTable extends React.Component<SourceRecorderTableProps, State> {
{
headerName: 'Title',
field: 'title',
cellRendererFramework: SourceRecorderSelectCell,
cellRenderer: SourceRecorderSelectCell,
cellRendererParams: {
handleSetSourcecastData: this.props.handleSetSourcecastData
},
Expand Down Expand Up @@ -96,7 +96,7 @@ class SourcecastTable extends React.Component<SourceRecorderTableProps, State> {
{
headerName: 'Share',
field: 'uid',
cellRendererFramework: SourceRecorderShareCell,
cellRenderer: SourceRecorderShareCell,
cellRendererParams: {
courseId: this.props.courseId
},
Expand All @@ -107,7 +107,7 @@ class SourcecastTable extends React.Component<SourceRecorderTableProps, State> {
{
headerName: 'Delete',
field: '',
cellRendererFramework: SourcastDeleteCell,
cellRenderer: SourcastDeleteCell,
cellRendererParams: {
handleDeleteSourcecastEntry: this.props.handleDeleteSourcecastEntry
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/academy/adminPanel/AdminPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'ag-grid-community/dist/styles/ag-grid.css';
import 'ag-grid-community/dist/styles/ag-theme-balham.css';
import 'ag-grid-community/styles/ag-grid.css';
import 'ag-grid-community/styles/ag-theme-balham.css';

import { Button, Divider, H1, Intent, Tab, Tabs } from '@blueprintjs/core';
import { cloneDeep } from 'lodash';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const AddStoriesUserPanel: React.FC<Props> = props => {
onGridSizeChanged={() => gridApi.current?.sizeColumnsToFit()}
rowData={users}
rowHeight={36}
suppressCellSelection={true}
suppressCellFocus={true}
suppressMovableColumns={true}
pagination
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const AddUserPanel: React.FC<Props> = props => {
onGridSizeChanged={() => gridApi.current?.sizeColumnsToFit()}
rowData={users}
rowHeight={36}
suppressCellSelection={true}
suppressCellFocus={true}
suppressMovableColumns={true}
pagination
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Button, H2, Intent } from '@blueprintjs/core';
import { GridApi, GridReadyEvent, ValueFormatterFunc } from 'ag-grid-community';
import { ColDef, GridApi, GridReadyEvent, ValueFormatterFunc } from 'ag-grid-community';
import { AgGridReact } from 'ag-grid-react';
import { cloneDeep } from 'lodash';
import React, { useEffect, useState } from 'react';
Expand Down Expand Up @@ -94,7 +94,7 @@ const NotificationConfigPanel = () => {
return params.data!.notificationType.forStaff ? 'Staff' : 'Student';
};

const columnDefs = [
const columnDefs: ColDef[] = [
{
headerName: 'Notification Type',
field: 'notificationType.name',
Expand Down Expand Up @@ -122,7 +122,7 @@ const NotificationConfigPanel = () => {
{
headerName: 'Reminder Time Options (hours)',
field: 'timeOptions',
cellRendererFramework: TimeOptionCell,
cellRenderer: TimeOptionCell,
cellRendererParams: {
setStateHandler: setTimeOptions,
setDelete: addTimeOptionsToDelete,
Expand All @@ -132,7 +132,7 @@ const NotificationConfigPanel = () => {
{
headerName: 'Default Reminder (hours)',
field: 'timeOptions',
cellRendererFramework: SelectCell,
cellRenderer: SelectCell,
cellRendererParams: {
setStateHandler: setTimeOptions,
field: 'timeOptions'
Expand All @@ -141,7 +141,7 @@ const NotificationConfigPanel = () => {
{
headerName: 'Enabled',
field: 'isEnabled',
cellRendererFramework: BooleanCell,
cellRenderer: BooleanCell,
cellRendererParams: {
setStateHandler: setIsEnabled,
field: 'isEnabled'
Expand Down Expand Up @@ -199,7 +199,7 @@ const NotificationConfigPanel = () => {
rowData={notificationConfig.current}
rowHeight={36}
rowDragManaged={true}
suppressCellSelection={true}
suppressCellFocus={true}
suppressMovableColumns={true}
suppressPaginationPanel={true}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Button, H2 } from '@blueprintjs/core';
import { CellValueChangedEvent, GridApi, GridReadyEvent, RowDragEvent } from 'ag-grid-community';
import {
CellValueChangedEvent,
ColDef,
GridApi,
GridReadyEvent,
RowDragEvent
} from 'ag-grid-community';
import { AgGridReact } from 'ag-grid-react';
import { isEqual } from 'lodash';
import React from 'react';
Expand Down Expand Up @@ -95,7 +101,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
setAssessmentConfigsToDelete(deleted[0]);
};

const columnDefs = [
const columnDefs: ColDef[] = [
{
headerName: 'Assessment Type',
field: 'type',
Expand All @@ -105,7 +111,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
{
headerName: 'Is Manually Graded',
field: 'isManuallyGraded',
cellRendererFramework: BooleanCell,
cellRenderer: BooleanCell,
cellRendererParams: {
setStateHandler: setIsManuallyGraded,
field: 'isManuallyGraded'
Expand All @@ -114,7 +120,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
{
headerName: 'Display in Dashboard',
field: 'displayInDashboard',
cellRendererFramework: BooleanCell,
cellRenderer: BooleanCell,
cellRendererParams: {
setStateHandler: setDisplayInDashboard,
field: 'displayInDashboard'
Expand All @@ -123,7 +129,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
{
headerName: 'Max Bonus XP',
field: 'earlySubmissionXp',
cellRendererFramework: NumericCell,
cellRenderer: NumericCell,
cellRendererParams: {
setStateHandler: setEarlyXp,
field: 'earlySubmissionXp'
Expand All @@ -132,7 +138,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
{
headerName: 'Early Hours Before Decay',
field: 'hoursBeforeEarlyXpDecay',
cellRendererFramework: NumericCell,
cellRenderer: NumericCell,
cellRendererParams: {
setStateHandler: setHoursBeforeDecay,
field: 'hoursBeforeEarlyXpDecay'
Expand All @@ -141,7 +147,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
{
headerName: 'Delete Row',
field: 'placeholderToPreventColumnRerender',
cellRendererFramework: DeleteRowCell,
cellRenderer: DeleteRowCell,
cellRendererParams: {
deleteRowHandler: deleteRowHandler
},
Expand Down Expand Up @@ -177,7 +183,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
);

// Updates the data passed into ag-grid (this is necessary to update the rowIndex in our custom
// cellRendererFramework)
// cellRenderer)
const onRowDragLeaveOrEnd = (event: RowDragEvent) => {
gridApi.current?.setRowData(assessmentConfig.current);
props.setHasChangesAssessmentConfig(true);
Expand Down Expand Up @@ -212,7 +218,7 @@ const AssessmentConfigPanel: React.FC<AssessmentConfigPanelProps> = props => {
rowData={props.assessmentConfig.current}
rowHeight={36}
rowDragManaged={true}
suppressCellSelection={true}
suppressCellFocus={true}
suppressMovableColumns={true}
suppressPaginationPanel={true}
onRowDragMove={onRowDragMove}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const UserConfigPanel: React.FC<UserConfigPanelProps> = props => {
{
headerName: 'Role',
field: 'role',
cellRendererFramework: RolesCell,
cellRenderer: RolesCell,
cellRendererParams: {
courseRegId: props.courseRegId,
handleUpdateUserRole: props.handleUpdateUserRole
Expand All @@ -58,7 +58,7 @@ const UserConfigPanel: React.FC<UserConfigPanelProps> = props => {
{
headerName: 'Actions',
field: 'actions',
cellRendererFramework: UserActionsCell,
cellRenderer: UserActionsCell,
cellRendererParams: {
handleDeleteUserFromCourse: props.handleDeleteUserFromCourse
},
Expand Down Expand Up @@ -88,7 +88,7 @@ const UserConfigPanel: React.FC<UserConfigPanelProps> = props => {
onGridSizeChanged={() => gridApi.current?.sizeColumnsToFit()}
rowData={userCourseRegistrations}
rowHeight={36}
suppressCellSelection={true}
suppressCellFocus={true}
suppressMovableColumns={true}
pagination
/>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/academy/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'ag-grid-community/dist/styles/ag-grid.css';
import 'ag-grid-community/dist/styles/ag-theme-balham.css';
import 'ag-grid-community/styles/ag-grid.css';
import 'ag-grid-community/styles/ag-theme-balham.css';

import { ColDef, GridApi, GridReadyEvent } from 'ag-grid-community';
import { AgGridReact } from 'ag-grid-react';
Expand Down Expand Up @@ -55,7 +55,7 @@ const Dashboard: React.FC<DashboardProps> = props => {
onGridSizeChanged={resizeGrid}
rowData={gradingSummary.rows}
rowHeight={30}
suppressCellSelection={true}
suppressCellFocus={true}
suppressMovableColumns={true}
/>
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/pages/academy/groundControl/GroundControl.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'ag-grid-community/dist/styles/ag-grid.css';
import 'ag-grid-community/dist/styles/ag-theme-balham.css';
import 'ag-grid-community/styles/ag-grid.css';
import 'ag-grid-community/styles/ag-theme-balham.css';

import { Button, Collapse, Divider, Intent } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
Expand Down Expand Up @@ -75,7 +75,7 @@ class GroundControl extends React.Component<GroundControlProps, State> {
inRangeInclusive: true
},
sortingOrder: ['desc', 'asc', null],
cellRendererFramework: EditCell,
cellRenderer: EditCell,
cellRendererParams: {
handleAssessmentChangeDate: this.props.handleAssessmentChangeDate,
forOpenDate: true
Expand All @@ -91,7 +91,7 @@ class GroundControl extends React.Component<GroundControlProps, State> {
inRangeInclusive: true
},
sortingOrder: ['desc', 'asc', null],
cellRendererFramework: EditCell,
cellRenderer: EditCell,
cellRendererParams: {
handleAssessmentChangeDate: this.props.handleAssessmentChangeDate,
forOpenDate: false
Expand All @@ -101,7 +101,7 @@ class GroundControl extends React.Component<GroundControlProps, State> {
{
headerName: 'Publish',
field: '',
cellRendererFramework: PublishCell,
cellRenderer: PublishCell,
cellRendererParams: {
handlePublishAssessment: this.props.handlePublishAssessment
},
Expand All @@ -116,7 +116,7 @@ class GroundControl extends React.Component<GroundControlProps, State> {
{
headerName: 'Delete',
field: '',
cellRendererFramework: DeleteCell,
cellRenderer: DeleteCell,
cellRendererParams: {
handleDeleteAssessment: this.props.handleDeleteAssessment
},
Expand Down Expand Up @@ -174,7 +174,7 @@ class GroundControl extends React.Component<GroundControlProps, State> {
onGridSizeChanged={this.resizeGrid}
rowData={this.props.assessmentOverviews}
rowHeight={30}
suppressCellSelection={true}
suppressCellFocus={true}
suppressMovableColumns={true}
suppressPaginationPanel={true}
/>
Expand Down
Loading

0 comments on commit acafed3

Please sign in to comment.