Skip to content

Commit

Permalink
Merge branch 'main' into jest_test_has_many_copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dulerong committed Oct 19, 2021
2 parents 9bfc4c8 + e054d7f commit f4a9ce6
Show file tree
Hide file tree
Showing 114 changed files with 907 additions and 156 deletions.
5 changes: 5 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
version: "2"
exclude_patterns:
- "website/"
- "test/dummy"
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/DOCUMENTATION_ISSUE.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug Report
description: File a bug report
name: Documentation Issue
description: File a documentation issue
title: "[Doc]: "
labels: [documentation]
assignees:
Expand Down
67 changes: 53 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,35 @@ jobs:
bundle exec standardrb
yarn lint
jest:
name: Run Jest tests
docs:
name: Build Docusaurus site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up NPM
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Run tests
- name: run yarn build
working-directory: ./website
run: |
yarn install
yarn test
yarn build
docs:
name: Build Docusaurus site
jest:
name: Run Jest tests
runs-on: ubuntu-latest
needs: [lint, docs]
steps:
- uses: actions/checkout@v2
- name: Set up NPM
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: run yarn build
working-directory: ./website
- name: Run tests
run: |
yarn install
yarn build
yarn test
sqlite:
runs-on: ubuntu-latest
Expand All @@ -67,7 +68,6 @@ jobs:
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
BUNDLE_PATH_RELATIVE_TO_CWD: true

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand All @@ -85,6 +85,14 @@ jobs:
bundle exec rails prepare_assets
bundle exec rails db:test:prepare
bundle exec rails test
- name: Prepare artifacts for codeclimate
run: |
mv coverage/coverage.json coverage/raw.sqlite.${{ matrix.ruby }}.${{ matrix.gemfile }}.json
- name: Save partial coverage as an artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/raw.sqlite.${{ matrix.ruby }}.${{ matrix.gemfile }}.json

mysql:
runs-on: ubuntu-latest
Expand All @@ -98,7 +106,6 @@ jobs:
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
BUNDLE_PATH_RELATIVE_TO_CWD: true

services:
mysql:
image: mysql:8
Expand All @@ -107,7 +114,6 @@ jobs:
MYSQL_DATABASE: test
ports: ['3306:3306']
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand All @@ -125,6 +131,14 @@ jobs:
bundle exec rails prepare_assets
bundle exec rails db:test:prepare
bundle exec rails test
- name: Prepare artifacts for codeclimate
run: |
mv coverage/coverage.json coverage/raw.mysql.${{ matrix.ruby }}.${{ matrix.gemfile }}.json
- name: Save partial coverage as an artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/raw.mysql.${{ matrix.ruby }}.${{ matrix.gemfile }}.json

postgres:
needs: [lint, docs]
Expand All @@ -138,7 +152,6 @@ jobs:
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
BUNDLE_PATH_RELATIVE_TO_CWD: true

services:
postgres:
image: postgres:12
Expand All @@ -147,7 +160,6 @@ jobs:
POSTGRES_PASSWORD: password
POSTGRES_DB: test
ports: ['5432:5432']

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand All @@ -165,3 +177,30 @@ jobs:
bundle exec rails prepare_assets
bundle exec rails db:test:prepare
bundle exec rails test
- name: Prepare artifacts for codeclimate
run: |
mv coverage/coverage.json coverage/raw.postgres.${{ matrix.ruby }}.${{ matrix.gemfile }}.json
- name: Save partial coverage as an artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/raw.postgres.${{ matrix.ruby }}.${{ matrix.gemfile }}.json

codeclimate:
needs: [sqlite, mysql, postgres]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Download partial coverages
uses: actions/download-artifact@v2
with:
name: coverage
path: coverage
- name: Format, sum & upload results to Code Climate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
debug: true
coverageLocations: coverage/raw.*.json:simplecov
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.2.0](https://github.com/CMDBrew/adminterface/compare/v0.1.0...v0.2.0) (2021-10-15)


### Features

* add license checker ([e9f114f](https://github.com/CMDBrew/adminterface/commits/e9f114f3a298185c66541392ba8eacaa5addb20d))
* license_key encryption ([081e90a](https://github.com/CMDBrew/adminterface/commits/081e90a549263db213fa4fdfb607df57649ceb07))


### Bug Fixes

* only check license when starting rails server ([5b47829](https://github.com/CMDBrew/adminterface/commits/5b478298d28f301e501e8ffaafca40e8c8080b56))

## 0.1.0 (2021-09-25)


Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ group :test do
# For system and integration tests
gem "capybara"
gem "webdrivers"
gem "webmock"
gem "vcr"
# For test coverage reports
gem "simplecov", require: false
gem "simplecov_json_formatter", require: false
gem "simplecov-console", require: false
end
34 changes: 30 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PATH
remote: .
specs:
adminterface (0.1.0)
adminterface (0.2.0)
activeadmin (~> 2.9)
httparty (>= 0.18)
image_processing (~> 1.0)
rails (>= 6.0)
rainbow (~> 3.0)
Expand Down Expand Up @@ -80,6 +81,7 @@ GEM
zeitwerk (~> 2.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
appraisal (2.4.0)
bundler
rake
Expand Down Expand Up @@ -107,6 +109,8 @@ GEM
country_select (6.0.0)
countries (~> 4.0)
sort_alphabetical (~> 1.1)
crack (0.4.5)
rexml
crass (1.0.6)
devise (4.8.0)
bcrypt (~> 3.0)
Expand Down Expand Up @@ -150,7 +154,11 @@ GEM
has_scope (0.8.0)
actionpack (>= 5.2)
activesupport (>= 5.2)
hashdiff (1.0.1)
hashie (4.1.0)
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
i18n_data (0.13.0)
Expand Down Expand Up @@ -195,16 +203,19 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
marcel (1.0.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0901)
mini_magick (4.11.0)
mini_mime (1.0.3)
minitest (5.14.4)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.3)
nio4r (2.5.7)
nio4r (2.5.8)
nokogiri (1.12.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.12.5-x86_64-linux)
Expand All @@ -229,7 +240,7 @@ GEM
parslet (1.8.2)
pg (1.2.3)
public_suffix (4.0.6)
puma (5.3.2)
puma (5.5.1)
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
Expand Down Expand Up @@ -311,6 +322,10 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-console (0.9.1)
ansi
simplecov
terminal-table
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
sixarm_ruby_unaccent (1.2.0)
Expand All @@ -329,6 +344,8 @@ GEM
rubocop-performance (= 1.11.2)
standardrb (1.0.0)
standard
terminal-table (3.0.1)
unicode-display_width (>= 1.1.1, < 3)
thor (1.1.0)
tilt (2.0.10)
toml (0.2.0)
Expand All @@ -337,12 +354,17 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.0.0)
unicode_utils (1.4.0)
vcr (6.0.0)
warden (1.2.9)
rack (>= 2.0.9)
webdrivers (4.6.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (3.13.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.0)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
Expand Down Expand Up @@ -380,9 +402,13 @@ DEPENDENCIES
puma
sassc-rails
simplecov
simplecov-console
simplecov_json_formatter
sqlite3
standardrb
vcr
webdrivers
webmock
webpacker (~> 5.0)

BUNDLED WITH
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Adminterface <!-- omit in toc -->
[![CI](https://github.com/CMDBrew/adminterface/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/CMDBrew/adminterface/actions/workflows/ci.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/4dbedfdf21a2d675d2ca/maintainability)](https://codeclimate.com/github/CMDBrew/adminterface/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/4dbedfdf21a2d675d2ca/test_coverage)](https://codeclimate.com/github/CMDBrew/adminterface/test_coverage)
[![gem](https://img.shields.io/gem/v/adminterface?color=%23E9573F&label=rubygems.org)](https://rubygems.org/gems/adminterface)
[![npm](https://img.shields.io/npm/v/@cmdbrew/adminterface?color=%230273B4&label=npmjs.com)](https://www.npmjs.com/package/@cmdbrew/adminterface)

An add-on that brings Bootstrap 5 and other goodies into ActiveAdmin.

Expand Down Expand Up @@ -43,3 +47,19 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
## License
Adminterface is free for personal and non-commercial use and with a yearly subscription for commercial purposes. See [our Terms of Service in full text](LICENSE.md) for more information.
### For Commerical License
Get a license at https://adminterface.io/pricing, then create and add the `license_key` into the following file in your project:
```ruby
# config/initializers/adminterface.rb
Adminterface.setup do |config|
config.license_key = "**********************"
## Use Rails credentials:
## doc: https://edgeguides.rubyonrails.org/security.html#custom-credentials
# config.license_key = Rails.application.credentials.adminterface[:license_key]
## Or, use environment variables:
# config.license_key = ENV["ADMINTERFACE_LICENSE_KEY"]
end
```
1 change: 1 addition & 0 deletions adminterface.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
spec.add_dependency "rails", ">= 6.0"
spec.add_dependency "rainbow", "~> 3.0"
spec.add_dependency "image_processing", "~> 1.0"
spec.add_dependency "httparty", ">= 0.18"
end
2 changes: 1 addition & 1 deletion app/javascript/adminterface/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const info = {

const admonitionStyles = {
heading: {
head: 'font-weight: bold; color: #3C324C; background: #9e82c8;',
head: 'font-weight: bold; color: #3C324C; background: #9E82C8;',
body: 'color: white; background: #3C324C;'
},
success: {
Expand Down
4 changes: 4 additions & 0 deletions gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ end
group :test do
gem "capybara"
gem "webdrivers"
gem "webmock"
gem "vcr"
gem "simplecov", require: false
gem "simplecov_json_formatter", require: false
gem "simplecov-console", require: false
end

gemspec path: "../"
Loading

0 comments on commit f4a9ce6

Please sign in to comment.