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

Remove localization, set english as default #348

Merged
merged 44 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5dce683
Remove localization, set english as default
wouterbles Oct 10, 2023
f5dd7fb
Merge branch 'master' into english-default
wouterbles Oct 10, 2023
8326609
Add migrations
wouterbles Oct 10, 2023
8b12a23
Merge branch 'master' into english-default
wouterbles Oct 11, 2023
8c652ff
Fix tests and merge issues
wouterbles Oct 11, 2023
b9e666b
Fix down method in migrations
wouterbles Oct 11, 2023
f1e553b
Fix tests
wouterbles Oct 11, 2023
77c7fc6
Fix agenda date parsing
wouterbles Oct 11, 2023
d424fe2
Fix tests and remaining Vue localizatoin
wouterbles Oct 11, 2023
a9442d2
Fix agenda repo
wouterbles Oct 11, 2023
99c2991
Fix bugs after setting english
wouterbles Oct 11, 2023
f54f27e
Fix lang files
wouterbles Oct 11, 2023
8e4ee65
Remove lang
wouterbles Oct 11, 2023
c4d041f
Fix missing lang strings
wouterbles Oct 11, 2023
4dffdfb
Remove lang files
wouterbles Oct 11, 2023
53e61e2
Fix library controller
wouterbles Oct 11, 2023
575e437
Fix string in tests
wouterbles Oct 11, 2023
d812311
Set charset in migrations
wouterbles Oct 12, 2023
3d8d378
Fix migrations
wouterbles Oct 12, 2023
b92baa7
Improve aplication form and page management layout
wouterbles Oct 12, 2023
db2b86a
Check null value in texts
wouterbles Oct 12, 2023
bd1eb55
Fix null string
wouterbles Oct 12, 2023
f9b21bd
Fix null string in tests
wouterbles Oct 12, 2023
84d9fdf
Fix variable naming
wouterbles Oct 12, 2023
10abe08
Fix routes and page show
wouterbles Oct 12, 2023
049065e
Routes translation
wouterbles Oct 14, 2023
b261f82
Improve EN text, fix page show
wouterbles Oct 17, 2023
eb17111
Add additional validation
wouterbles Oct 18, 2023
41c44de
Remove console.log
wouterbles Oct 18, 2023
b78fdd2
Merge branch 'master' into english-default
wouterbles Oct 18, 2023
9739b5a
Fix login screen text
wouterbles Oct 18, 2023
b5c2a82
Improve agenda api
wouterbles Oct 18, 2023
0115554
Fix unregister button style
wouterbles Oct 18, 2023
2ba3650
Update codecov to allow decrease in patch coverage
wouterbles Oct 18, 2023
ec9b823
Switch response to longtext, instead of only 255 chars
wouterbles Oct 18, 2023
48a8f8a
Merge branch 'master' into english-default
wouterbles Oct 18, 2023
9f2c170
Fix merge
wouterbles Oct 18, 2023
d676a1d
Remove repo factory
wouterbles Oct 18, 2023
680957e
Fix seeder
wouterbles Oct 18, 2023
d81d270
Merge branch 'master' into english-default
wouterbles Oct 19, 2023
f6b4c77
Remove intro packages
wouterbles Oct 19, 2023
0ef9be5
Revert status code retrieval
wouterbles Oct 19, 2023
7bf25fd
Fix typo
wouterbles Oct 19, 2023
0f66f1a
Remove telescope
wouterbles Oct 19, 2023
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
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:8000

TELESCOPE_ENABLED=true
TELESCOPE_PROD=false

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
Expand Down
42 changes: 17 additions & 25 deletions app/AgendaItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Support\Facades\Storage;

class AgendaItem extends Model
{
Expand All @@ -19,57 +20,48 @@ class AgendaItem extends Model
'endDate',
'image_url',
'category',
'climbing_activity'
'climbing_activity',
];

protected $casts = [
'climbing_activity' => 'boolean'
'climbing_activity' => 'boolean',
];

public function getApplicationForm(): HasOne{
return $this->hasOne(ApplicationForm::class,'id',"application_form_id");
}

public function agendaItemText(){
return $this->hasOne('App\Text', 'id', 'text');
}

public function agendaItemTitle()
public function getApplicationForm(): HasOne
{
return $this->hasOne('App\Text', 'id', 'title');
}
public function agendaItemShortDescription()
{
return $this->hasOne('App\Text', 'id', 'shortDescription');
return $this->hasOne(ApplicationForm::class, 'id', "application_form_id");
}

public function agendaItemCategory()
{
return $this->hasOne('App\AgendaItemCategorie', 'id', 'category')->withTrashed();
return $this->hasOne('App\AgendaItemCategory', 'id', 'category')->withTrashed();
}

public function getCreatedBy()
{
return $this->hasOne('App\User', 'id', 'createdBy');
}

public function getImageUrl(){
if($this->image_url != ""){
return \Storage::disk('public')->url($this->image_url);
public function getImageUrl()
{
if ($this->image_url != "") {
return Storage::disk('public')->url($this->image_url);
} else {
return "/img/default_agenda_item_cover.jpg";
}
}

public function getApplicationFormResponses(){
return $this->hasMany(ApplicationResponse::class,'agenda_id');
public function getApplicationFormResponses()
{
return $this->hasMany(ApplicationResponse::class, 'agenda_id');
}

public function canRegister(){
if($this->subscription_endDate < Carbon::now()){
public function canRegister()
{
if ($this->subscription_endDate < Carbon::now()) {
return false;
} else {
return true;
}
}
}
}
9 changes: 3 additions & 6 deletions app/AgendaItemCategorie.php → app/AgendaItemCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class AgendaItemCategorie extends Model
class AgendaItemCategory extends Model
{
use SoftDeletes;

protected $fillable = [
'name'
'name',
];

public function categorieName(){
return $this->hasOne('App\Text', 'id', 'name')->withTrashed();
}
}
8 changes: 1 addition & 7 deletions app/Certificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ class Certificate extends Model
use SoftDeletes;
protected $fillable = [
'name',
'duration',
'abbreviation'
'abbreviation',
];

public function certificateName(){
return $this->hasOne('App\Text', 'id', 'name');
}

}
2 changes: 1 addition & 1 deletion app/Console/Commands/RemoveOldApplications.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct()
public function handle()
{
ApplicationResponse::query()
->where('created_at','<',Carbon::now()->subYear(config('custom.application_response_save_period')))
->where('created_at', '<', Carbon::now()->subYears(config('custom.application_response_save_period')))
->forceDelete();
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/RemoveOldUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct()
public function handle()
{
User::query()
->whereDate('lid_af','<',Carbon::now()->subYear(config('custom.old_users_save_period')))
->whereDate('lid_af', '<', Carbon::now()->subYears(config('custom.old_users_save_period')))
->update([
'email' => null,
'password' => null,
Expand Down
9 changes: 4 additions & 5 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Console;

use App\Console\Commands\RemoveOldUsers;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

Expand All @@ -25,10 +24,10 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('remove:oldUsers')
->weekly();
$schedule->command('remove:oldApplications')
->weekly();
$schedule->command('remove:oldUsers')
->weekly();
$schedule->command('remove:oldApplications')
->weekly();
}

/**
Expand Down
5 changes: 2 additions & 3 deletions app/CustomClasses/MailList/MailList.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace App\CustomClasses\MailList;


class MailList
{
private $id;
Expand Down Expand Up @@ -103,7 +102,7 @@ public function getMembers(): array
*/
public function addMember(MailListMember $member): MailList
{
array_push($this->members,$member);
array_push($this->members, $member);
return $this;
}
}
}
54 changes: 31 additions & 23 deletions app/CustomClasses/MailList/MailListFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,29 @@ class MailListFacade
private $_mailListParser;
private $_mailManHandler;

public function __construct(MailListParser $mailListParser,MailMan $mailMan)
public function __construct(MailListParser $mailListParser, MailMan $mailMan)
{
$this->_mailListParser = $mailListParser;
$this->_mailManHandler = $mailMan;
}

public function getAllMailLists(){
public function getAllMailLists()
{
$mailLists = array();
$response = $this->_mailManHandler->get('/lists');
foreach($response->entries as $mailList){
array_push($mailLists,$this->_mailListParser->parseMailManMailList($mailList));
foreach ($response->entries as $mailList) {
array_push($mailLists, $this->_mailListParser->parseMailManMailList($mailList));
}
return $mailLists;
}

public function getMailList($id){
public function getMailList($id)
{
$mailList = $this->_mailListParser->parseMailManMailList($this->_mailManHandler->get('/lists/' . $id));
$members = $this->_mailManHandler->get('/lists/' . $id . '/roster/member');

if(property_exists($members,"entries")){
foreach ($members->entries as $member){
if (property_exists($members, "entries")) {
foreach ($members->entries as $member) {
$parsedMember = $this->_mailListParser->parseMailManMember($member);
$mailList->addMember($parsedMember);
}
Expand All @@ -42,21 +44,25 @@ public function getMailList($id){
return $mailList;
}

public function storeMailList(array $data){
public function storeMailList(array $data)
{
$this->_mailManHandler->post("/lists", [
'fqdn_listname' => $data['address'] . env("MAIL_MAN_DOMAIN"),
]);
}

public function deleteMailList($id){
public function deleteMailList($id)
{
$this->_mailManHandler->delete("/lists/" . $id);
}

public function deleteMemberFromMailList($mailListId,$memberEmail){
$this->_mailManHandler->delete("/lists/" . $mailListId ."/member/". $memberEmail);
public function deleteMemberFromMailList($mailListId, $memberEmail)
{
$this->_mailManHandler->delete("/lists/" . $mailListId . "/member/" . $memberEmail);
}

public function addMember($mailListId, $email,$name){
public function addMember($mailListId, $email, $name)
{
$this->_mailManHandler->post(
"/members",
[
Expand All @@ -70,28 +76,30 @@ public function addMember($mailListId, $email,$name){
);
}

public function deleteUserFormAllMailList($user){
foreach ($this->getAllMailLists() as $mailList){
public function deleteUserFormAllMailList($user)
{
foreach ($this->getAllMailLists() as $mailList) {
try {
//we used try to delete the user from the mail list wihout checken if he is in the list because
//that take to much time
$this->deleteMemberFromMailList($mailList->getId(),$user->email);
} catch (\Exception $e){
$this->deleteMemberFromMailList($mailList->getId(), $user->email);
} catch (\Exception $e) {
}
}
}

public function updateUserEmailFormAllMailList($user, $oldEmail, $newEmail){
foreach ($this->getAllMailLists() as $mailList){
public function updateUserEmailFormAllMailList($user, $oldEmail, $newEmail)
{
foreach ($this->getAllMailLists() as $mailList) {
$mailList = $this->getMailList($mailList->getAddress());
foreach ($mailList->getMembers() as $member){
if($oldEmail === $member->getAddress()){
$this->deleteMemberFromMailList($mailList->getId(),$member->getAddress());
$this->addMember($mailList->getId(),$newEmail,$user->getName());
foreach ($mailList->getMembers() as $member) {
if ($oldEmail === $member->getAddress()) {
$this->deleteMemberFromMailList($mailList->getId(), $member->getAddress());
$this->addMember($mailList->getId(), $newEmail, $user->getName());
}
}

}
}

}
}
3 changes: 1 addition & 2 deletions app/CustomClasses/MailList/MailListMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace App\CustomClasses\MailList;


class MailListMember
{
private $name;
Expand Down Expand Up @@ -49,4 +48,4 @@ public function setAddress($address)
$this->address = $address;
return $this;
}
}
}
8 changes: 5 additions & 3 deletions app/CustomClasses/MailList/MailListParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class MailListParser
* @param $object
* @return MailList
*/
public function parseMailManMailList($object) : MailList{
public function parseMailManMailList($object): MailList
{
$mailList = new MailList();
$mailList
->setId($object->list_id)
Expand All @@ -36,12 +37,13 @@ public function parseMailManMailList($object) : MailList{
* @param $object
* @return MailListMember
*/
public function parseMailManMember($object) : MailListMember{
public function parseMailManMember($object): MailListMember
{
$member = new MailListMember();
$member
->setAddress($object->email)
->setName($object->display_name);

return $member;
}
}
}
27 changes: 15 additions & 12 deletions app/CustomClasses/MailList/MailMan.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace App\CustomClasses\MailList;


use GuzzleHttp\Client;

class MailMan
Expand All @@ -22,27 +21,31 @@ public function __construct()
$this->_client = new Client();
}

public function get(string $url){
return $this->call("GET",$url);
public function get(string $url)
{
return $this->call("GET", $url);
}

public function post(string $url,array $body){
return $this->call("POST",$url,$body);
public function post(string $url, array $body)
{
return $this->call("POST", $url, $body);
}

public function delete(string $url){
return $this->call("DELETE",$url);
public function delete(string $url)
{
return $this->call("DELETE", $url);
}

private function call(string $method,string $url,array $body = []){
$response = $this->_client->request($method,$this->_baseUrl . $url,[
private function call(string $method, string $url, array $body = [])
{
$response = $this->_client->request($method, $this->_baseUrl . $url, [
"form_params" => $body,
"auth" => [
env('MAIL_MAN_USERNAME'),
env('MAIL_MAN_PASSWORD')
]
env('MAIL_MAN_PASSWORD'),
],
]);

return json_decode($response->getBody()->getContents());
}
}
}
Loading
Loading