diff --git a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/EditVisaMasterPaymentOrder.php b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/EditVisaMasterPaymentOrder.php index 151a3b7..229779d 100644 --- a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/EditVisaMasterPaymentOrder.php +++ b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/EditVisaMasterPaymentOrder.php @@ -16,7 +16,7 @@ class EditVisaMasterPaymentOrder extends EditRecord protected function getHeaderActions(): array { return [ - ViewAction::make(), + // ViewAction::make(), DeleteAction::make(), ForceDeleteAction::make(), RestoreAction::make(), diff --git a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/ViewVisaMasterPaymentOrder.php b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/ViewVisaMasterPaymentOrder.php index 922d37e..6dbe947 100644 --- a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/ViewVisaMasterPaymentOrder.php +++ b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Pages/ViewVisaMasterPaymentOrder.php @@ -5,6 +5,7 @@ namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOr use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\VisaMasterPaymentOrderResource; use Filament\Actions\EditAction; use Filament\Resources\Pages\ViewRecord; +use Filament\Support\Icons\Heroicon; class ViewVisaMasterPaymentOrder extends ViewRecord { @@ -13,7 +14,8 @@ class ViewVisaMasterPaymentOrder extends ViewRecord protected function getHeaderActions(): array { return [ - EditAction::make(), + EditAction::make() + ->icon(Heroicon::OutlinedPencil), ]; } } diff --git a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Schemas/VisaMasterPaymentOrderInfolist.php b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Schemas/VisaMasterPaymentOrderInfolist.php index 9385db5..d862963 100644 --- a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Schemas/VisaMasterPaymentOrderInfolist.php +++ b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Schemas/VisaMasterPaymentOrderInfolist.php @@ -7,6 +7,7 @@ use App\Modules\Region\Repositories\RegionRepository; use App\Modules\TurkmenPassport\Repositories\TurkmenPassportRepository; use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder; use Filament\Infolists\Components\IconEntry; +use Illuminate\Support\Str; use Filament\Infolists\Components\SpatieMediaLibraryImageEntry; use Filament\Infolists\Components\TextEntry; use Filament\Schemas\Components\Fieldset; @@ -14,6 +15,8 @@ use Filament\Schemas\Components\Section; use Filament\Schemas\Components\Tabs; use Filament\Schemas\Components\Tabs\Tab; use Filament\Schemas\Schema; +use Filament\Support\Enums\IconSize; +use Filament\Support\Enums\TextSize; use Filament\Support\Icons\Heroicon; class VisaMasterPaymentOrderInfolist @@ -22,23 +25,20 @@ class VisaMasterPaymentOrderInfolist { return $schema ->components([ - Section::make(__('Order details')) + Section::make() ->columnSpanFull() - ->columns(4) + ->columns(3) ->components([ TextEntry::make('type') - ->label(__('Payment type')) - ->formatStateUsing(fn ($state) => VisaMasterPaymentOrder::applicationTypes()[$state] ?? $state) - ->inlineLabel(true) - ->badge(), + ->label(__('Payment type')) + ->extraAttributes(['style' => 'text-transform:uppercase;font-size:1.5em;font-weight:bold;']), TextEntry::make('status') ->label(__('Status')) - ->formatStateUsing(fn ($state) => OrderStatusRepository::statusValues()[$state] ?? $state) - ->badge() - ->color(OrderStatusRepository::statusColorMatching()) - ->columnSpan(2), + ->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state)) + ->extraAttributes(['style' => 'text-transform:uppercase;font-size:1.2em;font-weight:bold;']) + ->color(OrderStatusRepository::statusColorMatching()), IconEntry::make('paid') ->label(sprintf('%s (%s)', __('Paid'), __('This month'))) diff --git a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Tables/VisaMasterPaymentOrdersTable.php b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Tables/VisaMasterPaymentOrdersTable.php index f69a637..c095bf8 100644 --- a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Tables/VisaMasterPaymentOrdersTable.php +++ b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/Tables/VisaMasterPaymentOrdersTable.php @@ -67,7 +67,7 @@ class VisaMasterPaymentOrdersTable TrashedFilter::make(), ]) ->recordActions([ - ViewAction::make(), + // ViewAction::make(), EditAction::make(), ]) ->toolbarActions([ diff --git a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/VisaMasterPaymentOrderResource.php b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/VisaMasterPaymentOrderResource.php index 3754b28..1e33d64 100644 --- a/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/VisaMasterPaymentOrderResource.php +++ b/app/Filament/Clusters/VisaMasterPayments/Resources/VisaMasterPaymentOrders/VisaMasterPaymentOrderResource.php @@ -50,11 +50,6 @@ class VisaMasterPaymentOrderResource extends Resource return VisaMasterPaymentOrderForm::configure($schema); } - public static function infolist(Schema $schema): Schema - { - return VisaMasterPaymentOrderInfolist::configure($schema); - } - public static function table(Table $table): Table { return VisaMasterPaymentOrdersTable::configure($table); diff --git a/app/Providers/Filament/WorkPanelProvider.php b/app/Providers/Filament/WorkPanelProvider.php index 83f57f1..2814a00 100644 --- a/app/Providers/Filament/WorkPanelProvider.php +++ b/app/Providers/Filament/WorkPanelProvider.php @@ -8,6 +8,7 @@ use App\Modules\BaseAuth\Middleware\RedirectIfUserPhoneIsUnVerfied; use App\Modules\BaseLocale\Middleware\SetLocale; use BezhanSalleh\FilamentShield\FilamentShieldPlugin; use CraftForge\FilamentLanguageSwitcher\FilamentLanguageSwitcherPlugin; +use Filament\Enums\GlobalSearchPosition; use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\AuthenticateSession; use Filament\Http\Middleware\DisableBladeIconComponents; diff --git a/public/css/asmit/filament-upload/filepond-pdf.css b/public/css/asmit/filament-upload/filepond-pdf.css new file mode 100644 index 0000000..5d71c0a --- /dev/null +++ b/public/css/asmit/filament-upload/filepond-pdf.css @@ -0,0 +1,56 @@ +.filepond--pdf-preview-wrapper { + background: #00000003; + border-radius: 0.45em; + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + position: absolute; + right: 0; + top: 0; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.filepond--pdf-preview { + align-items: center; + background: #222; + display: flex; + height: 100%; + left: 0; + /* pointer-events: none; */ + position: absolute; + top: 0; + width: 100%; + will-change: transform, opacity; + z-index: 1; +} + +.filepond--pdf-preview-iframe { + position: absolute; + left: 0; + right: 0; + margin: auto; + width: 100%; + padding-top: unset; + transform: scale(1.05); +} + +.filepond--overlay-shadow { + background: linear-gradient(to bottom, #282828d9 0%, transparent 100%); + mix-blend-mode: multiply; + width: 100%; + height: 4rem; + position: absolute; + left: 0; + z-index: 2; +} + +.filepond--overlay-shadow.overlay-shadow--success { + background: linear-gradient(to bottom, #369763 0%, transparent 100%); +} + +.filepond--overlay-shadow.overlay-shadow--failure { + background: linear-gradient(to bottom, #c44e47 0%, transparent 100%); +} diff --git a/public/js/asmit/filament-upload/components/filepond-pdf.js b/public/js/asmit/filament-upload/components/filepond-pdf.js new file mode 100644 index 0000000..28e4c55 --- /dev/null +++ b/public/js/asmit/filament-upload/components/filepond-pdf.js @@ -0,0 +1 @@ +var u=r=>r.type==="application/pdf",y=r=>new URLSearchParams({toolbar:r.query("GET_PDF_TOOLBAR")?1:0,navpanes:r.query("GET_PDF_NAVPANE")?1:0,statusbar:r.query("GET_PDF_STATUS_BAR")?1:0,zoom:r.query("GET_PDF_ZOOM")?1:0,view:r.query("GET_PDF_VIEW"),scrollbar:r.query("GET_PDF_SCROLLBAR")?1:0,page:r.query("GET_PDF_DISPLAY_PAGE")}),I=r=>{let a=({root:e,props:n})=>{let{id:c}=n,t=e.query("GET_ITEM",c),p=y(e),d=()=>{if(typeof t.source!="string"){let i=window.URL||window.webkitURL,l=new Blob([t.file],{type:t.file.type});return i.createObjectURL(l)}return t.source};e.ref.pdf.src=`${d()}#${p.toString()}`,e.ref.pdf.addEventListener("load",()=>{e.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:c,height:e.ref.pdf.scrollHeight})},!1)},s=({root:e,props:n})=>{e.query("GET_ITEM",n.id).file&&(e.ref.pdf=document.createElement("iframe"),e.ref.pdf.setAttribute("height",e.query("GET_PDF_PREVIEW_HEIGHT")||320),e.ref.pdf.classList.add("filepond--pdf-preview-iframe"),e.element.appendChild(e.ref.pdf))};return r.createView({name:"pdf-preview",tag:"div",create:s,write:r.createRoute({DID_PDF_PREVIEW_LOAD:a})})},T=r=>r.createView({name:"overlay-shadow",tag:"div",ignoreRect:!0,create:({root:a,props:s})=>{a.element.classList.add(`overlay-shadow--${s.status}`)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),D=r=>{let a=r.utils,s=I(a),e=T(a),n=({root:i,props:l})=>{let{id:f}=l;i.dispatch("DID_PDF_PREVIEW_LOAD",{id:f})},c=({root:i,props:l})=>{i.ref.overlayShadow=i.appendChildView(i.createChildView(e,{opacity:1,status:"idle"})),i.ref.overlaySuccess=i.appendChildView(i.createChildView(e,{opacity:0,status:"success"})),i.ref.overlayError=i.appendChildView(i.createChildView(e,{opacity:0,status:"failure"})),i.ref.pdf=i.appendChildView(i.createChildView(s,{id:l.id}))},t=({root:i})=>{i.ref.overlayShadow.opacity=1,i.ref.overlayError.opacity=0,i.ref.overlaySuccess.opacity=0},p=({root:i,props:l})=>{i.ref.overlayShadow.opacity=.1,i.ref.overlayError.opacity=1},d=({root:i,props:l})=>{i.ref.overlayShadow.opacity=.1,i.ref.overlaySuccess.opacity=1};return a.createView({name:"pdf-preview-wrapper",tag:"div",create:c,write:a.createRoute({DID_CREATE_PDF_PREVIEW_CONTAINER_VIEW:n,DID_THROW_ITEM_LOAD_ERROR:p,DID_THROW_ITEM_PROCESSING_ERROR:p,DID_THROW_ITEM_INVALID:p,DID_COMPLETE_ITEM_PROCESSING:d,DID_START_ITEM_PROCESSING:t,DID_REVERT_ITEM_PROCESSING:t})})},v=r=>{let{addFilter:a,utils:s}=r,{Type:e,createRoute:n}=s,c=D(r);return a("CREATE_VIEW",t=>{let{is:p,view:d,query:i}=t;if(!p("file"))return;let l=({root:f,props:w})=>{let{id:E}=w,_=i("GET_ITEM",E),o=i("GET_ALLOW_PDF_PREVIEW");!_||!u(_?.file)||_?.archived||!o||(f.ref.pdfPreview=d.appendChildView(d.createChildView(c,{id:E})),f.dispatch("DID_CREATE_PDF_PREVIEW_CONTAINER_VIEW",{id:E}))};d.registerWriter(n({DID_LOAD_ITEM:l}),(f,w)=>{f.ref.pdfPreview&&f.rect.element.hidden})}),{options:{allowPdfPreview:[!0,e.BOOLEAN],pdfPreviewHeight:[400,e.INT],pdfToolbar:[!1,e.BOOLEAN],pdfNavPanes:[!1,e.BOOLEAN],pdfStatusBar:[!1,e.BOOLEAN],pdfZoom:[!1,e.BOOLEAN],pdfView:["fitW",e.STRING],pdfDisplayPage:[1,e.INT]}}},P=v;function R({pdfPreviewHeight:r,pdfScrollbar:a,pdfDisplayPage:s,pdfToolbar:e,pdfNavPanes:n,pdfZoom:c,pdfView:t,allowPdfPreview:p}){document.addEventListener("FilePond:loaded",function(){let d=window.FilePond;d.registerPlugin(P),d.setOptions({pdfPreviewHeight:r,pdfScrollbar:a,pdfDisplayPage:s,pdfToolbar:e,pdfNavPanes:n,pdfZoom:c,pdfView:t,allowPdfPreview:p})})}export{R as default}; diff --git a/resources/svg/visa-blue.svg b/resources/svg/visa-blue.svg new file mode 100644 index 0000000..de7f99c --- /dev/null +++ b/resources/svg/visa-blue.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file