Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/inikoo/wowsbar into main
Browse files Browse the repository at this point in the history
  • Loading branch information
aqordeon committed Oct 6, 2023
2 parents 373764e + 19c46b0 commit 9e9efc7
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 9 deletions.
79 changes: 79 additions & 0 deletions app/Actions/CRM/Appointment/UI/IndexAppointment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
/*
* Author: Raul Perusquia <raul@inikoo.com>
* Created: Fri, 06 Oct 2023 08:55:05 Malaysia Time, Office, Bali, Indonesia
* Copyright (c) 2023, Raul A Perusquia Flores
*/

namespace App\Actions\CRM\Appointment\UI;

use App\Actions\InertiaAction;
use App\Enums\Portfolio\Snapshot\SnapshotStateEnum;
use App\InertiaTable\InertiaTable;
use App\Models\CRM\Appointment;
use App\Models\Helpers\Snapshot;
use App\Models\Portfolio\Banner;
use App\Models\Web\Webpage;
use Closure;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Lorisleiva\Actions\ActionRequest;
use Spatie\QueryBuilder\QueryBuilder;

class IndexAppointment extends InertiaAction
{
public function authorize(ActionRequest $request): bool
{
return
(
$request->user()->tokenCan('root') or
$request->get('customerUser')->hasPermissionTo('portfolio.banners.view')
);
}

/** @noinspection PhpUndefinedMethodInspection */
public function handle(Banner|Webpage $parent, $prefix = null): LengthAwarePaginator
{
$queryBuilder = QueryBuilder::for(Appointment::class);

return $queryBuilder
->defaultSort('-schedule_at')
->allowedSorts(['schedule_at'])
->withPaginator($prefix)
->withQueryString();
}

public function tableStructure(Appointment $appointment, ?array $modelOperations = null, $prefix = null, ?array $exportLinks = null): Closure
{
return function (InertiaTable $table) use ($modelOperations, $prefix, $exportLinks) {
if ($prefix) {
$table
->name($prefix)
->pageName($prefix . 'Page');
}

$table
->withModelOperations($modelOperations)
->withGlobalSearch()
->withEmptyState(
[
'title' => __('No appointment'),
'count' => 0
]
);
if ($exportLinks) {
$table->withExportLinks($exportLinks);
}


$table->column(key: 'customer_name', label: 'customer name')
->column(key: 'schedule_at', label: __('schedule at'), sortable: true)
->column(key: 'state', label: __('state'))
->column(key: 'type', label: __('type'))
->column(key: 'event', label: __('event'))
->column(key: 'event_address', label: __('event address'))
->defaultSort('published_at');
};
}


}
7 changes: 0 additions & 7 deletions app/Actions/Portfolio/Banner/UI/ParseBannerLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ public function handle(array $layout): array
{
$slides = [];

$hash=Arr::pull($layout, 'hash');
Arr::forget($layout, 'publishedHash');

foreach (Arr::get($layout, 'components') as $key => $slideData) {

$slides[Arr::get($slideData, 'ulid', $key)] = [
'layout' => Arr::get($slideData, 'layout'),
'visibility' => Arr::get($slideData, 'visibility'),
Expand All @@ -33,12 +29,9 @@ public function handle(array $layout): array
];
}


return [
Arr::except($layout, ['components', 'images']),
$slides,
$hash

];
}

Expand Down
9 changes: 9 additions & 0 deletions app/Actions/UI/Organisation/GetLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ public function handle(OrganisationUser $user): array
'name' => 'org.crm.shop.mailroom.dashboard',
'parameters' => $shop->slug
]
],
[

'label' => __('appointment'),
'icon' => ['fal', 'fa-handshake'],
'route' => [
'name' => 'org.crm.shop.mailroom.dashboard',
'parameters' => $shop->slug
]
]
],
default => []
Expand Down
5 changes: 3 additions & 2 deletions resources/js/Layouts/OrgApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
faAbacus,
faChevronDown,
faGlobe,
faLanguage, faUsers,faNetworkWired,faCalendar,faStopwatch,faBuilding
faLanguage, faUsers, faNetworkWired, faCalendar, faStopwatch, faBuilding, faHandshake
} from "@/../private/pro-light-svg-icons"
import { faSearch, faBell} from "../../private/pro-regular-svg-icons"

Expand All @@ -55,7 +55,8 @@ library.add(
faNetworkWired,
faCalendar,
faStopwatch,
faBuilding
faBuilding,
faHandshake
)

const sidebarOpen = ref(false)
Expand Down
4 changes: 4 additions & 0 deletions routes/org/web/crm.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@
});

Route::get('mailroom', ShowMailroomDashboard::class)->name('mailroom.dashboard');

Route::prefix('appointments')->as('appointments.')->group(function () {
Route::get('/', ShowMailroomDashboard::class)->name('mailroom.dashboard');
});
});

0 comments on commit 9e9efc7

Please sign in to comment.