app/javascript/js/controllers/fields/trix_field_controller.js
Function uploadFile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uploadFile(file, progressCallback, successCallback) {
const formData = this.createFormData(file)
const xhr = new XMLHttpRequest()
xhr.open('POST', this.uploadUrl, true)
Function connect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
connect() {
if (this.attachmentsDisabledValue) {
// Remove the attachments button
this.controllerTarget.querySelector('.trix-button-group--file-tools').remove()
}