Automattic / Automattic/jetpack

Map Block: provide a better UI fallback on wpcom sites, where an API key is provisioned

Open
#20,593 0 comments 0 reactions 0 assignees View on GitHub
[Block] Map [Pri] Normal Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

On a WordPress.com site, a Mapbox API key is provided to you so you don't have to create one for yourself:
https://github.com/Automattic/jetpack/blob/f8969425fdf4fe2aa08a797ea86d321238436ba4/projects/plugins/jetpack/_inc/lib/class-jetpack-mapbox-helper.php#L59-L64

However, the UI does not show that API key:
![image](https://user-images.githubusercontent.com/426388/128548663-d7c3a75a-ed1f-4dff-8abc-189eb3e18d14.png)

It is fine not to show the key, but it would be nice if the UI would indicate that a key has already been provisioned to you. Alternatively, we could remove that UI element altogether:
https://github.com/Automattic/jetpack/blob/dcec8da3dec6e37868e7f4b4793567705a81dd73/projects/plugins/jetpack/extensions/blocks/map/controls.js#L176-L209

Before we make such a change, we should consider previous discussions and PRs about this, where we deliberately chose to display the field on WordPress.com sites: #14597.

****

Related issue: #20591

Contributor guide

Open the contributing guide

Research direction

Start with class-jetpack-mapbox-helper.php and extensions/blocks/map/controls.js, then review the discussion in #14597 and related issue #20591. The work is done when the Map block UI clearly handles the provisioned WordPress.com API key without exposing it unnecessarily, according to the chosen approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.