apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform

Home Page:https://superset.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not create permalink on safari browser

iercan opened this issue · comments

We've just upgraded superset to 1.5.0. Our users using Safari browser reported that they are not able to create permalink on dashboard or in explore chart. I've also tested it on Safari and confirmed it is not working although it works on Chrome.

When we click "Copy permalink to clipboard " we see below error.
Screen Shot 2022-05-09 at 17 26 15

In my investigation I realized backend creates permalink successfully but somehow frontend throw this error.

How to reproduce the bug

  1. Open a dashboard with safari
  2. Click on 'Copy permalink to clipboard'
  3. See error

Expected results

Permalink should be copied to clipboard

Actual results

UI throws error although backend return success

Environment

  • browser type and version: Safari 14.1.2, Chrome 101
  • superset version: 1.5.0 installed with apache/superset docker image
  • any feature flags active:
    "SQLLAB_BACKEND_PERSISTENCE": True,
    "THUMBNAILS": True,
    "THUMBNAILS_SQLA_LISTENERS": True,
    "LISTVIEWS_DEFAULT_CARD_VIEW": False,
    "ALERT_REPORTS": True,
    "DASHBOARD_NATIVE_FILTERS": True,
    "DASHBOARD_CROSS_FILTERS": False,
    "DRUID_JOINS": True,
    "DASHBOARD_NATIVE_FILTERS_SET": True,
    "DASHBOARD_RBAC": True,
    "ENABLE_EXPLORE_DRAG_AND_DROP": True,
    "ENABLE_DND_WITH_CLICK_UX": True,

Also this is the error I see on javascript console
Screen Shot 2022-05-09 at 17 36 32

Takes me this code segment

Screen Shot 2022-05-09 at 17 56 48

I was able to repro. It appears we're using the deprecated copy command which Safari no longer supports:

if (!document.execCommand('copy')) {

Let's replace it with the current best practice and include it in 1.5.1.