Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Feb 19, 2024
1 parent 6bcc83b commit b14abbe
Show file tree
Hide file tree
Showing 24 changed files with 83 additions and 22 deletions.
1 change: 0 additions & 1 deletion public/build/assets/app-0ddd4245.js

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions public/build/assets/app-ae0fb693.js

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

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/build/assets/chart-023ee9f6.js

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/chart-cdfe4a3f.js

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

1 change: 0 additions & 1 deletion public/build/assets/dropdown-023ee9f6.js

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/dropdown-cdfe4a3f.js

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

1 change: 0 additions & 1 deletion public/build/assets/editor-023ee9f6.js

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/editor-cdfe4a3f.js

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

1 change: 0 additions & 1 deletion public/build/assets/media-manager-023ee9f6.js

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/media-manager-cdfe4a3f.js

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

1 change: 0 additions & 1 deletion public/build/assets/repeater-023ee9f6.js

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/repeater-cdfe4a3f.js

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

1 change: 0 additions & 1 deletion public/build/assets/table-023ee9f6.js

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/table-cdfe4a3f.js

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

20 changes: 10 additions & 10 deletions public/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
{
"resources/js/app.css": {
"file": "assets/app-4030c9ab.css",
"file": "assets/app-f3558307.css",
"src": "resources/js/app.css"
},
"resources/js/app.js": {
"css": [
"assets/app-4030c9ab.css"
"assets/app-f3558307.css"
],
"file": "assets/app-679efe62.js",
"file": "assets/app-1e861c10.js",
"isEntry": true,
"src": "resources/js/app.js"
},
"resources/js/chart.js": {
"file": "assets/chart-023ee9f6.js",
"file": "assets/chart-cdfe4a3f.js",
"imports": [
"resources/js/app.js"
],
"isEntry": true,
"src": "resources/js/chart.js"
},
"resources/js/dropdown.js": {
"file": "assets/dropdown-023ee9f6.js",
"file": "assets/dropdown-cdfe4a3f.js",
"imports": [
"resources/js/app.js"
],
"isEntry": true,
"src": "resources/js/dropdown.js"
},
"resources/js/editor.js": {
"file": "assets/editor-023ee9f6.js",
"file": "assets/editor-cdfe4a3f.js",
"imports": [
"resources/js/app.js"
],
"isEntry": true,
"src": "resources/js/editor.js"
},
"resources/js/media-manager.js": {
"file": "assets/media-manager-023ee9f6.js",
"file": "assets/media-manager-cdfe4a3f.js",
"imports": [
"resources/js/app.js"
],
"isEntry": true,
"src": "resources/js/media-manager.js"
},
"resources/js/repeater.js": {
"file": "assets/repeater-023ee9f6.js",
"file": "assets/repeater-cdfe4a3f.js",
"imports": [
"resources/js/app.js"
],
"isEntry": true,
"src": "resources/js/repeater.js"
},
"resources/js/table.js": {
"file": "assets/table-023ee9f6.js",
"file": "assets/table-cdfe4a3f.js",
"imports": [
"resources/js/app.js"
],
"isEntry": true,
"src": "resources/js/table.js"
},
"resources/sass/app.scss": {
"file": "assets/app-0ddd4245.js",
"file": "assets/app-ae0fb693.js",
"imports": [
"resources/js/app.js"
],
Expand Down
8 changes: 8 additions & 0 deletions resources/sass/component/_notification.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
@use 'sprucecss/scss/spruce' as *;

.app-notification {
&__backdrop {
background-color: color('background', 'modal');
block-size: 100dvh;
inset: 0;
position: fixed;
z-index: 25;
}

&__drawer {
@include transition;
background-color: color('background');
Expand Down
1 change: 1 addition & 0 deletions resources/sass/helper/_index.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@forward 'display';
@forward 'margin';
@forward 'vertical-align';
5 changes: 5 additions & 0 deletions resources/sass/helper/_vertical-align.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@use 'sprucecss/scss/spruce' as *;

.vertical-align\:top {
vertical-align: top !important;
}
6 changes: 6 additions & 0 deletions resources/views/components/layout/notifications.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<div id="notifications" class="app-notification" x-data="notifications('{{ $url }}')" x-on:click.outside="open = false" data-turbo-permanent>
<div
class="app-notification__backdrop"
x-on:click="open = ! open"
x-transition
x-show="open"
></div>
<button
class="btn btn--light btn--icon btn--counter app-notification__toggle"
aria-label="{{ __('Notifications') }}"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/resources/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<div class="table-responsive">
<table class="table">
@foreach($fields as $field)
<tr>
<tr class="vertical-align:top">
<th>{{ $field['label'] }}</th>
@include('root::table.cell', $field)
</tr>
Expand Down
4 changes: 1 addition & 3 deletions src/Fields/Repeater.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ public function withFields(Closure $callback): static
$field->setModelAttribute($attribute)
->name($attribute)
->id($attribute)
->value(static function () use ($tmpModel, $key): mixed {
return $tmpModel->getAttribute($key);
});
->value(fn (): mixed => $tmpModel->getAttribute($key));
});

return $fields;
Expand Down
43 changes: 43 additions & 0 deletions tests/Fields/RepeaterTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Cone\Root\Tests\Fields;

use Cone\Root\Fields\Repeater;
use Cone\Root\Fields\Text;
use Cone\Root\Tests\TestCase;

class RepeaterTest extends TestCase
{
protected Repeater $field;

public function setUp(): void
{
parent::setUp();

$this->field = Repeater::make('Properties')
->withFields(function () {
return [
new Text('Name'),
];
});
}

public function test_a_repeater_field_has_repeater_template(): void
{
$this->assertSame('root::fields.repeater', $this->field->getTemplate());
}

public function test_a_repeater_field_register_routes(): void
{
$this->app['router']->prefix('posts/fields')->group(function ($router) {
$this->field->registerRoutes($this->app['request'], $router);
});

$this->assertSame('/posts/fields/properties', $this->field->getUri());

$this->assertArrayHasKey(
trim($this->field->getUri(), '/'),
$this->app['router']->getRoutes()->get('POST')
);
}
}

0 comments on commit b14abbe

Please sign in to comment.