Skip to content

Commit

Permalink
Update dev (#397)
Browse files Browse the repository at this point in the history
* fix: video url type error (#393)

* fix: video url type error

* fix: add video repeater validation rules

* Translations update from translate.commit (#351)

* Added translation using Weblate (English)

* Translated using Weblate (English)

Currently translated at 0.4% (2 of 482 strings)

Translation: Bursa Binelui/Core
Translate-URL: https://translate.commitglobal.org/projects/bursa-binelui/core/en/

* Translated using Weblate (English)

Currently translated at 0.6% (3 of 488 strings)

Translation: Bursa Binelui/Core
Translate-URL: https://translate.commitglobal.org/projects/bursa-binelui/core/en/

---------

Co-authored-by: Tudor Amariei <[email protected]>
Co-authored-by: Miruna Muscan <[email protected]>
Co-authored-by: Andrei Ioniță <[email protected]>

* fix: project description validation (#394)

* fix statue activity log (#396)

* fix statue activity log

* formatting

---------

Co-authored-by: Andrei Ioniță <[email protected]>

* Fix bcr project click link && transform description to html

* wip

---------

Co-authored-by: Andrei Ioniță <[email protected]>
Co-authored-by: code4ro-github-bot <[email protected]>
Co-authored-by: Tudor Amariei <[email protected]>
Co-authored-by: Miruna Muscan <[email protected]>
  • Loading branch information
5 people authored Oct 14, 2024
1 parent 045dfe0 commit d531d33
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 53 deletions.
4 changes: 2 additions & 2 deletions app/Filament/Resources/BCRProjectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
use Camya\Filament\Forms\Components\TitleWithSlugInput;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Resources\Form;
Expand Down Expand Up @@ -94,7 +94,7 @@ public static function form(Form $form): Form
->columnSpanFull()
->required(),

Textarea::make('description')
RichEditor::make('description')
->label(__('bcr-project.labels.description'))
->inlineLabel()
->columnSpanFull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,23 @@ protected function setUp(): void

Value::make('changed_field_new_value')
->label(__('activity.value.new'))
->content(
function (Activity $record) {

->content(function (Activity $record) {
if ($record->changed_field === 'statute') {
$media = Media::find($record->changed_field_new_value);
if (! $media) {
return '-';
}

return new HtmlString(
sprintf(
'<a href="%s" target="_blank">%s</a>',
$media->getTemporaryUrl(now()->addMinutes(30)),
$media->file_name
)
);
return new HtmlString(\sprintf(
'<a href="%s" target="_blank">%s</a>',
$media->getTemporaryUrl(now()->addMinutes(30)),
$media->file_name
));
}

return $record->changed_field_new_value;
}
)
})

->inlineLabel(),
]);

Expand Down
29 changes: 14 additions & 15 deletions resources/js/Pages/AdminOng/Projects/EditProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,7 @@
</template>
</Field>

<Field
:label="$t('video_link_label')"
alt
:errors="formChangeStatus.errors.videos || arrayError('videos.0.url')"
>
<Field :label="$t('video_link_label')" alt :errors="formChangeStatus.errors.videos || arrayError('videos')">
<template #value>
<div class="flex items-center col-span-12 gap-6 text-base font-medium leading-6 text-gray-700">
<div class="grid gap-4">
Expand Down Expand Up @@ -501,10 +497,10 @@
{
label: $t('video_link_label'),
key: 'url',
error: arrayError('videos.0.url'),
error: arrayError('videos'),
},
]"
:error="arrayError('videos.0.url')"
:error="arrayError('videos')"
name="videos"
/>
</EditModal>
Expand All @@ -513,7 +509,7 @@

<Field
:label="$t('external_links_title')"
:errors="formChangeStatus.errors.external_links || arrayError('external_links.0.title')"
:errors="formChangeStatus.errors.external_links || arrayError('external_links')"
>
<template #value>
<div class="flex items-center col-span-12 gap-6 text-base font-medium leading-6 text-gray-700">
Expand All @@ -533,7 +529,7 @@
<EditModal
@action="editField('external_links')"
class="flex justify-end col-span-1"
:errors="arrayError('external_links.0.url')"
:errors="arrayError('external_links')"
:label="$t('external_links_title')"
>
<RepeaterComponent
Expand All @@ -543,12 +539,12 @@
{
label: $t('project.labels.external_links_title'),
key: 'title',
error: arrayError('external_links.0.title'),
error: arrayError('external_links'),
},
{
label: $t('project.labels.external_links_url'),
key: 'url',
error: arrayError('external_links.0.url'),
error: arrayError('external_links'),
},
]"
/>
Expand Down Expand Up @@ -650,9 +646,12 @@ const editField = (field) => {
});
};
function arrayError(key) {
if (props?.errors[key]) {
return props?.errors[key];
}
return null;
let errorMessage = '';
Object.keys(props?.errors).forEach((error) => {
if (error.startsWith(key)) {
errorMessage = props?.errors[error];
}
});
return errorMessage;
}
</script>
48 changes: 24 additions & 24 deletions resources/js/Pages/Public/Bcr/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<div class="mb-10" v-if="project.description">
<h2 class="mb-6 text-3xl font-bold text-primary-900">{{ $t('description') }}</h2>
<div class="text-lg text-gray-500" v-text="project.description" />
<div class="text-lg text-gray-500" v-html="project.description" />
</div>
</div>

Expand Down Expand Up @@ -85,11 +85,11 @@

<ul class="pl-8 leading-relaxed border-l-8 border-primary-500">
<li
v-for="({ url, title, source }, index) in project.external_links"
v-for="({ link, title, source }, index) in project.external_links"
:key="index"
class="overflow-hidden text-gray-800"
>
<a :href="url" class="inline group" target="_blank" rel="noopener">
<a :href="link" class="inline group" target="_blank" rel="noopener">
<span v-text="title" class="text-blue-500 underline group-hover:no-underline" />
</a>

Expand Down Expand Up @@ -126,25 +126,25 @@
</template>

<script setup>
/** Import form vue */
import { onMounted, ref } from 'vue';
/** Import from inertia. */
import Head from '@/Components/Head.vue';
/** Import components. */
import PageLayout from '@/Layouts/PageLayout.vue';
import SharePage from '@/Components/SharePage.vue';
import Gallery from '@/Components/Gallery.vue';
import LargeSquarePattern from '@/Components/patterns/LargeSquarePattern.vue';
import { ExternalLinkIcon, BookmarkIcon, ChartBarIcon } from '@heroicons/vue/outline';
import { LocationMarkerIcon, CalendarIcon } from '@heroicons/vue/solid';
const props = defineProps({
project: {
type: Object,
required: true,
},
});
/** Import form vue */
import { onMounted, ref } from 'vue';
/** Import from inertia. */
import Head from '@/Components/Head.vue';
/** Import components. */
import PageLayout from '@/Layouts/PageLayout.vue';
import SharePage from '@/Components/SharePage.vue';
import Gallery from '@/Components/Gallery.vue';
import LargeSquarePattern from '@/Components/patterns/LargeSquarePattern.vue';
import { ExternalLinkIcon, BookmarkIcon, ChartBarIcon } from '@heroicons/vue/outline';
import { LocationMarkerIcon, CalendarIcon } from '@heroicons/vue/solid';
const props = defineProps({
project: {
type: Object,
required: true,
},
});
</script>

0 comments on commit d531d33

Please sign in to comment.