mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-29 20:41:03 +00:00
Merge remote-tracking branch 'origin/master' into 2.3
This commit is contained in:
commit
4ab0d25f65
23 changed files with 727 additions and 604 deletions
1198
CHANGELOG.md
1198
CHANGELOG.md
File diff suppressed because it is too large
Load diff
|
@ -35,7 +35,7 @@ framework:
|
|||
assets: ~
|
||||
|
||||
wallabag_core:
|
||||
version: 2.2.2
|
||||
version: 2.2.3
|
||||
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
|
||||
languages:
|
||||
en: 'English'
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
"javibravo/simpleue": "^1.0",
|
||||
"symfony/dom-crawler": "^3.1",
|
||||
"friendsofsymfony/jsrouting-bundle": "^1.6",
|
||||
"bdunogier/guzzle-site-authenticator": "dev-master"
|
||||
"bdunogier/guzzle-site-authenticator": "1.0.0-beta1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/doctrine-fixtures-bundle": "~2.2",
|
||||
|
|
|
@ -297,10 +297,19 @@ class EntryRestController extends WallabagRestController
|
|||
$entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
|
||||
|
||||
if (false === $entry) {
|
||||
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
|
||||
new Entry($this->getUser()),
|
||||
$url
|
||||
);
|
||||
$entry = new Entry($this->getUser());
|
||||
try {
|
||||
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
|
||||
$entry,
|
||||
$url
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
$this->get('logger')->error('Error while saving an entry', [
|
||||
'exception' => $e,
|
||||
'entry' => $entry,
|
||||
]);
|
||||
$entry->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_null($title)) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
|
||||
|
@ -33,7 +34,7 @@ class EntryFilterType extends AbstractType
|
|||
$this->user = $tokenStorage->getToken() ? $tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $this->user || !is_object($this->user)) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +42,14 @@ class EntryFilterType extends AbstractType
|
|||
{
|
||||
$builder
|
||||
->add('readingTime', NumberRangeFilterType::class, [
|
||||
'left_number_options' => [
|
||||
'condition_operator' => FilterOperands::OPERATOR_GREATER_THAN_EQUAL,
|
||||
'attr' => ['min' => 0],
|
||||
],
|
||||
'right_number_options' => [
|
||||
'condition_operator' => FilterOperands::OPERATOR_LOWER_THAN_EQUAL,
|
||||
'attr' => ['min' => 0],
|
||||
],
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
$lower = $values['value']['left_number'][0];
|
||||
$upper = $values['value']['right_number'][0];
|
||||
|
|
|
@ -215,7 +215,7 @@ entry:
|
|||
# share_email_label: 'Email'
|
||||
# public_link: 'public link'
|
||||
# delete_public_link: 'delete public link'
|
||||
download: 'Download'
|
||||
# export: 'Export'
|
||||
# print: 'Print'
|
||||
problem:
|
||||
label: 'Problemer?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'E-Mail'
|
||||
public_link: 'Öffentlicher Link'
|
||||
delete_public_link: 'Lösche öffentlichen Link'
|
||||
download: 'Herunterladen'
|
||||
export: 'Exportieren'
|
||||
print: 'Drucken'
|
||||
problem:
|
||||
label: 'Probleme?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'Email'
|
||||
public_link: 'public link'
|
||||
delete_public_link: 'delete public link'
|
||||
download: 'Download'
|
||||
export: 'Export'
|
||||
print: 'Print'
|
||||
problem:
|
||||
label: 'Problems?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'e-mail'
|
||||
public_link: 'enlace público'
|
||||
delete_public_link: 'eliminar enlace público'
|
||||
download: 'Descargar'
|
||||
export: 'Exportar'
|
||||
print: 'Imprimir'
|
||||
problem:
|
||||
label: '¿Algún problema?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'نشانی ایمیل'
|
||||
# public_link: 'public link'
|
||||
# delete_public_link: 'delete public link'
|
||||
download: 'بارگیری'
|
||||
export: 'بارگیری'
|
||||
print: 'چاپ'
|
||||
problem:
|
||||
label: 'مشکلات؟'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: "Courriel"
|
||||
public_link: "Lien public"
|
||||
delete_public_link: "Supprimer le lien public"
|
||||
download: "Télécharger"
|
||||
export: "Exporter"
|
||||
print: "Imprimer"
|
||||
problem:
|
||||
label: "Un problème ?"
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'E-mail'
|
||||
# public_link: 'public link'
|
||||
# delete_public_link: 'delete public link'
|
||||
download: 'Download'
|
||||
export: 'Esporta'
|
||||
print: 'Stampa'
|
||||
problem:
|
||||
label: 'Problemi?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'Corrièl'
|
||||
public_link: 'ligam public'
|
||||
delete_public_link: 'suprimir lo ligam public'
|
||||
download: 'Telecargar'
|
||||
export: 'Exportar'
|
||||
print: 'Imprimir'
|
||||
problem:
|
||||
label: 'Un problèma ?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'Adres email'
|
||||
public_link: 'Publiczny link'
|
||||
delete_public_link: 'Usuń publiczny link'
|
||||
download: 'Pobierz'
|
||||
export: 'Export'
|
||||
print: 'Drukuj'
|
||||
problem:
|
||||
label: 'Problemy'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'E-mail'
|
||||
public_link: 'link público'
|
||||
delete_public_link: 'apagar link público'
|
||||
download: 'Download'
|
||||
export: 'Exportar'
|
||||
print: 'Imprimir'
|
||||
problem:
|
||||
label: 'Problemas?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'E-mail'
|
||||
# public_link: 'public link'
|
||||
# delete_public_link: 'delete public link'
|
||||
download: 'Descarcă'
|
||||
export: 'Descarcă'
|
||||
# print: 'Print'
|
||||
problem:
|
||||
label: 'Probleme?'
|
||||
|
|
|
@ -216,7 +216,7 @@ entry:
|
|||
share_email_label: 'E-posta'
|
||||
# public_link: 'public link'
|
||||
# delete_public_link: 'delete public link'
|
||||
download: 'İndir'
|
||||
export: 'Dışa Aktar'
|
||||
# print: 'Print'
|
||||
problem:
|
||||
label: 'Bir sorun mu var?'
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<ul>
|
||||
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
|
||||
<li><a href="http://doc.wallabag.org/en/master/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
|
||||
<li><a href="https://doc.wallabag.org/en/developer/api/readme.html">{{ 'developer.full_documentation'|trans }}</a></li>
|
||||
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -34,9 +34,10 @@
|
|||
<div id="set2" class="col s12">
|
||||
<dl>
|
||||
<dt>{{ 'about.getting_help.documentation'|trans }}</dt>
|
||||
<dd><a href="http://doc.wallabag.org/en/master/">english</a></dd>
|
||||
<dd><a href="http://doc.wallabag.org/fr/master/">français</a></dd>
|
||||
<dd><a href="http://doc.wallabag.org/de/master/">deutsch</a></dd>
|
||||
<dd><a href="https://doc.wallabag.org/en/">english</a></dd>
|
||||
<dd><a href="https://doc.wallabag.org/fr/">français</a></dd>
|
||||
<dd><a href="https://doc.wallabag.org/de/">deutsch</a></dd>
|
||||
<dd><a href="https://doc.wallabag.org/it/">italiano</a></dd>
|
||||
|
||||
<dt>{{ 'about.getting_help.bug_reports'|trans }}</dt>
|
||||
<dd>{{ 'about.getting_help.support'|trans|raw }}</dd>
|
||||
|
@ -46,7 +47,7 @@
|
|||
<div id="set3" class="col s12">
|
||||
<dl>
|
||||
<dt>{{ 'about.helping.description'|trans }}</dt>
|
||||
<dd>{{ 'about.helping.by_contributing_2'|trans }} <a href="https://github.com/wallabag/wallabag/issues/1254">{{ 'about.helping.by_contributing'|trans }}</a></dd>
|
||||
<dd>{{ 'about.helping.by_contributing'|trans }} <a href="https://github.com/wallabag/wallabag/issues/1254">{{ 'about.helping.by_contributing_2'|trans }}</a></dd>
|
||||
<dd><a href="{{ paypal_url }}">{{ 'about.helping.by_paypal'|trans }}</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
|
|
@ -69,8 +69,8 @@
|
|||
<div class="card-action">
|
||||
<ul>
|
||||
<li><a href="{{ path('developer') }}">{{ 'quickstart.developer.create_application'|trans }}</a></li>
|
||||
<li><a href="http://doc.wallabag.org/en/master/developer/docker.html">{{ 'quickstart.developer.use_docker'|trans }}</a></li>
|
||||
<li><a href="http://doc.wallabag.org/en/master/index.html#dev-docs">{{ 'quickstart.more'|trans }}</a></li>
|
||||
<li><a href="https://doc.wallabag.org/en/developer/docker.html">{{ 'quickstart.developer.use_docker'|trans }}</a></li>
|
||||
<li><a href="https://doc.wallabag.org/">{{ 'quickstart.more'|trans }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -84,9 +84,9 @@
|
|||
</div>
|
||||
<div class="card-action">
|
||||
<ul>
|
||||
<li><a href="http://doc.wallabag.org/en/master/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
|
||||
<li><a href="http://doc.wallabag.org/en/master/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
|
||||
<li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
|
||||
<li><a href="https://doc.wallabag.org/en/user/articles/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
|
||||
<li><a href="https://doc.wallabag.org/en/user/articles/download.html">{{ 'quickstart.docs.export'|trans }}</a></li>
|
||||
<li><a href="https://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -183,7 +183,7 @@
|
|||
<li class="bold">
|
||||
<a class="waves-effect collapsible-header">
|
||||
<i class="material-icons small">file_download</i>
|
||||
<span>{{ 'entry.view.left_menu.download'|trans }}</span>
|
||||
<span>{{ 'entry.view.left_menu.export'|trans }}</span>
|
||||
</a>
|
||||
<div class="collapsible-body">
|
||||
<ul>
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Tests\Wallabag\ApiBundle\Controller;
|
|||
|
||||
use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
|
||||
class EntryRestControllerTest extends WallabagApiTestCase
|
||||
{
|
||||
|
@ -375,6 +376,39 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
|||
$this->assertCount(3, $content['tags']);
|
||||
}
|
||||
|
||||
public function testPostEntryWhenFetchContentFails()
|
||||
{
|
||||
/** @var \Symfony\Component\DependencyInjection\Container $container */
|
||||
$container = $this->client->getContainer();
|
||||
$contentProxy = $this->getMockBuilder(ContentProxy::class)
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['updateEntry'])
|
||||
->getMock();
|
||||
$contentProxy->expects($this->any())
|
||||
->method('updateEntry')
|
||||
->willThrowException(new \Exception('Test Fetch content fails'));
|
||||
$container->set('wallabag_core.content_proxy', $contentProxy);
|
||||
|
||||
try {
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
'url' => 'http://www.example.com/',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
$this->assertGreaterThan(0, $content['id']);
|
||||
$this->assertEquals('http://www.example.com/', $content['url']);
|
||||
} finally {
|
||||
// Remove the created entry to avoid side effects on other tests
|
||||
if (isset($content['id'])) {
|
||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||
$entry = $em->getReference('WallabagCoreBundle:Entry', $content['id']);
|
||||
$em->remove($entry);
|
||||
$em->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function testPostArchivedAndStarredEntry()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
|
|
|
@ -627,6 +627,26 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertCount(1, $crawler->filter('div[class=entry]'));
|
||||
}
|
||||
|
||||
public function testFilterOnReadingTimeWithNegativeValue()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
$crawler = $client->request('GET', '/unread/list');
|
||||
|
||||
$form = $crawler->filter('button[id=submit-filter]')->form();
|
||||
|
||||
$data = [
|
||||
'entry_filter[readingTime][right_number]' => -22,
|
||||
'entry_filter[readingTime][left_number]' => -22,
|
||||
];
|
||||
|
||||
$crawler = $client->submit($form, $data);
|
||||
|
||||
// forcing negative value results in no entry displayed
|
||||
$this->assertCount(0, $crawler->filter('div[class=entry]'));
|
||||
}
|
||||
|
||||
public function testFilterOnReadingTimeOnlyUpper()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
|
|
Loading…
Reference in a new issue