-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add allowances tab #31
Conversation
Leaving this in draft until openedx/paragon#3138 is merged. After the paragon PR is merged, I will update the package.json file, and the test failure should go away. |
src/index.scss
Outdated
@import "@edx/brand/paragon/variables.scss"; | ||
@import "@openedx/paragon/scss/core/core.scss"; | ||
@import "@edx/brand/paragon/overrides.scss"; | ||
@import "~@edx/brand/paragon/fonts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this to match other MFEs.
1d20088
to
2b90f9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome! Just a nit and a couple of questions.
@@ -25,19 +32,29 @@ const ExamsPage = ({ courseId }) => { | |||
const { | |||
attemptsList, | |||
} = useExamAttemptsData(); | |||
const { | |||
allowancesList, | |||
} = useAllowancesData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I like how this matches with the attemptsList above.
</Container> | ||
<Tabs variant="tabs" mountOnEnter defaultActiveKey="attempts"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: is there a reason that the Tabs component no longer needs the defaultActiveKey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because I modified the tabs component from an uncontrolled usage to a controlled usage (see https://paragon-openedx.netlify.app/components/tabs/). I had to do this to expose the current key, which is used to toggle whether or not the exams selector is disabled.
@@ -20,6 +21,7 @@ jest.mock('./hooks', () => ({ | |||
describe('ExamsPage', () => { | |||
beforeAll(() => { | |||
hooks.useExamAttemptsData.mockReturnValue(testUtils.defaultAttemptsData); | |||
hooks.useAllowancesData.mockReturnValue({ allowancesList: [] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: I took a look at the epic and it looks like actually having allowances is not in the scope of this work, right? That is, for now, we only need to test this case and not the case where there are allowances? Thanks for clarifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this ticket is only for the case where there are no allowances
href="#" | ||
role="tab" | ||
> | ||
Allowances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Is there a reason that "Allowances" isn't set as a message (for potential future internationalization, as with AllowanceList below) here? Is this just to be consistent with others (like Review Dashboard above)? Thanks for clarifying?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! I'm not entirely sure why the other tabs aren't translated, but yes, I did this to be consistent with them.
064d48c
to
979eff7
Compare
979eff7
to
f9d3871
Compare
COSMO-366
This PR adds an additional tab to allow instructors to add exam allowances. As of now, this is not hooked up to the backend, so the tab always renders as though there are no allowances.