dropzone: Addressed existing todos, cleaned attachment ux

Updated dom layout of attahcments to prevent nested dropzones (No issue
but potential to be one) and updated edit form dropzone handling so the
dropzone item card was not as distracting.
This commit is contained in:
Dan Brown 2023-04-26 23:31:38 +01:00
parent e36cdaad0d
commit 9a17656f88
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
6 changed files with 10 additions and 15 deletions

View File

@ -48,7 +48,6 @@ class GalleryImageController extends Controller
'file' => $this->getImageValidationRules(),
]);
} catch (ValidationException $exception) {
// TODO - Check potential other upload locations?
return $this->jsonError(implode("\n", $exception->errors()['file']));
}

View File

@ -13,10 +13,6 @@ export class EditorToolbox extends Component {
// Set the first tab as active on load
this.setActiveTab(this.contentElements[0].dataset.tabContent);
setTimeout(() => {
this.setActiveTab('files', true);
}, 500);
}
setupListeners() {

View File

@ -1,7 +1,7 @@
<div component="ajax-form"
option:ajax-form:url="/attachments/{{ $attachment->id }}"
option:ajax-form:method="put"
option:ajax-form:response-container=".attachment-edit-container"
option:ajax-form:response-container="#edit-form-container"
option:ajax-form:success-message="{{ trans('entities.attachments_updated_success') }}">
<h5>{{ trans('entities.attachments_edit_file') }}</h5>

View File

@ -4,7 +4,7 @@
<div component="ajax-form"
option:ajax-form:url="/attachments/link"
option:ajax-form:method="post"
option:ajax-form:response-container=".link-form-container"
option:ajax-form:response-container="#link-form-container"
option:ajax-form:success-message="{{ trans('entities.attachments_link_attached') }}">
<input type="hidden" name="attachment_link_uploaded_to" value="{{ $pageId }}">
<p class="text-muted small">{{ trans('entities.attachments_explain_link') }}</p>

View File

@ -38,12 +38,12 @@
</div>
</div>
<div refs="attachments@links-container" hidden class="link-form-container">
@include('attachments.manager-link-form', ['pageId' => $page->id])
</div>
<div refs="attachments@edit-container" hidden class="attachment-edit-container"></div>
</div>
<div id="link-form-container" refs="attachments@links-container" hidden class="px-l">
@include('attachments.manager-link-form', ['pageId' => $page->id])
</div>
<div id="edit-form-container" refs="attachments@edit-container" hidden class="px-l"></div>
</div>

View File

@ -12,7 +12,7 @@
option:dropzone:zone-text="{{ trans('entities.attachments_dropzone') }}"
option:dropzone:file-accept="*"
class="relative">
<div refs="dropzone@status-area" class="fixed top-right px-m py-m"></div>
<div refs="dropzone@status-area"></div>
<button type="button"
refs="dropzone@select-button dropzone@drop-target"
class="dropzone-landing-area text-center">