Conversation
✅ Deploy Preview for disfactory-frontend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR restores the image upload functionality after a period of maintenance by introducing a configurable image upload provider system that supports both Imgur and backend filesystem uploads.
- Removes maintenance warnings and modal that blocked image uploads
- Adds configurable image upload provider (Imgur vs backend) with environment variables
- Updates CI/CD workflows to use backend upload provider for staging and production environments
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/ImageUploadForm.vue | Removes the warning alert that informed users about image upload limitations |
| src/api/index.ts | Adds upload provider abstraction with uploadToBackend function and configuration for selecting between Imgur and backend uploads |
| src/App.vue | Removes MaintenanceModal component, related state, and dismiss handler that displayed maintenance notice |
| .github/workflows/ci.yml | Configures environment variables for backend upload provider in staging and production deployment workflows |
| .env.example | Adds documentation and example values for new image upload configuration variables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Image upload provider configuration | ||
| type ImageUploadProvider = 'imgur' | 'backend' | ||
| const IMAGE_UPLOAD_PROVIDER: ImageUploadProvider = (process.env.VUE_APP_IMAGE_UPLOAD_PROVIDER as ImageUploadProvider) || 'imgur' |
There was a problem hiding this comment.
The environment variable VUE_APP_IMAGE_UPLOAD_PROVIDER is cast to ImageUploadProvider type without validation. If someone sets an invalid value (e.g., 'aws' or 'cloudinary'), TypeScript will not catch this at runtime, and the code will silently fall back to 'imgur'. Consider adding runtime validation:
const rawProvider = process.env.VUE_APP_IMAGE_UPLOAD_PROVIDER
if (rawProvider && rawProvider !== 'imgur' && rawProvider !== 'backend') {
console.warn(`Invalid IMAGE_UPLOAD_PROVIDER: ${rawProvider}. Falling back to 'imgur'`)
}
const IMAGE_UPLOAD_PROVIDER: ImageUploadProvider = (rawProvider as ImageUploadProvider) || 'imgur'| const IMAGE_UPLOAD_PROVIDER: ImageUploadProvider = (process.env.VUE_APP_IMAGE_UPLOAD_PROVIDER as ImageUploadProvider) || 'imgur' | |
| const rawProvider = process.env.VUE_APP_IMAGE_UPLOAD_PROVIDER | |
| let IMAGE_UPLOAD_PROVIDER: ImageUploadProvider | |
| if (rawProvider === 'imgur' || rawProvider === 'backend') { | |
| IMAGE_UPLOAD_PROVIDER = rawProvider | |
| } else { | |
| if (rawProvider) { | |
| console.warn(`Invalid VUE_APP_IMAGE_UPLOAD_PROVIDER: ${rawProvider}. Falling back to 'imgur'`) | |
| } | |
| IMAGE_UPLOAD_PROVIDER = 'imgur' | |
| } |
Bring back the image upload