From 4826731b1af03e418182345f6c0a62aea25d1eb7 Mon Sep 17 00:00:00 2001 From: Blaine Gunn Date: Wed, 9 Oct 2024 15:42:56 -0600 Subject: [PATCH] MWPW-159547 & MWPW-160053 --- acrobat/blocks/verb-widget/limits.js | 8 ++++---- acrobat/blocks/verb-widget/verb-widget.js | 5 +---- acrobat/scripts/alloy/verb-widget.js | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/acrobat/blocks/verb-widget/limits.js b/acrobat/blocks/verb-widget/limits.js index 298a1073..4457b30b 100644 --- a/acrobat/blocks/verb-widget/limits.js +++ b/acrobat/blocks/verb-widget/limits.js @@ -2,23 +2,23 @@ const LIMITS = { fillsign: { maxFileSize: 100000000, // 100 MB maxFileSizeFriendly: '100 MB', // 100 MB - acceptedFiles: ['application/pdf'], + acceptedFiles: '.pdf', maxNumFiles: 1, mobileApp: true, }, 'delete-pages': { maxFileSize: 100000000, // 1 MB - acceptedFiles: ['application/pdf'], + acceptedFiles: '.pdf', maxNumFiles: 1, }, 'number-pages': { maxFileSize: 100000000, // 1 MB - acceptedFiles: ['application/pdf'], + acceptedFiles: '.pdf', maxNumFiles: 1, }, 'compress-pdf': { maxFileSize: 100000000, - acceptedFiles: ['application/pdf'], + acceptedFiles: '.pdf', maxNumFiles: 1, }, }; diff --git a/acrobat/blocks/verb-widget/verb-widget.js b/acrobat/blocks/verb-widget/verb-widget.js index d56cae1b..2580cb9b 100644 --- a/acrobat/blocks/verb-widget/verb-widget.js +++ b/acrobat/blocks/verb-widget/verb-widget.js @@ -108,7 +108,7 @@ export default async function init(element) { const widgetMobCopy = createTag('p', { class: 'verb-copy' }, window.mph[`verb-widget-${VERB}-mobile-description`]); const widgetButton = createTag('button', { for: 'file-upload', class: 'verb-cta', tabindex: 0 }, window.mph['verb-widget-cta']); const widgetMobileButton = createTag('a', { class: 'verb-mobile-cta', href: mobileLink }, window.mph['verb-widget-cta-mobile']); - const button = createTag('input', { type: 'file', id: 'file-upload', class: 'hide', 'aria-hidden': true }); + const button = createTag('input', { type: 'file', accept: LIMITS[VERB].acceptedFiles, id: 'file-upload', class: 'hide', 'aria-hidden': true }); const widgetImage = createTag('img', { class: 'verb-image', src: `/acrobat/img/verb-widget/${VERB}.png`, alt: '' }); // Since we're using placeholders we need a solution for the hyperlinks const legal = createTag('p', { class: 'verb-legal' }, `${window.mph['verb-widget-legal']} `); @@ -142,7 +142,6 @@ export default async function init(element) { // Redirect after IMS:Ready window.addEventListener('IMS:Ready', () => { - console.log('IMS:Ready 😎'); if (window.adobeIMS.isSignedInUser() && window.adobeIMS.getAccountType() !== 'type1') { redDir(VERB); @@ -151,7 +150,6 @@ export default async function init(element) { // Race Condition if (window.adobeIMS?.isSignedInUser() && window.adobeIMS?.getAccountType() !== 'type1') { - console.log('Race Con ⏩'); redDir(VERB); } @@ -235,7 +233,6 @@ export default async function init(element) { element.addEventListener('unity:show-error-toast', (e) => { // eslint-disable-next-line no-console - console.log(`⛔️ Error Code - ${e.detail?.code}`); if (e.detail?.code.includes('error_only_accept_one_file')) { handleError(e.detail?.message); verbAnalytics('error', VERB); diff --git a/acrobat/scripts/alloy/verb-widget.js b/acrobat/scripts/alloy/verb-widget.js index f04636c9..31aca1cf 100644 --- a/acrobat/scripts/alloy/verb-widget.js +++ b/acrobat/scripts/alloy/verb-widget.js @@ -32,7 +32,6 @@ export default function init(eventName, verb, metaData) { // eslint-disable-next-line consistent-return return tokenPayload.sub || tokenPayload.user_id; } - console.log(`📡 Event Name - acrobat:verb-${verb}:${eventName} - metaData: ${metaData?.type} / ${metaData?.size} `); const event = { documentUnloading: true, data: {