Skip to content

Commit

Permalink
Merge pull request #6 from lara-zeus/add-beta-note
Browse files Browse the repository at this point in the history
clean up and add beta note widget
  • Loading branch information
atmonshi authored Aug 20, 2022
2 parents bd5ac06 + 5cba15f commit 5049844
Show file tree
Hide file tree
Showing 25 changed files with 13,006 additions and 122 deletions.
8,005 changes: 8,005 additions & 0 deletions resources/dist/app.css

Large diffs are not rendered by default.

4,828 changes: 4,828 additions & 0 deletions resources/dist/app.js

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions resources/dist/app.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*!
* FilePond 4.30.4
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginFileValidateSize 2.2.7
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginFileValidateType 1.2.8
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImageCrop 2.0.6
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImageExifOrientation 1.0.11
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImagePreview 4.6.11
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImageResize 2.0.10
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImageTransform 3.8.7
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginMediaPreview 1.0.11
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*/

/*! @license DOMPurify 2.3.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.10/LICENSE */

/*! choices.js v10.1.0 | © 2022 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

/**!
* Sortable 1.15.0
* @author RubaXa <[email protected]>
* @author owenm <[email protected]>
* @license MIT
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<x-filament::widget>
<x-filament::card>
<div class="text-center font-semibold">
<p class="text-red-500">
🚧🚧 Still Under Development 🚧🚧
</p>
<p>
thank you 🙏🏽 for testing Bolt.
<br>
this package was extracted from a client project, working on making it stable inside filament :)
</p>
</div>
</x-filament::card>
</x-filament::widget>
3 changes: 3 additions & 0 deletions resources/views/forms/create-forms.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div x-data x-init="tippy('[data-tippy-content]', {animation: 'perspective'});">

@livewire(\Livewire\Livewire::getAlias(\LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote::class))

<x-zeus::box shadowless class="bg-gray-50 mb-10 shadow-sm">
<div class="flex-grow">
<div class="flex items-center justify-between gap-4">
Expand Down
1 change: 0 additions & 1 deletion resources/views/forms/modals/fieldsCreateNewList.blade.php

This file was deleted.

6 changes: 3 additions & 3 deletions src/BoltServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class BoltServiceProvider extends PluginServiceProvider
{
public static string $name = 'zeus-bolt';

/*protected array $styles = [
'zeus-bolt-styles' => __DIR__ . '/../resources/dist/app.css',
];*/
protected array $styles = [
'zeus-bolt-styles' => __DIR__.'/../resources/dist/app.css',
];

/*protected function getStyles() : array
{
Expand Down
26 changes: 14 additions & 12 deletions src/Filament/Resources/CollectionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Filament\Resources\Table;
use Filament\Tables;
use LaraZeus\Bolt\Filament\Resources\CollectionResource\Pages;
use LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote;
use LaraZeus\Bolt\Models\Collection;

class CollectionResource extends Resource
Expand Down Expand Up @@ -47,14 +48,14 @@ public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')->label(__('zeus-bolt::common.collections.name'))->required()->maxLength(255)->columnSpan(2),
TextInput::make('name')->label(__('Collections Name'))->required()->maxLength(255)->columnSpan(2),

Forms\Components\Repeater::make('values')
->label(__('zeus-bolt::common.collections.values'))
->label(__('Collections Values'))
->schema([
TextInput::make('itemKey')->required(),
TextInput::make('itemValue')->required(),
Toggle::make('itemIsDefault'),
TextInput::make('itemKey')->required()->label(__('Key')),
TextInput::make('itemValue')->required()->label(__('Value')),
Toggle::make('itemIsDefault')->label(__('selected by default')),
])->columnSpan(2)->columns(3),
]);
}
Expand All @@ -63,23 +64,24 @@ public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('name')->label(__('Name')),
Tables\Columns\TextColumn::make('values-list')->html()->label(__('Values')),
]);
}

public static function getRelations(): array
public static function getPages(): array
{
return [
//
'index' => Pages\ListCollections::route('/'),
'create' => Pages\CreateCollection::route('/create'),
'edit' => Pages\EditCollection::route('/{record}/edit'),
];
}

public static function getPages(): array
public static function getWidgets(): array
{
return [
'index' => Pages\ListCollections::route('/'),
'create' => Pages\CreateCollection::route('/create'),
'edit' => Pages\EditCollection::route('/{record}/edit'),
BetaNote::class,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@

use Filament\Resources\Pages\CreateRecord;
use LaraZeus\Bolt\Filament\Resources\CollectionResource;
use LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote;

class CreateCollection extends CreateRecord
{
protected static string $resource = CollectionResource::class;

protected function getHeaderWidgets(): array
{
return [
BetaNote::class,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@

use Filament\Resources\Pages\EditRecord;
use LaraZeus\Bolt\Filament\Resources\CollectionResource;
use LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote;

class EditCollection extends EditRecord
{
protected static string $resource = CollectionResource::class;

protected function getHeaderWidgets(): array
{
return [
BetaNote::class,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@

use Filament\Resources\Pages\ListRecords;
use LaraZeus\Bolt\Filament\Resources\CollectionResource;
use LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote;

class ListCollections extends ListRecords
{
protected static string $resource = CollectionResource::class;

protected function getHeaderWidgets(): array
{
return [
BetaNote::class,
];
}
}
9 changes: 8 additions & 1 deletion src/Filament/Resources/FormResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use LaraZeus\Bolt\Filament\Resources\FormResource\Pages;
use LaraZeus\Bolt\Filament\Resources\FormResource\RelationManagers\ResponsesRelationManager;
use LaraZeus\Bolt\Filament\Resources\FormResource\RelationManagers\SectionsRelationManager;
use LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote;
use LaraZeus\Bolt\Models\Form as ZeusForm;

class FormResource extends Resource
Expand Down Expand Up @@ -121,7 +122,13 @@ public static function getPages(): array
{
return [
'index' => Pages\ListForms::route('/'),
'view' => Pages\ViewForm::route('/{record}'),
];
}

public static function getWidgets(): array
{
return [
BetaNote::class,
];
}
}
11 changes: 0 additions & 11 deletions src/Filament/Resources/FormResource/Pages/CreateForm.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/Filament/Resources/FormResource/Pages/EditForm.php

This file was deleted.

13 changes: 8 additions & 5 deletions src/Filament/Resources/FormResource/Pages/ListForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
use Filament\Pages\Actions\Action;
use Filament\Resources\Pages\ListRecords;
use LaraZeus\Bolt\Filament\Resources\FormResource;
use LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote;

class ListForms extends ListRecords
{
protected static string $resource = FormResource::class;

protected function getHeaderWidgets(): array
{
return [
BetaNote::class,
];
}

protected function getActions(): array
{
return [
/*Action::make('create')
->label('create')
->icon('heroicon-o-plus')
->tooltip('Create New Form')
->url(fn() : string => url('admin/forms/create')),*/
Action::make('create-zeus')
->label('create form')
->icon('heroicon-o-plus')
Expand Down
11 changes: 0 additions & 11 deletions src/Filament/Resources/FormResource/Pages/ViewForm.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace LaraZeus\Bolt\Filament\Resources\FormResource\RelationManagers;

use Filament\Resources\Form;
use Filament\Resources\RelationManagers\HasManyRelationManager;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables\Columns\TextColumn;

class ResponsesRelationManager extends HasManyRelationManager
class ResponsesRelationManager extends RelationManager
{
protected static string $relationship = 'responses';
protected static ?string $recordTitleAttribute = 'form_id';
Expand All @@ -28,9 +28,6 @@ public static function table(Table $table): Table
->columns([
TextColumn::make('user_id'),
TextColumn::make('status'),
])
->filters([
//
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use Filament\Forms\Components\TextInput;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\HasManyRelationManager;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables\Columns\TextColumn;

class SectionsRelationManager extends HasManyRelationManager
class SectionsRelationManager extends RelationManager
{
protected static string $relationship = 'sections';
protected static ?string $recordTitleAttribute = 'name';
Expand All @@ -28,9 +28,6 @@ public static function table(Table $table): Table
->columns([
TextColumn::make('name'),
TextColumn::make('ordering'),
])
->filters([
//
]);
}
}
11 changes: 11 additions & 0 deletions src/Filament/Resources/FormResource/Widgets/BetaNote.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace LaraZeus\Bolt\Filament\Resources\FormResource\Widgets;

use Filament\Widgets\Widget;

class BetaNote extends Widget
{
protected int|string|array $columnSpan = 'full';
protected static string $view = 'zeus-bolt::filament.resources.form-resource.widgets.beta-note';
}
12 changes: 8 additions & 4 deletions src/Filament/Resources/ResponseResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Filament\Resources\Table;
use Filament\Tables;
use Filament\Tables\Filters\SelectFilter;
use LaraZeus\Bolt\Filament\Resources\FormResource\Widgets\BetaNote;
use LaraZeus\Bolt\Filament\Resources\ResponseResource\Pages;
use LaraZeus\Bolt\Filament\Resources\ResponseResource\RelationManagers\FieldsResponsesRelationManager;
use LaraZeus\Bolt\Models\Response;
Expand Down Expand Up @@ -88,12 +89,15 @@ public static function getRelations(): array

public static function getPages(): array
{
//
return [
'index' => Pages\BrowseResponses::route('/'),
//'index' => Pages\ListResponses::route('/'),
'create' => Pages\CreateResponse::route('/create'),
'edit' => Pages\EditResponse::route('/{record}/edit'),
];
}

public static function getWidgets(): array
{
return [
BetaNote::class,
];
}
}
Loading

0 comments on commit 5049844

Please sign in to comment.