diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue
index 7ddd1372..4fe13b4d 100644
--- a/app/javascript/template_builder/builder.vue
+++ b/app/javascript/template_builder/builder.vue
@@ -309,6 +309,8 @@
:data-document-uuid="item.attachment_uuid"
:accept-file-types="acceptFileTypes"
:with-replace-button="withUploadButton"
+ :with-google-drive="withGoogleDrive"
+ :authenticity-token="authenticityToken"
:editable="editable"
:dynamic-documents="dynamicDocuments"
:with-dynamic-documents="withDynamicDocuments"
@@ -456,6 +458,8 @@
:with-arrows="template.schema.length > 1"
:item="template.schema.find((item) => item.attachment_uuid === document.uuid)"
:with-replace-button="withUploadButton"
+ :with-google-drive="withGoogleDrive"
+ :authenticity-token="authenticityToken"
:accept-file-types="acceptFileTypes"
:document="document"
:template="template"
diff --git a/app/javascript/template_builder/controls.vue b/app/javascript/template_builder/controls.vue
index e09397ae..df976002 100644
--- a/app/javascript/template_builder/controls.vue
+++ b/app/javascript/template_builder/controls.vue
@@ -10,6 +10,9 @@
v-if="withReplaceButton"
:template-id="template.id"
:accept-file-types="acceptFileTypes"
+ :authenticity-token="authenticityToken"
+ :with-google-drive="withGoogleDrive"
+ :google-drive-file-id="item.google_drive_file_id"
@click.stop
@success="$emit('replace', { replaceSchemaItem: item, ...$event })"
/>
@@ -73,6 +76,16 @@ export default {
required: true,
default: true
},
+ withGoogleDrive: {
+ type: Boolean,
+ required: false,
+ default: false
+ },
+ authenticityToken: {
+ type: String,
+ required: false,
+ default: ''
+ },
withArrows: {
type: Boolean,
required: false,
diff --git a/app/javascript/template_builder/google_drive_picker_modal.vue b/app/javascript/template_builder/google_drive_picker_modal.vue
new file mode 100644
index 00000000..e4a40f14
--- /dev/null
+++ b/app/javascript/template_builder/google_drive_picker_modal.vue
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
diff --git a/app/javascript/template_builder/i18n.js b/app/javascript/template_builder/i18n.js
index 53066f5c..e2bb817d 100644
--- a/app/javascript/template_builder/i18n.js
+++ b/app/javascript/template_builder/i18n.js
@@ -219,7 +219,9 @@ const en = {
revisions: 'Revisions',
apply: 'Apply',
no_revisions_yet: 'No revisions yet',
- viewing_revision_from: 'Viewing revision from {date}'
+ viewing_revision_from: 'Viewing revision from {date}',
+ connect_google_drive: 'Connect Google Drive',
+ submitting: 'Submitting'
}
const es = {
@@ -443,7 +445,9 @@ const es = {
revisions: 'Revisiones',
apply: 'Aplicar',
no_revisions_yet: 'Aún no hay revisiones',
- viewing_revision_from: 'Viendo revisión del {date}'
+ viewing_revision_from: 'Viendo revisión del {date}',
+ connect_google_drive: 'Conectar Google Drive',
+ submitting: 'Enviando'
}
const it = {
@@ -667,7 +671,9 @@ const it = {
revisions: 'Revisioni',
apply: 'Applica',
no_revisions_yet: 'Nessuna revisione ancora',
- viewing_revision_from: 'Visualizzazione revisione del {date}'
+ viewing_revision_from: 'Visualizzazione revisione del {date}',
+ connect_google_drive: 'Connetti Google Drive',
+ submitting: 'Invio in corso'
}
const pt = {
@@ -891,7 +897,9 @@ const pt = {
revisions: 'Revisões',
apply: 'Aplicar',
no_revisions_yet: 'Nenhuma revisão ainda',
- viewing_revision_from: 'Visualizando revisão de {date}'
+ viewing_revision_from: 'Visualizando revisão de {date}',
+ connect_google_drive: 'Conectar Google Drive',
+ submitting: 'Enviando'
}
const fr = {
@@ -1115,7 +1123,9 @@ const fr = {
revisions: 'Révisions',
apply: 'Appliquer',
no_revisions_yet: 'Aucune révision pour le moment',
- viewing_revision_from: 'Affichage de la révision du {date}'
+ viewing_revision_from: 'Affichage de la révision du {date}',
+ connect_google_drive: 'Connecter Google Drive',
+ submitting: 'Soumission en cours'
}
const de = {
@@ -1339,7 +1349,9 @@ const de = {
revisions: 'Revisionen',
apply: 'Anwenden',
no_revisions_yet: 'Noch keine Revisionen',
- viewing_revision_from: 'Ansicht der Revision vom {date}'
+ viewing_revision_from: 'Ansicht der Revision vom {date}',
+ connect_google_drive: 'Google Drive verbinden',
+ submitting: 'Wird eingereicht'
}
const nl = {
@@ -1563,7 +1575,9 @@ const nl = {
revisions: 'Revisies',
apply: 'Toepassen',
no_revisions_yet: 'Nog geen revisies',
- viewing_revision_from: 'Revisie van {date} bekijken'
+ viewing_revision_from: 'Revisie van {date} bekijken',
+ connect_google_drive: 'Verbind Google Drive',
+ submitting: 'Indienen'
}
export { en, es, it, pt, fr, de, nl }
diff --git a/app/javascript/template_builder/preview.vue b/app/javascript/template_builder/preview.vue
index 1fe1288d..efd21777 100644
--- a/app/javascript/template_builder/preview.vue
+++ b/app/javascript/template_builder/preview.vue
@@ -36,7 +36,10 @@
v-if="withReplaceButton"
:template-id="template.id"
:accept-file-types="acceptFileTypes"
- class="opacity-0 group-hover:opacity-100"
+ :authenticity-token="authenticityToken"
+ :with-google-drive="withGoogleDrive"
+ :google-drive-file-id="item.google_drive_file_id"
+ class="opacity-0 group-hover:opacity-100 has-[label:focus]:opacity-100"
@click.stop
@success="$emit('replace', { replaceSchemaItem: item, ...$event })"
/>
@@ -232,6 +235,16 @@ export default {
required: true,
default: true
},
+ withGoogleDrive: {
+ type: Boolean,
+ required: false,
+ default: false
+ },
+ authenticityToken: {
+ type: String,
+ required: false,
+ default: ''
+ },
dynamicDocuments: {
type: Array,
required: true
diff --git a/app/javascript/template_builder/replace.vue b/app/javascript/template_builder/replace.vue
index 3d0f3597..e8dc25c7 100644
--- a/app/javascript/template_builder/replace.vue
+++ b/app/javascript/template_builder/replace.vue
@@ -1,14 +1,52 @@
-
diff --git a/app/javascript/template_builder/upload.vue b/app/javascript/template_builder/upload.vue
index 0c688914..775d4d2d 100644
--- a/app/javascript/template_builder/upload.vue
+++ b/app/javascript/template_builder/upload.vue
@@ -61,87 +61,16 @@
-
-
-
+ v-model:loading="isLoadingGoogleDrive"
+ :template-id="templateId"
+ :authenticity-token="authenticityToken"
+ :modal-container-el="modalContainerEl"
+ :reopen-after-auth="true"
+ @close="showGoogleDriveModal = false"
+ @picked="onGoogleDrivePicked"
+ />