Skip to content

Commit

Permalink
Merge pull request #37 from Pearson-Advance/vue/PADV-969
Browse files Browse the repository at this point in the history
PADV-969 feat: Update students table
  • Loading branch information
AuraAlba authored Feb 20, 2024
2 parents fd6acf8 + af628ed commit ff30b18
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/assets/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $color-white: #fefefe;
$color-gray: #60646d;
$gray-70: #666666;
$gray-60: #808080;
$gray-30: #d3d3d3;
$gray-20: #dfe1e1;
$color-pink: #ffecf0;
$color-green: #e7f7eb;
Expand Down
9 changes: 8 additions & 1 deletion src/assets/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
border: 1px solid $gray-20;
border-radius: 0.375rem;
padding: 20px 0;
box-shadow: 0px 3px 12px 0px rgba(0, 0, 0, 0.16);
box-shadow: 0px 3px 12px 0px $gray-30;
background-color: $color-white;

.progress {
border-radius: 2rem;
background: $gray-20;
border: none;
height: 0.6rem;
}
}

.filter-container .filters {
Expand Down
10 changes: 9 additions & 1 deletion src/features/Students/StudentsTable/_test_/columns.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ describe('getColumns', () => {
const columns = getColumns();

expect(columns).toBeInstanceOf(Array);
expect(columns).toHaveLength(5);
expect(columns).toHaveLength(7);

const [
nameColumn,
emailColumn,
classNameColumn,
ClassIdColumn,
dateColumn,
progressColumn,
examReadyColumn,
] = columns;

Expand All @@ -27,6 +29,12 @@ describe('getColumns', () => {
expect(ClassIdColumn).toHaveProperty('Header', 'Class Id');
expect(ClassIdColumn).toHaveProperty('accessor', 'classId');

expect(dateColumn).toHaveProperty('Header', 'Start - End Date');
expect(dateColumn).toHaveProperty('accessor', 'startDate');

expect(progressColumn).toHaveProperty('Header', 'Progress');
expect(progressColumn).toHaveProperty('accessor', 'completePercentage');

expect(examReadyColumn).toHaveProperty('Header', 'Exam Ready');
expect(examReadyColumn).toHaveProperty('accessor', 'examReady');
});
Expand Down
16 changes: 16 additions & 0 deletions src/features/Students/StudentsTable/columns.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable react/prop-types */
import { format } from 'date-fns';
import { ProgressBar } from '@edx/paragon';

const getColumns = () => [
{
Expand All @@ -17,6 +19,20 @@ const getColumns = () => [
Header: 'Class Id',
accessor: 'classId',
},
{
Header: 'Start - End Date',
accessor: 'startDate',
Cell: ({ row }) => {
const startDate = row.values.startDate ? format(row.values.startDate, 'MM/dd/yy') : '';
const endDate = row.values.endDate ? format(row.values.endDate, 'MM/dd/yy') : '';
return <div>{startDate} - {endDate}</div>;
},
},
{
Header: 'Progress',
accessor: 'completePercentage',
Cell: ({ row }) => (<ProgressBar now={row.values.completePercentage} variant="primary" />),
},
{
Header: 'Exam Ready',
accessor: 'examReady',
Expand Down

0 comments on commit ff30b18

Please sign in to comment.