Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow to edit tags in settings #6760

Merged
merged 13 commits into from
Nov 6, 2023
31 changes: 31 additions & 0 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
use PragmaRX\Google2FALaravel\Facade as Google2FA;
use App\Http\Resources\Contact\ContactShort as ContactResource;
use App\Http\Resources\Settings\WebauthnKey\WebauthnKey as WebauthnKeyResource;
use App\Models\Contact\Tag;
use Illuminate\Support\Facades\Validator;

class SettingsController extends Controller
{
Expand Down Expand Up @@ -365,6 +367,35 @@
return redirect()->route('settings.tags.index')
->with('success', trans('settings.tags_list_delete_success'));
}

/**
* Method editTag
*
* @param Tag $tag
* @param Request $request
*
* @return \Illuminate\Http\RedirectResponse
*/
public function editTag(Tag $tag, Request $request): RedirectResponse

Check failure on line 379 in app/Http/Controllers/SettingsController.php

View workflow job for this annotation

GitHub Actions / psalm

UndefinedClass

app/Http/Controllers/SettingsController.php:379:58: UndefinedClass: Class, interface or enum named App\Http\Controllers\RedirectResponse does not exist (see https://psalm.dev/019)

Check failure on line 379 in app/Http/Controllers/SettingsController.php

View workflow job for this annotation

GitHub Actions / phpstan

Method App\Http\Controllers\SettingsController::editTag() has invalid return type App\Http\Controllers\RedirectResponse.

Check failure on line 379 in app/Http/Controllers/SettingsController.php

View workflow job for this annotation

GitHub Actions / phpstan

PHPDoc tag @return with type Illuminate\Http\RedirectResponse is not subtype of native type App\Http\Controllers\RedirectResponse.
{
$validator = Validator::make($request->all(), [
'tag_name' => 'required|string|max:255',
]);

if ($validator->fails()) {
return redirect()->route('settings.tags.index')

Check failure on line 386 in app/Http/Controllers/SettingsController.php

View workflow job for this annotation

GitHub Actions / phpstan

Method App\Http\Controllers\SettingsController::editTag() should return App\Http\Controllers\RedirectResponse but returns Illuminate\Http\RedirectResponse.
->with('error', $validator->errors());
}

$newName = $request->input('tag_name');

$tag->name = $newName;
$tag->save();


return redirect()->route('settings.tags.index')

Check failure on line 396 in app/Http/Controllers/SettingsController.php

View workflow job for this annotation

GitHub Actions / phpstan

Method App\Http\Controllers\SettingsController::editTag() should return App\Http\Controllers\RedirectResponse but returns Illuminate\Http\RedirectResponse.
->with('success', trans('settings.tags_list_edit_success'));
}

public function api()
{
Expand Down
1 change: 1 addition & 0 deletions resources/lang/ar/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 جهة اتصال|:count جهات اتصال',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/cs/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Své kontakty můžete organizovat pomocí tagů. Tagy fungují jako adresáře, kontaktům můžete ale přidat vícero tagů. Nový tag přidáte úpravou vlastního kontaktu.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'Tag byl úspěšně smazán',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Opravdu chcete smazat tento tag? Bude smazán pouze vybraný tag, žádné kontakty.',
'tags_blank_title' => 'Tagy jsou šikovné řešení kategorizace kontaktů.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/da/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/de/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Du kannst deine Kontakte mithilfe von Tags organisieren. Tags funktionieren wie Ordner, wobei ein Kontakt auch mehrere Tags erhalten kann. Um einen neuen Tag anzulegen, musst du ihn nur beim Kontakt hinzufügen.',
'tags_list_contact_number' => '1 Kontakt|:count Kontakte',
'tags_list_delete_success' => 'Der Tag wurde erfolgreich gelöscht',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Möchtest du den Tag wirklich löschen? Kontakte werden nicht gelöscht, sondern nur der Tag.',
'tags_blank_title' => 'Tags bieten eine tolle Möglichkeit Kontakte zu organisieren.',
'tags_blank_description' => 'Tags funktionieren wie Ordner, wobei ein Kontakt auch mehrere Tags erhalten kann. Öffne einen Kontakt und tagge einen Freund direkt unter dem Namen. Sobald ein Kontakt getaggt ist, kannst du hier deine Tags verwalten.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/el/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Μπορείτε να οργανώσετε τις επαφές σας χρησιμοποιώντας ετικέτες. Οι ετικέτες λειτουργούν σαν φάκελοι οργάνωσης, αλλά μπορείτε να προσθέσετε περισσότερες από μία ετικέτες σε κάθε επαφή. Για να δημιουργήσετε μια νέα ετικέτα, απλά προσθέστε την στην ίδια την επαφή.',
'tags_list_contact_number' => '1 επαφή|:count επαφές',
'tags_list_delete_success' => 'Η ετικέτα έχει διαγραφεί με επιτυχία',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Είστε βέβαιοι ότι θέλετε να διαγράψετε την ετικέτα? Καμία επαφή δεν θα διαγραφεί, μόνο αυτή η ετικέτα από τις επαφές που είχε χρησιμοποιηθεί.',
'tags_blank_title' => 'Οι ετικέτες είναι ένας πολύ καλός τρόπος για να κατηγοριοποιήσετε τις επαφές σας.',
'tags_blank_description' => 'Οι ετικέτες λειτουργούν σαν φάκελοι οργάνωσης, ενώ μπορείτε να προσθέσετε περισσότερες από μία ετικέτες σε μια επαφή. Μεταβείτε σε μια επαφή και προσθέστε μια ετικέτα, ακριβώς κάτω από το όνομα. Μόλις προστεθεί η ετικέτα, μπορείτε να επιστρέψτε εδώ για να διαχειριστείτε όλες τις ετικέτες στον λογαριασμό σας.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en-GB/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/es/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Puede organizar sus contactos configurando etiquetas. Las etiquetas funcionan como carpetas, pero puede añadir más de una etiqueta a un contacto. Para añadir una nueva etiqueta, añádela en el contacto mismo.',
'tags_list_contact_number' => '1 contacto|:count contactos',
'tags_list_delete_success' => 'La etiqueta se ha eliminado correctamente',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => '¿Está seguro que desea eliminar la etiqueta? Ningún contacto será eliminado, sólo la etiqueta.',
'tags_blank_title' => 'Las etiquetas son una excelente forma de clasificar tus contactos.',
'tags_blank_description' => 'Las etiquetas funcionan como carpetas, pero puede añadir más de una etiqueta a un contacto. Ir a un contacto y etiquetar a un amigo, justo debajo del nombre. Una vez que un contacto está etiquetado, vuelve aquí para gestionar todas las etiquetas de tu cuenta.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/fa/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/fi/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/fr/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Vous pouvez organiser vos contact avec des étiquettes. Les étiquettes sont comme des dossiers, mais vous pouvez avoir autant d’étiquettes que vous le souhaitez par contact.',
'tags_list_contact_number' => ':count contact|:count contacts',
'tags_list_delete_success' => 'L’étiquette a été supprimée avec succès',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Êtes-vous sûr de vouloir supprimer cette étiquette ? Aucun contact ne sera supprimé, seulement l’étiquette.',
'tags_blank_title' => 'Les étiquettes sont une excellente manière de catégoriser vos contacts.',
'tags_blank_description' => 'Les étiquettent fonctionnent comme des dossiers, mais vous pouvez ajouter plus d\'une étiquette à un contact. Allez à un contact et taguez un ami, juste en dessous du nom. Une fois qu\'un contact est étiqueté, revenez ici pour gérer toutes les étiquettes de votre compte.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/he/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'ניתן לארגן את אנשי הקשר שלך על ידי הגדרת תגיות. תגיות עובדות כמו תיקיות אך יש לך אפשרות להוסיף יותר מתגית אחת לאיש קשר. כדי להוסיף תגית חדשה, ניתן להוסיף אותה על איש הקשר עצמו.',
'tags_list_contact_number' => 'איש קשר אחד|:count אנשי קשר',
'tags_list_delete_success' => 'התגית נמחקה בהצלחה',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'למחוק את התגית? לא יימחקו אנשי קשר, רק התגית.',
'tags_blank_title' => 'תגיות הן דרך נהדרת לארגון אנשי הקשר שלך.',
'tags_blank_description' => 'תגיות עובדות כמו תיקיות, אך ניתן להוסיף יותר מתגית אחת לאיש קשר. יש לגשת לאיש קשר ולתייג כחבר, מיד מתחת לשם. לאחר תיוג איש קשר, ניתן לחזור לכאן כדי לנהל את כל התגיות בחשבון שלך.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/hr/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/id/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Anda dapat mengkategorikan kontak Anda dengan mengatur tag. Tag berfungsi seperti folder, tetapi Anda dapat menambahkan lebih dari satu tag ke kontak. Untuk menambahkan sebuah tag baru, tambahkan tag pada kontak tersebut.',
'tags_list_contact_number' => ':count kontak',
'tags_list_delete_success' => 'Tag telah berhasil dihapus',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Apakah Anda yakin ingin menghapus tag? Tidak ada kontak yang akan dihapus, hanya tag saja.',
'tags_blank_title' => 'Tag adalah sebuah cara yang bagus untuk mengkategorikan kontak Anda.',
'tags_blank_description' => 'Tag bekerja seperti folder, tetapi Anda dapat menambahkan lebih dari satu tag ke kontak. Cari sebuah kontak dan tag seorang teman, tepat di bawah namanya. Setelah sebuah kontak ditambhkan tag, kembali ke sini untuk mengelola semua tag di akun Anda.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/it/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Puoi organizzare i tuoi contatti attraverso le etichette. Le etichette funzionano come delle cartelle, ma puoi aggiungere più di un\'etichetta a ogni contatto. Per aggiungere una nuova etichetta, aggiungila al contatto stesso.',
'tags_list_contact_number' => '1 contatto|:count contatti',
'tags_list_delete_success' => 'Etichetta rimossa',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Rimuovere etichetta? Nessun contatto verrà rimosso, solo l\'etichetta.',
'tags_blank_title' => 'Le etichette sono un buon modo di organizzare i tuoi contatti.',
'tags_blank_description' => 'I tag funzionano come cartelle, ma puoi aggiungerne più di uno a un contatto. Vai a un contatto e tagga un amico, proprio sotto al nome. Una volta taggato un contatto, torna qui per gestire tutti i tag nel tuo profilo.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/ja/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'You can organize your contacts by setting up tags. Tags work like folders, but you can add more than one tag to a contact. To add a new tag, add it on the contact itself.',
'tags_list_contact_number' => '1 contact|:count contacts',
'tags_list_delete_success' => 'The tag has been successfully deleted',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Are you sure you want to delete the tag? No contacts will be deleted, only the tag.',
'tags_blank_title' => 'Tags are a great way of categorizing your contacts.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/nl/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Je kan je contacten organiseren door labels toe te voegen. Labels werken als mappen maar je kan meer dan één label toevoegen aan een contact. Om een nieuw label toe te voegen moet je dat bij een contactpersoon zelf doen.',
'tags_list_contact_number' => '1 contact|:count contacten',
'tags_list_delete_success' => 'Het label is succesvol verwijderd',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Weet je zeker dat je het label wil verwijderen? Alleen het label zal worden verwijderd, contactpersonen blijven behouden.',
'tags_blank_title' => 'Labels zijn een geweldige methode om je contacten te organiseren.',
'tags_blank_description' => 'Tags work like folders, but you can add more than one tag to a contact. Go to a contact and tag a friend, right below the name. Once a contact is tagged, come back here to manage all the tags in your account.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/no/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Du kan organisere kontaktene dine ved å sette opp tagger. Tagger fungerer som mapper, men du kan legge til flere enn ett tag til en kontakt. For å legge til en ny tag, legg den til selve kontakten.',
'tags_list_contact_number' => '1 kontakt|:count kontakter',
'tags_list_delete_success' => 'Taggen har blitt slettet',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Er du sikker på at du vil slette taggen? Ingen kontakter vil bli slettet, bare taggen.',
'tags_blank_title' => 'Tagger er en flott måte å kategorisere kontaktene på.',
'tags_blank_description' => 'Merker fungerer som mapper, men du kan legge til flere enn en tag til en kontakt. Gå til kontakt og tagg en venn rett under navnet. Når en kontakt er tagget, kom tilbake hit for å administrere alle taggene på kontoen din.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/pt-BR/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
'tags_list_description' => 'Você pode organizar seus contatos configurando etiquetas (tags). As tags funcionam como pastas, mas você pode adicionar mais de uma tag a um contato. Para adicionar uma nova tag, adicione-a no próprio contato.',
'tags_list_contact_number' => '1 contato|:count contatos',
'tags_list_delete_success' => 'A tag foi excluída com sucesso',
'tags_list_edit_success' => 'The tag has been successfully updated',
'tags_list_delete_confirmation' => 'Tem certeza que deseja excluir a etiqueta? Nenhum contato será excluído, apenas a etiqueta.',
'tags_blank_title' => 'As tags são uma ótima maneira de categorizar seus contatos.',
'tags_blank_description' => 'As tags funcionam como pastas, mas você pode adicionar mais de uma tag a um contato. Vá para um contato e marque um amigo, logo abaixo do nome. Depois de adicionar uma tag ao contato, volte aqui para gerenciar todas as tags da sua conta.',
Expand Down
Loading
Loading