mirror of
https://github.com/wallabag/wallabag.git
synced 2024-10-31 22:28:54 +00:00
Merge pull request #3574 from shulard/feature/rename-tags
Allow to rename tags from the web interface.
This commit is contained in:
commit
e673b54f70
28 changed files with 247 additions and 13 deletions
|
@ -70,4 +70,23 @@ $(document).ready(() => {
|
|||
retrievePercent(x.entryId, true);
|
||||
});
|
||||
}
|
||||
|
||||
document.querySelectorAll('[data-handler=tag-rename]').forEach((item) => {
|
||||
const current = item;
|
||||
current.wallabag_edit_mode = false;
|
||||
current.onclick = (event) => {
|
||||
const target = event.currentTarget;
|
||||
|
||||
if (target.wallabag_edit_mode === false) {
|
||||
$(target.parentNode.querySelector('[data-handle=tag-link]')).addClass('hidden');
|
||||
$(target.parentNode.querySelector('[data-handle=tag-rename-form]')).removeClass('hidden');
|
||||
target.parentNode.querySelector('[data-handle=tag-rename-form] input').focus();
|
||||
target.querySelector('.material-icons').innerHTML = 'done';
|
||||
|
||||
target.wallabag_edit_mode = true;
|
||||
} else {
|
||||
target.parentNode.querySelector('[data-handle=tag-rename-form]').submit();
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
@ -295,6 +295,15 @@ div.pagination ul {
|
|||
}
|
||||
}
|
||||
|
||||
.hide {
|
||||
.card-tag-form {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.card-tag-form input[type="text"] {
|
||||
min-width: 20em;
|
||||
}
|
||||
|
||||
.hide,
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -180,6 +180,17 @@ a.original:not(.waves-effect) {
|
|||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.card-tag-form {
|
||||
display: flex;
|
||||
min-width: 100px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.card-tag-form input {
|
||||
margin-bottom: 0;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.card-tag-rss {
|
||||
display: flex;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Form\Type\NewTagType;
|
||||
use Wallabag\CoreBundle\Form\Type\RenameTagType;
|
||||
|
||||
class TagController extends Controller
|
||||
{
|
||||
|
@ -87,8 +88,14 @@ class TagController extends Controller
|
|||
$tags = $this->get('wallabag_core.tag_repository')
|
||||
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
|
||||
|
||||
$renameForms = [];
|
||||
foreach ($tags as $tag) {
|
||||
$renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView();
|
||||
}
|
||||
|
||||
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
|
||||
'tags' => $tags,
|
||||
'renameForms' => $renameForms,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -130,4 +137,48 @@ class TagController extends Controller
|
|||
'tag' => $tag,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename a given tag with a new label
|
||||
* Create a new tag with the new name and drop the old one.
|
||||
*
|
||||
* @param Tag $tag
|
||||
* @param Request $request
|
||||
*
|
||||
* @Route("/tag/rename/{slug}", name="tag_rename")
|
||||
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function renameTagAction(Tag $tag, Request $request)
|
||||
{
|
||||
$form = $this->createForm(RenameTagType::class, new Tag());
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entries = $this->get('wallabag_core.entry_repository')->findAllByTagId(
|
||||
$this->getUser()->getId(),
|
||||
$tag->getId()
|
||||
);
|
||||
foreach ($entries as $entry) {
|
||||
$this->get('wallabag_core.tags_assigner')->assignTagsToEntry(
|
||||
$entry,
|
||||
$form->get('label')->getData()
|
||||
);
|
||||
$entry->removeTag($tag);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'flashes.tag.notice.tag_renamed'
|
||||
);
|
||||
|
||||
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true);
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
}
|
||||
|
|
35
src/Wallabag/CoreBundle/Form/Type/RenameTagType.php
Normal file
35
src/Wallabag/CoreBundle/Form/Type/RenameTagType.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class RenameTagType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('label', TextType::class, [
|
||||
'required' => true,
|
||||
'attr' => [
|
||||
'placeholder' => 'tag.rename.placeholder',
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'tag';
|
||||
}
|
||||
}
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
# add: 'Add'
|
||||
# placeholder: 'You can add several tags, separated by a comma.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
# export:
|
||||
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
# tag_added: 'Tag added'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
# failed: 'Import failed, please try again.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
add: 'Hinzufügen'
|
||||
placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
export:
|
||||
footer_template: '<div style="text-align:center;"><p>Generiert von wallabag mit Hilfe von %method%</p><p>Bitte öffne <a href="https://github.com/wallabag/wallabag/issues">ein Ticket</a> wenn du ein Problem mit der Darstellung von diesem E-Book auf deinem Gerät hast.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Tag hinzugefügt'
|
||||
#tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'Import fehlgeschlagen, bitte erneut probieren.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
add: 'Add'
|
||||
placeholder: 'You can add several tags, separated by a comma.'
|
||||
rename:
|
||||
placeholder: 'You can update tag name.'
|
||||
|
||||
export:
|
||||
footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Tag added'
|
||||
tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'Import failed, please try again.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
add: 'Añadir'
|
||||
placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
# export:
|
||||
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Etiqueta añadida'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'Importación fallida, por favor, inténtelo de nuevo.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
# add: 'Add'
|
||||
# placeholder: 'You can add several tags, separated by a comma.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
# export:
|
||||
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'برچسب افزوده شد'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'درونریزی شکست خورد. لطفاً دوباره تلاش کنید.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
add: "Ajouter"
|
||||
placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule."
|
||||
rename:
|
||||
placeholder: 'Vous pouvez changer le nom de votre tag.'
|
||||
|
||||
export:
|
||||
footer_template: '<div style="text-align:center;"><p>Généré par wallabag with %method%</p><p>Merci d''ouvrir <a href="https://github.com/wallabag/wallabag/issues">un ticket</a> si vous rencontrez des soucis d''affichage avec ce document sur votre support.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: "Tag ajouté"
|
||||
tag_renamed: "Tag renommé"
|
||||
import:
|
||||
notice:
|
||||
failed: "L’import a échoué, veuillez ré-essayer"
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
add: 'Aggiungi'
|
||||
placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
# export:
|
||||
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Etichetta aggiunta'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'Importazione fallita, riprova.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
add: 'Ajustar'
|
||||
placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula."
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
export:
|
||||
footer_template: '<div style="text-align:center;"><p>Produch per wallabag amb %method%</p><p>Mercés de dobrir <a href="https://github.com/wallabag/wallabag/issues">una sollicitacion</a> s’avètz de problèmas amb l’afichatge d’aqueste E-Book sus vòstre periferic.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Etiqueta ajustada'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: "L'importacion a fracassat, mercés de tornar ensajar."
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
add: 'Dodaj'
|
||||
placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
export:
|
||||
footer_template: '<div style="text-align:center;"><p>Stworzone przez wallabag z %method%</p><p>Proszę zgłoś <a href="https://github.com/wallabag/wallabag/issues">sprawę</a>, jeżeli masz problem z wyświetleniem tego e-booka na swoim urządzeniu.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Tag dodany'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'Nieudany import, prosimy spróbować ponownie.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
# add: 'Add'
|
||||
# placeholder: 'You can add several tags, separated by a comma.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
# export:
|
||||
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Tag adicionada'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'Importação falhou, por favor tente novamente.'
|
||||
|
|
|
@ -399,6 +399,8 @@ tag:
|
|||
new:
|
||||
# add: 'Add'
|
||||
# placeholder: 'You can add several tags, separated by a comma.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
# export:
|
||||
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -585,6 +587,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
# tag_added: 'Tag added'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
# failed: 'Import failed, please try again.'
|
||||
|
|
|
@ -387,6 +387,8 @@ tag:
|
|||
new:
|
||||
add: 'Добавить'
|
||||
placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
import:
|
||||
page_title: 'Импорт'
|
||||
|
@ -547,6 +549,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Тег добавлен'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'Во время импорта произошла ошибка, повторите попытку.'
|
||||
|
@ -564,4 +567,4 @@ flashes:
|
|||
notice:
|
||||
added: 'Пользователь "%username%" добавлен'
|
||||
updated: 'Пользователь "%username%" обновлен'
|
||||
deleted: 'Пользователь "%username%" удален'
|
||||
deleted: 'Пользователь "%username%" удален'
|
||||
|
|
|
@ -397,6 +397,8 @@ tag:
|
|||
new:
|
||||
add: 'เพิ่ม'
|
||||
placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
export:
|
||||
footer_template: '<div style="text-align:center;"><p>ผลิตโดย wallabag กับ %method%</p><p>ให้ทำการเปิด <a href="https://github.com/wallabag/wallabag/issues">ฉบับนี้</a> ถ้าคุณมีข้อบกพร่องif you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -583,6 +585,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'แท็กที่เพิ่ม'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
failed: 'นำข้อมูลเข้าล้มเหลว, ลองใหม่อีกครั้ง'
|
||||
|
|
|
@ -397,6 +397,8 @@ tag:
|
|||
new:
|
||||
# add: 'Add'
|
||||
# placeholder: 'You can add several tags, separated by a comma.'
|
||||
rename:
|
||||
# placeholder: 'You can update tag name.'
|
||||
|
||||
# export:
|
||||
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>'
|
||||
|
@ -563,6 +565,7 @@ flashes:
|
|||
tag:
|
||||
notice:
|
||||
tag_added: 'Etiket eklendi'
|
||||
# tag_renamed: 'Tag renamed'
|
||||
import:
|
||||
notice:
|
||||
# failed: 'Import failed, please try again.'
|
||||
|
|
|
@ -10,10 +10,22 @@
|
|||
<ul>
|
||||
{% for tag in tags %}
|
||||
<li id="tag-{{ tag.id|e }}">
|
||||
<a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a>
|
||||
<a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right">
|
||||
<i class="material-icons md-24">rss_feed</i>
|
||||
<a href="{{ path('tag_entries', {'slug': tag.slug}) }}" data-handle="tag-link">{{ tag.label }} ({{ tag.nbEntries }})</a>
|
||||
|
||||
{% if renameForms is defined and renameForms[tag.id] is defined %}
|
||||
<form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug})}}" method="POST">
|
||||
{{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }}
|
||||
{{ form_rest(renameForms[tag.id]) }}
|
||||
</form>
|
||||
<a class="card-tag-rename" data-handler="tag-rename" href="javascript:void(0);">
|
||||
<i class="material-icons">mode_edit</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if app.user.config.rssToken %}
|
||||
<a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right">
|
||||
<i class="material-icons md-24">rss_feed</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -13,7 +13,18 @@
|
|||
<ul class="card-tag-labels">
|
||||
{% for tag in tags %}
|
||||
<li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}">
|
||||
<a href="{{ path('tag_entries', {'slug': tag.slug}) }}" class="card-tag-link">{{tag.label}} ({{ tag.nbEntries }})</a>
|
||||
<a href="{{ path('tag_entries', {'slug': tag.slug}) }}" class="card-tag-link" data-handle="tag-link">
|
||||
{{ tag.label }} ({{ tag.nbEntries }})
|
||||
</a>
|
||||
{% if renameForms is defined and renameForms[tag.id] is defined %}
|
||||
<form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug})}}" method="POST">
|
||||
{{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }}
|
||||
{{ form_rest(renameForms[tag.id]) }}
|
||||
</form>
|
||||
<a class="card-tag-rename" data-handler="tag-rename" href="javascript:void(0);">
|
||||
<i class="material-icons">mode_edit</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if app.user.config.rssToken %}
|
||||
<a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="card-tag-rss"><i class="material-icons">rss_feed</i></a>
|
||||
{% endif %}
|
||||
|
|
|
@ -176,4 +176,49 @@ class TagControllerTest extends WallabagCoreTestCase
|
|||
$em->remove($tag);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
public function testRenameTagUsingTheFormInsideTagList()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
$tag = new Tag();
|
||||
$tag->setLabel($this->tagName);
|
||||
$entry = new Entry($this->getLoggedInUser());
|
||||
$entry->setUrl('http://0.0.0.0/foo');
|
||||
$entry->addTag($tag);
|
||||
$this->getEntityManager()->persist($entry);
|
||||
$this->getEntityManager()->flush();
|
||||
$this->getEntityManager()->clear();
|
||||
|
||||
// We make a first request to set an history and test redirection after tag deletion
|
||||
$crawler = $client->request('GET', '/tag/list');
|
||||
$form = $crawler->filter('#tag-' . $tag->getId() . ' form')->form();
|
||||
|
||||
$data = [
|
||||
'tag[label]' => 'specific label',
|
||||
];
|
||||
|
||||
$client->submit($form, $data);
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
|
||||
$freshEntry = $client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->find($entry->getId());
|
||||
|
||||
$tags = $freshEntry->getTags()->toArray();
|
||||
foreach ($tags as $key => $item) {
|
||||
$tags[$key] = $item->getLabel();
|
||||
}
|
||||
|
||||
$this->assertFalse(array_search($tag->getLabel(), $tags, true), 'Previous tag is not attach to entry anymore.');
|
||||
|
||||
$newTag = $client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Tag')
|
||||
->findOneByLabel('specific label');
|
||||
$this->assertInstanceOf(Tag::class, $newTag, 'Tag "specific label" exists.');
|
||||
$this->assertTrue($newTag->hasEntry($freshEntry), 'Tag "specific label" is assigned to the entry.');
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -80,8 +80,7 @@
|
|||
"themes/_global/img/icons/shaarli.png": "themes/_global/img/icons/shaarli.png",
|
||||
"themes/_global/img/icons/unmark-icon--black.png": "themes/_global/img/icons/unmark-icon--black.png",
|
||||
"themes/_global/img/list.png": "themes/_global/img/list.png",
|
||||
"themes/_global/img/logo-other_themes.png": "themes/_global/img/logo-other_themes.png",
|
||||
"themes/_global/img/logo-square.png": "themes/_global/img/logo-square.png",
|
||||
"themes/_global/img/logo-square.svg": "themes/_global/img/logo-square.svg",
|
||||
"themes/_global/img/logo-w.png": "themes/_global/img/logo-w.png",
|
||||
"themes/_global/img/logo-wallabag.svg": "themes/_global/img/logo-wallabag.svg",
|
||||
"themes/_global/img/table.png": "themes/_global/img/table.png"
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
!function(o){function __webpack_require__(e){if(n[e])return n[e].exports;var p=n[e]={i:e,l:!1,exports:{}};return o[e].call(p.exports,p,p.exports,__webpack_require__),p.l=!0,p.exports}var n={};__webpack_require__.m=o,__webpack_require__.c=n,__webpack_require__.i=function(o){return o},__webpack_require__.d=function(o,n,e){__webpack_require__.o(o,n)||Object.defineProperty(o,n,{configurable:!1,enumerable:!0,get:e})},__webpack_require__.n=function(o){var n=o&&o.__esModule?function(){return o.default}:function(){return o};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(o,n){return Object.prototype.hasOwnProperty.call(o,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=52)}(Array(40).concat([function(o,n,e){function webpackContext(o){return e(webpackContextResolve(o))}function webpackContextResolve(o){var n=p[o];if(!(n+1))throw new Error("Cannot find module '"+o+"'.");return n}var p={"./appicon/apple-touch-icon-114.png":55,"./appicon/apple-touch-icon-120.png":56,"./appicon/apple-touch-icon-144.png":57,"./appicon/apple-touch-icon-152.png":58,"./appicon/apple-touch-icon-57.png":59,"./appicon/apple-touch-icon-72.png":60,"./appicon/apple-touch-icon-76.png":61,"./appicon/apple-touch-icon.png":62,"./appicon/favicon.ico":63,"./bg-select.png":64,"./icons/Diaspora-asterisk.svg":65,"./icons/carrot-icon--black.png":66,"./icons/carrot-icon--white.png":67,"./icons/diaspora-icon--black.png":68,"./icons/diaspora-icon--white.png":69,"./icons/scuttle.png":70,"./icons/shaarli.png":71,"./icons/unmark-icon--black.png":72,"./list.png":73,"./logo-other_themes.png":74,"./logo-square.png":75,"./logo-w.png":76,"./logo-wallabag.svg":77,"./table.png":78};webpackContext.keys=function(){return Object.keys(p)},webpackContext.resolve=webpackContextResolve,o.exports=webpackContext,webpackContext.id=40},,,,,,,function(o,n){},,,,,function(o,n,e){"use strict";e(47),function(o){o.keys().forEach(o)}(e(40))},,,function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-114.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-120.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-144.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-152.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-57.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-72.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-76.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/favicon.ico"},function(o,n,e){o.exports=e.p+"themes/_global/img/bg-select.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/Diaspora-asterisk.svg"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--black.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--white.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--black.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--white.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/scuttle.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/shaarli.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/icons/unmark-icon--black.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/list.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/logo-other_themes.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/logo-square.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/logo-w.png"},function(o,n,e){o.exports=e.p+"themes/_global/img/logo-wallabag.svg"},function(o,n,e){o.exports=e.p+"themes/_global/img/table.png"}]));
|
||||
!function(o){function __webpack_require__(e){if(n[e])return n[e].exports;var p=n[e]={i:e,l:!1,exports:{}};return o[e].call(p.exports,p,p.exports,__webpack_require__),p.l=!0,p.exports}var n={};__webpack_require__.m=o,__webpack_require__.c=n,__webpack_require__.i=function(o){return o},__webpack_require__.d=function(o,n,e){__webpack_require__.o(o,n)||Object.defineProperty(o,n,{configurable:!1,enumerable:!0,get:e})},__webpack_require__.n=function(o){var n=o&&o.__esModule?function(){return o.default}:function(){return o};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(o,n){return Object.prototype.hasOwnProperty.call(o,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=232)}({220:function(o,n,e){function webpackContext(o){return e(webpackContextResolve(o))}function webpackContextResolve(o){var n=p[o];if(!(n+1))throw new Error("Cannot find module '"+o+"'.");return n}var p={"./appicon/apple-touch-icon-114.png":235,"./appicon/apple-touch-icon-120.png":236,"./appicon/apple-touch-icon-144.png":237,"./appicon/apple-touch-icon-152.png":238,"./appicon/apple-touch-icon-57.png":239,"./appicon/apple-touch-icon-72.png":240,"./appicon/apple-touch-icon-76.png":241,"./appicon/apple-touch-icon.png":242,"./appicon/favicon.ico":243,"./bg-select.png":244,"./icons/Diaspora-asterisk.svg":245,"./icons/carrot-icon--black.png":246,"./icons/carrot-icon--white.png":247,"./icons/diaspora-icon--black.png":248,"./icons/diaspora-icon--white.png":249,"./icons/scuttle.png":250,"./icons/shaarli.png":251,"./icons/unmark-icon--black.png":252,"./list.png":253,"./logo-square.svg":254,"./logo-w.png":255,"./logo-wallabag.svg":256,"./table.png":257};webpackContext.keys=function(){return Object.keys(p)},webpackContext.resolve=webpackContextResolve,o.exports=webpackContext,webpackContext.id=220},227:function(o,n){},232:function(o,n,e){"use strict";e(227),function(o){o.keys().forEach(o)}(e(220))},235:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-114.png"},236:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-120.png"},237:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-144.png"},238:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-152.png"},239:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-57.png"},240:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-72.png"},241:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-76.png"},242:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon.png"},243:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/favicon.ico"},244:function(o,n,e){o.exports=e.p+"themes/_global/img/bg-select.png"},245:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/Diaspora-asterisk.svg"},246:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--black.png"},247:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--white.png"},248:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--black.png"},249:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--white.png"},250:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/scuttle.png"},251:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/shaarli.png"},252:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/unmark-icon--black.png"},253:function(o,n,e){o.exports=e.p+"themes/_global/img/list.png"},254:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-square.svg"},255:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-w.png"},256:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-wallabag.svg"},257:function(o,n,e){o.exports=e.p+"themes/_global/img/table.png"}});
|
Loading…
Reference in a new issue