-
Notifications
You must be signed in to change notification settings - Fork 3
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: Call LearningAssistantSummary endpoint #68
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good so far! A couple of questions!
src/data/slice.js
Outdated
@@ -11,6 +11,10 @@ export const initialState = { | |||
disclosureAcknowledged: false, | |||
sidebarIsOpen: false, | |||
isEnabled: false, | |||
auditTrial: { | |||
startDate: 0, | |||
expirationDate: null, // TODO: what do we use for a datetime value here? |
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.
To clarify, are you looking to set the default value? Could it be the same (either 0 or null?)?
src/components/Sidebar/index.jsx
Outdated
@@ -98,7 +99,10 @@ const Sidebar = ({ | |||
</div> | |||
) | |||
} | |||
{getMessageForm()} | |||
{ |
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.
Is this only happening in the case where the user is an audit learner? In other words, where are we handling the logic to check if the learner is audit or verified (since the experience will be different).
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.
Following up from a standup discussion we had, I removed the gating here as that functionality will be implemented in another ticket.
Note for self, this should be the shape of the data returned by the GET endpoint be worked on in edx/learning-assistant#140.
|
- also refactored tests accordingly
async function fetchLearningAssistantMessageHistory(courseId) { | ||
const url = new URL(`${getConfig().CHAT_RESPONSE_URL}/${courseId}/history`); | ||
async function fetchLearningAssistantSummary(courseId) { | ||
const url = new URL(`${getConfig().CHAT_RESPONSE_URL}/${courseId}/summary`); |
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.
NOTE: This Ticket/PR has been modified such that we're now calling the "summary" endpoint that Michael is working on in his PR: edx/learning-assistant#140.
This endpoint gets all the data for enabled
, message_history
, and audit_trial
all in one GET request.
@@ -124,13 +101,46 @@ export function updateSidebarIsOpen(isOpen) { | |||
}; | |||
} | |||
|
|||
export function getIsEnabled(courseId) { | |||
export function getLearningAssistantSummary(courseId) { |
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.
I replaced the getLearningAssistantMessageHistory
, getIsEnabled
, and getAuditTrial
thunks with a singular getLearningAssistantSummary
thunk.
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.
Let me know if I need to revert this, but I removed the message-history
hook because I was able to call the summary hook from Xpert.jsx
https://2u-internal.atlassian.net/browse/COSMO-575