Show EOL warning in the update section
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
64feb3f391
commit
ec1e039790
|
@ -40,3 +40,7 @@
|
||||||
color: #555;
|
color: #555;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#updatenotification .warning {
|
||||||
|
color: #ce3702;
|
||||||
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ define(function (require) {
|
||||||
this.vm.channels = data.channels;
|
this.vm.channels = data.channels;
|
||||||
this.vm.notifyGroups = data.notifyGroups;
|
this.vm.notifyGroups = data.notifyGroups;
|
||||||
this.vm.isDefaultUpdateServerURL = data.isDefaultUpdateServerURL;
|
this.vm.isDefaultUpdateServerURL = data.isDefaultUpdateServerURL;
|
||||||
|
this.vm.versionIsEol = data.versionIsEol;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,13 @@
|
||||||
<div id="updatenotification" class="followupsection">
|
<div id="updatenotification" class="followupsection">
|
||||||
<div class="update">
|
<div class="update">
|
||||||
<template v-if="isNewVersionAvailable">
|
<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>
|
<p>
|
||||||
<span v-html="newVersionAvailableString"></span><br>
|
<span v-html="newVersionAvailableString"></span><br>
|
||||||
<span v-if="!isListFetched" class="icon icon-loading-small"></span>
|
<span v-if="!isListFetched" class="icon icon-loading-small"></span>
|
||||||
|
@ -83,6 +90,7 @@
|
||||||
lastCheckedDate: '',
|
lastCheckedDate: '',
|
||||||
isUpdateChecked: false,
|
isUpdateChecked: false,
|
||||||
updaterEnabled: true,
|
updaterEnabled: true,
|
||||||
|
versionIsEol: false,
|
||||||
downloadLink: '',
|
downloadLink: '',
|
||||||
isNewVersionAvailable: false,
|
isNewVersionAvailable: false,
|
||||||
updateServerURL: '',
|
updateServerURL: '',
|
||||||
|
|
|
@ -94,6 +94,7 @@ class Admin implements ISettings {
|
||||||
'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'],
|
'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'],
|
||||||
'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'],
|
'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'],
|
||||||
'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'],
|
'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'],
|
||||||
|
'versionIsEol' => empty($updateState['versionIsEol']) ? false : $updateState['versionIsEol'],
|
||||||
'isDefaultUpdateServerURL' => $updateServerURL === $defaultUpdateServerURL,
|
'isDefaultUpdateServerURL' => $updateServerURL === $defaultUpdateServerURL,
|
||||||
'updateServerURL' => $updateServerURL,
|
'updateServerURL' => $updateServerURL,
|
||||||
'notifyGroups' => $this->getSelectedGroups($notifyGroups),
|
'notifyGroups' => $this->getSelectedGroups($notifyGroups),
|
||||||
|
|
|
@ -49,6 +49,7 @@ class UpdateChecker {
|
||||||
$result['updateAvailable'] = true;
|
$result['updateAvailable'] = true;
|
||||||
$result['updateVersion'] = $data['versionstring'];
|
$result['updateVersion'] = $data['versionstring'];
|
||||||
$result['updaterEnabled'] = $data['autoupdater'] === '1';
|
$result['updaterEnabled'] = $data['autoupdater'] === '1';
|
||||||
|
$result['versionIsEol'] = $data['eol'] === '1';
|
||||||
if (strpos($data['web'], 'https://') === 0) {
|
if (strpos($data['web'], 'https://') === 0) {
|
||||||
$result['updateLink'] = $data['web'];
|
$result['updateLink'] = $data['web'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,6 +100,7 @@ class AdminTest extends TestCase {
|
||||||
'updateVersion' => '8.1.2',
|
'updateVersion' => '8.1.2',
|
||||||
'downloadLink' => 'https://downloads.nextcloud.org/server',
|
'downloadLink' => 'https://downloads.nextcloud.org/server',
|
||||||
'updaterEnabled' => true,
|
'updaterEnabled' => true,
|
||||||
|
'versionIsEol' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$group = $this->createMock(IGroup::class);
|
$group = $this->createMock(IGroup::class);
|
||||||
|
@ -124,6 +125,7 @@ class AdminTest extends TestCase {
|
||||||
'newVersionString' => '8.1.2',
|
'newVersionString' => '8.1.2',
|
||||||
'downloadLink' => 'https://downloads.nextcloud.org/server',
|
'downloadLink' => 'https://downloads.nextcloud.org/server',
|
||||||
'updaterEnabled' => true,
|
'updaterEnabled' => true,
|
||||||
|
'versionIsEol' => false,
|
||||||
'isDefaultUpdateServerURL' => true,
|
'isDefaultUpdateServerURL' => true,
|
||||||
'updateServerURL' => 'https://updates.nextcloud.com/updater_server/',
|
'updateServerURL' => 'https://updates.nextcloud.com/updater_server/',
|
||||||
'notifyGroups' => [
|
'notifyGroups' => [
|
||||||
|
|
|
@ -52,12 +52,14 @@ class UpdateCheckerTest extends TestCase {
|
||||||
'web'=> 'javascript:alert(1)',
|
'web'=> 'javascript:alert(1)',
|
||||||
'url'=> 'javascript:alert(2)',
|
'url'=> 'javascript:alert(2)',
|
||||||
'autoupdater'=> '0',
|
'autoupdater'=> '0',
|
||||||
|
'eol'=> '1',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$expected = [
|
$expected = [
|
||||||
'updateAvailable' => true,
|
'updateAvailable' => true,
|
||||||
'updateVersion' => 'Nextcloud 123',
|
'updateVersion' => 'Nextcloud 123',
|
||||||
'updaterEnabled' => false,
|
'updaterEnabled' => false,
|
||||||
|
'versionIsEol' => true,
|
||||||
];
|
];
|
||||||
$this->assertSame($expected, $this->updateChecker->getUpdateState());
|
$this->assertSame($expected, $this->updateChecker->getUpdateState());
|
||||||
}
|
}
|
||||||
|
@ -72,12 +74,14 @@ class UpdateCheckerTest extends TestCase {
|
||||||
'web'=> 'https://docs.nextcloud.com/myUrl',
|
'web'=> 'https://docs.nextcloud.com/myUrl',
|
||||||
'url'=> 'https://downloads.nextcloud.org/server',
|
'url'=> 'https://downloads.nextcloud.org/server',
|
||||||
'autoupdater'=> '1',
|
'autoupdater'=> '1',
|
||||||
|
'eol'=> '0',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$expected = [
|
$expected = [
|
||||||
'updateAvailable' => true,
|
'updateAvailable' => true,
|
||||||
'updateVersion' => 'Nextcloud 123',
|
'updateVersion' => 'Nextcloud 123',
|
||||||
'updaterEnabled' => true,
|
'updaterEnabled' => true,
|
||||||
|
'versionIsEol' => false,
|
||||||
'updateLink' => 'https://docs.nextcloud.com/myUrl',
|
'updateLink' => 'https://docs.nextcloud.com/myUrl',
|
||||||
'downloadLink' => 'https://downloads.nextcloud.org/server',
|
'downloadLink' => 'https://downloads.nextcloud.org/server',
|
||||||
];
|
];
|
||||||
|
|
|
@ -98,6 +98,7 @@ class VersionCheck {
|
||||||
$tmp['url'] = (string)$data->url;
|
$tmp['url'] = (string)$data->url;
|
||||||
$tmp['web'] = (string)$data->web;
|
$tmp['web'] = (string)$data->web;
|
||||||
$tmp['autoupdater'] = (string)$data->autoupdater;
|
$tmp['autoupdater'] = (string)$data->autoupdater;
|
||||||
|
$tmp['eol'] = isset($data->eol) ? (string)$data->eol : '0';
|
||||||
} else {
|
} else {
|
||||||
libxml_clear_errors();
|
libxml_clear_errors();
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,7 @@ class VersionCheckTest extends \Test\TestCase {
|
||||||
'url' => 'https://download.example.org/community/owncloud-8.0.4.zip',
|
'url' => 'https://download.example.org/community/owncloud-8.0.4.zip',
|
||||||
'web' => 'http://doc.example.org/server/8.0/admin_manual/maintenance/upgrade.html',
|
'web' => 'http://doc.example.org/server/8.0/admin_manual/maintenance/upgrade.html',
|
||||||
'autoupdater' => '0',
|
'autoupdater' => '0',
|
||||||
|
'eol' => '1',
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->config
|
$this->config
|
||||||
|
@ -123,6 +124,7 @@ class VersionCheckTest extends \Test\TestCase {
|
||||||
<url>https://download.example.org/community/owncloud-8.0.4.zip</url>
|
<url>https://download.example.org/community/owncloud-8.0.4.zip</url>
|
||||||
<web>http://doc.example.org/server/8.0/admin_manual/maintenance/upgrade.html</web>
|
<web>http://doc.example.org/server/8.0/admin_manual/maintenance/upgrade.html</web>
|
||||||
<autoupdater>0</autoupdater>
|
<autoupdater>0</autoupdater>
|
||||||
|
<eol>1</eol>
|
||||||
</owncloud>';
|
</owncloud>';
|
||||||
$this->updater
|
$this->updater
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
|
@ -180,6 +182,7 @@ class VersionCheckTest extends \Test\TestCase {
|
||||||
'url' => '',
|
'url' => '',
|
||||||
'web' => '',
|
'web' => '',
|
||||||
'autoupdater' => '',
|
'autoupdater' => '',
|
||||||
|
'eol' => '0',
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->config
|
$this->config
|
||||||
|
@ -273,6 +276,7 @@ class VersionCheckTest extends \Test\TestCase {
|
||||||
'url' => '',
|
'url' => '',
|
||||||
'web' => '',
|
'web' => '',
|
||||||
'autoupdater' => '',
|
'autoupdater' => '',
|
||||||
|
'eol' => '0',
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->config
|
$this->config
|
||||||
|
|
Loading…
Reference in New Issue