Skip to content

Commit

Permalink
Merge branch '3.x' into actually-hide-hidden-item-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin authored May 8, 2024
2 parents feabd9b + c1bb0a9 commit ce966e5
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 20 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"sortablejs": "^1.15.0",
"tailwindcss": "^3.4.0",
"tippy.js": "^6.3.7",
"trix": "^1.3.1",
"trix": "^2.1.1",
"uuid-browser": "^3.1.0",
"vanilla-colorful": "^0.6.2"
}
Expand Down
6 changes: 5 additions & 1 deletion packages/actions/src/Exports/Jobs/ExportCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ public function handle(): void
/** @var Authenticatable $user */
$user = $this->export->user;

auth()->setUser($user);
if (method_exists(auth()->guard(), 'login')) {
auth()->login($user);
} else {
auth()->setUser($user);
}

$exceptions = [];

Expand Down
6 changes: 5 additions & 1 deletion packages/actions/src/Imports/Jobs/ImportCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ public function handle(): void
/** @var Authenticatable $user */
$user = $this->import->user;

auth()->setUser($user);
if (method_exists(auth()->guard(), 'login')) {
auth()->login($user);
} else {
auth()->setUser($user);
}

$exceptions = [];

Expand Down
2 changes: 1 addition & 1 deletion packages/forms/resources/lang/no/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@

'max_items_message' => 'Bare :count kan velges.',

'no_search_results_message' => 'No alternativer matcher ditt søk.',
'no_search_results_message' => 'Ingen alternativer matcher ditt søk.',

'placeholder' => 'Velg et alternativ',

Expand Down
4 changes: 2 additions & 2 deletions packages/forms/resources/views/components/builder.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class="space-y-4"
class="fi-fo-builder-item rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-white/5 dark:ring-white/10"
x-bind:class="{ 'fi-collapsed overflow-hidden': isCollapsed }"
>
@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $hasBlockLabels || $isCloneable || $isDeletable || $isCollapsible || count($visibleExtraItemActions))
@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $hasBlockLabels || $isCloneable || $isDeletable || $isCollapsible || $visibleExtraItemActions)
<div
@if ($isCollapsible)
x-on:click.stop="isCollapsed = !isCollapsed"
Expand Down Expand Up @@ -141,7 +141,7 @@ class="fi-fo-builder-item rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 d
</h4>
@endif

@if ($isCloneable || $isDeletable || $isCollapsible || count($visibleExtraItemActions))
@if ($isCloneable || $isDeletable || $isCollapsible || $visibleExtraItemActions)
<ul
class="ms-auto flex items-center gap-x-3"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@php
use Filament\Forms\Components\Actions\Action;
$containers = $getChildComponentContainers();
$addAction = $getAction($getAddActionName());
Expand All @@ -7,6 +9,7 @@
$moveDownAction = $getAction($getMoveDownActionName());
$moveUpAction = $getAction($getMoveUpActionName());
$reorderAction = $getAction($getReorderActionName());
$extraItemActions = $getExtraItemActions();
$isAddable = $isAddable();
$isCloneable = $isCloneable();
Expand Down Expand Up @@ -41,6 +44,13 @@
class="gap-4"
>
@foreach ($containers as $uuid => $item)
@php
$visibleExtraItemActions = array_filter(
$extraItemActions,
fn (Action $action): bool => $action(['item' => $uuid])->isVisible(),
);
@endphp

<li
wire:key="{{ $this->getId() }}.{{ $item->getStatePath() }}.{{ $field::class }}.item"
x-sortable-item="{{ $uuid }}"
Expand All @@ -50,7 +60,7 @@ class="fi-fo-repeater-item simple flex justify-start gap-x-3"
{{ $item }}
</div>

@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $isCloneable || $isDeletable)
@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $isCloneable || $isDeletable || $visibleExtraItemActions)
<ul class="flex items-center gap-x-1">
@if ($isReorderableWithDragAndDrop)
<li x-sortable-handle>
Expand All @@ -72,6 +82,12 @@ class="flex items-center justify-center"
</li>
@endif

@foreach ($visibleExtraItemActions as $extraItemAction)
<li>
{{ $extraItemAction(['item' => $uuid]) }}
</li>
@endforeach

@if ($isCloneable)
<li>
{{ $cloneAction(['item' => $uuid]) }}
Expand Down
8 changes: 8 additions & 0 deletions packages/panels/resources/lang/no/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,12 @@

],

'avatar' => [
'alt' => 'Avatar av :name',
],

'logo' => [
'alt' => ':name logo',
],

];
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'form' => [

'email' => [
'label' => 'E-post adresse',
'label' => 'E-postadresse',
],

'name' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

return [

'title' => 'Bekreft din e-post adresse',
'title' => 'Bekreft din e-postadresse',

'heading' => 'Bekreft din e-post adresse',
'heading' => 'Bekreft din e-postadresse',

'actions' => [

Expand All @@ -16,7 +16,7 @@

'messages' => [
'notification_not_received' => 'Ikke mottatt e-posten vi sendte?',
'notification_sent' => 'Vi har sendt e-post til :email med informasjon om hvordan du bekrefter din e-post adresse.',
'notification_sent' => 'Vi har sendt e-post til :email med informasjon om hvordan du bekrefter din e-postadresse.',
],

'notifications' => [
Expand Down
2 changes: 1 addition & 1 deletion packages/panels/resources/lang/no/pages/auth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'form' => [

'email' => [
'label' => 'E-post adresse',
'label' => 'E-postedresse',
],

'password' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'form' => [

'email' => [
'label' => 'E-post adresse',
'label' => 'E-postadresse',
],

'password' => [
Expand Down
2 changes: 1 addition & 1 deletion packages/panels/resources/lang/no/pages/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'form' => [

'email' => [
'label' => 'E-post adresse',
'label' => 'E-postadresse',
],

'name' => [
Expand Down
7 changes: 7 additions & 0 deletions packages/panels/resources/lang/no/unsaved-changes-alert.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [

'body' => 'Du har endringer som ikke er lagret. Er du sikker på at du vil forlate siden?',

];
8 changes: 8 additions & 0 deletions packages/support/resources/lang/no/components/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@

'actions' => [

'first' => [
'label' => 'Første',
],

'go_to_page' => [
'label' => 'Gå til side :page',
],

'last' => [
'label' => 'Siste',
],

'next' => [
'label' => 'Neste',
],
Expand Down
4 changes: 2 additions & 2 deletions packages/tables/resources/lang/no/table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
'text' => [

'actions' => [
'collapse_list' => 'Vis :count til',
'expand_list' => 'Vis :count mindre',
'collapse_list' => 'Vis :count mindre',
'expand_list' => 'Vis :count til',
],

'more_list_items' => 'og :count til',
Expand Down

0 comments on commit ce966e5

Please sign in to comment.