-
Notifications
You must be signed in to change notification settings - Fork 4
Update frontend directions for AskTim drawer #494
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,13 +47,14 @@ Configuration | |
|
||
3. In frontend-app-learning, Run the below in the shell inside the learning MFE folder: | ||
--------------------------------------------------------------------------------------- | ||
This will generate a bundle for the remoteAiChatDrawer. This bundle will be used in the learning MFE to render the chat drawer. | ||
This will download the smoot-design package and copy the pre-bundled JS file to a location loadable by OpenEdx. | ||
|
||
.. code-block:: sh | ||
|
||
npm pack @mitodl/smoot-design@^6.0.0 | ||
npm pack @mitodl/smoot-design@^6.4.0 | ||
tar -xvzf mitodl-smoot-design*.tgz | ||
mv package mitodl-smoot-design | ||
mkdir -p public/static/smoot-design | ||
cp package/dist/bundles/* public/static/smoot-design | ||
|
||
4. Create env.config.jsx in the frontend-app-learning and add the below code: | ||
----------------------------------------------------------------------------- | ||
|
@@ -63,26 +64,34 @@ The Unit is rendered inside an Iframe and we use postMessage to communicate betw | |
|
||
import { getConfig } from '@edx/frontend-platform'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to retain this to load the configuration and the LMS URL dynamically instead of hardcoding the LMS base URL. |
||
|
||
import * as remoteTutorDrawer from "./mitodl-smoot-design/dist/bundles/remoteTutorDrawer.umd.js"; | ||
|
||
remoteTutorDrawer.init({ | ||
messageOrigin: getConfig().LMS_BASE_URL, | ||
transformBody: messages => ({ message: messages[messages.length - 1].content }), | ||
import( | ||
/* webpackIgnore: true */ | ||
"/static/smoot-design/remoteTutorDrawer.es.js").then(module => { | ||
module.init({ | ||
messageOrigin: getConfig().LMS_BASE_URL, | ||
transformBody: messages => ({ message: messages[messages.length - 1].content }), | ||
}) | ||
}) | ||
|
||
const config = { | ||
...process.env, | ||
}; | ||
const config = { | ||
...process.env, | ||
}; | ||
|
||
export default config; | ||
|
||
(Alternatively, you can import the drawer code from a CDN like kg.com/@mitodl/[email protected]/dist/bundles/remoteTutorDrawer.umd.js to skip Step 3. However, the steps outlined here are most similar to what we do in production.) | ||
|
||
5. Start learning MFE by ``npm run dev`` | ||
------------------- | ||
6. In LMS, enable the ``ol_openedx_chat.ol_openedx_chat_enabled`` waffle flag at ``<LMS>/admin/waffle/flag/`` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it's not part of this PR, but for the point/7 to work, we need an additional setting. We need to enable This can be done via If you can add it then that's fine, otherwise we can add that in another PR. |
||
------------------------------------------------------------------------------------------------------------- | ||
This will enable the ol_openedx_chat plugin for all courses. You can disable it and add a ``Waffle Flag Course Override`` at ``/admin/waffle_utils/waffleflagcourseoverridemodel/`` to enable it for a single course. | ||
|
||
7. Go to any course in CMS > Settings > Advanced Settings and add the below in "Other Course Settings" | ||
7. Set `FEATURES["ENABLE_OTHER_COURSE_SETTINGS"] = True` in your `cms/envs/private.py` and `lms/envs/private.py` files | ||
---------------------------------------------------------- | ||
This enables "Other Course Settings" below. | ||
|
||
8. Go to any course in CMS > Settings > Advanced Settings and add the below in "Other Course Settings" | ||
------------------------------------------------------------------------------------------------------ | ||
.. code-block:: | ||
|
||
|
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.
The code chunk below is not getting rendered. We might want to bring back this new line. This is how it currently looks

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.
Thanks, formatting issues should be fixed now.