From 477f0e870113b0b9dff9513990444190064b954a Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Sun, 9 Jun 2024 16:49:46 +0800 Subject: [PATCH 01/13] Remove unused style classes --- src/styles/_commons.scss | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/styles/_commons.scss b/src/styles/_commons.scss index fffd5c8ffe..f66b05afbd 100644 --- a/src/styles/_commons.scss +++ b/src/styles/_commons.scss @@ -61,12 +61,6 @@ } } -.WhiteBackground { - background-color: white; - padding: 20px; - border-radius: 10px; -} - .Horizontal { display: flex; flex-direction: row; @@ -80,19 +74,6 @@ align-items: center; } -.VerticalStack { - > * + * { - margin-top: 10px; - } -} - -.Centered { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-evenly; -} - .WaitingCursor { cursor: wait; } From e06a617aa670865fbe6a275b8d2287c287916af5 Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Sun, 9 Jun 2024 17:58:24 +0800 Subject: [PATCH 02/13] Use flexbox for user config panels Also updated the titles of the pages. --- .../StoriesUserConfigPanel.tsx | 30 +++++++---------- .../userConfigPanel/UserConfigPanel.tsx | 33 +++++++------------ 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/src/pages/academy/adminPanel/subcomponents/storiesUserConfigPanel/StoriesUserConfigPanel.tsx b/src/pages/academy/adminPanel/subcomponents/storiesUserConfigPanel/StoriesUserConfigPanel.tsx index 15b1ced6a6..02f2c4d3ef 100644 --- a/src/pages/academy/adminPanel/subcomponents/storiesUserConfigPanel/StoriesUserConfigPanel.tsx +++ b/src/pages/academy/adminPanel/subcomponents/storiesUserConfigPanel/StoriesUserConfigPanel.tsx @@ -15,6 +15,13 @@ type Props = { handleDeleteStoriesUserFromUserGroup: (id: number) => void; }; +const defaultColumnDefs: ColDef = { + flex: 1, + filter: true, + resizable: true, + sortable: true +}; + /** * Only admins can access this panel. * - Admins cannot be deleted @@ -30,15 +37,8 @@ const StoriesUserConfigPanel: React.FC = props => { ); const columnDefs: ColDef[] = [ - { - headerName: 'Name', - field: 'name', - sort: 'asc' - }, - { - headerName: 'Username', - field: 'username' - }, + { headerName: 'Name', field: 'name', sort: 'asc' }, + { headerName: 'Username', field: 'username' }, { headerName: 'Role', field: 'role', @@ -46,8 +46,7 @@ const StoriesUserConfigPanel: React.FC = props => { cellRendererParams: { id: props.userId, handleUpdateStoriesUserRole: props.handleUpdateStoriesUserRole - }, - width: 110 + } }, { headerName: 'Actions', @@ -56,18 +55,11 @@ const StoriesUserConfigPanel: React.FC = props => { cellRendererParams: { handleDeleteStoriesUserFromUserGroup: props.handleDeleteStoriesUserFromUserGroup }, - width: 120, filter: false, resizable: false } ]; - const defaultColumnDefs = { - filter: true, - resizable: true, - sortable: true - }; - const onGridReady = (params: GridReadyEvent) => { gridApi.current = params.api; }; @@ -92,7 +84,7 @@ const StoriesUserConfigPanel: React.FC = props => { return (
-

Users

+

Stories Users

+ ); diff --git a/src/commons/editingWorkspace/EditingWorkspace.tsx b/src/commons/editingWorkspace/EditingWorkspace.tsx index e92fb1bb68..83a6ac1e31 100644 --- a/src/commons/editingWorkspace/EditingWorkspace.tsx +++ b/src/commons/editingWorkspace/EditingWorkspace.tsx @@ -1,7 +1,8 @@ import { - ButtonGroup, Classes, Dialog, + DialogBody, + DialogFooter, Intent, NonIdealState, Spinner, @@ -214,31 +215,33 @@ const EditingWorkspace: React.FC = props => { isOpen={showResetTemplateOverlay} title="Confirmation: Reset editor?" > -
+ -
-
- - setShowResetTemplateOverlay(false)} - options={{ minimal: false }} - /> - { - const assessment = retrieveLocalAssessment()!; - setAssessment(assessment); - setHasUnsavedChanges(false); - setShowResetTemplateOverlay(false); - setOriginalMaxXp(getMaxXp()); - handleRefreshLibrary(); - resetWorkspaceValues(); - }} - options={{ minimal: false, intent: Intent.DANGER }} - /> - -
+ + + setShowResetTemplateOverlay(false)} + options={{ minimal: false }} + /> + { + const assessment = retrieveLocalAssessment()!; + setAssessment(assessment); + setHasUnsavedChanges(false); + setShowResetTemplateOverlay(false); + setOriginalMaxXp(getMaxXp()); + handleRefreshLibrary(); + resetWorkspaceValues(); + }} + options={{ minimal: false, intent: Intent.DANGER }} + /> + + } + /> ); diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx index 1c3db43464..31bca99493 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentManageQuestionTab.tsx @@ -1,4 +1,4 @@ -import { Button, ButtonGroup, Classes, Dialog, Intent } from '@blueprintjs/core'; +import { Button, Dialog, DialogBody, DialogFooter, Intent } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import React, { useState } from 'react'; import { useNavigate } from 'react-router'; @@ -120,26 +120,28 @@ const ManageQuestionTab: React.FC = props => { isOpen={showSaveOverlay} title="Confirmation: Save unsaved changes?" > -
+ -
-
- - setShowSaveOverlay(false)} - options={{ minimal: false }} - /> - { - modifyAssessment(); - setShowSaveOverlay(false); - }} - options={{ minimal: false, intent: Intent.DANGER }} - /> - -
+ + + setShowSaveOverlay(false)} + options={{ minimal: false }} + /> + { + modifyAssessment(); + setShowSaveOverlay(false); + }} + options={{ minimal: false, intent: Intent.DANGER }} + /> + + } + /> ); diff --git a/src/commons/gitHubOverlay/FileExplorerDialog.tsx b/src/commons/gitHubOverlay/FileExplorerDialog.tsx index 4bbbbd1fa9..6afffd2236 100644 --- a/src/commons/gitHubOverlay/FileExplorerDialog.tsx +++ b/src/commons/gitHubOverlay/FileExplorerDialog.tsx @@ -3,6 +3,8 @@ import { Button, Classes, Dialog, + DialogBody, + DialogFooter, InputGroup, Intent, Tree, @@ -47,7 +49,7 @@ const FileExplorerDialog: React.FC = props => {

Select a File

-
+ = props => { />
)} -
-
-
- - -
-
+ + + + + + } + /> ); diff --git a/src/commons/gitHubOverlay/RepositoryDialog.tsx b/src/commons/gitHubOverlay/RepositoryDialog.tsx index 6139059d8a..97e539c753 100644 --- a/src/commons/gitHubOverlay/RepositoryDialog.tsx +++ b/src/commons/gitHubOverlay/RepositoryDialog.tsx @@ -3,6 +3,8 @@ import { Button, Classes, Dialog, + DialogBody, + DialogFooter, Intent, Radio, RadioGroup @@ -25,7 +27,7 @@ const RepositoryDialog: React.FC = props => {

Select a Repository

-
+ = props => { ))} -
-
-
- - - Select - -
-
+ + + + + Select + + + } + /> ); diff --git a/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx b/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx index 7621b12a40..9b05ad9a57 100644 --- a/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx +++ b/src/commons/researchAgreementPrompt/ResearchAgreementPrompt.tsx @@ -1,4 +1,4 @@ -import { Button, Classes, Dialog, H4, Intent } from '@blueprintjs/core'; +import { Button, Classes, Dialog, DialogBody, DialogFooter, H4, Intent } from '@blueprintjs/core'; import { useDispatch } from 'react-redux'; import SessionActions from '../application/actions/SessionActions'; @@ -17,7 +17,7 @@ const ResearchAgreementPrompt: React.FC = () => { isCloseButtonShown={false} isOpen > -
+

Welcome to your new {Constants.sourceAcademyDeploymentName} course!

Here at {Constants.sourceAcademyDeploymentName}, our mission is to bring out the beauty @@ -31,20 +31,22 @@ const ResearchAgreementPrompt: React.FC = () => { with no penalty for you whatsoever. Contact your course instructor if you have questions or concerns about this research.
-
-
-
-
-
+ + +