Skip to content

Commit 6aec63a

Browse files
wip
1 parent b6bd606 commit 6aec63a

File tree

2 files changed

+2
-42
lines changed

2 files changed

+2
-42
lines changed

packages/core/src/Entities/BaseResource.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public static function getSaveAction(): Action
122122
->keyBindings(['command+s', 'ctrl+s'])
123123
->color('success')
124124
->action(function ($livewire): void {
125-
// static::handleTranslationBeforeSave($livewire);
126125
$livewire instanceof CreateRecord ? $livewire->create() : $livewire->save();
127126
})
128127
->visible(fn ($livewire): bool => $livewire instanceof CreateRecord || $livewire instanceof EditRecord);
@@ -203,33 +202,4 @@ public static function getRestoreAction(): Action
203202
->visible(fn ($livewire, $record): bool => $record && $record->trashed());
204203
}
205204

206-
// protected static function handleTranslationBeforeSave($livewire): void
207-
// {
208-
// $locale = $livewire->lang;
209-
// if (!$locale || !$livewire->record) {
210-
// return;
211-
// }
212-
213-
// // Get or create translation
214-
// $translation = $livewire->record->translateOrNew($locale);
215-
// // Copy all translatable attributes to translation
216-
// foreach ($livewire->record->translatedAttributes as $attr) {
217-
// if (isset($livewire->data[$attr])) {
218-
// $translation->$attr = $livewire->data[$attr];
219-
// }
220-
// }
221-
222-
// // Set author if it's a new translation
223-
// if (!$translation->exists) {
224-
// $translation->author_id = auth()->id();
225-
// }
226-
227-
// // Save the translation
228-
// $livewire->record->translations()->save($translation);
229-
230-
// // Handle status changes if needed
231-
// if ($livewire->record->isDirty('status')) {
232-
// $livewire->record->handleSchedulingDates();
233-
// }
234-
// }
235205
}

packages/draft/src/Moox/Entities/Drafts/Draft/DraftResource.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ public static function getNavigationGroup(): ?string
6464
return config('draft.navigation_group');
6565
}
6666

67-
// public static function getEloquentQuery(): Builder
68-
// {
69-
// $query = parent::getEloquentQuery();
70-
// if ($locale = request()->query('lang')) {
71-
// $query->with(['translations' => function ($query) use ($locale) {
72-
// $query->where('locale', $locale);
73-
// }]);
74-
// }
75-
76-
// return $query;
77-
// }
7867

7968
public static function form(Form $form): Form
8069
{
@@ -144,7 +133,8 @@ public static function form(Form $form): Form
144133
->label('Status')
145134
->placeholder(__('core::core.status'))
146135
->reactive()
147-
->options(['draft' => 'Draft', 'waiting' => 'Waiting', 'privat' => 'Privat', 'scheduled' => 'Scheduled', 'published' => 'Published']),
136+
->options(['draft' => 'Draft', 'waiting' => 'Waiting', 'privat' => 'Privat', 'scheduled' => 'Scheduled', 'published' => 'Published'])
137+
->default('draft'),
148138
DateTimePicker::make('to_publish_at')
149139
->label('To publish at')
150140
->placeholder(__('core::core.to_publish_at'))

0 commit comments

Comments
 (0)