Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ChristopherChudzicki
Copy link
Contributor

What are the relevant tickets?

For https://github.com/mitodl/hq/issues/7259

Description (What does it do?)

Updates readme.

How can this be tested?

  1. Follow directions in readme.

Copy link
Contributor

@arslanashraf7 arslanashraf7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of small changes.

/* webpackIgnore: true */
"/static/smoot-design/remoteTutorDrawer.es.js").then(module => {
module.init({
messageOrigin: "http://local.openedx.io:8000",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
messageOrigin: "http://local.openedx.io:8000",
messageOrigin: getConfig().LMS_BASE_URL,


4. Create env.config.jsx in the frontend-app-learning and add the below code:
-----------------------------------------------------------------------------
The Unit is rendered inside an Iframe and we use postMessage to communicate between the Iframe and the parent window. The below code is used to initialize the remoteAiChatDrawer.

.. code-block:: js

import { getConfig } from '@edx/frontend-platform';
Copy link
Contributor

Choose a reason for hiding this comment

The 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.


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/``
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ENABLE_OTHER_COURSE_SETTINGS in FEATURES for Other Course Settings to display.

This can be done via private.py or tutor config --set command.

If you can add it then that's fine, otherwise we can add that in another PR.

Copy link
Contributor

@arslanashraf7 arslanashraf7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two very small comments on the rendered rst.


4. Create env.config.jsx in the frontend-app-learning and add the below code:
-----------------------------------------------------------------------------
The Unit is rendered inside an Iframe and we use postMessage to communicate between the Iframe and the parent window. The below code is used to initialize the remoteAiChatDrawer.

.. code-block:: js

Copy link
Contributor

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
image

Copy link
Contributor Author

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.

@@ -106,7 +114,7 @@ LMS Chat Drawer View

.. image:: static/images/ai_chat_aside_lms_drawer_view.png

9. Disable it for a single block
7. Disable it for a single block
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
7. Disable it for a single block
9. Disable it for a single block

Copy link
Contributor

@arslanashraf7 arslanashraf7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for making all the changes 👍

@arslanashraf7
Copy link
Contributor

@ChristopherChudzicki Just a reminder to merge this whenever you get the chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants