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

Show readonly code editor field on detail page #5969

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

Uplink03
Copy link
Contributor

@Uplink03 Uplink03 commented Oct 22, 2023

This patch adds a read-only CodeMirror for CodeEditorField on the detail page.

Assets rebuilt with make build-assets.

Problems with this PR

@javiereguiluz I need some help, if you don't mind.

Unfortunately, I can't get good results from yarn build, so this PR is a draft until I figure that out. The patch works even without a rebuild, but a build is necessary to make the CodeMirror editor read-only.

When I run yarn build, the following problems occur:

  • WARNING The value passed to setPublicPath() should *usually* start with "/" or be a full URL (http://...). If you're not sure, then you should probably change your public path and make this message disappear.
  • The manifest.json file refers to paths that start with /, therefore the browser just gets 404 for everything.
  • Removing the leading / manually makes JS and CSS load again, but everything (and I mean everything rendered by EasyAdminBundle) is RTL, and the CodeEditor field doesn't accept input, and I'm also missing fonts

@javiereguiluz
Copy link
Collaborator

Regarding the asset building, you are not doing anything wrong ... but because of how we need to define assets in this project, you need to run another command after running yarn build. See

EasyAdminBundle/Makefile

Lines 28 to 30 in 3b7e8c4

build-assets: ## Rebuild assets after changes in JS or SCSS
yarn encore production
php ./src/Resources/bin/fix-assets-manifest-file.php

@Uplink03 Uplink03 marked this pull request as ready for review October 25, 2023 19:55
@Uplink03
Copy link
Contributor Author

Thanks @javiereguiluz . I didn't notice that Makefile there. It's all built now.

@javiereguiluz javiereguiluz added this to the 4.x milestone Nov 1, 2023
@javiereguiluz
Copy link
Collaborator

I really like this proposal. It looks really nice in the detail page. Thanks a lot @Uplink03!

@javiereguiluz javiereguiluz merged commit ce6f560 into EasyCorp:4.x Nov 1, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants