Skip to content

Commit

Permalink
feat: Version 0.15.2 (#192)
Browse files Browse the repository at this point in the history
* feat: component filter added (#176)

* fix: only add column when it doesn't exist (#167)

* fix: only add column when it doesn't exist

* style: formatting

* feat: export cms (#169)

* feat: import export

* feat: use file instead of database

* feat: move import/export to model

* fix: export from tableitem

* feat: move export to Trait

* style: formatting

* style: formatting

* fix: never use file as source of truth

* style: formatting

* chore: cleanup

* fix: use export to file

* feat: comment things that no longer work

* feat: add  meta data

* feat: list filenames

* feat: cleaner export

* feat: remove UI for import/export

* style: formatting

* feat: add import command

* feat: import from files

* feat: remove import UI

* feat: prevent editing tables with changes on disk

* feat: do not use id's in export for tables

* feat: optionally export ids

* feat: import ids when available

---------

Co-authored-by: Rene <rene@64k.nl>

* feat: component filter added

* feat: added filterparams

* feat: only query if filter exists

* feat: WIP

* feat: typed editor classes

* feat: editor changes

* feat: removed code

* feat: removed request from editor and overview

* feat: added TODO

* chore: update dependency

* feat: migration for model column in cms_table

* fix: retain model on import export cms_table

* feat: moved code to component

* feat: added guards

* style: formatting

* feat: parameters now in tableservice

* feat: removed parameter

* feat: removed request() from editor

* fix: return empty array if key not exists

* style: formatting

* style: formatting

---------

Co-authored-by: René <rene@64k.nl>

* fix: exceptions handling (#189)

* fix: exception handling

* style: formatting

* fix: return type

* feat: date helper (#191)

* feat: moved layoutbar to editor (#193)

* feat: moved layoutbar to editor

* style: formatting

* chore: remove unused methods

---------

Co-authored-by: Rene <rene@64k.nl>

---------

Co-authored-by: Xander Schuurman <44030544+keeama13@users.noreply.github.com>
  • Loading branch information
64knl and keeama13 committed Feb 1, 2024
1 parent 166ae92 commit ab6225b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 38 deletions.
19 changes: 2 additions & 17 deletions src/Http/Controllers/Assets/TableOverviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use NotFound\Framework\Services\Assets\TableQueryService;
use NotFound\Framework\Services\Assets\TableService;
use NotFound\Layout\Elements\LayoutBar;
use NotFound\Layout\Elements\LayoutBarButton;
use NotFound\Layout\Elements\LayoutPage;
use NotFound\Layout\Elements\LayoutPager;
use NotFound\Layout\Elements\LayoutSearchBox;
Expand Down Expand Up @@ -76,22 +75,8 @@ public function index(Request $request, Table $table)

$page->addBreadCrumb($editor->getBreadCrumbs());

$bar = new LayoutBar();
$bottomBar = new LayoutBar();
$bottomBar->noBackground();

if ($table->allow_create) {
$addNew = new LayoutBarButton('Nieuw');
$addNew->setIcon('plus');
$url = '/table/'.$table->url.'/0';
if ($params = $editor->filterToParams());

$url .= '?'.ltrim($params, '&');

$addNew->setLink($url);
$bar->addBarButton($addNew);
$bottomBar->addBarButton($addNew);
}
$bar = $editor->getBar();
$bottomBar = $editor->getBottomBar();

$pager = new LayoutPager(totalItems: $siteTableRowsPaginator->total(), itemsPerPage: request()->query('pitems') ?? $table->properties->itemsPerPage ?? 25);
$bar->addPager($pager);
Expand Down
45 changes: 24 additions & 21 deletions src/Models/Editor/AbstractEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace NotFound\Framework\Models\Editor;

use NotFound\Framework\Services\Assets\TableService;
use NotFound\Layout\Elements\LayoutBar;
use NotFound\Layout\Elements\LayoutBarButton;
use NotFound\Layout\Elements\LayoutBreadcrumb;

abstract class AbstractEditor
Expand All @@ -12,39 +14,40 @@ public function __construct(protected TableService $ts)

}

/**
* preOverview
*
* Runs before the overview is rendered
*/
public function preOverview(): void
public function getBar(): LayoutBar
{
$bar = new LayoutBar();

}

public function postOverview(): void
{

}

public function preEdit(): void
{

}
$table = $this->ts->getAssetModel();

public function postEdit(): void
{
if ($table->allow_create) {
$addNew = $this->getNewButton();
$bar->addBarButton($addNew);
}

return $bar;
}

public function preCreate(): void
public function getBottomBar(): LayoutBar
{
$bottomBar = $this->getBar();
$bottomBar->noBackground();

return $bottomBar;
}

public function postCreate(): void
public function getNewButton(): LayoutBarButton
{
$addNew = new LayoutBarButton('Nieuw');
$table = $this->ts->getAssetModel();
$addNew->setIcon('plus');
$url = '/table/'.$table->url.'/0';
if ($params = $this->filterToParams()) {
$url .= '?'.ltrim($params, '&');
}
$addNew->setLink($url);

return $addNew;
}

public function getBreadCrumbs(): LayoutBreadCrumb
Expand Down

0 comments on commit ab6225b

Please sign in to comment.