Skip to content

Commit

Permalink
Show the "Update all" button even if there are uninstallable updates
Browse files Browse the repository at this point in the history
Resolves #4230
  • Loading branch information
brandonkelly committed May 8, 2019
1 parent 4921d5d commit 85daa37
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### Changed
- The “Update all” button on the Updates utility is now shown even if the page contains some uninstallable updates. ([#4230](https://github.com/craftcms/cms/issues/4230))
- Craft now stores the Default User Group’s UID in the project config, in case the group’s ID is different across environments.
- `craft\services\Assets::EVENT_BEFORE_REPLACE_ASSET` event handlers can now change the filename of the replaced asset before it is saved.
- Improved the performance of background jobs. ([#4219](https://github.com/craftcms/cms/pull/4219))
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/edituser/dist/profile.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/web/assets/matrix/dist/MatrixInput.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/matrix/dist/MatrixInput.min.js.map

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions src/web/assets/updates/dist/UpdatesUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
totalAvailableUpdates: 0,
criticalUpdateAvailable: false,
allowUpdates: null,
showUpdateAllBtn: true,
updates: null,
installableUpdates: null,

init: function() {
this.$body = $('#content');

var $graphic = $('#graphic'),
$status = $('#status');

this.updates = [];
this.installableUpdates = [];

var data = {
forceRefresh: true,
Expand Down Expand Up @@ -66,11 +65,11 @@
headingText = Craft.t('app', '{num} Available Updates', {num: this.totalAvailableUpdates});
}

$('#page-title').find('h1').text(headingText);
$('#header h1').text(headingText);

if (this.allowUpdates && this.showUpdateAllBtn && this.updates.length > 1) {
this.createUpdateForm(Craft.t('app', 'Update all'), this.updates)
.insertAfter($('#header').children('h1'));
if (this.allowUpdates && this.installableUpdates.length > 1) {
this.createUpdateForm(Craft.t('app', 'Update all'), this.installableUpdates)
.insertAfter($('#header h1 + .flex-grow'));
}
} else {
$graphic.addClass('success');
Expand All @@ -87,7 +86,10 @@

this.totalAvailableUpdates++;

this.updates.push(new Update(this, updateInfo, isPlugin));
var update = new Update(this, updateInfo, isPlugin);
if (update.installable) {
this.installableUpdates.push(update);
}
},

createUpdateForm: function(label, updates)
Expand Down Expand Up @@ -136,6 +138,7 @@
{
updateInfo: null,
isPlugin: null,
installable: true,

$container: null,
$header: null,
Expand All @@ -162,7 +165,7 @@
$('<blockquote class="note ineligible"><p>'+this.updateInfo.statusText+'</p></blockquote>').insertBefore(this.$releaseContainer);

if (this.updateInfo.status === 'expired' || this.updateInfo.latestVersion === null) {
this.updatesPage.showUpdateAllBtn = false;
this.installable = false;
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/updates/dist/UpdatesUtility.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 85daa37

Please sign in to comment.