Compare commits

...
3 Commits
Author SHA1 Message Date
Pete Matsyburka 3c8fae78d1 use alpine3.18 2023-12-20 00:45:31 +02:00
Pete Matsyburka 441c1d7044 add builder on upload callback 2023-12-19 19:27:07 +02:00
Pete Matsyburka 203f4633f7 return 422 when submit archived submission 2023-12-19 15:51:56 +02:00
4 changed files with 23 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ COPY ./app/views ./app/views
RUN echo "gem 'shakapacker'" > Gemfile && ./bin/shakapacker RUN echo "gem 'shakapacker'" > Gemfile && ./bin/shakapacker
FROM ruby:3.2.2-alpine as app FROM ruby:3.2.2-alpine3.18 as app
ENV RAILS_ENV=production ENV RAILS_ENV=production
ENV BUNDLE_WITHOUT="development:test" ENV BUNDLE_WITHOUT="development:test"
@@ -42,6 +42,12 @@ class SubmitFormController < ApplicationController
return render json: { error: 'Form has been completed already.' }, status: :unprocessable_entity return render json: { error: 'Form has been completed already.' }, status: :unprocessable_entity
end end
if submitter.template.deleted_at? || submitter.submission.deleted_at?
Rollbar.info("Archived template: #{submitter.template.id}") if defined?(Rollbar)
return render json: { error: 'Form has been archived.' }, status: :unprocessable_entity
end
Submitters::SubmitValues.call(submitter, params, request) Submitters::SubmitValues.call(submitter, params, request)
head :ok head :ok
+1 -1
View File
@@ -749,7 +749,7 @@ export default {
} }
} }
}).catch(error => { }).catch(error => {
alert(error) console.error(error)
}).finally(() => { }).finally(() => {
this.isSubmitting = false this.isSubmitting = false
}) })
@@ -351,6 +351,13 @@ export default {
required: false, required: false,
default: true default: true
}, },
onUpload: {
type: Function,
required: false,
default () {
return () => {}
}
},
withStickySubmitters: { withStickySubmitters: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -732,6 +739,10 @@ export default {
this.scrollIntoDocument(schema[0]) this.scrollIntoDocument(schema[0])
}) })
if (this.onUpload) {
this.onUpload(this.template)
}
this.save() this.save()
}, },
updateName (value) { updateName (value) {
@@ -765,6 +776,10 @@ export default {
}) })
}) })
if (this.onUpload) {
this.onUpload(this.template)
}
this.save() this.save()
}, },
moveDocument (item, direction) { moveDocument (item, direction) {