Giter VIP home page Giter VIP logo

bullet_train-fields's Introduction

bullet_train-fields's People

Contributors

adampal avatar andrewculver avatar danieldpence avatar existentialmutt avatar gazayas avatar jorbs avatar leenyburger avatar mazaleyrat avatar pascallaliberte avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bullet_train-fields's Issues

Add "Select All" and "Reset" options to `options`.

The options field partial currently look like this when multiple: true:

Screen Shot 2022-07-14 at 11 53 55 AM

I'm currently working on a form where the list of options could be dozens, and I'd like to add a little link in the help text portion that allows people to "Select All".

Also, in my current example, the model might have some subset of options preselected when creating the model. Once the user selects more or deselects some or selects all, I'd like them to be presented with a little link that allows them to "Reset to Default".

Add columns to `options`.

Currently working on a form where the "options" presented could number in the dozens. When this is the case, I would love for the field to have the option of automatically breaking itself up into two or three columns, although remaining responsively in one column on mobile, etc.

Add `files_field`.

We have file_field, but it only supports a single file. Would love to add a separate field partial that supports multiple files.

Local Minitest is failing

I feel like I saw this with some other repos in the past, but now I'm only seeing it with bullet_train-fields. I won't spend too much time trying to figure it out if it isn't high priority, but it just bothered me a bit:

> bundle exec rails test
/home/gazayas/work/bt/bullet_train-fields/lib/bullet_train/fields/engine.rb:5:in `block in <class:Engine>': undefined method `linked_gems' for BulletTrain:Module (NoMethodError)

        BulletTrain.linked_gems << "bullet_train-fields"
                   ^^^^^^^^^^^^
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/initializable.rb:32:in `instance_exec'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/initializable.rb:32:in `run'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:347:in `each'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:347:in `call'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/initializable.rb:60:in `run_initializers'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/application.rb:372:in `initialize!'
	from /home/gazayas/work/bt/bullet_train-fields/test/dummy/config/environment.rb:5:in `<top (required)>'
	from /home/gazayas/work/bt/bullet_train-fields/test/test_helper.rb:4:in `require_relative'
	from /home/gazayas/work/bt/bullet_train-fields/test/test_helper.rb:4:in `<top (required)>'
	from /home/gazayas/work/bt/bullet_train-fields/test/bullet_train/fields_test.rb:1:in `require'
	from /home/gazayas/work/bt/bullet_train-fields/test/bullet_train/fields_test.rb:1:in `<top (required)>'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/test_unit/runner.rb:47:in `require'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/test_unit/runner.rb:47:in `block in load_tests'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/test_unit/runner.rb:47:in `each'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/test_unit/runner.rb:47:in `load_tests'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/test_unit/runner.rb:40:in `run'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/commands/test/test_command.rb:33:in `perform'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/command/base.rb:87:in `perform'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/command.rb:48:in `invoke'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/commands.rb:18:in `<top (required)>'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/engine/commands.rb:9:in `require'
	from /home/gazayas/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/railties-7.0.3/lib/rails/engine/commands.rb:9:in `<top (required)>'
	from bin/rails:14:in `require'
	from bin/rails:14:in `<main>'

Selection in one super select affects options of another.

Background

Hypothetically, when setting up a webhooks endpoint for scaffolding_completely_concrete_tangible_things.updated, we want users to be able to specify that they only want to receive a webhook when a specific tangible thing is updated. The current plan is to implement this by adding a scaffolding_completely_concrete_tangible_thing_id attribute to Webhooks::Outgoing::Endpoint. (We're also going to add a scaffolding_absolutely_abstract_creative_concept_id attribute as well, for filtering those kinds of events.)

Assume there is both a "Creative Concept" and "Tangible Thing" super select field on the form for Webhooks::Outgoing::Endpoint.

Request

  1. Before a Creative Concept is selected, I think the Tangible Things field should be disabled by default.
  2. When someone selects a Creative Concept, I want the list of options in the Tangible Things select field to only be those options that exist under the selected Creative Concept.
  3. I'd like this to be implemented in a way where it could be used multiple levels deep, e.g. Country > Region > City.

Initial Thoughts

I think this should be relatively straightforward, since we have the ability to populate a Super Select based on an AJAX request and you can hit /account/scaffolding/absolutely_abstract/creative_concepts/$CREATIVE_CONCEPT_ID/completely_concrete/tangible_things.json and get a list of Tangible Things for a given Creative Concept.

super-select: too many clicks needed to use type-ahead text field

On a super-select field that doesn't allow multiple selected elements, too many clicks are needed to enter text into the type-ahead text field.

CleanShot 2022-09-20 at 16 37 55

It's especially noticeable on the Time Zone field during the sign-up process:

CleanShot 2022-09-20 at 16 34 19

And seen in both GIFs above, clicking the field's <label> does outline the field, but doesn't provide a way to start typing keys to narrow the selection as expected.

The `code` field partial needs a `secret` option.

Looking at the following view as an example:

Screen Shot 2022-09-05 at 10 36 41 AM

We need the option to specify that "Client Secret" and "Token" are secret and shouldn't be shown completely without user action. Basically we should present them as the first five characters and then a link to show the rest:

fDaLt Show

Application won't boot when using `yarn link`.

Here's the output from bin/dev:

09:23:02 web.1       | started with pid 68288
09:23:02 worker.1    | started with pid 68289
09:23:02 js.1        | started with pid 68290
09:23:02 light-js.1  | started with pid 68291
09:23:02 light-css.1 | started with pid 68292
09:23:02 light-js.1  | yarn run v1.22.17
09:23:02 js.1        | yarn run v1.22.17
09:23:03 light-js.1  | $ esbuild `bundle exec bin/theme javascript light` --bundle --sourcemap --outdir=app/assets/builds --loader:.png=file --loader:.jpg=file --watch
09:23:03 js.1        | $ node esbuild.config.js --watch
09:23:03 js.1        | ✘ [ERROR] Could not resolve "@bullet-train/fields/app/assets/javascripts/intl-tel-input-utils.js"
09:23:03 js.1        | 
09:23:03 js.1        |     app/javascript/intl-tel-input-utils.js:1:7:
09:23:03 js.1        |       1 │ import "@bullet-train/fields/app/assets/javascripts/intl-tel-input-...
09:23:03 js.1        |         ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
09:23:03 js.1        | 
09:23:03 js.1        |   You can mark the path "@bullet-train/fields/app/assets/javascripts/intl-tel-input-utils.js" as external to exclude it from the bundle, which will remove this error.
09:23:03 js.1        | 
09:23:03 js.1        | ▲ [WARNING] "@charset" must be the first rule in the file
09:23:03 js.1        | 
09:23:03 js.1        |     ../../asdf/local/bullet_train-fields/node_modules/trix/dist/trix.css:300:0:
09:23:03 js.1        |       300 │ @charset "UTF-8";
09:23:03 js.1        |           ╵ ~~~~~~~~
09:23:03 js.1        | 
09:23:03 js.1        |   This rule cannot come before a "@charset" rule
09:23:03 js.1        | 
09:23:03 js.1        |     ../../asdf/local/bullet_train-fields/node_modules/trix/dist/trix.css:6:0:
09:23:03 js.1        |       6 │ trix-editor {
09:23:03 js.1        |         ╵ ^
09:23:03 js.1        | 
09:23:03 js.1        | resolveDir /Users/andrewculver/Sites/clean/bullet_train/app/javascript/controllers
09:23:03 js.1        | path ./**/*_controller.js
09:23:03 js.1        | error Command failed with exit code 1.
09:23:03 js.1        | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
09:23:03 light-js.1  | [watch] build finished, watching for changes...
09:23:04 js.1        | exited with code 1
09:23:04 system      | sending SIGTERM to all processes
09:23:04 light-css.1 | terminated by SIGTERM
09:23:04 light-js.1  | exited with code 1
09:23:04 worker.1    | terminated by SIGTERM
09:23:04 web.1       | terminated by SIGTERM

Here are the steps to reproduce:

Steps to reproduce:

export IDE=code # or whatever command you use to open a project in your IDE from the terminal.
git clone [email protected]:bullet-train-co/bullet_train.git bullet_train
cd bullet_train
bin/develop
# Select number 3 and hit <Enter>.

Read all the output for context. Basically it automatically links up both the Ruby gem and the npm package to the checked out copy in local/bullet_train-fields.

Open a new terminal:

bin/dev

That should exit with a failure.

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.