зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-08-28 15:36:17 +03:00
Сравнить коммиты
7 Коммитов
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
8d6b05297a | ||
|
|
5d9b6f70fd | ||
|
|
6fa021c0c7 | ||
|
|
357ef382d6 | ||
|
|
43ae70c7c9 | ||
|
|
6daf6f6bc8 | ||
|
|
98c235d346 |
44
.github/workflows/brakeman-analysis.yml
поставляемый
Обычный файл
44
.github/workflows/brakeman-analysis.yml
поставляемый
Обычный файл
@@ -0,0 +1,44 @@
|
||||
# This workflow integrates Brakeman with GitHub's Code Scanning feature
|
||||
# Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications
|
||||
|
||||
name: Brakeman Scan
|
||||
|
||||
# This section configures the trigger for the workflow. Feel free to customize depending on your convention
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "main" ]
|
||||
pull_request:
|
||||
branches: [ "master", "main" ]
|
||||
|
||||
jobs:
|
||||
brakeman-scan:
|
||||
name: Brakeman Scan
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Checkout the repository to the GitHub Actions runner
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Customize the ruby version depending on your needs
|
||||
- name: Setup Ruby
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '2.7'
|
||||
|
||||
- name: Setup Brakeman
|
||||
env:
|
||||
BRAKEMAN_VERSION: '4.10' # SARIF support is provided in Brakeman version 4.10+
|
||||
run: |
|
||||
gem install brakeman --version $BRAKEMAN_VERSION
|
||||
|
||||
# Execute Brakeman CLI and generate a SARIF output with the security issues identified during the analysis
|
||||
- name: Scan
|
||||
continue-on-error: true
|
||||
run: |
|
||||
brakeman -f sarif -o output.sarif.json .
|
||||
|
||||
# Upload the SARIF file generated in the previous step
|
||||
- name: Upload SARIF
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: output.sarif.json
|
||||
1
.rspec
1
.rspec
@@ -1,3 +1,2 @@
|
||||
--require rails_helper
|
||||
--format documentation
|
||||
--profile
|
||||
|
||||
11
README.md
11
README.md
@@ -87,9 +87,16 @@ the *upload_admin_post_path*) and it doesn't provide a way to remove images (jus
|
||||
the editor will not destroy them, you'll need to implement a purge logic for that).
|
||||
|
||||
## Do you like it? Star it!
|
||||
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
|
||||
If you use this component just star it. A developer is more motivated to improve a project when there is some interest. My other [Active Admin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source).
|
||||
|
||||
Take a look at [other Active Admin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source) that I made if you are curious.
|
||||
<div style="background: #d1ecf1; margin: 0 auto; padding: 10px; text-align: center; width: 60%">
|
||||
<p style="color: #0c5460">Or consider offering me a coffee please,<br/>it's a small thing but it is greatly appreciated.</p>
|
||||
<form action="https://www.paypal.com/donate" method="post" target="_top">
|
||||
<input type="hidden" name="hosted_button_id" value="CT86ENQEBBB5N" />
|
||||
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
|
||||
<img alt="" border="0" src="https://www.paypal.com/en_IT/i/scr/pixel.gif" width="1" height="1" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
## Contributors
|
||||
- [Mattia Roccoberton](http://blocknot.es): author
|
||||
|
||||
5
Rakefile
5
Rakefile
@@ -5,7 +5,10 @@ require 'bundler/gem_tasks'
|
||||
begin
|
||||
require 'rspec/core/rake_task'
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
RSpec::Core::RakeTask.new(:spec) do |t|
|
||||
# t.ruby_opts = %w[-w]
|
||||
t.rspec_opts = ['--color', '--format documentation']
|
||||
end
|
||||
|
||||
task default: :spec
|
||||
rescue LoadError
|
||||
|
||||
@@ -19,13 +19,15 @@ Gem::Specification.new do |spec|
|
||||
|
||||
spec.add_runtime_dependency 'activeadmin', '~> 2.0'
|
||||
|
||||
spec.add_development_dependency 'activestorage', '~> 6.0.3.2'
|
||||
spec.add_development_dependency 'capybara', '~> 3.33.0'
|
||||
spec.add_development_dependency 'pry', '~> 0.13.1'
|
||||
spec.add_development_dependency 'puma', '~> 4.3.5'
|
||||
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
|
||||
spec.add_development_dependency 'rspec-rails', '~> 4.0.1'
|
||||
spec.add_development_dependency 'rubocop', '~> 0.90.0'
|
||||
spec.add_development_dependency 'selenium-webdriver', '~> 3.142.7'
|
||||
spec.add_development_dependency 'sqlite3', '~> 1.4.2'
|
||||
spec.add_development_dependency 'activestorage', '~> 6.0'
|
||||
spec.add_development_dependency 'capybara', '~> 3.33'
|
||||
spec.add_development_dependency 'pry', '~> 0.13'
|
||||
spec.add_development_dependency 'puma', '~> 4.3'
|
||||
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4'
|
||||
spec.add_development_dependency 'rspec-rails', '~> 4.0'
|
||||
spec.add_development_dependency 'rubocop', '~> 0.90'
|
||||
spec.add_development_dependency 'sassc', '~> 2.4'
|
||||
spec.add_development_dependency 'selenium-webdriver', '~> 3.142'
|
||||
spec.add_development_dependency 'sprockets-rails', '~> 3.2'
|
||||
spec.add_development_dependency 'sqlite3', '~> 1.4'
|
||||
end
|
||||
|
||||
@@ -29,6 +29,7 @@ body.active_admin [data-aa-quill-editor] {
|
||||
max-height: 300px;
|
||||
min-height: 150px;
|
||||
padding: 10px;
|
||||
word-break: break-all;
|
||||
|
||||
ol {
|
||||
list-style-type: decimal;
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
module ActiveAdmin
|
||||
module QuillEditor
|
||||
VERSION = '0.3.0'
|
||||
VERSION = '0.3.2'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
{
|
||||
"name": "activeadmin_quill_editor",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.2",
|
||||
"description": "Quill Editor for ActiveAdmin",
|
||||
"author": "Mattia Roccoberton <mat@blocknot.es>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/blocknotes/activeadmin_quill_editor",
|
||||
"main": "index.js"
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"app/**/*",
|
||||
"index.js"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
require_relative 'boot'
|
||||
|
||||
require 'rails/all'
|
||||
require 'sprockets/railtie'
|
||||
|
||||
Bundler.require(*Rails.groups)
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@ RSpec.describe 'Quill editor', type: :system do
|
||||
end
|
||||
|
||||
after do
|
||||
Post.destroy_all
|
||||
author.destroy
|
||||
Post.delete_all
|
||||
author.delete
|
||||
end
|
||||
|
||||
context 'with a Quill editor' do
|
||||
it 'updates some HTML content' do
|
||||
it 'initialize the editor' do
|
||||
visit "/admin/posts/#{post.id}/edit"
|
||||
|
||||
%w[bold italic underline link].each do |button|
|
||||
@@ -22,13 +22,37 @@ RSpec.describe 'Quill editor', type: :system do
|
||||
end
|
||||
expect(page).to have_css('#post_description[data-aa-quill-editor]')
|
||||
expect(page).to have_css('#post_description_input .ql-editor', text: 'Some content...')
|
||||
end
|
||||
|
||||
it 'adds some text to the description' do
|
||||
visit "/admin/posts/#{post.id}/edit"
|
||||
|
||||
find('#post_description_input .ql-editor').click
|
||||
find('#post_description_input .ql-editor').base.send_keys('more text')
|
||||
|
||||
find('[type="submit"]').click
|
||||
expect(page).to have_content('was successfully updated')
|
||||
expect(post.reload.description).to eq '<p>Some content...more text</p>'
|
||||
end
|
||||
|
||||
it 'adds some bold text to the description' do
|
||||
visit "/admin/posts/#{post.id}/edit"
|
||||
|
||||
find('#post_description_input .ql-editor').click
|
||||
find('#post_description_input .ql-toolbar .ql-bold').click
|
||||
find('#post_description_input .ql-editor').base.send_keys('more text')
|
||||
find('[type="submit"]').click
|
||||
expect(post.reload.description).to eq '<p>Some content...<strong>more text</strong></p>'
|
||||
end
|
||||
|
||||
it 'adds some italic text to the description' do
|
||||
visit "/admin/posts/#{post.id}/edit"
|
||||
|
||||
find('#post_description_input .ql-editor').click
|
||||
find('#post_description_input .ql-toolbar .ql-italic').click
|
||||
find('#post_description_input .ql-editor').base.send_keys('more text')
|
||||
find('[type="submit"]').click
|
||||
expect(post.reload.description).to eq '<p>Some content...<em>more text</em></p>'
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a Quill editor in a nested resource' do
|
||||
|
||||
Ссылка в новой задаче
Block a user