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

Addition to recent update on development build - Turnstile build still missing language / tooltip help info #590

Open
spamhater-grav opened this issue Jan 12, 2023 · 0 comments

Comments

@spamhater-grav
Copy link

spamhater-grav commented Jan 12, 2023

Sorry I not sure how to do a pull request but referring to a recent update that you have completed @rhukster ref 38c85c3

where you fixed some blueprint and language settings for tunstile, but today I noticed some of the refs are pointing to google_recaptcha

The turnstile plugin code in the blueprint is currently this
BLUEPRINT.YAML

    turnstile_captcha:
      type: section
      title: PLUGIN_FORM.TURNSTILE_CAPTCHA

      fields:
        turnstile.theme:
          type: select
          label: PLUGIN_FORM.TURNSTILE_THEME
          default: light
          options:
            light: PLUGIN_FORM.TURNSTILE_THEME_LIGHT
            dark: PLUGIN_FORM.TURNSTILE_THEME_DARK
        turnstile.site_key:
          type: text
          label: PLUGIN_FORM.TURNSTILE_SITE_KEY
          help: PLUGIN_FORM.TURNSTILE_SITE_KEY_HELP
          default: ''
        turnstile.secret_key:
          type: text
          label: PLUGIN_FORM.TURNSTILE_SECRET_KEY
          help: PLUGIN_FORM.TURNSTILE_SECRET_KEY_HELP
          default: ''

But entries are pointing to google recaptcha language.yaml enteries.

So the change listed are to stop using the google_recaptcha enteries and incorrect help hint and point them to the cloudflare turnstile options

LANGUAGE.YAML

en:
  PLUGIN_FORM:
  TURNSTILE_CAPTCHA: "Cloudflare Turnstile Captcha" 
  TURNSTILE_THEME: "Theme" 
  TURNSTILE_SITE_KEY_HELP: "For more info visit https://www.cloudflare.com/turnstile/" 
  TURNSTILE_SECRET_KEY_HELP: "For more info visit https://www.cloudflare.com/turnstile/" 

OR giving them a complete set of enteries

BLUEPRINT.YAML

    turnstile_captcha:
      type: section
      title: PLUGIN_FORM.TURNSTILE_CAPTCHA

      fields:
        turnstile.theme:
          type: select
          label: PLUGIN_FORM.TURNSTILE_CAPTCHA_THEME
          default: light
          options:
            light: PLUGIN_FORM.TURNSTILE_THEME_LIGHT
            dark: PLUGIN_FORM.TURNSTILE_THEME_DARK
        turnstile.site_key:
          type: text
          label: PLUGIN_FORM.TURNSTILE_CAPTCHA_SITE_KEY
          help: PLUGIN_FORM.TURNSTILE_CAPTCHA_SITE_KEY_HELP
          default: ''
        turnstile.secret_key:
          type: text
          label: PLUGIN_FORM.TURNSTILE_CAPTCHA_SECRET_KEY
          help: PLUGIN_FORM.TURNSTILE_CAPTCHA_SECRET_KEY_HELP
          default: ''

And then and the additional lines added to language.yaml , sorry only provided :en versions
LANGUAGE.YAML

en:
  PLUGIN_FORM:
  TURNSTILE_CAPTCHA: "Cloudflare Turnstile Captcha"
  TURNSTILE_THEME: = "Theme"       
  TURNSTILE_THEME_LIGHT: "Light Theme"
  TURNSTILE_THEME_LIGHT: "Dark Theme"
  TURNSTILE_SITE_KEY: "Cloudflares Turnstyle Site API Key"
  TURNSTILE_SITE_KEY_HELP: "For more info visit https://www.cloudflare.com/turnstile/"
  TURNSTILE_SECRET_KEY: "Cloudflares Turnstyle Secret API Key"
  TURNSTILE_SITE_KEY_HELP: "For more info visit https://www.cloudflare.com/turnstile/"

Finally not sure if you want to include a new blueprint field for the .js api code integration which comes from the dashboard

BLUEPRINT.YAML

        turnstile.client.js:
          type: text
          label: PLUGIN_FORM.TURNSTILE_CLIENT_JS
          help: PLUGIN_FORM.TURNSTILE_CLIENT_JS_HELP
          default: ''

LANGUAGES.YAML

          TURNSTILE_CLIENT_JS: "Cloudflares Turnstyle Dashboard Client JS Code"
          TURNSTILE_CLIENT_JS_HELP: "For more info https://www.cloudflare.com/turnstile/"

Logic in Twig Template to support if it is present, to provide an override if this code changes

Currently from dashboard : <script src=https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>

and converted to

{% do assets.addjs('https://challenges.cloudflare.com/turnstile/v0/api.js', { group: 'bottom' }) %}

(not sure if that is the best asset call selection) - then added in to the defered js group at load time of form.

Hope this is alright, and some of it useful without having to do too much lead work.

Thanks
Spamhater
image

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

No branches or pull requests

1 participant