Skip to content

Commit

Permalink
Refactor javascript sources
Browse files Browse the repository at this point in the history
Add dynamic imports
Use datatables as npm deps
Set axios as global var
Simplify datatables view
  • Loading branch information
pdavide committed Apr 17, 2019
1 parent 6c14318 commit 802825f
Show file tree
Hide file tree
Showing 18 changed files with 13,767 additions and 15,225 deletions.
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import"
]
}
23 changes: 13 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
module.exports = {
"extends": [
"eslint:recommended"
],
"env": {
"browser": true,
"jquery": true,
"commonjs": true,
"es6": true
},
"parser": "babel-eslint"
"extends": [
"eslint:recommended"
],
"env": {
"browser": true,
"jquery": true,
"commonjs": true,
"es6": true
},
"globals": {
"axios": "readonly"
},
"parser": "babel-eslint"
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ TODO
/public/css
/public/js
/public/images
/public/web-toolkit

# ignored for security reasons
/env/build.properties
Expand Down
13 changes: 6 additions & 7 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ public function index()
{
$datatable = [
'columns' => [
'name' => 'Nome',
'familyName' => 'Cognome',
'email' => 'Email',
'role' => 'Ruolo',
'added_at' => 'Iscritto dal',
'status' => 'Stato',
'actions' => 'Azioni',
['data' => 'name', 'name' => 'Cognome e nome'],
['data' => 'email', 'name' => 'Email'],
['data' => 'admin', 'name' => 'Amministratore'],
['data' => 'added_at', 'name' => 'Iscritto dal'],
['data' => 'status', 'name' => 'Stato'],
['data' => 'buttons', 'name' => 'Azioni'],
],
'source' => route('users-data-json'),
'caption' => 'Elenco degli utenti web abilitati su Web Analytics Italia', //TODO: set title in lang file
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/WebsiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public function index()
{
$datatable = [
'columns' => [
'url' => 'URL',
'type' => 'Tipo',
'added_at' => 'Iscritto dal',
'status' => 'Stato',
'last_month_visits' => 'Visite*',
'actions' => 'Azioni',
['data' => 'url', 'name' => 'URL'],
['data' => 'type', 'name' => 'Tipo'],
['data' => 'added_at', 'name' => 'Aggiunto il'],
['data' => 'status', 'name' => 'Stato'],
['data' => 'last_month_visits', 'name' => 'Visite*'],
['data' => 'buttons', 'name' => 'Azioni'],
],
'source' => route('websites-data-json'),
'caption' => 'Elenco dei siti web abilitati su Web Analytics Italia', //TODO: set title in lang file
Expand Down
Loading

0 comments on commit 802825f

Please sign in to comment.