Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url preview block upgrade #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rwaldron
Copy link

No description provided.

How this block chooses a preview to show:

Without a specified Table & Field:
 - The user selects a row in grid view.
 - The block looks in the Selected Field for a supported URL
  (e.g. https://www.youtube.com/watch?v=KYz2wyBy3kc)
 - The block uses this URL to construct an embed URL and inserts this URL into an iframe.

With a Specified Table & Specified Field:
 - The user opens Settings and selects a Specified Table and Specified Field for URL previews.
 - The user selects a row in grid view.
 - If the Selected Field in the Active Table match the Specified Field & Specified Table, then:
     - The block looks in the Selected Field for a supported URL
         (e.g. https://www.youtube.com/watch?v=KYz2wyBy3kc)
     - If the block supports this URL, then:
         - The block uses this URL to construct an embed URL and inserts this URL into an iframe.
     - Else,
         - Display: "Select a cell to see a preview, View supported URLs"
 - Else,
     - If the Active Table does not match the Specified Table, then:
         - Display: "Switch to the “[Specified Table]” table to see previews."
     - If the Selected Field does match the Specified Field, then:
         - Display: "Switch to the “[Specified Field]” field to see previews."
…r choose between "Selected field" and "Specific field"

With a Specified Table & Specified Field:

    - The user may use "Settings" to set a Specified Table and Specified Field for URL previews.
    - The user may use "Settings" to toggle the Specified Table and Specified Field constraint.
Copy link

@jugglinmike jugglinmike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, Rick!

const [isSettingsVisible, setIsSettingsVisible] = useState(false);
useSettingsButton(() => {
if (!isSettingsVisible) {
viewport.enterFullscreenIfPossible();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically switching to full screen feels a little jarring to me. Unlike some other blocks, I can see and do everything I'm interested in from the default view.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the pattern used in all examples, with the exception of the name-quiz-block

frontend/index.js Show resolved Hide resolved
{label: 'Yes', value: IsEnforced.YES},
{label: 'No', value: IsEnforced.NO},
]}
globalConfigKey={ConfigKeys.IS_ENFORCED}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I load the Settings page for the first time, neither button for "Enforce Table & URL Field Settings?" is enabled.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a bug in SelectButtonsSynced, which is supposed to sync the value via the provided globalConfigKey

frontend/index.js Show resolved Hide resolved
frontend/index.js Show resolved Hide resolved
frontend/index.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants