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

Teams - contact person #179

Merged
merged 6 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion app/Filament/Resources/OrganisationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static function form(Form $form): Form
->columnSpanFull(),
]),

Section::make(__('organisation.field.contact_person'))
Section::make(__('organisation.section.contact_person'))
->columns()
->schema([
TextInput::make('contact_person.first_name')
Expand Down Expand Up @@ -201,6 +201,33 @@ public static function form(Form $form): Form
]),
]),

Section::make(__('organisation.section.contact_person_in_teams'))
->columns()
->schema([
TextInput::make('contact_person_in_teams.first_name')
->label(__('organisation.field.contact_person_in_teams_first_name'))
->maxLength(100),

TextInput::make('contact_person_in_teams.last_name')
->label(__('organisation.field.contact_person_in_teams_last_name'))
->maxLength(100),

TextInput::make('contact_person_in_teams.role')
->label(__('organisation.field.role'))
->columnSpanFull()
->maxLength(200),

TextInput::make('contact_person_in_teams.email')
->label(__('organisation.field.email'))
->maxLength(200)
->email(),

TextInput::make('contact_person_in_teams.phone')
->label(__('organisation.field.phone'))
->maxLength(14)
->tel(),
]),

Section::make(__('organisation.section.activity'))
->columns()
->schema([
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/OrganisationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function __invoke(): JsonResource
'type',
'status',
'area',
'contact_person_in_teams',
'description',
'created_at',
'updated_at',
Expand Down
1 change: 1 addition & 0 deletions app/Http/Resources/OrganisationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function toArray(Request $request): array
'created_at' => $this->created_at->format('Y-m-d H:i:s'),
'updated_at' => $this->updated_at->format('Y-m-d H:i:s'),
'volunteers_count' => (int) $this->volunteers_count,
'contact_person_in_teams' => $this->contact_person_in_teams,
];
}
}
2 changes: 2 additions & 0 deletions app/Models/Organisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function registerMediaConversions(Media $media = null): void
'cif',
'registration_number',
'contact_person',
'contact_person_in_teams',
'other_information',
'description',
'address',
Expand All @@ -75,6 +76,7 @@ public function registerMediaConversions(Media $media = null): void
'ngo_type' => NGOType::class,
'status' => OrganisationStatus::class,
'contact_person' => 'array',
'contact_person_in_teams' => 'array',
'other_information' => AsCollection::class,
'has_branches' => 'boolean',
];
Expand Down
9 changes: 9 additions & 0 deletions database/factories/OrganisationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ public function definition()
'role' => fake()->jobTitle(),
];

$contactPersonInTeams = [
'first_name' => fake()->firstName(),
'last_name' => fake()->lastName(),
'email' => fake()->unique()->safeEmail(),
'phone' => fake()->phoneNumber(),
'role' => fake()->jobTitle(),
];

$otherInfo = [
'facebook' => fake()->boolean() ? 'https://www.facebook.com/#link' : null,
'website' => fake()->boolean() ? fake()->url() : null,
Expand All @@ -60,6 +68,7 @@ public function definition()
'description' => fake()->sentence('10'),
'address' => fake()->address(),
'contact_person' => $contactPerson,
'contact_person_in_teams' => $contactPersonInTeams,
'other_information' => $otherInfo,
'has_branches' => fake()->boolean(),
'city_id' => $city->id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('organisations', function (Blueprint $table) {
$table->json('contact_person_in_teams')->nullable()->after('contact_person');
});
}
};
5 changes: 4 additions & 1 deletion lang/ro/organisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
'description' => 'Descriere extinsă organizație',
'short_description' => 'Descriere scurtă organizație',
'logo' => 'Logo organizație',
'contact_person' => 'Persoană de contact în relația cu DSU',
'choose' => 'Alege',
'email' => 'Email',
'phone' => 'Telefon',
'contact_person_first_name' => 'Prenume persoană de contact',
'contact_person_last_name' => 'Nume persoană de contact',
'contact_person_in_teams_first_name' => 'Nume',
'contact_person_in_teams_last_name' => 'Prenume',
'other_information' => 'Alte informații',
'social_services_accreditation' => 'ONG acreditat pentru servicii sociale',
'risk_categories' => 'Tipuri de riscuri acoperite',
Expand Down Expand Up @@ -104,6 +105,8 @@
'localities' => 'Localitati',
'other_information' => 'Alte informatii',
'profile' => 'Profil',
'contact_person' => 'Persoană de contact în relația cu DSU',
'contact_person_in_teams' => 'Persoană de contact pentru Platforma Teams "Sprijin Umanitar DSU-GOV / FiiPregătit"'
],

'help' => [
Expand Down