NYCPlanning / labs-zola

NYC Planning's Zoning and Land Use App
https://zola.planning.nyc.gov
Other
77 stars 28 forks source link

BBL Lookup: Users can still issue network request by clicking submit #921

Open sentry-io[bot] opened 5 years ago

sentry-io[bot] commented 5 years ago

If users click the "disabled" submit button on BBL lookup dialogue box, it still issues a network request with no parameters, throwing a 404:

Sentry Issue: LABS-ZOLA-A

Error: Not found
  at None (/assets/app-66aa1f122f1cfaa72a7390a9d58ac33a.js:7089:16)
  at v (/assets/app-66aa1f122f1cfaa72a7390a9d58ac33a.js:4780:22)
  at k (/assets/app-66aa1f122f1cfaa72a7390a9d58ac33a.js:4791:12)
  at S (/assets/app-66aa1f122f1cfaa72a7390a9d58ac33a.js:4789:129)
  at invokeWithOnError (/assets/app-66aa1f122f1cfaa72a7390a9d58ac33a.js:4303:144)
...
(5 additional frame(s) were not displayed)
allthesignals commented 3 years ago

This can be solved by updating the add-on over here: https://github.com/NYCPlanning/labs-ember-search/blob/master/addon/templates/components/labs-bbl-lookup.hbs#L11

It looks like in the add-on, it adds a css class disabled if there's nothing to submit. However, since it uses a native form, it should also add disabled as an attribute.

allthesignals commented 3 years ago

Fixing this via the add-on is complicated by an issue I'm having with upgrading the labs-ember-search add-on in zola:

Template Compiler Error (TemplateCompiler) in ember-basic-dropdown/templates/components/basic-dropdown-content.hbs

Compile Error: Element modifiers are not allowed in components

Stack Trace and Error Report: /var/folders/g0/l926clqx2zn2wgvvx_r8xs700000gp/T/error.dump.fddc39e69ed349897f35be98c720b379.log

...

broccoliBuilderErrorStack: Error: Compile Error: Element modifiers are not allowed in components at JavaScriptCompiler.closeComponent (/Users/mattgardner/labs-zola/node_modules/ember-source/dist/ember-template-compiler.js:2640:15) at /Users/mattgardner/labs-zola/node_modules/ember-source/dist/ember-template-compiler.js:2556:21 at Array.forEach () at JavaScriptCompiler.process (/Users/mattgardner/labs-zola/node_modules/ember-source/dist/ember-template-compiler.js:2548:20) at Function.process (/Users/mattgardner/labs-zola/node_modules/ember-source/dist/ember-template-compiler.js:2540:23) at Function.compile (/Users/mattgardner/labs-zola/node_modules/ember-source/dist/ember-template-compiler.js:3045:33) at precompile (/Users/mattgardner/labs-zola/node_modules/ember-source/dist/ember-template-compiler.js:3635:26) at Object.precompile (/Users/mattgardner/labs-zola/node_modules/ember-source/dist/ember-template-compiler.js:7684:37) at TemplateCompiler.processString (/Users/mattgardner/labs-zola/node_modules/labs-ember-search/node_modules/ember-basic-dropdown/node_modules/ember-cli-htmlbars/lib/template-compiler-plugin.js:68:55) at Object.processString (/Users/mattgardner/labs-zola/node_modules/labs-ember-search/node_modules/ember-basic-dropdown/node_modules/broccoli-persistent-filter/lib/strategies/persistent.js:45:36)

  • code: [undefined]