-
Notifications
You must be signed in to change notification settings - Fork 463
Integrate marksmith markdown editor #18435
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
rubhanazeem
wants to merge
4
commits into
openSUSE:master
Choose a base branch
from
rubhanazeem:integrate-ms
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
be0c71b
Add marksmith gem and it's configurations
rubhanazeem 061384f
Add changes to request decision component to support marksmith editor
rubhanazeem ba174d8
Add marksmith to user biography
rubhanazeem f327250
Update package form to support markdown editor
rubhanazeem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 17 additions & 20 deletions
37
src/api/app/components/write_and_preview_component.html.haml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,20 @@ | ||
| .card.write-and-preview{ data: { preview_message_url: preview_message_url, message_body_param: message_body_param } } | ||
| %ul.card-header.nav.nav-tabs.px-3.pt-2.pb-0.disable-link-generation{ role: 'tablist' } | ||
| %li.nav-item | ||
| = link_to('Write', "#write_#{text_area_attributes[:id_suffix]}", class: 'nav-link active', data: { 'bs-toggle': 'tab' }, role: 'tab', | ||
| aria: { controls: 'write-message-tab', selected: 'true' }) | ||
| %li.nav-item | ||
| = link_to('Preview', "#preview_#{text_area_attributes[:id_suffix]}", class: 'nav-link preview-message-tab', | ||
| data: { 'bs-toggle': 'tab', preview_message_url: preview_message_url }, | ||
| role: 'tab', aria: { controls: 'preview-message-tab', selected: 'false' }) | ||
| .tab-content.px-3 | ||
| .tab-pane.fade.show.active.my-3{ id: "write_#{text_area_attributes[:id_suffix]}", | ||
| role: 'tabpanel', 'aria-labelledby': 'write-message-tab', 'data-canned-controller': '' } | ||
| - if Flipper.enabled?(:canned_responses, User.session) && canned_responses_enabled | ||
| .d-flex.justify-content-end | ||
| = render CannedResponsesDropdownComponent.new(User.session.canned_responses.where(decision_type: nil).order(:title)) | ||
| ~ form.text_area(text_area_attributes[:object_name], id: "#{text_area_attributes[:id_suffix]}_body", | ||
| rows: text_area_attributes[:rows], required: text_area_attributes[:required], | ||
| placeholder: text_area_attributes[:placeholder], class: 'w-100 form-control message-field') | ||
| .tab-pane.fade{ id: "preview_#{text_area_attributes[:id_suffix]}", role: 'tabpanel', 'aria-labelledby': 'preview-message-tab' } | ||
| .message-preview.my-3 | ||
| %markdown-toolbar.write-and-preview{ id: "write_#{text_area_attributes[:id_suffix]}", | ||
| role: 'tabpanel', 'aria-labelledby': 'write-message-tab', | ||
| 'data-canned-controller': '' } | ||
| - if Flipper.enabled?(:canned_responses, User.session) && canned_responses_enabled | ||
| .d-flex.justify-content-end | ||
| = render CannedResponsesDropdownComponent.new(User.session.canned_responses.where(decision_type: nil).order(:title)) | ||
| = form.marksmith(text_area_attributes[:object_name], | ||
| id: "#{text_area_attributes[:id_suffix]}_body", | ||
| rows: text_area_attributes[:rows], | ||
| required: text_area_attributes[:required], | ||
| placeholder: text_area_attributes[:placeholder], | ||
| enable_file_uploads: false, | ||
| upload_url: nil, | ||
| maxlength: text_area_attributes[:maxlength], | ||
| class: "w-100 form-control message-field") | ||
| .tab-pane.fade{ id: "preview_#{text_area_attributes[:id_suffix]}", role: 'tabpanel', 'aria-labelledby': 'preview-message-tab' } | ||
| .message-preview.my-3 | ||
|
|
||
| :javascript | ||
| attachPreviewMessageOnCommentBoxes(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,5 @@ | |
| pin "application" | ||
| pin_all_from 'app/javascript/src', under: 'src', to: 'src' | ||
| pin "@hotwired/turbo-rails", to: "turbo.min.js" | ||
| pin "@hotwired/stimulus", to: "https://ga.jspm.io/npm:@hotwired/[email protected]/dist/stimulus.js" | ||
| pin "@avo-hq/marksmith", to: "@avo-hq--marksmith.js" # 0.4.7 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Marksmith.configure do |config| | ||
| config.automatically_mount_engine = true | ||
| config.mount_path = "/marksmith" | ||
| config.parser = "redcarpet" | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@rubhanazeem not sure if disabling css compressing is something we can do on production. I don't have any numbers, but this probably will increase load times on every view. Have you considered exchanging
sasscwith https://github.com/rails/dartsass-rails/ for example?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.
I looked into https://github.com/rails/cssbundling-rails but it was not working out of the box and needed a couple more modifications. I will have a look into
dartsass