-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing previewUsing
to work on attachExisting
#163
Comments
MediaUploadingListItem.vue methods: {
loadPreview() {
if (this.media.isImage) { // could we change this
this.preview = this.media.previewUrl
} else {
return
}
... ...
if (this.media.previewUrl) { // to this?
this.preview = this.media.previewUrl
} else {
return
}
... |
As of inspecting, {
"0": {
"id": ...,
"size": 13133,
"mimeType": "application/pdf",
"fileName": "sample-2.pdf",
"collectionName": "",
"extension": "pdf",
"previewUrl": "http://127.0.0.1:9000/.../media/16fc12ce-e916-4e0f-bf65-21fd71b2f3bc/sample-2.pdf"
}
} |
class AttachableMediaPresenter implements Arrayable
{
private $media;
public function __construct(Media $media)
{
$this->media = $media;
}
public function toArray(): array
{
return array_merge([
'id' => $this->media->id,
'size' => $this->media->size,
'mimeType' => $this->media->mime_type,
'fileName' => $this->media->file_name,
'collectionName' => $this->media->collection_name,
'extension' => $this->media->extension,
'previewUrl' => $this->media->getFullUrl('preview'), // how could we pass the conversion value :)
]);
}
} |
This seems to work, we just need to find where to get the |
Preparing the pull request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are using
![image](https://user-images.githubusercontent.com/5117811/193168531-c13579a5-1380-44e5-98a5-bb3bc039d292.png)
previewUsing
to use aconversion
file for preview.But on "use existing" button, preview does not work.
![image](https://user-images.githubusercontent.com/5117811/193168434-744bd976-5324-4b38-a65e-b13f78a12d73.png)
We can't seem to find on documents
and we are still looking at the source code.We reviewed the closed issues but still couldn't find a reference.
The text was updated successfully, but these errors were encountered: