Skip to content
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

Issues with overriding widgets in the frontend #2447

Open
sandroscosta opened this issue Jun 25, 2024 · 2 comments
Open

Issues with overriding widgets in the frontend #2447

sandroscosta opened this issue Jun 25, 2024 · 2 comments
Assignees

Comments

@sandroscosta
Copy link
Collaborator

Hello all!

We need some help overriding frontend components on our site factory and we've been encountering some challenges.
We need to override widgets/SyllabusCourseRunsList/components/SyllabusCourseRun on our end, but the system is not processing the correct path. Can you point us toward the correct configuration, if it's possible to do (which I assume it is, by the documentation).

Can you gives us some additional insights? @jbpenrath

@sandroscosta sandroscosta self-assigned this Jun 25, 2024
@sandroscosta
Copy link
Collaborator Author

Discussed with @JoaoGarcao

@jbpenrath
Copy link
Member

jbpenrath commented Jun 26, 2024

Hi Sandro!
You have to use the relative path to the correct component.

To find the proper path, you have to imagine you start from the folder of the module you are overriding within richie-education package and you want to go to the new module you created to override it.

e.g: you are in the frontend folder of a site factory and you want to override the web-analytics index module, you put the replacement module within js/web-analytics/custom.ts

js
	| web-analytics
		| custom.ts
node_modules
	| richie-education
		| js
			| web-analytics
				| index.ts

From node_modules/richie-education/js/web-analytics to go to js/web-analytics you have to do cd ../../../../../js/web-analytics

So within overrides.json you'll add :

"js/web-analytics/index.ts": "../../../../../js/web-analytics/custom.ts"

https://github.com/openfun/fun-richie-site-factory/blob/26a114bbede1bbb8a4b5d1a6ab93821823e4d468/sites/funmooc/src/frontend/overrides.json#L1-L6

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

No branches or pull requests

2 participants