Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"permissions": {
"allow": [
"WebFetch(domain:github.com)",
"Bash(grep:*)",
"Bash(gh pr checkout:*)",
"Bash(git reset:*)",
"Bash(npm install)",
"Bash(npm run build:*)",
"Bash(npm install:*)",
"Bash(bundle exec:*)",
"Bash(DOCKER_BUILDKIT=1 docker compose up db redis nginx localstack -d)"
],
"deny": []
}
}
20 changes: 13 additions & 7 deletions app/javascript/packs/controllers/crop_upload_controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Controller } from "@hotwired/stimulus"
import Cropper from "cropperjs"
import { Uppy } from '@uppy/core'
import FileInput from '@uppy/file-input'
import Informer from '@uppy/informer'
import ProgressBar from '@uppy/progress-bar'
import ThumbnailGenerator from '@uppy/thumbnail-generator'
import XHRUpload from '@uppy/xhr-upload'

export default class extends Controller {
static targets = [ "fileInput" ]
Expand All @@ -22,23 +28,23 @@ export default class extends Controller {

formGroup.removeChild(fileInput)

let uppy = Uppy.Core({
let uppy = new Uppy({
autoProceed: true,
})
.use(Uppy.FileInput, {
.use(FileInput, {
target: formGroup,
locale: { strings: { chooseFiles: 'Choose file' } },
})
.use(Uppy.Informer, {
.use(Informer, {
target: formGroup,
})
.use(Uppy.ProgressBar, {
.use(ProgressBar, {
target: imagePreview.parentNode,
})
.use(Uppy.ThumbnailGenerator, {
.use(ThumbnailGenerator, {
thumbnailWidth: 600,
})
.use(Uppy.XHRUpload, {
.use(XHRUpload, {
endpoint: '/upload/avatar',
})

Expand All @@ -62,4 +68,4 @@ export default class extends Controller {
})
})
}
}
}
3 changes: 0 additions & 3 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<%= javascript_include_tag 'video_player', 'data-turbolinks-track': 'reload' %>
<meta name="turbo-cache-control" content="no-cache">

<script src="https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.js"></script>

<link href="https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.6/cropper.css" rel="stylesheet" />

<meta property="og:site_name" content="<%= site_name %>" />
Expand Down
3 changes: 0 additions & 3 deletions app/views/layouts/no_headers.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<%= javascript_include_tag 'video_player', 'data-turbolinks-track': 'reload' %>
<meta name="turbo-cache-control" content="no-cache">

<script src="https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.js"></script>

<link href="https://transloadit.edgly.net/releases/uppy/v1.6.0/uppy.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.6/cropper.css" rel="stylesheet" />

<meta property="og:site_name" content="<%= site_name %>" />
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
"@rails/actioncable": "7.2.201",
"@rails/activestorage": "7.2.201",
"@rails/ujs": "7.1.2",
"@uppy/aws-s3-multipart": "3.12.0",
"@uppy/core": "3.13.1",
"@uppy/dashboard": "3.9.1",
"@uppy/xhr-upload": "3.6.8",
"@uppy/aws-s3-multipart": "4.0.0",
"@uppy/core": "4.4.6",
"@uppy/dashboard": "4.3.4",
"@uppy/file-input": "^4.1.3",
"@uppy/informer": "^4.2.1",
"@uppy/progress-bar": "^4.2.1",
"@uppy/thumbnail-generator": "^4.1.1",
"@uppy/xhr-upload": "4.3.3",
"autoprefixer": "^10.4.19",
"bootstrap": "5.3.7",
"bootstrap-icons": "^1.11.3",
Expand Down
Loading
Loading