Giter Site home page Giter Site logo

Comments (7)

philipjohn avatar philipjohn commented on August 29, 2024

If you only have one ad code, it's impossible to select it.

This is related to this Gutenberg bug

from newspack-ads.

sonjaleix avatar sonjaleix commented on August 29, 2024

For 3. maybe we can move the selector into the ad block UI. This contextual implementation would very helpful, especially because the ad unit selector doesn't appear in the block sidebar controls until you click on the block. I did a quick mockup:
Screenshot 2019-07-15 17 14 12
We would need to build in error messages / warnings when a user has added an ad unit but hasn't selected a unit. It would probably be good to display these errors/warnings when a post/page with undefined ad units is trying to be published. This also relates to recommendation 4., which is a good idea.

from newspack-ads.

jeffersonrabb avatar jeffersonrabb commented on August 29, 2024

There is no handling for when no ad units are defined. When no ad units exist, I recommend changing the text from "Select an ad unit" to something like "No ad units have been created yet. You can create ad units in the Ad Manager wizard".

Great idea. Done in 203c740.

from newspack-ads.

jeffersonrabb avatar jeffersonrabb commented on August 29, 2024

This isn't a technical issue, but it took me like 15 minutes of debugging to realize that the select dialogue is in the sidebar and not to expect a select dropdown in the block itself. The "Select an ad unit" text in the block really makes it seem like there should be a select right there. My suggestion is to either change the text to something like "Select an ad unit from the block settings in the sidebar" or have the select be within the block.

Did this in 7106db9

from newspack-ads.

jeffersonrabb avatar jeffersonrabb commented on August 29, 2024

If you only have one ad code, it's impossible to select it. Also, to select the first ad code you must first select a different ad code and then select the first ad code. If while fixing this, you really want the block to initialize with the "Select an ad unit" text instead of selected on the first ad code, I recommend making the first select option "Select an ad code" instead of the first code.

This is done in 7106db9. It's not perfect — ideally the first item in the SelectControl would be disabled, but this isn't an option yet.

from newspack-ads.

jeffersonrabb avatar jeffersonrabb commented on August 29, 2024

Ads without dimensions or with dimensions that don't parse don't look nice when the preview is rendered in the editor. It's probably best to have a nice min value for the preview dimensions. It'll be weird to manage pixel-based ad codes (ad codes with dimensions of 1x1 or no dimension) if there isn't a minimum on the preview.

This still needs work, but let's track it in #5 since the nature of the problem has evolved (due to moving the Select onto the block).

from newspack-ads.

jeffersonrabb avatar jeffersonrabb commented on August 29, 2024

You may also want to display some sort of error notice in the block if the code doesn't look like a valid ad code (e.g. dimension parsing fails).

Done in 8a25b41

from newspack-ads.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.