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

Feat(widget-relation): string templates support #3659

Merged
merged 6 commits into from Apr 30, 2020

Conversation

erezrokah
Copy link
Contributor

@erezrokah erezrokah commented Apr 26, 2020

Fixes #1063
Fixes #2800

Created a package called netlify-cms-lib-widgets to share common code between widgets.
Also updated the relation widget docs with an example on how to use string templates and re-arranged so the required fields are listed first.

@barthc
Copy link
Collaborator

barthc commented Apr 26, 2020

Created a package called netlify-cms-lib-widgets to share common code between widgets.

How about we move the compileStringTemplate to netlify-cms-lib-util since it's also used by the core ?

@erezrokah
Copy link
Contributor Author

erezrokah commented Apr 26, 2020

How about we move the compileStringTemplate to netlify-cms-lib-util since it's also used by the core ?

I thought about that - but netlify-cms-lib-util has a lot of backend related code too (well almost only backend related code other than promise.ts which is no longer used and path.ts that we can replace just using the path module) which is not related to the widgets.

Maybe move that code to netlify-cms-lib-backends?

Thought about doing that refactoring in another PR, what do you think?

@barthc
Copy link
Collaborator

barthc commented Apr 26, 2020

Maybe move that code to netlify-cms-lib-backends?

Agreed.

I am thinking, the new netlify-cms-lib-widgets package doesn't have much content save the compileStringTemplate. Maybe we can wait for more widget related lib codes to ramp up before splitting or group them by folder inside the netlify-cms-lib-util package, thoughts?

@erezrokah
Copy link
Contributor Author

erezrokah commented Apr 26, 2020

Ok, let me do the refactoring with the libs. I was planning on removing promise.js and replacing path.js usages with the built in path module, but I'll do that in another PR.

@erezrokah
Copy link
Contributor Author

erezrokah commented Apr 26, 2020

Ok, let me do the refactoring with the libs.

Ok so changing netlify-cms-lib-util to netlify-cms-lib-backends touches A LOT of code which seems a bit risky and unrelated to do as a part of a relation widget PR.

I'll re-visit this in another designated refactoring.

@erezrokah erezrokah requested a review from erquhart Apr 27, 2020
@erezrokah erezrokah added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Apr 29, 2020
@erezrokah erezrokah force-pushed the feat/relation_string_templates branch from 16ceacf to ac78539 Compare Apr 30, 2020
@erezrokah erezrokah merged commit 213ae86 into master Apr 30, 2020
23 checks passed
@erezrokah erezrokah deleted the feat/relation_string_templates branch Apr 30, 2020
@guillett
Copy link

guillett commented May 6, 2020

I don't know anywhere else I can thank you. So here it is many thanks for that PR!! The work done on Netlify CMS is really great. 🙏 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
3 participants