Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bajramemini committed Jan 7, 2025
1 parent 4f90872 commit d5ed9e1
Show file tree
Hide file tree
Showing 46 changed files with 0 additions and 155 deletions.
2 changes: 0 additions & 2 deletions resources/views/components/fields/file.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ class="cursor-pointer text-primary-400 hover:text-red-500"/>

@php
unset($field['field']);
// ray($field, $selected);
@endphp

<livewire:aura::media-uploader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
$filterIndex = $modelParts[4] ?? 0;
$selectedValues = $field['field']->selectedValues($field['resource'], $this->filters['custom'][$filterGroup]['filters'][$filterIndex]['value'], $field);
ray($selectedValues);
}
@endphp
Expand Down
1 change: 0 additions & 1 deletion resources/views/components/fields/radio.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@php
// ray($field);
@endphp

<x-aura::fields.wrapper :field="$field">
Expand Down
1 change: 0 additions & 1 deletion resources/views/components/table/filters.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div>

@php
// ray($this->filters)
@endphp
@once
@push('scripts')
Expand Down
3 changes: 0 additions & 3 deletions resources/views/livewire/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@
}">
@include($this->settings['views']['header'])

{{-- @dump(json_encode($this->filters)) --}}

@php
// ray($this->filters);
@endphp

<div class="mt-4">
Expand Down
7 changes: 0 additions & 7 deletions src/Aura.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ public function getOption($name)
$settings = [];
}

// ray($settings);

return $settings;

});
Expand Down Expand Up @@ -265,11 +263,8 @@ public function getWidgets(): array
public function injectView(string $name): Htmlable
{
if (isset($this->injectViews[$name])) {
// ray($name, $this->injectViews[$name]);
}

// ray($name);

$hooks = array_map(
fn (callable $hook): string => (string) app()->call($hook),
$this->injectViews[$name] ?? [],
Expand Down Expand Up @@ -356,8 +351,6 @@ public function registerFields(array $fields): void
public function registerInjectView(string $name, Closure $callback): void
{
$this->injectViews[$name][] = $callback;

// ray($this->injectViews);
}

public function registerResources(array $resources): void
Expand Down
2 changes: 0 additions & 2 deletions src/AuraServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,6 @@ public function packageBooted()
// 'Aura\Base\Resources\User' => 'Aura\Base\Resources\User',
// ]);

// ray('relation');

$this
->bootGate()
->bootLivewireComponents();
Expand Down
1 change: 0 additions & 1 deletion src/ConditionalLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public static function shouldDisplayField($model, $field, $post = null)
$cacheKey = md5(get_class($model).json_encode($field).json_encode($post).Auth::id());

if ($field['slug'] === 'prompt') {
// ray($cacheKey, $post)->blue();
}

return self::$shouldDisplayFieldCache[$cacheKey]
Expand Down
1 change: 0 additions & 1 deletion src/Fields/AdvancedSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public function get($class, $value, $field = null)
return [$value];
}
if ($value instanceof \Illuminate\Database\Eloquent\Model) {
// ray($value)->green();
return [$value->id];
}
if ($value instanceof \Illuminate\Support\Collection) {
Expand Down
1 change: 0 additions & 1 deletion src/Fields/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ public function value($value)

public function view()
{
// ray($this, $this->view);
if ($this->view) {
return $this->view;
}
Expand Down
3 changes: 0 additions & 3 deletions src/Fields/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ public function hydrate() {}

public function saving($post, $field, $value)
{
// ray('...saving field', $post)->red();
$key = $field['slug'];

// If value is empty (null or empty string), prevent password update entirely
if (empty($value)) {
// ray('...empty value')->red();
// For User model, remove password from all possible locations
if ($post instanceof \App\Models\User || $post instanceof \Aura\Base\Resources\User) {
// Remove password from attributes if it exists
Expand All @@ -46,7 +44,6 @@ public function saving($post, $field, $value)
// Force the model to forget the password attribute
// $post->syncOriginal();

// ray('Password removed from attributes', $post->attributes)->red();
return $post;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Fields/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public function isRelation($field = null)

// public function get($class, $value, $field = null)
// {
// ray('get roles........', $class, $value, $field)->blue();

// return $value;
// }

Expand Down
2 changes: 0 additions & 2 deletions src/Listeners/SyncDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public function handle(SaveFields $event)

// Option 2: Keep all migration files and try to sync db -> cons: multiple migration files, more complex

// ray('sync', $fieldsToAdd, $fieldsToUpdate, $fieldsToDelete, $model, $model->getTable());

return;

// Change Migration File
Expand Down
5 changes: 0 additions & 5 deletions src/Livewire/EditResourceField.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public function activate($params)
'conditional_logic' => '',
];

ray('newFieldIndex', $params['id'], $params['children'])->blue();

$this->newFieldIndex = $params['id'] + $params['children'];

$this->model = Aura::findResourceBySlug($params['model']);
Expand Down Expand Up @@ -181,8 +179,6 @@ public function save()
$this->validate();

if ($this->mode == 'create') {
// ray('saveNewField', $this->form['fields'], $this->newFieldIndex, $this->newFieldSlug)->blue();
ray('saveNewField', $this->form['fields'], $this->newFieldIndex)->blue();
$this->dispatch('saveNewField', $this->form['fields'], $this->newFieldIndex);
} else {
// emit event to parent with slug and value
Expand All @@ -198,7 +194,6 @@ public function save()
public function updated($property)
{
// $property: The name of the current property that was updated
// ray('updated', $property)->orange();

if ($property === 'form.fields.type') {
// $this->username = strtolower($this->username);
Expand Down
2 changes: 0 additions & 2 deletions src/Livewire/MediaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function select()
public function selectAttachment($ids)
{
if (! $this->initialSelectionDone) {
ray('selectAttachment', $ids);
$this->selected = $ids;
$this->initialSelectionDone = true;
}
Expand All @@ -94,7 +93,6 @@ public function updated($name, $value)
public function updateField($field)
{
if ($field['slug'] == $this->fieldSlug) {
ray('updated', $this->selected);
$this->selected = $field['value'];
$this->dispatch('selectedRows', $this->selected);
}
Expand Down
1 change: 0 additions & 1 deletion src/Livewire/MediaUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class MediaUploader extends Component

public function mount()
{
// ray('mount media uploader', $this->model, $this->field, $this->selected);
$this->model = app($this->namespace);
}

Expand Down
9 changes: 0 additions & 9 deletions src/Livewire/Resource/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function initializeModelFields()
{
foreach ($this->model->inputFields() as $field) {

// ray($field)->blue();
// If the method exists in the field type, call it directly.
if (method_exists($field['field'], 'hydrate')) {
$this->form['fields'][$field['slug']] = $field['field']->hydrate();
Expand Down Expand Up @@ -87,8 +86,6 @@ public function mount($id)

// foreach fields, call the hydration method on the field

// ray('mount', $this->form, $this->model);

// Set on model instead of here
// if $this->form['terms']['tag'] is not set, set it to null
}
Expand Down Expand Up @@ -117,14 +114,8 @@ public function rules()

public function save()
{
// ray('saving', $this->form);
$this->validate();

//
// ray('saving', $this->form['fields']);

// unset($this->form['fields']['group']);

// unset this post fields group
if ($this->model->usesCustomTable()) {
$this->model->update($this->form['fields']);
Expand Down
2 changes: 0 additions & 2 deletions src/Livewire/ResourceEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ public function getActionsProperty()

public function getMappedFieldsProperty()
{
// ray('getMappedFieldsProperty', $this->newFields)->blue();

if ($this->newFields) {
$this->updateGlobalTabs();

Expand Down
7 changes: 0 additions & 7 deletions src/Livewire/Table/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ public function headers()
})->toArray();
}

// ray('headers', $sort);

return $headers;
}
Expand All @@ -234,8 +233,6 @@ public function loadTable()
#[Computed]
public function model()
{
// ray('hier', $this->model);

return $this->model;
}

Expand Down Expand Up @@ -416,7 +413,6 @@ public function updatedColumns($columns)
{
// Save the columns for the current user.
if ($this->columns) {
// ray('Save the columns for the current user', $this->columns);
auth()->user()->updateOption('columns.'.$this->model()->getType(), $this->columns);
}
}
Expand All @@ -428,9 +424,6 @@ public function updatedColumns($columns)
*/
public function updatedSelected()
{
// ray('table updatedSelected', $this->selected);
// return;

$this->selectAll = false;
$this->selectPage = false;

Expand Down
1 change: 0 additions & 1 deletion src/Livewire/Table/Traits/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ public function updatedFiltersCustom($value, $key)
*/
public function updatedSelectedFilter($filter)
{
ray('updatedSelectedFilter', $filter);
$this->clearFiltersCache();

// Reset filters first
Expand Down
6 changes: 0 additions & 6 deletions src/Pipeline/AddIdsToFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ class AddIdsToFields implements Pipe
{
public function handle($fields, Closure $next)
{
if (request()->url() != 'http://aura-demo.test') {
// ray('before:', $fields->toJson())->green()->once();
}

$parentStack = [];
$globalTabs = null;
$lastGlobalTab = null;
Expand Down Expand Up @@ -165,8 +161,6 @@ public function handle($fields, Closure $next)
});

if (request()->url() != 'http://aura-demo.test') {
// ray('after:', $processedFields->toJson())->blue()->once();
// ray('after:', $processedFields->toArray())->blue()->once();
}

return $next($processedFields);
Expand Down
4 changes: 0 additions & 4 deletions src/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ public function __construct(array $attributes = [])

public function __call($method, $parameters)
{
if ($method == 'actors') {
ray('call', $method)->red();
}
if ($this->getFieldSlugs()->contains($method)) {

$fieldClass = $this->fieldClassBySlug($method);
Expand Down Expand Up @@ -127,7 +124,6 @@ public function __get($key)
// }

// if ($this->getFieldSlugs()->contains($key)) {
// ray('contains', $key);
// $fieldClass = $this->fieldClassBySlug($key);
// if ($fieldClass->isRelation()) {
// $field = $this->fieldBySlug($key);
Expand Down
2 changes: 0 additions & 2 deletions src/Resources/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ protected static function booted()
// $user->switchTeam($team);

$user->current_team_id = $team->id;
// ray('current_team_id', $user->current_team_id)->red();
// ray($user);
$user->save();
}

Expand Down
4 changes: 0 additions & 4 deletions src/Resources/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ public function belongsToTeam($team)

public function cachedRoles(): mixed
{
// ray('roles', $this->roles, DB::table('user_meta')->get(), DB::table('post_relations')->get())->blue();

return $this->roles;

return Cache::remember($this->getCacheKeyForRoles(), now()->addMinutes(60), function () {
Expand Down Expand Up @@ -495,8 +493,6 @@ public function hasAnyRole(array $roles): bool
{
$cachedRoles = $this->cachedRoles()->pluck('slug');

// ray($cachedRoles, $roles)->red();

if (! $cachedRoles) {
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/Traits/AuraModelConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,6 @@ public function scopeWhereMeta($query, ...$args)
*/
public function scopeWhereMetaContains($query, $key, $value)
{
// ray($query, $key, $value)->red();

return $query->whereHas('meta', function ($query) use ($key, $value) {
$value = is_numeric($value) ? (int) $value : $value;
$query->where('key', $key)
Expand Down
Loading

0 comments on commit d5ed9e1

Please sign in to comment.