Merge from docusealco/wip
This commit is contained in:
@@ -11,7 +11,7 @@ jobs:
|
|||||||
- name: Install Ruby
|
- name: Install Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 3.3.4
|
ruby-version: 3.4.1
|
||||||
- name: Cache gems
|
- name: Cache gems
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
- name: Install Ruby
|
- name: Install Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 3.3.4
|
ruby-version: 3.4.1
|
||||||
- name: Cache gems
|
- name: Cache gems
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
@@ -100,7 +100,7 @@ jobs:
|
|||||||
- name: Install Ruby
|
- name: Install Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 3.3.4
|
ruby-version: 3.4.1
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
FROM ruby:3.3.4-alpine as fonts
|
FROM ruby:3.4.1-alpine as fonts
|
||||||
|
|
||||||
WORKDIR /fonts
|
WORKDIR /fonts
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ RUN apk --no-cache add fontforge wget && wget https://github.com/satbyy/go-noto-
|
|||||||
|
|
||||||
RUN fontforge -lang=py -c 'font1 = fontforge.open("FreeSans.ttf"); font2 = fontforge.open("NotoSansSymbols2-Regular.ttf"); font1.mergeFonts(font2); font1.generate("FreeSans.ttf")'
|
RUN fontforge -lang=py -c 'font1 = fontforge.open("FreeSans.ttf"); font2 = fontforge.open("NotoSansSymbols2-Regular.ttf"); font1.mergeFonts(font2); font1.generate("FreeSans.ttf")'
|
||||||
|
|
||||||
FROM ruby:3.3.4-alpine as webpack
|
FROM ruby:3.4.1-alpine as webpack
|
||||||
|
|
||||||
ENV RAILS_ENV=production
|
ENV RAILS_ENV=production
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
@@ -32,7 +32,7 @@ COPY ./app/views ./app/views
|
|||||||
|
|
||||||
RUN echo "gem 'shakapacker'" > Gemfile && ./bin/shakapacker
|
RUN echo "gem 'shakapacker'" > Gemfile && ./bin/shakapacker
|
||||||
|
|
||||||
FROM ruby:3.3.4-alpine as app
|
FROM ruby:3.4.1-alpine as app
|
||||||
|
|
||||||
ENV RAILS_ENV=production
|
ENV RAILS_ENV=production
|
||||||
ENV BUNDLE_WITHOUT="development:test"
|
ENV BUNDLE_WITHOUT="development:test"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
ruby '3.3.4'
|
ruby '3.4.1'
|
||||||
|
|
||||||
gem 'arabic-letter-connector', require: 'arabic-letter-connector/logic'
|
gem 'arabic-letter-connector', require: 'arabic-letter-connector/logic'
|
||||||
gem 'aws-sdk-s3', require: false
|
gem 'aws-sdk-s3', require: false
|
||||||
|
|||||||
+1
-1
@@ -634,7 +634,7 @@ DEPENDENCIES
|
|||||||
webmock
|
webmock
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 3.3.4p94
|
ruby 3.4.1p0
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.5.3
|
2.5.3
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ module Api
|
|||||||
key = params.key?(:submission) ? :submission : :submissions
|
key = params.key?(:submission) ? :submission : :submissions
|
||||||
|
|
||||||
params.permit(
|
params.permit(
|
||||||
key => [permitted_attrs]
|
{ key => [permitted_attrs] }, { key => permitted_attrs }
|
||||||
).fetch(key, [])
|
).fetch(key, [])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div
|
<div
|
||||||
class="absolute overflow-visible group"
|
class="absolute overflow-visible group"
|
||||||
:style="positionStyle"
|
:style="positionStyle"
|
||||||
|
:class="{ 'z-[1]': isMoved || isDragged }"
|
||||||
@pointerdown.stop
|
@pointerdown.stop
|
||||||
@mousedown="startMouseMove"
|
@mousedown="startMouseMove"
|
||||||
@touchstart="startTouchDrag"
|
@touchstart="startTouchDrag"
|
||||||
@@ -316,6 +317,11 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
maxPage: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
defaultField: {
|
defaultField: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -720,12 +726,18 @@ export default {
|
|||||||
const rect = page.getBoundingClientRect()
|
const rect = page.getBoundingClientRect()
|
||||||
|
|
||||||
this.area.x = Math.min(Math.max((this.dragFrom.x + e.touches[0].clientX - rect.left) / rect.width, 0), 1 - this.area.w)
|
this.area.x = Math.min(Math.max((this.dragFrom.x + e.touches[0].clientX - rect.left) / rect.width, 0), 1 - this.area.w)
|
||||||
this.area.y = Math.min(Math.max((this.dragFrom.y + e.touches[0].clientY - rect.top) / rect.height, 0), 1 - this.area.h)
|
this.area.y = (this.dragFrom.y + e.touches[0].clientY - rect.top) / rect.height
|
||||||
|
|
||||||
|
if ((this.area.page === 0 && this.area.y < 0) || (this.area.page === this.maxPage && this.area.y > 1 - this.area.h)) {
|
||||||
|
this.area.y = Math.min(Math.max(this.area.y, 0), 1 - this.area.h)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
stopTouchDrag () {
|
stopTouchDrag () {
|
||||||
this.$el.getRootNode().removeEventListener('touchmove', this.touchDrag)
|
this.$el.getRootNode().removeEventListener('touchmove', this.touchDrag)
|
||||||
this.$el.getRootNode().removeEventListener('touchend', this.stopTouchDrag)
|
this.$el.getRootNode().removeEventListener('touchend', this.stopTouchDrag)
|
||||||
|
|
||||||
|
this.maybeChangeAreaPage(this.area)
|
||||||
|
|
||||||
if (this.isDragged) {
|
if (this.isDragged) {
|
||||||
this.save()
|
this.save()
|
||||||
}
|
}
|
||||||
@@ -773,12 +785,18 @@ export default {
|
|||||||
const rect = page.getBoundingClientRect()
|
const rect = page.getBoundingClientRect()
|
||||||
|
|
||||||
this.area.x = Math.min(Math.max((this.dragFrom.x + e.clientX - rect.left) / rect.width, 0), 1 - this.area.w)
|
this.area.x = Math.min(Math.max((this.dragFrom.x + e.clientX - rect.left) / rect.width, 0), 1 - this.area.w)
|
||||||
this.area.y = Math.min(Math.max((this.dragFrom.y + e.clientY - rect.top) / rect.height, 0), 1 - this.area.h)
|
this.area.y = (this.dragFrom.y + e.clientY - rect.top) / rect.height
|
||||||
|
|
||||||
|
if ((this.area.page === 0 && this.area.y < 0) || (this.area.page === this.maxPage && this.area.y > 1 - this.area.h)) {
|
||||||
|
this.area.y = Math.min(Math.max(this.area.y, 0), 1 - this.area.h)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
stopMouseMove (e) {
|
stopMouseMove (e) {
|
||||||
this.$el.getRootNode().removeEventListener('mousemove', this.mouseMove)
|
this.$el.getRootNode().removeEventListener('mousemove', this.mouseMove)
|
||||||
this.$el.getRootNode().removeEventListener('mouseup', this.stopMouseMove)
|
this.$el.getRootNode().removeEventListener('mouseup', this.stopMouseMove)
|
||||||
|
|
||||||
|
this.maybeChangeAreaPage(this.area)
|
||||||
|
|
||||||
if (this.isMoved) {
|
if (this.isMoved) {
|
||||||
this.save()
|
this.save()
|
||||||
}
|
}
|
||||||
@@ -788,6 +806,15 @@ export default {
|
|||||||
|
|
||||||
this.$emit('stop-drag')
|
this.$emit('stop-drag')
|
||||||
},
|
},
|
||||||
|
maybeChangeAreaPage (area) {
|
||||||
|
if (area.y < -(area.h / 2)) {
|
||||||
|
area.page -= 1
|
||||||
|
area.y = 1 + area.y + (16.0 / this.$parent.$refs.mask.previousSibling.offsetHeight)
|
||||||
|
} else if (area.y > 1 - (area.h / 2)) {
|
||||||
|
area.page += 1
|
||||||
|
area.y = area.y - 1 - (16.0 / this.$parent.$refs.mask.previousSibling.offsetHeight)
|
||||||
|
}
|
||||||
|
},
|
||||||
stopDrag () {
|
stopDrag () {
|
||||||
this.$el.getRootNode().removeEventListener('mousemove', this.drag)
|
this.$el.getRootNode().removeEventListener('mousemove', this.drag)
|
||||||
this.$el.getRootNode().removeEventListener('mouseup', this.stopDrag)
|
this.$el.getRootNode().removeEventListener('mouseup', this.stopDrag)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
:draw-field="drawField"
|
:draw-field="drawField"
|
||||||
:draw-field-type="drawFieldType"
|
:draw-field-type="drawFieldType"
|
||||||
:selected-submitter="selectedSubmitter"
|
:selected-submitter="selectedSubmitter"
|
||||||
|
:total-pages="sortedPreviewImages.length"
|
||||||
:image="image"
|
:image="image"
|
||||||
@drop-field="$emit('drop-field', {...$event, attachment_uuid: document.uuid })"
|
@drop-field="$emit('drop-field', {...$event, attachment_uuid: document.uuid })"
|
||||||
@remove-area="$emit('remove-area', $event)"
|
@remove-area="$emit('remove-area', $event)"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
:with-field-placeholder="withFieldPlaceholder"
|
:with-field-placeholder="withFieldPlaceholder"
|
||||||
:default-field="defaultFields.find((f) => f.name === item.field.name)"
|
:default-field="defaultFields.find((f) => f.name === item.field.name)"
|
||||||
:default-submitters="defaultSubmitters"
|
:default-submitters="defaultSubmitters"
|
||||||
|
:max-page="totalPages - 1"
|
||||||
@start-resize="resizeDirection = $event"
|
@start-resize="resizeDirection = $event"
|
||||||
@stop-resize="resizeDirection = null"
|
@stop-resize="resizeDirection = null"
|
||||||
@remove="$emit('remove-area', item.area)"
|
@remove="$emit('remove-area', item.area)"
|
||||||
@@ -88,6 +89,10 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
totalPages: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
drawFieldType: {
|
drawFieldType: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ module Submissions
|
|||||||
submission.submitters.where(completed_at: nil)
|
submission.submitters.where(completed_at: nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
submitters.preload(attachments_attachments: :blob).each do |s|
|
submitters.preload(attachments_attachments: :blob).each_with_index do |s, index|
|
||||||
GenerateResultAttachments.fill_submitter_fields(s, submission.account, pdfs_index,
|
GenerateResultAttachments.fill_submitter_fields(s, submission.account, pdfs_index,
|
||||||
with_signature_id:, is_flatten:)
|
with_signature_id:, is_flatten:, with_headings: index.zero?)
|
||||||
end
|
end
|
||||||
|
|
||||||
template = submission.template
|
template = submission.template
|
||||||
|
|||||||
@@ -147,15 +147,18 @@ module Submissions
|
|||||||
fill_submitter_fields(submitter, submitter.account, pdfs_index, with_signature_id:, is_flatten:)
|
fill_submitter_fields(submitter, submitter.account, pdfs_index, with_signature_id:, is_flatten:)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is_flatten:)
|
def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is_flatten:, with_headings: nil)
|
||||||
cell_layouter = HexaPDF::Layout::TextLayouter.new(text_valign: :center, text_align: :center)
|
cell_layouter = HexaPDF::Layout::TextLayouter.new(text_valign: :center, text_align: :center)
|
||||||
|
|
||||||
attachments_data_cache = {}
|
attachments_data_cache = {}
|
||||||
|
|
||||||
return pdfs_index if submitter.submission.template_fields.blank?
|
return pdfs_index if submitter.submission.template_fields.blank?
|
||||||
|
|
||||||
|
with_headings = find_last_submitter(submitter.submission, submitter:).blank? if with_headings.nil?
|
||||||
|
|
||||||
submitter.submission.template_fields.each do |field|
|
submitter.submission.template_fields.each do |field|
|
||||||
next if field['submitter_uuid'] != submitter.uuid
|
next if field['type'] == 'heading' && !with_headings
|
||||||
|
next if field['submitter_uuid'] != submitter.uuid && field['type'] != 'heading'
|
||||||
|
|
||||||
field.fetch('areas', []).each do |area|
|
field.fetch('areas', []).each do |area|
|
||||||
pdf = pdfs_index[area['attachment_uuid']]
|
pdf = pdfs_index[area['attachment_uuid']]
|
||||||
@@ -188,6 +191,7 @@ module Submissions
|
|||||||
font = pdf.fonts.add(field.dig('preferences', 'font').presence || FONT_NAME)
|
font = pdf.fonts.add(field.dig('preferences', 'font').presence || FONT_NAME)
|
||||||
|
|
||||||
value = submitter.values[field['uuid']]
|
value = submitter.values[field['uuid']]
|
||||||
|
value = field['default_value'] if field['type'] == 'heading'
|
||||||
|
|
||||||
text_align = field.dig('preferences', 'align').to_s.to_sym.presence ||
|
text_align = field.dig('preferences', 'align').to_s.to_sym.presence ||
|
||||||
(value.to_s.match?(RTL_REGEXP) ? :right : :left)
|
(value.to_s.match?(RTL_REGEXP) ? :right : :left)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ module SigningFormHelper
|
|||||||
ctx.lineTo(150, 150);
|
ctx.lineTo(150, 150);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
JS
|
JS
|
||||||
sleep 1
|
sleep 0.5
|
||||||
end
|
end
|
||||||
|
|
||||||
def field_value(submitter, field_name)
|
def field_value(submitter, field_name)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ RSpec.describe 'App Setup' do
|
|||||||
|
|
||||||
expect do
|
expect do
|
||||||
click_button 'Submit'
|
click_button 'Submit'
|
||||||
sleep 2
|
page.driver.wait_for_network_idle
|
||||||
end.to change(Account, :count).by(1).and change(User, :count).by(1).and change(EncryptedConfig, :count).by(2)
|
end.to change(Account, :count).by(1).and change(User, :count).by(1).and change(EncryptedConfig, :count).by(2)
|
||||||
|
|
||||||
user = User.last
|
user = User.last
|
||||||
|
|||||||
Reference in New Issue
Block a user