diff --git a/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.scss b/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.scss index bd7b6403b..b70bc83a5 100644 --- a/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.scss +++ b/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.scss @@ -1,15 +1,44 @@ @import "../../../../shared/styles/variables/variables"; .editStudentPerimissionsForm { - width: 400px; + width: 540px; .formTop { display: flex; + justify-content: space-between; align-content: center; background-color: $blue; color: white; font-weight: bold; padding: 10px; + + .studentName { + align-content: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .closeButton button { + padding: 0px; + border: none; + width: 40px; + height: 40px; + text-align: center; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50px; + background-color: white; + &:hover { + background-color: darken(white, 10%); + } + i { + color: $blue; + margin: 0 auto; + font-size: 16px; + } + } } .scrollableWrapper { @@ -40,6 +69,12 @@ } } + .scrollableWrapper .formRow { + &:nth-child(even) { + background-color: #f5f5f5; + } + } + .name { width: 273px; } @@ -64,12 +99,20 @@ background-color: $permission-gold; border-color: $permission-gold; color: white; + &:not(:disabled):hover { + background-color: darken($permission-gold, 10%); + border-color: darken($permission-gold, 10%); + } } .cancelButton { background-color: #ccc; border-color: #ccc; color:#333; + &:not(:disabled):hover { + background-color: darken(#ccc, 10%); + border-color: darken(#ccc, 10%); + } } } } diff --git a/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.tsx b/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.tsx index e0a9ef4be..2ed49397d 100644 --- a/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.tsx +++ b/rails/react-components/src/library/components/permission-forms-v2/students-tab/edit-student-permissions-form.tsx @@ -61,14 +61,22 @@ export const EditStudentPermissionsForm = ({ student, permissionForms, onFormCan const savedIds = student.permission_forms.map(pf => pf.id).sort(); const newIds = localPermissions.map(lp => lp.id).sort(); const hasChanges = savedIds.length !== newIds.length || savedIds.some((id, i) => id !== newIds[i]); + const sortedPermissions = permissionForms.sort((a, b) => a.name.localeCompare(b.name)); return (
- { `EDIT: ${student.name}` } +
+ { `EDIT Permission Forms for: ${student.name}` } +
+
+ +
- { permissionForms.map((p, i) => { + { sortedPermissions.map((p, i) => { const isChecked = localPermissions.some(lp => lp.id === p.id); return ( diff --git a/rails/react-components/src/library/components/permission-forms-v2/students-tab/students-table.tsx b/rails/react-components/src/library/components/permission-forms-v2/students-tab/students-table.tsx index 80799ce24..6db64bfb7 100644 --- a/rails/react-components/src/library/components/permission-forms-v2/students-tab/students-table.tsx +++ b/rails/react-components/src/library/components/permission-forms-v2/students-tab/students-table.tsx @@ -46,7 +46,7 @@ export const StudentsTable = ({ classId, currentSelectedProject }: IProps) => { const [requestInProgress, setRequestInProgress] = useState(false); const [permissionsExpanded, setPermissionsExpanded] = useState(false); - const currentForms = filteredByProject(nonArchived(permissionForms), currentSelectedProject); + const currentForms = filteredByProject(nonArchived(permissionForms), currentSelectedProject).sort((a, b) => a.name.localeCompare(b.name)); const permissionFormToAddOptions = Object.freeze( currentForms.filter(pf => !permissionFormsToRemove.find(pfr => pfr.value === pf.id)).map(pf => ({ value: pf.id, label: pf.name }))