From aa49e87d975f638e2ee7872b93c4e5aa16741379 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 11 Jun 2021 16:15:31 +0200 Subject: [PATCH] Disable creation of new polls from the old app --- customize.dist/pages/index.js | 2 +- www/common/common-ui-elements.js | 1 + www/common/drive-ui.js | 1 + www/common/sframe-common.js | 1 + www/poll/main.js | 4 ++++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/customize.dist/pages/index.js b/customize.dist/pages/index.js index 3257126e9..8ea334667 100644 --- a/customize.dist/pages/index.js +++ b/customize.dist/pages/index.js @@ -31,7 +31,7 @@ define([ [ 'code', Msg.type.code], [ 'slide', Msg.type.slide], [ 'sheet', Msg.type.sheet], - [ 'poll', Msg.type.poll], + [ 'form', Msg.type.form], [ 'kanban', Msg.type.kanban], [ 'whiteboard', Msg.type.whiteboard], [ 'drive', Msg.type.drive] diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 60b0571c8..cc13661b6 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2081,6 +2081,7 @@ define([ if (p === 'file') { return; } if (p === 'accounts') { return; } if (p === 'calendar') { return; } + if (p === 'poll') { return; } // Replaced by forms if (!common.isLoggedIn() && AppConfig.registeredOnlyTypes && AppConfig.registeredOnlyTypes.indexOf(p) !== -1) { return; } return true; diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index aea222188..b65e8ccf5 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -2557,6 +2557,7 @@ define([ if (type === 'file') { return; } if (type === 'accounts') { return; } if (type === 'calendar') { return; } + if (type === 'poll') { return; } // replaced by forms if (!APP.loggedIn && AppConfig.registeredOnlyTypes && AppConfig.registeredOnlyTypes.indexOf(type) !== -1) { return; diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 227656040..6c77fc8f9 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -448,6 +448,7 @@ define([ } }; funcs.createPad = function (cfg, cb) { + var priv = ctx.metadataMgr.getPrivateData(); if (AppConfig.disableAnonymousPadCreation && !funcs.isLoggedIn()) { return void UI.errorLoadingScreen(Messages.mustLogin); } diff --git a/www/poll/main.js b/www/poll/main.js index 644761f32..f238a74a3 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -14,6 +14,10 @@ define([ var obj = SFCommonO.initIframe(waitFor, true); href = obj.href; hash = obj.hash; + if (!hash) { + window.location.href = '/form/'; + waitFor.abort(); + } }).nThen(function (/*waitFor*/) { SFCommonO.start({ hash: hash,