Skip to content

Give the contact link once in each example's output, tagged with the example's file #210

Open

Description

@jwrosewell

The example helpers answer a Property the data file or resource key in use cannot give with a link to the contact page in every answer, tagged with the helper's own file. The specification asks for the link once in an example's output, tagged with the example's file.

What the specification says

device-detection-specification/required-examples.md lines 101 to 113 at d79bbe3b:

Where the data file in use has no value for one of them, the example says that the Property needs the Enterprise Data File, rather than leaving it out or showing a default value, and once in its output gives a link to the 51Degrees contact page to ask for a copy. The link the example writes carries utm_source=code, utm_medium=example, the language repository's name as utm_campaign and the example's file as utm_content, so that an enquiry can be traced to the example that prompted it.

ip-intelligence-specification/required-examples.md lines 88 to 91 at the same commit say an example "says of each one the data file in use cannot give that it needs the Enterprise data file, and once gives a link to the contact page to ask for a copy".

What the examples do

Once #193 is in, the answer is plain text, which that pull request fixes, and these two gaps remain. Both were there before #193 as well.

  1. The link is in every missing Property's answer. PropertyHelper.tryGet in examples/device-detection/shared and in examples/ip-intelligence/shared puts the whole link into each answer. An example that reads many Properties through it, such as the IP Intelligence GettingStartedCloudMixed (24 reads) or GettingStartedCloud (16 reads), can print the link once for each Property it cannot answer.
  2. The link is tagged with the helper's file. Every answer, and the IP Intelligence advisory PRICING_MESSAGE that the helper logs once, carries utm_content=shared-src-main-java-...-shared-propertyhelper.java, so an enquiry cannot be traced to the example that prompted it. The banner the web examples' HtmlContentHelper adds is tagged with that helper's file in the same way.

What is wanted

  • The helper's answer names the Property and says it needs the Enterprise data file or a resource key that includes it, without the link.
  • Each example gives its own tagged link once in its output. Most on-premise console examples already hold a CONTACT_US constant tagged with their own file and print it once, so the cloud console examples, the IP Intelligence advisory and the web banners are the ones to change.
  • A test for each shared helper that its answer holds no link, and a test that an example's output holds the link once.

Related: #197, making the link an anchor on the web pages.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions