diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-03-20 22:39:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-20 22:39:00 +0100 |
commit | 18994cd7008f422fb12b1d4a9ba164cb25f8984a (patch) | |
tree | 945cbe28eec37027a42c23349c352a0bc6e68d0f /apps/updatenotification | |
parent | 29c551c88ff42e4cd0699787f038175b01e56980 (diff) | |
parent | ec1e0397901f12cd1c9dc99eab60d6464cac5a0b (diff) | |
download | nextcloud-server-18994cd7008f422fb12b1d4a9ba164cb25f8984a.tar.gz nextcloud-server-18994cd7008f422fb12b1d4a9ba164cb25f8984a.zip |
Merge pull request #8821 from nextcloud/feature/noid/show-eol-warning
Show EOL warning in the update section
Diffstat (limited to 'apps/updatenotification')
-rw-r--r-- | apps/updatenotification/css/admin.css | 4 | ||||
-rw-r--r-- | apps/updatenotification/js-src/app.js | 1 | ||||
-rw-r--r-- | apps/updatenotification/js-src/components/root.vue | 8 | ||||
-rw-r--r-- | apps/updatenotification/lib/Settings/Admin.php | 1 | ||||
-rw-r--r-- | apps/updatenotification/lib/UpdateChecker.php | 1 | ||||
-rw-r--r-- | apps/updatenotification/tests/Settings/AdminTest.php | 2 | ||||
-rw-r--r-- | apps/updatenotification/tests/UpdateCheckerTest.php | 4 |
7 files changed, 21 insertions, 0 deletions
diff --git a/apps/updatenotification/css/admin.css b/apps/updatenotification/css/admin.css index 52cc961ae35..775e2134ba5 100644 --- a/apps/updatenotification/css/admin.css +++ b/apps/updatenotification/css/admin.css @@ -40,3 +40,7 @@ color: #555; font-weight: normal; } + +#updatenotification .warning { + color: #ce3702; +} diff --git a/apps/updatenotification/js-src/app.js b/apps/updatenotification/js-src/app.js index bf96a2ff326..0b28cabd6ac 100644 --- a/apps/updatenotification/js-src/app.js +++ b/apps/updatenotification/js-src/app.js @@ -48,6 +48,7 @@ define(function (require) { this.vm.channels = data.channels; this.vm.notifyGroups = data.notifyGroups; this.vm.isDefaultUpdateServerURL = data.isDefaultUpdateServerURL; + this.vm.versionIsEol = data.versionIsEol; } }; }); diff --git a/apps/updatenotification/js-src/components/root.vue b/apps/updatenotification/js-src/components/root.vue index 774fd6dd539..a52e1b12bd4 100644 --- a/apps/updatenotification/js-src/components/root.vue +++ b/apps/updatenotification/js-src/components/root.vue @@ -2,6 +2,13 @@ <div id="updatenotification" class="followupsection"> <div class="update"> <template v-if="isNewVersionAvailable"> + <p v-if="versionIsEol"> + <span class="warning"> + <span class="icon icon-error"></span> + {{ t('updatenotification', 'The version you are running is not maintained anymore. Please make sure to update to a supported version as soon as possible.') }} + </span> + </p> + <p> <span v-html="newVersionAvailableString"></span><br> <span v-if="!isListFetched" class="icon icon-loading-small"></span> @@ -83,6 +90,7 @@ lastCheckedDate: '', isUpdateChecked: false, updaterEnabled: true, + versionIsEol: false, downloadLink: '', isNewVersionAvailable: false, updateServerURL: '', diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php index 258cba35e80..5213eb905ee 100644 --- a/apps/updatenotification/lib/Settings/Admin.php +++ b/apps/updatenotification/lib/Settings/Admin.php @@ -94,6 +94,7 @@ class Admin implements ISettings { 'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'], 'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'], 'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'], + 'versionIsEol' => empty($updateState['versionIsEol']) ? false : $updateState['versionIsEol'], 'isDefaultUpdateServerURL' => $updateServerURL === $defaultUpdateServerURL, 'updateServerURL' => $updateServerURL, 'notifyGroups' => $this->getSelectedGroups($notifyGroups), diff --git a/apps/updatenotification/lib/UpdateChecker.php b/apps/updatenotification/lib/UpdateChecker.php index 5f2712423d2..bba1fa5d48c 100644 --- a/apps/updatenotification/lib/UpdateChecker.php +++ b/apps/updatenotification/lib/UpdateChecker.php @@ -49,6 +49,7 @@ class UpdateChecker { $result['updateAvailable'] = true; $result['updateVersion'] = $data['versionstring']; $result['updaterEnabled'] = $data['autoupdater'] === '1'; + $result['versionIsEol'] = $data['eol'] === '1'; if (strpos($data['web'], 'https://') === 0) { $result['updateLink'] = $data['web']; } diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php index 440e26cfd33..4e2ac3a53d9 100644 --- a/apps/updatenotification/tests/Settings/AdminTest.php +++ b/apps/updatenotification/tests/Settings/AdminTest.php @@ -100,6 +100,7 @@ class AdminTest extends TestCase { 'updateVersion' => '8.1.2', 'downloadLink' => 'https://downloads.nextcloud.org/server', 'updaterEnabled' => true, + 'versionIsEol' => false, ]); $group = $this->createMock(IGroup::class); @@ -124,6 +125,7 @@ class AdminTest extends TestCase { 'newVersionString' => '8.1.2', 'downloadLink' => 'https://downloads.nextcloud.org/server', 'updaterEnabled' => true, + 'versionIsEol' => false, 'isDefaultUpdateServerURL' => true, 'updateServerURL' => 'https://updates.nextcloud.com/updater_server/', 'notifyGroups' => [ diff --git a/apps/updatenotification/tests/UpdateCheckerTest.php b/apps/updatenotification/tests/UpdateCheckerTest.php index 5502e1ce8ac..6f5edf0c78c 100644 --- a/apps/updatenotification/tests/UpdateCheckerTest.php +++ b/apps/updatenotification/tests/UpdateCheckerTest.php @@ -52,12 +52,14 @@ class UpdateCheckerTest extends TestCase { 'web'=> 'javascript:alert(1)', 'url'=> 'javascript:alert(2)', 'autoupdater'=> '0', + 'eol'=> '1', ]); $expected = [ 'updateAvailable' => true, 'updateVersion' => 'Nextcloud 123', 'updaterEnabled' => false, + 'versionIsEol' => true, ]; $this->assertSame($expected, $this->updateChecker->getUpdateState()); } @@ -72,12 +74,14 @@ class UpdateCheckerTest extends TestCase { 'web'=> 'https://docs.nextcloud.com/myUrl', 'url'=> 'https://downloads.nextcloud.org/server', 'autoupdater'=> '1', + 'eol'=> '0', ]); $expected = [ 'updateAvailable' => true, 'updateVersion' => 'Nextcloud 123', 'updaterEnabled' => true, + 'versionIsEol' => false, 'updateLink' => 'https://docs.nextcloud.com/myUrl', 'downloadLink' => 'https://downloads.nextcloud.org/server', ]; |