Skip to content

Commit

Permalink
Merge pull request #476 from OpenSynergic/fix-author-can-create-submi…
Browse files Browse the repository at this point in the history
…ssion-files-components

fix: author can create submission file components
  • Loading branch information
rahmanramsi authored Dec 31, 2024
2 parents 9d83ae2 + cc37208 commit 69ce2e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function downloadAllAction()
->icon('iconpark-download-o')
->label(__('general.download_all_files'))
->button()
->hidden(fn (): bool => $this->isViewOnly())
->hidden(fn (Table $table): bool => !$table->getQuery()->exists() || $this->isViewOnly())
->color('gray')
->action(function (TableAction $action) {
$files = $this->submission->media()->where('collection_name', $this->category)->get();
Expand All @@ -85,24 +85,8 @@ public function uploadFormSchema(): array
Select::make('type')
->label(__('general.type'))
->required()
->options(
fn () => SubmissionFileType::all()->pluck('name', 'id')->toArray()
)
->searchable()
->createOptionForm([
TextInput::make('name')
->label(__('general.name'))
->required(),
])
->createOptionAction(function (FormAction $action) {
$action->modalWidth('xl')
->failureNotificationTitle(__('general.problem_creating_file_type'))
->successNotificationTitle(__('general.file_type_created_successfulyy'));
})
->createOptionUsing(function (array $data) {
SubmissionFileType::create($data);
})
->reactive(),
->options(fn () => SubmissionFileType::all()->pluck('name', 'id')->toArray())
->searchable(),
SpatieMediaLibraryFileUpload::make('files')
->required()
->previewable(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public function render()

public function nextStep()
{
if (! $this->record->participants()->exists()) {
$this->addError('errors', __('general.must_add_one_author'));

return;
}

$this->dispatch('refreshLivewire');
$this->dispatch('refreshAbstractsFiles');
$this->dispatch('next-wizard-step');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class="flex items-center justify-between w-full p-4 border-b border-gray-200 rou
</li>
<li class="w-full p-4 space-y-2 border-b border-gray-200 sm:px-6 dark:border-gray-800">
<div class="font-medium">{{ __('general.keywords') }}</div>
<div class="flex flex-wrap items-center gap-1 text-gray-700">
<div class="flex flex-wrap items-center gap-1 text-gray-500">
@forelse ($this->record->tagsWithType('submissionKeywords')->pluck('name')->toArray() as $tag)
<span @class([
'inline-flex items-center justify-center min-h-6 px-2 py-0.5 text-sm tracking-tight rounded-xl text-primary-700 bg-primary-500/10 whitespace-normal',
Expand All @@ -69,7 +69,7 @@ class="flex items-center justify-between w-full p-4 border-b border-gray-200 rou
</li>
<li class="w-full p-4 border-gray-800 sm:px-6 dark:border-gray-800">
<div class="font-medium">{{ __('general.abstract') }}</div>
<div class="dark:text-gray-500">
<div class="text-gray-500">
{!! $this->record->getMeta('abstract') !!}
</div>
</li>
Expand Down

0 comments on commit 69ce2e6

Please sign in to comment.