Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aggrid
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
aggrid
Commits
30b2956c
Commit
30b2956c
authored
2 years ago
by
Mike Feranda
Committed by
Mike Feranda
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3341023
by mferanda: Drush download no longer working
parent
a417c68d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+18
-4
18 additions, 4 deletions
README.md
composer.libraries.json
+2
-9
2 additions, 9 deletions
composer.libraries.json
drush.services.yml
+0
-5
0 additions, 5 deletions
drush.services.yml
src/Commands/AggridDrushCommands.php
+0
-89
0 additions, 89 deletions
src/Commands/AggridDrushCommands.php
with
20 additions
and
107 deletions
README.md
+
18
−
4
View file @
30b2956c
...
...
@@ -42,11 +42,25 @@
<https://github.com/ag-grid/ag-grid>
Make sure to download the min.noStyle versions of the Community and
Enterprise versions.
## COMPOSER SETUP
<https://github.com/ag-grid/ag-grid/raw/master/packages/ag-grid-community/dist/ag-grid-community.min.noStyle.js>
<https://github.com/ag-grid/ag-grid/raw/master/packages/ag-grid-enterprise/dist/ag-grid-enterprise.min.noStyle.js>
-
Make sure these are added to your composer.json
composer require wikimedia/composer-merge-plugin composer/installers
-
Edit the "composer.json" file of your website and under the "extra": { section add:
"merge-plugin": {
"include": [
"web/modules/contrib/aggrid/composer.libraries.json"
]
}
**
Note - May need to modify the include based on your site implementation from root.
-
Re-run composer to include the required libraries
composer update drupal/aggrid --with-dependencies
## CONFIGURATION
...
...
This diff is collapsed.
Click to expand it.
composer.libraries.json
+
2
−
9
View file @
30b2956c
...
...
@@ -23,13 +23,6 @@
"Drupal\\aggrid\\"
:
"src/"
}
},
"extra"
:
{
"drush"
:
{
"services"
:
{
"drush.services.yml"
:
"^9"
}
}
},
"repositories"
:
{
"ag-grid-community"
:
{
"type"
:
"package"
,
...
...
@@ -69,7 +62,7 @@
}
},
"require"
:
{
"ag-grid-community/ag-grid-community"
:
"
20.2.0
"
,
"ag-grid-enterprise/ag-grid-enterprise"
:
"
20.2.0
"
"ag-grid-community/ag-grid-community"
:
"
*
"
,
"ag-grid-enterprise/ag-grid-enterprise"
:
"
*
"
}
}
This diff is collapsed.
Click to expand it.
drush.services.yml
deleted
100644 → 0
+
0
−
5
View file @
a417c68d
services
:
aggrid.commands
:
class
:
\Drupal\aggrid\Commands\AggridDrushCommands
tags
:
-
{
name
:
drush.command
}
This diff is collapsed.
Click to expand it.
src/Commands/AggridDrushCommands.php
deleted
100644 → 0
+
0
−
89
View file @
a417c68d
<?php
namespace
Drupal\aggrid\Commands
;
use
Drush\Commands\DrushCommands
;
use
Exception
;
/**
* Class AggridDrushCommands.
*
* @package Drupal\aggrid\Commands
*/
class
AggridDrushCommands
extends
DrushCommands
{
/**
* Downloads the most current ag-Grid Library files.
*
* Argument provided to the drush command.
*
* @command aggrid:download
* @aliases agg-download
* @usage aggrid:download
* Download/Update the ag-Grid Library from GitHub
*/
public
function
download
()
{
// Create a file system service manager.
// Remove the existing directory if it exists.
$library_directory
=
DRUPAL_ROOT
.
'/libraries/'
;
$clear_cache
=
false
;
try
{
$aggrid_library_directory
=
$library_directory
.
'/ag-grid'
;
if
(
file_exists
(
$library_directory
)
&&
file_exists
(
$aggrid_library_directory
))
{
// Remove the existing file.
if
(
file_exists
(
$aggrid_library_directory
.
'/ag-grid-community.min.noStyle.js'
))
{
unlink
(
$aggrid_library_directory
.
'/ag-grid-community.min.noStyle.js'
);
}
if
(
file_exists
(
$aggrid_library_directory
.
'/ag-grid-enterprise.min.noStyle.js'
))
{
unlink
(
$aggrid_library_directory
.
'/ag-grid-enterprise.min.noStyle.js'
);
}
if
(
file_exists
(
$aggrid_library_directory
.
'/css/ag-grid.css'
))
{
unlink
(
$aggrid_library_directory
.
'/css/ag-grid.css'
);
}
if
(
file_exists
(
$aggrid_library_directory
.
'/css/ag-theme-balham.css'
))
{
unlink
(
$aggrid_library_directory
.
'/css/ag-theme-balham.css'
);
}
rmdir
(
$aggrid_library_directory
.
'/css'
);
rmdir
(
$aggrid_library_directory
);
}
// Create the directory(s).
if
(
!
file_exists
(
$library_directory
))
{
mkdir
(
DRUPAL_ROOT
.
'/libraries'
);
}
mkdir
(
DRUPAL_ROOT
.
'/libraries/ag-grid'
);
mkdir
(
DRUPAL_ROOT
.
'/libraries/ag-grid/css'
);
// Download the community file.
if
(
!
drush_shell_exec
(
'curl -o '
.
DRUPAL_ROOT
.
'/libraries/ag-grid'
.
'/ag-grid-community.min.noStyle.js https://github.com/ag-grid/ag-grid/raw/master/packages/ag-grid-community/dist/ag-grid-community.min.noStyle.js'
)){
throw
new
Exception
(
'Community Edition download failed - [stopping]'
);
}
drush_log
(
dt
(
'ag-Grid Community library has been successfully installed at libraries/ag-grid'
,
[],
'success'
),
'success'
);
// Download the enterprise file.
if
(
!
drush_shell_exec
(
'curl -o '
.
DRUPAL_ROOT
.
'/libraries/ag-grid'
.
'/ag-grid-enterprise.min.noStyle.js https://github.com/ag-grid/ag-grid/raw/master/packages/ag-grid-enterprise/dist/ag-grid-enterprise.min.noStyle.js'
)){
throw
new
Exception
(
'Enterprise Edition download failed - [stopping]'
);
}
drush_log
(
dt
(
'ag-Grid Enterprise library has been successfully installed at libraries/ag-grid'
,
[],
'success'
),
'success'
);
if
(
!
drush_shell_exec
(
'curl -o '
.
DRUPAL_ROOT
.
'/libraries/ag-grid/css'
.
'/ag-grid.css https://raw.githubusercontent.com/ag-grid/ag-grid/master/packages/ag-grid-community/dist/styles/ag-grid.css'
)){
throw
new
Exception
(
'ag-Grid CSS download failed - [stopping]'
);
}
drush_log
(
dt
(
'ag-Grid CSS has been successfully installed at libraries/ag-grid/css'
,
[],
'success'
),
'success'
);
// Get ag-Grid CSS
if
(
!
drush_shell_exec
(
'curl -o '
.
DRUPAL_ROOT
.
'/libraries/ag-grid/css'
.
'/ag-theme-balham.css https://raw.githubusercontent.com/ag-grid/ag-grid/master/packages/ag-grid-community/dist/styles/ag-theme-balham.css'
)){
throw
new
Exception
(
'Balham (default) theme download failed - [stopping]'
);
}
drush_log
(
dt
(
'ag-Grid theme Balham (default) CSS has been successfully installed at libraries/ag-grid/css'
,
[],
'success'
),
'success'
);
drupal_flush_all_caches
();
}
catch
(
Exception
$e
)
{
drush_log
(
dt
(
'aggrid Download Error: @error'
,
[
'@error'
=>
$e
->
getMessage
()],
'error'
),
'error'
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment