Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Add full-width embedded map support #1352

Merged
merged 1 commit into from May 26, 2021
Merged

Conversation

TaiWilkin
Copy link
Contributor

@TaiWilkin TaiWilkin commented May 25, 2021

Overview

Adjusts the embedded map preview and sample code to allow users
to set the embedded map to full width, and implements sensible
defaults when moving between full width and set width.

Per a conversation with Scott, some small changes have been made to the
styling of the size section of the embedded map settings.

The width and height text inputs were not allowing users to completely clear them, which made it difficult to enter an entirely new size. There is now a validation message presented in response to empty text inputs instead.

Connects #1311

Testing Instructions

  • Run ./scripts/server
  • Login and navigate to settings under the embed tab
  • Update the width and height of the map.
    • The preview size should change appropriately.
    • The embed code, when copied, should create the same iframe as the preview.
  • Set the width to full-width.
    • The width input should be hidden.
    • The checkbox label should say '100% Width' instead of '100%'
    • The aspect ratio of the preview should be maintained.
    • The embed code, when copied, should create the same iframe as the preview.
  • Uncheck the full-width checkbox.
    • The width input should reappear with the width set to 1000.
    • The aspect ratio should be maintained.
  • Delete the text in the width or height input.
    • There should be an error message, but you should be able to clear the input.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

Copy link
Contributor

@caseycesari caseycesari left a comment

Choose a reason for hiding this comment

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

Couple small things, but this is working well.

left:0;width:100%;height:100%;"
title="embedded-map"></iframe>
</div>
</div>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider changing the indentation over so that this block lines up with the block below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, thanks

const DEFAULT_WIDTH = '1000';
const DEFAULT_HEIGHT = '800';
export const DEFAULT_WIDTH = '1000';
export const DEFAULT_HEIGHT = '800';
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be for a follow-up card, but do we want to set a minimum as well? The map is unusable at small sizes.

Screen Shot 2021-05-26 at 11 43 35 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caseycesari My thought here is that, since users will have direct visual feedback that it looks terrible if they set it at a small size, we can let them self-police their sizing.

@caseycesari caseycesari assigned TaiWilkin and unassigned caseycesari May 26, 2021
Adjusts the embedded map preview and sample code to allow users
to set the embedded map to full width, and implements sensible
defaults when moving between full width and set width.

Per a conversation with Scott, some small changes have been made to the
styling of the size section of the embedded map settings.

As part of updating the iframe code, also fixes a type in the iframe
src url.
@TaiWilkin
Copy link
Contributor Author

Thanks for the review!

@TaiWilkin TaiWilkin merged commit 436f661 into develop May 26, 2021
@TaiWilkin TaiWilkin deleted the tw/full-width-iframe branch May 26, 2021 19:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants