From 32089998ea3a005f37acf1de6fe6ddcf58d022a9 Mon Sep 17 00:00:00 2001 From: Rello Date: Thu, 19 Aug 2021 21:49:58 +0200 Subject: [PATCH] 3.2.0 --- js/app.js | 19 ++++++++++++------- lib/Controller/WhatsNewController.php | 8 ++++---- .../Version3002Date20210019213332.php | 2 +- lib/WhatsNew/WhatsNewCheck.php | 4 ---- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/js/app.js b/js/app.js index f1710de3..41d73571 100644 --- a/js/app.js +++ b/js/app.js @@ -1085,13 +1085,18 @@ OCA.Audioplayer.Backend = { }); }, - whatsnewDismiss: function dismiss(version) { - let data = {version: encodeURIComponent(version)}; - let xhr = new XMLHttpRequest(); - xhr.open('POST', OC.generateUrl('apps/audioplayer/whatsnew')); - xhr.setRequestHeader('requesttoken', OC.requestToken); - xhr.setRequestHeader('OCS-APIREQUEST', 'true'); - xhr.send(JSON.stringify(data)); + whatsnewDismiss: function (version) { + //let data = {version: encodeURIComponent(version)}; + //let xhr = new XMLHttpRequest(); + //xhr.open('POST', OC.generateUrl('apps/audioplayer/whatsnew')); + //xhr.setRequestHeader('requesttoken', OC.requestToken); + //xhr.setRequestHeader('OCS-APIREQUEST', 'true'); + //xhr.send(JSON.stringify(data)); + $.ajax({ + type: 'POST', + url: OC.generateUrl('apps/audioplayer/whatsnew'), + data: {version: encodeURIComponent(version)} + }) let elem = document.querySelector('.whatsNewPopover'); elem.parentNode.removeChild(elem); diff --git a/lib/Controller/WhatsNewController.php b/lib/Controller/WhatsNewController.php index a7b2ec67..74d127e7 100644 --- a/lib/Controller/WhatsNewController.php +++ b/lib/Controller/WhatsNewController.php @@ -77,8 +77,6 @@ public function get(): DataResponse $iterator = $this->langFactory->getLanguageIterator(); $whatsNew = $this->whatsNewService->getChangesForVersion($currentVersion); - $this->logger->debug(json_encode($whatsNew)); - $resultData = [ 'changelogURL' => $whatsNew['changelogURL'], 'product' => 'Audioplayer', @@ -101,10 +99,12 @@ public function get(): DataResponse /** * @NoAdminRequired * - * @throws \OCP\PreConditionNotMetException + * @param string $version + * @return DataResponse * @throws DoesNotExistException + * @throws \OCP\PreConditionNotMetException */ - public function dismiss(string $version): DataResponse + public function dismiss($version) { $user = $this->userSession->getUser(); if ($user === null) { diff --git a/lib/Migration/Version3002Date20210019213332.php b/lib/Migration/Version3002Date20210019213332.php index 008ccf9b..bc0c6c9f 100644 --- a/lib/Migration/Version3002Date20210019213332.php +++ b/lib/Migration/Version3002Date20210019213332.php @@ -57,7 +57,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $query = $this->connection->getQueryBuilder(); $query->insert('audioplayer_whats_new') ->values([ - 'version' => $query->createNamedParameter('2.11.0'), + 'version' => $query->createNamedParameter('3.2.0'), 'data' => $query->createNamedParameter('{"changelogURL":"https:\/\/github.com\/rello\/audioplayer\/blob\/master\/CHANGELOG.md","whatsNew":{ "en":{"regular":["Collaborative tags support","Dashboard widget"],"admin":["New Features apply to users"]}, "de":{"regular":["Collaborative tags support","Dashboard widget"],"admin":["Nur User Features"]} diff --git a/lib/WhatsNew/WhatsNewCheck.php b/lib/WhatsNew/WhatsNewCheck.php index 286132e0..410dae18 100644 --- a/lib/WhatsNew/WhatsNewCheck.php +++ b/lib/WhatsNew/WhatsNewCheck.php @@ -131,10 +131,6 @@ protected function evaluateResponse(IResponse $response): int } elseif ($response->getStatusCode() === 200) { return self::RESPONSE_HAS_CONTENT; } - $this->logger->debug('Unexpected return code {code} from changelog server', [ - 'app' => 'core', - 'code' => $response->getStatusCode(), - ]); return self::RESPONSE_NO_CONTENT; }