Skip to content

Commit

Permalink
Item12952: Improve extension installer
Browse files Browse the repository at this point in the history
Change "Install" button to "Study".  And add some documentation / page
headings to make it more readable.

Add a warning about the automatic installation of deps if there are
missing deps.

Add "Simulate" and "Install without Dependencies" buttons to the
Dependency report.

Note:   The  extension installer is not working. There is something
going on with the repository parameter.  That's unrelated to this
checkin.
  • Loading branch information
gac410 committed Oct 4, 2014
1 parent 42f9b94 commit 48680a8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
8 changes: 7 additions & 1 deletion core/lib/Foswiki/Configure/Wizards/ExploreExtensions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ sub _get_extensions {
my $uninstalledExts;
my $uninstalledCount = 0;

$reporter->NOTE('---++ Available Extensions');
$reporter->NOTE(
'> Each extension is listed along with a "Study" button. Click "Study" to generate a dependency report for the extension. From there, you can proceed with the installation. '
);
$reporter->NOTE('> ');

# count
foreach my $key ( keys %$exts ) {
my $ext = $exts->{$key};
Expand Down Expand Up @@ -282,7 +288,7 @@ sub _get_extensions {
# is the version number read from FastReport, and {release} will be
# the latest release from there.

my $install = 'Install';
my $install = 'Study';
my $uninstall = '';

if ( $ext->{installedRelease} ) {
Expand Down
34 changes: 32 additions & 2 deletions core/lib/Foswiki/Configure/Wizards/InstallExtensions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,36 @@ sub depreport {
if (@$installed);
if (@$missing) {
$reporter->NOTE( "> *MISSING*", map { "\t* $_" } @$missing );
$reporter->WARN( <<DEPS );
> *Caution:* If you proceed with install, the missing dependencies listed as _Required_
will be automatically installed. Be sure that this is what you want.
DEPS
}
else {
$reporter->NOTE("> All dependencies satisfied");
}

$reporter->NOTE(' * Click "Install" to proceed with the installation.');
$reporter->NOTE(
' * Click "Simulate" to get a detailed report on what will happen during installation.'
);
$reporter->NOTE(
' * Click "Install without Dependencies" to install _only_ this extension, ignoring the dependencies.'
) if (@$missing);

my $simulate = 0;
my $nodeps = 0;

if ( $this->param('args')->{installable} ) {
my %data = (
wizard => 'InstallExtensions',
method => 'add',
args => {
repository => $pkg->repository(),
module => $pkg->module(),
SIMULATE => 0,
NODEPS => 0,

# SIMULATE =>
# NODEPS =>
# USELOCAL =>
}
);
Expand All @@ -124,6 +139,21 @@ sub depreport {
$reporter->NOTE(
"<button class=\"wizard_button\" data-wizard=\"$json\">Install</button>"
);

$data{args}->{SIMULATE} = 1;
$json = JSON->new->encode( \%data );
$json =~ s/"/&quot;/g;

$reporter->NOTE(
"<button class=\"wizard_button\" data-wizard=\"$json\">Simulate</button>"
);
if (@$missing) {
$data{args}->{SIMULATE} = 0;
$data{args}->{NODEPS} = 1;
$reporter->NOTE(
"<button class=\"wizard_button\" data-wizard=\"$json\">Install without dependencies</button>"
);
}
}

$pkg->finish();
Expand Down

0 comments on commit 48680a8

Please sign in to comment.