Skip to content

Commit

Permalink
Merge pull request #131 from larriereguichet/feature/helper
Browse files Browse the repository at this point in the history
Feature/helper
  • Loading branch information
johnkrovitch authored Nov 24, 2019
2 parents a97a9e1 + 793caff commit 6719fb7
Show file tree
Hide file tree
Showing 62 changed files with 56,634 additions and 244 deletions.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@
.php_cs.cache
bin
!bin/php-cs-fixer-modified-files
!bin/sam.php
build
composer.lock
phpunit.xml
vendor
var/phpunit

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: php

php:
- '7.1'
- '7.2'
- '7.3'
- 7.2
- 7.3

before_install:
- mysql -e "create database IF NOT EXISTS admin_bundle_test;"
Expand All @@ -18,8 +17,8 @@ install:
- wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer

script:
- make phpstan@analyse phpunit@run
- php php-cs-fixer fix
- make phpunit@run phpstan@analyse
#- php php-cs-fixer fix --dry-run --using-cache=no --verbose

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
Expand Down
30 changes: 3 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ all: install

current_dir = $(shell pwd)

include etc/make/assets.mk
include etc/make/tests.mk

install:
composer install
make assets
Expand All @@ -14,30 +17,3 @@ update:

assets@build:
php sam.php

security@check:
bin/security-checker security:check

### PHPUnit ###
tests: php-cs-fixer@fix phpstan@analyse security@check phpunit@run

phpunit@run:
bin/phpunit
@echo "Results file generated file://$(current_dir)/var/phpunit/coverage/index.html"

### CodeStyle ###
.PHONY: php-cs-fixer@fix php-cs-fixer@install phpstan@analyse

php-cs-fixer@fix:
php-cs-fixer fix

php-cs-fixer@install:
@echo "Install binary using composer (globally)"
composer global require friendsofphp/php-cs-fixer
@echo "Exporting composer binary path"
@export PATH="$PATH:$HOME/.composer/vendor/bin"

phpstan@analyse: composer.lock
bin/phpstan analyse --level=1 src
bin/phpstan analyse --level=1 tests
##################
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ class AppKernel extends Kernel
Import the routing configuration to have the admin generated routes :

```yml
# config/routes.yaml

# config/routes.yaml
lag_admin:
resource: .
type: extra
Expand All @@ -98,13 +97,15 @@ And now you could go to `http://127.0.0.1:8000/admin/planet/list` to see a list
Yan can go to `http://127.0.0.1:8000/app_dev.php/admin/` to see the homepage of your admin interface

## Documentation
1. [Introduction](https://github.com/larriereguichet/AdminBundle/tree/master/src/Resources/docs/1.1.introduction.md)
1. [How To Use](https://github.com/larriereguichet/AdminBundle/tree/master/src/Resources/docs/1.1.how_to_use.md#how-to-use)
2. Admins and Actions
3. Events
4. Data Providers
5. Filters
6. Views
1. [How to use](https://github.com/larriereguichet/AdminBundle/tree/master/src/Resources/docs/1.how-to-use.md)
1. [How To Use](https://github.com/larriereguichet/AdminBundle/tree/master/src/Resources/docs/1.how_to_use.md#how-to-use)
2. [Admins](https://github.com/larriereguichet/AdminBundle/tree/master/src/Resources/docs/1.how_to_use.md#admin)
3. [Actions](https://github.com/larriereguichet/AdminBundle/tree/master/src/Resources/docs/1.how_to_use.md#actions)
4. Fields
4. Events
5. Data Providers
6. Filters
7. Views
2. Customization
a. Custom actions
b. Custom rendering
Expand All @@ -113,13 +114,15 @@ Yan can go to `http://127.0.0.1:8000/app_dev.php/admin/` to see the homepage of
a. Application configuration
b. Admin configuration
4. FAQ
5. Configuration reference
5. [Configuration reference](https://github.com/larriereguichet/AdminBundle/tree/master/src/Resources/docs/5.configuration-reference.md)

## Road map

### v1.1
- add dynamic id column (instead of required "id" column)
### V1.0
- add more testing
- Add dynamic id column (instead of required "id" column) to improve generic and handle multiple ids columns

### v1.0
- Add more testing

## History
Version 0.4 :
Expand Down
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ v0.n+1:
- handle custom actions for edit form (enable user for example) (WIP)
- configure application date format (filename export, displayed date...) (WIP)
- localization (rest field label in edit mode)
- remove depency with container in action configuration (=> move camelize method in a trait)

- remove dependency with container in action configuration (=> move camelize method in a trait)
- use translation in twig instead for flash messages
-----------------------------------------------

v0.4:
Expand Down
9 changes: 9 additions & 0 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'jquery';
import 'popper.js/dist/popper';
import 'bootstrap/dist/js/bootstrap';
import 'bootstrap/dist/css/bootstrap.css';

import '@fortawesome/fontawesome-free/js/all.js';
import '@fortawesome/fontawesome-free/css/all.css';

import '../scss/admin.scss';

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions assets/scss/admin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "partials/variables";
@import "partials/main";
@import "partials/form";
@import "partials/menu";
19 changes: 19 additions & 0 deletions assets/scss/partials/_form.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
form {
&.admin-form {
border: 1px solid lightgray;
padding: 20px;
}
.control-label {
font-weight: bold;
}
label,
legend {
font-weight: bold;
}
}

#filters-container {
position: absolute;
width: 80%;
z-index: 9999;
}
64 changes: 64 additions & 0 deletions assets/scss/partials/_main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#admin-main-container {
margin-top: 60px;
padding-left: 0;
padding-bottom: 25px;
}

.form-horizontal .form-group {
margin-left: 0;
margin-right: 0;
}

table {
th {
a {
text-decoration: none;
display: inline-block;

i.fa {
display: block;
float: right;
padding-left: 2px;

&.fa-sort-asc {
margin-top: 6px;
}
&.fa-sort-desc {
margin-top: 2px;
}
}
}
}
div.checkbox {
margin: 0 0 -2px 0;
}
.checkbox label, .radio label {
min-height: 15px;
}
}
// overriding sb-admin brand display
.navbar-brand {
padding-right: 30px;
}

// fix top and left menu to top
#admin-top-menu {
position: fixed;
width: 100%;
}
#page-wrapper {
padding-top: 68px;
}

.page-header {
margin-top: 0;
}

.pagination {
margin: auto;
width: 50%;
}

.content-container {
padding-top: 25px;
}
28 changes: 28 additions & 0 deletions assets/scss/partials/_menu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.sidebar-sticky {
position: sticky;
top: 48px;
height: calc(100vh - 48px);
padding-top: .5rem;
overflow-x: hidden;
overflow-y: auto;
}

#main-menu-container {
padding-left: 0;

#side-menu {
li {
width: 100%;

a {
display: inline-block;
padding: 10px;
width: 100%;
}
}
li:hover {
background-color: lightgrey;
opacity: 0.9;
}
}
}
1 change: 1 addition & 0 deletions assets/scss/partials/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$fa-font-path: "../fonts";
44 changes: 24 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,31 @@
}
],
"require": {
"php": "^7.1",
"components/font-awesome": "~4.5",
"components/jquery": "~3.0",
"components/jqueryui": "~1.0",
"doctrine/doctrine-bundle": "~1.2",
"php": "^7.2",
"doctrine/doctrine-bundle": "^1.0 || ^2.0",
"doctrine/orm": "^2.5",
"johnkrovitch/configuration": "^1.0",
"twig/extensions": "~1.2",
"sensio/framework-extra-bundle": "~4.0 || ~5.0",
"white-october/pagerfanta-bundle": "~1.0",
"johnkrovitch/configuration": "^1.3",
"lag/string-utils": "^1.2",
"oneup/uploader-bundle": "^2.0",
"sensio/framework-extra-bundle": "^3.0 || ^4.0",
"symfony/config": "^3.0 || ^4.0",
"symfony/contracts": "^1.0 || ^2.0",
"symfony/dependency-injection": "^3.0 || ^4.0",
"symfony/form": "^3.0 || ^4.0",
"symfony/yaml": "^3.0 || ^4.0",
"symfony/translation": "^3.0 || ^4.0",
"symfony/security-bundle": "^3.0 || ^4.0",
"oneup/uploader-bundle": "^2.0",
"symfony/contracts": "^1.0",
"lag/string-utils": "^1.0"
"symfony/translation": "^3.0 || ^4.0",
"symfony/translation-contracts": "^1.0 || ^2.0",
"symfony/yaml": "^3.0 || ^4.0",
"twig/extensions": "^1.2",
"twig/twig": "^2.0",
"white-october/pagerfanta-bundle": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"scrutinizer/ocular": "~1.1",
"johnkrovitch/sam": "^0.1",
"twbs/bootstrap": "^4.0",
"sensiolabs/security-checker": "^5.0 || ^6.0",
"sensiolabs/security-checker": "^3.0 || ^4.0 || ^5.0 || ^6.0",
"phpstan/phpstan": "^0.11.15",
"symfony/var-dumper": "^3.0 || ^4.0",
"phpstan/phpstan": "^0.11.15"
"symfony/webpack-encore-bundle": "^1.7"
},
"autoload": {
"psr-4": {
Expand All @@ -64,6 +63,11 @@
},
"config": {
"bin-dir": "bin",
"component-dir": "components"
"sort-packages": true
},
"scripts": {
"auto-scripts": {
"security-checker security:check": "script"
}
}
}
10 changes: 10 additions & 0 deletions etc/make/assets.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: assets assets.production

assets:
yarn run encore dev

assets.watch:
yarn run encore dev --watch

assets.production:
yarn run encore production
26 changes: 26 additions & 0 deletions etc/make/tests.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.PHONY: tests php-cs-fixer@fix phpstan@analyse phpunit@run security@check

### PHPUnit ###
tests: phpunit@run php-cs-fixer@fix phpstan@analyse security@check

phpunit@run:
bin/phpunit
@echo "Results file generated file://$(current_dir)/var/phpunit/coverage/index.html"

### CodeStyle ###
php-cs-fixer@fix:
php-cs-fixer fix

php-cs-fixer@install:
@echo "Install binary using composer (globally)"
composer global require friendsofphp/php-cs-fixer
@echo "Exporting composer binary path"
@export PATH="$PATH:$HOME/.composer/vendor/bin"

phpstan@analyse:
bin/phpstan analyse --level=1 src
bin/phpstan analyse --level=1 tests
##################

security@check:
bin/security-checker security:check
Loading

0 comments on commit 6719fb7

Please sign in to comment.