Skip to content

Commit

Permalink
wip on bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Nov 24, 2023
1 parent 43c1f14 commit 8e35cae
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/storage/framework/testing/*
/storage/framework/views/*
/storage/logs/*
/.scannerwork
/vendor
_ide_helper_models.php
_ide_helper.php
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Import/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function parseDate(?string $input): ?Carbon
return Carbon::createFromFormat('M d Y H:i:s:A', $input);
}

public function mapCounty($oldCountyId): int
public function mapCounty(int $oldCountyId): int
{
$countiesMap = [
1 => 1,//Alba
Expand Down
9 changes: 7 additions & 2 deletions app/Console/Commands/Import/ImportProjectsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ protected function importProjects(): void
'end' => $this->parseDate($row->EndDate),
'accepting_volunteers' => (bool) $row->HasVolunteering,
'accepting_comments' => (bool) $row->AcceptComments,
// 'why_donate' => Sanitize::text($row->WhyDonate),
'reason_to_donate' => Sanitize::text($row->WhyDonate),
'scope' => Sanitize::text($row->ProjectPurpose),
'beneficiaries' => Sanitize::text($row->ToWhomDoIDonate),

'created_at' => $created_at,
'updated_at' => $created_at,
Expand All @@ -132,8 +134,11 @@ protected function importProjects(): void
]);

$project->categories()->attach($row->ProjectCategoryId);

$mappedCounties = collect(explode(',', $row->Counties ?? ''))
->map(fn ($county) => $this->mapCounty($county))->all();
->filter(fn (string $county) => $county !== '')
->map(fn (int $county) => $this->mapCounty($county))
->all();
$project->counties()->attach($mappedCounties);

if (! $this->option('skip-files')) {
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Resources/Project/ShowProjectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public function toArray(Request $request): array
return [
'src' => $media->getFullUrl(),
'thumbnail' => $media->getFullUrl('preview'),
'w' => 1200,
'h' => 800,
];
})->toArray(),
'is_active' => $this->is_active,
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Public/Articles/Articles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</Carousel>

<section class="container grid grid-cols-12 gap-12">
<div class="grid col-span-8 gap-10">
<div class="grid col-span-8 gap-10 mt-2">
<header v-if="!category">
<Head :title="$t('articles.index')" />
<h1 v-text="$t('articles.index')" class="text-3xl font-bold text-cyan-900" />
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Public/Articles/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div
class="inline-flex items-center justify-start px-3 py-1 mt-10 text-base font-semibold rounded-full cursor-pointer text-primary-500 bg-primary-50 gap-x-1"
>
{{ resource.category.name }}
{{ resource.category }}
</div>

<div class="prose-sm prose max-w-none sm:prose-lg xl:prose-xl">
Expand Down

0 comments on commit 8e35cae

Please sign in to comment.