Skip to content

Commit

Permalink
Only show fixes when its a validation error. e.g. if it fails because…
Browse files Browse the repository at this point in the history
… its a large file dont offer to reupload.
  • Loading branch information
jasonvarga committed Oct 16, 2024
1 parent bdf65ee commit 7f4d6eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resources/js/components/assets/Upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<div class="ml-4 px-2 flex items-center gap-2" v-if="status === 'error'">
{{ error }}
<dropdown-list>
<dropdown-list v-if="errorStatus === 422">
<template #trigger>
<button class="ml-4 btn btn-xs" v-text="`${__('Fix')}...`" />
</template>
Expand Down Expand Up @@ -55,6 +55,7 @@ export default {
basename: String,
percent: Number,
error: String,
errorStatus: Number,
allowSelectingExisting: Boolean,
},
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/assets/Uploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default {
extension: file.name.split('.').pop(),
percent: 0,
errorMessage: null,
errorStatus: null,
instance: upload,
retry: (opts) => this.retry(id, opts)
});
Expand Down Expand Up @@ -217,6 +218,7 @@ export default {
}
}
upload.errorMessage = msg;
upload.errorStatus = status;
this.$emit('error', upload, this.uploads);
this.processUploadQueue();
},
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/assets/Uploads.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:extension="upload.extension"
:percent="upload.percent"
:error="upload.errorMessage"
:error-status="upload.errorStatus"
:allow-selecting-existing="allowSelectingExisting"
@clear="clearUpload(i)"
@retry="retry(i, $event)"
Expand Down

0 comments on commit 7f4d6eb

Please sign in to comment.