Skip to content

Conversation

rueckstiess
Copy link
Contributor

WIP: not ready to be merged yet.

@imlucas can you help getting it wired up?

This is included in the PR

  • new model at ./models/query-options.js that holds the state, i.e. {query: {}, sort: {_id: 1}, limit: 10000, skip: 0}, via AmpersandState. The model is hanging off app.queryOptions.
  • new view at ./refine-view/* that holds the actual query input field, refine button, does validation on input and updates the model's .query property (luckily AmpersandState doesn't already have .query(), only AmpersandView does)
  • There's a listener in ./home/index.js here, that listens to changes on the queryOptions.query property and should fetch the new schema. Here's where I ran into trouble.

I don't know how to fetch new data and invalidate the old one. I was hoping just calling schema.fetch(app.queryOptions.serialize()) again would do the trick, but doesn't seem to work. Could you have a look at it? Any explanations how all the parts hang together would be helpful too, i.e. Schema, Instance, "with-scout", etc.

refine view validates objects on input changes, updates the refineQuery state on Refine button click, which triggers a new schema.fetch(..).
@rueckstiess rueckstiess changed the title Int 185 query bar INT-185 add query bar Jun 13, 2015
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See http://getbootstrap.com/css/#forms-control-validation for usage of has-error css class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that simplifies it. I made the change.

@rueckstiess
Copy link
Contributor Author

Thanks to Lucas' changes, query bar can now reload docs. Further:

  • Query bar is now part of the top header and does not scroll.
  • enter (onsubmit) is correctly caught and does not trigger a page reload anymore.
  • RefineView expects a model of type QueryOptions, see collection.js where it is instantiated.

Ready to be reviewed & merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

imlucas added a commit that referenced this pull request Jun 19, 2015
feature(query_builder): INT-185 add query bar
@imlucas imlucas merged commit ab740ed into dev Jun 19, 2015
@imlucas imlucas deleted the INT-185-query-bar branch July 6, 2015 21:32
gribnoysup pushed a commit that referenced this pull request Apr 26, 2021
Bumps [mocha](https://github.com/mochajs/mocha) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](mochajs/mocha@v7.0.0...v7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
mcasimir pushed a commit that referenced this pull request Jun 25, 2021
Also adds functionality in javascript for new Date
mcasimir pushed a commit that referenced this pull request Jun 25, 2021
Also adds functionality in javascript for new Date
mcasimir added a commit that referenced this pull request Jun 28, 2021
* move language-specific enums into object; can maybe then use them in codegenerator generically

* Merge pull request #21 from mongodb-js/errors-handling

Errors handling

* Use Symbol table generated from YAML file (#23)

* remove test yaml function

* Add symbols to generator only once

* Remove all visit methods from JavaGenerator

* Rename ecmascript to javascript

* Errors handling and refactoring for using classes instead of prototypes

* Move generators into their own dirs

* Move JavaGenerator into function

* Make both csharp and python generators into functions

* Add shell

* Small fixes

* Update package API and tests

* Set version to 0.0.0

* Update README

* Public package

* remove path-resolve

* 0.0.2

* Improve comments

* Separate json test files by input language

* Add shell error file

* remove old test files

* Avoid using fs

* Use shell not javascript for compile from shell

* Generate symbol table with script

* Add python/csharp/shell

* Fix bug for optional types and include BSON numeric type

* Build symbol table before tests

* Use strings instead of numbers for test

* Cast argument to expected type if numeric

* Add _long; don't cast BSON numeric types

* Add Number to casting

* Merge pull request #40 from mongodb-js/COMPASS-2623-add-bson-to-python-symbol-table

COMPASS-2623 Add BSON object built-in functions to Python symbol table

* Add shell bson constructors as input language (#41)

Also adds functionality in javascript for new Date

* Merge pull request #43 from mongodb-js/COMPASS-2622-2623-bson-object-methods-and-utils

Finished bson object methods and bson utils

* work with objects and arrays

* get numbers working csharp with symbol + emit

* make min/max key emit in generator

* add decimal128 + proper comments

* fix template for methods on bson types

* parsing decimal128 requries a TryParse

* rebase of master and change emit calls based on recent changes

* add back lib to gitingore and get rid of java lexer/parser

* Turn MaxKey into function call for shell

* Remove support for toJSON methods

* Remove support for new X

* Run tests again

* Set ctx.type in emit methods

* Allow js ObjectId.createFromTime to take date

* Add shell bson utils to symbol table + tests

* Add shell bson methods to symbol table + tests

* Java tests all running in jvm

* Java tests all running in jvm

* Add various attributes to js input

* work with objects and arrays

* get numbers working csharp with symbol + emit

* make min/max key emit in generator

* make dates work in c#

* add date.now generation

* add c# date tests

* make regex work in c#

* fix date, regex, and octals based on @aherlihy's review

* More JS/Shell tests

* BSON constructors shell --> javascript

* JS constructors shell --> javascript

* JS/BSON utils shell --> javascript

* BSON methods shell --> javascript

* Rename js to language

* Move JS specific code out of generators

* 0.0.3

* fixing package.json + npm version mismatch

* 0.0.5

* webpack / browser does not handle path.resolve

* 0.0.6

* bson code methods

* add object id bson methods

* binary object methods

* dbref object methods

* int32 value of method

* fix double templates

* decimal128 object method

* add timestamp methods

* add long bson methods

* symbol object methods

* add back output lang in code generation tests

* bson utils added to c# templates

* fix templates after rebasing off master

* bson utils for c# with correct templates

* fix rebase errors with bson double args

* 0.1.0

* Merge pull request #64 from mongodb-js/COMPASS-2790-shell-to-python

Compass 2790 shell to python

* Merge pull request #62 from mongodb-js/add-docs

add an API section to readme

* 0.2.0

* Remove emitBinaryFromJS (#68)

* fix int64 compiler errors

* fix errors that dotnet compiler wasn't liking

* sub bsonobjectid with just object id

* can't do try parse on decimal128

* fix bsonint64 comparison operations

* fix remainder of int64 errors

* fix number, regex and object create methods

* Remove emitBinData

* Rename BinaryFromJS to Binary

* Add comments + move shell process methods into shell visitor

* Move BSONRegExp into process/emit pattern

* Add support for JS --> Shell

* Add getTyped

* accept env variables as output/input params

* Merge pull request #66 from mongodb-js/some-validation-cases-ideas

Some validation cases ideas

* Misc Idiomatic Java

* More idiomatic java numbers

* Turn off csharp tests for Double/Int32

* fix numericals in c#

* return more coherent numbers in c#
* if the original number passed in as arg takes a string, return a parse function

* Merge pull request #85 from mongodb-js/COMPASS-2804-write-error-tests-for-python

COMPASS-2804 write error tests for python

* 0.2.1

* Remove Code.toString; Use java doc constructor

* bson-constructors for shell-csharp (#86)

* fix tests for shell-csharp bson constructors

* implement bson-constructors

* add import string as export

* Add import string as export
* Update README; add csharp imports

* add file for generating target language files

* Add helper file for creating runnable tests
* Update test file for python
* make test file for c#
* CR comments
* Add JS output
* Use imports

* check if a float string is passed in to do a float.parse

* Misc Idiomatic Python (#89)

* Python idiomatic fixes

* Template fixes

* test updates

* Fix Number for python

* Java Numeric Bugfix (#90)

* tests

* Fix octal casting

* add shell-c# bson-methods + bson-utils

* language types shell-c#

* shell-c# language tests
* fix date time ToString in js and shell

* Rename errors and fix bugs

* Add RangeError

* Sort error tests by error type

* don't skip tests if not in unsupported

* add error documentation

* Allow running test by mode

* Fix error tests

* Throw unimplemented errors

* Start compilation from root node

* Add tests for other semantic errors

* Syntax Tests + Fixes (#105)

* 0.3.0

* Tests for function calls without args (#106)

* fix nested documents bugs in c# and python (#107)

* fix bug in python + csharp in nested documents

* add a few extra nested tests

* contributing.md: project architecture docs

* Missing step for adding a new language in contrib

* bump node to 9.8.0

* Remove support for Binary/BinData

* remove initial \n in import strings (#111)

* 0.3.1

* add depth param to help with object/array indents

* 0.4.0

* insert indents in java arrays

* v0.4.1

* remove example package name in java imports

* 0.4.2

* Remove depth argument (#115)

* add tree visiting diagram

* 0.4.3

* Skip array elements that generate only commas

* 0.5.0

* indent items in csharp arrays (#117)

* Add args template for arrays

* indent items in csharp arrays

* move .join logic for arrays to args template

* v0.5.1

* Bump mongodb to 3.1.0 (#118)

* Support for using Java generators. (#119)

* Support for using Java generators.

* Add geoJSON support

* Remove |

* 0.6.0

* Set code to use non idiomatic objects

* Set default to using builders

* Imports now being generated by usage

* Documentation changes

* 0.7.0

* Agg tests

* Use BsonNull in java instead of null

* Adding package.json

* 0.7.2

* Allow getImports before compile

* 0.7.3

* Rename Bson-Compilers to Bson-Transpilers

* README fix

* 0.8.0

* Bump driver dependency

* 0.9.0

* Generators never directly access the tree (#126)

* Add Python as input language (#127)

* Add outline for python input

* grammar updated to python3 java version

* python grammar fixes

* generating simple statements

* updates

* tests for language-types

* indivual literals working

* simple literals

* obj for non-java

* non-java array/tuple

* java obj/array/tuple

* readded tests for idiomatic but w python

* idiomatic objects working from python

* binary ops + compare done

* finish idiomatic

* fill out symbol table

* prelim function calls

* Add attr access basic

* BSON types other than numbers + date/regex

* numerical types

* csharp java tests passing

* tests passing

* readd tests

* Dates fixed and moved into templates

* move regex flags into templates

* add generate helpers to js visitor

* python language-types passing

* python constructor tests done

* Add commented sample template file

* bson-methods and bson-utils tests added (not passing)

* All methods + utils except regex + objectid

* all but regex

* Syntax updates

* Python syntax tests done

* eslint

* Add first python error test

* argument errors done

* All python tests but unimplemented

* Python tests done

* Tests passing

* imports working for python

* tests now one line

* json test running

* using YAML not JSON

* idiomatic in json/yaml

* idiomatic in json/yaml

* idiomatic using yaml

* more YAML tests

* Start casting test

* python casting tests failing for neg numbers

* casting tests

* bson-constructors moved to yaml

* objects + arrays

* rename

* more native types

* Dates

* native types done

* syntax tests done

* bson-methods

* success tests removed

* argument-error

* syntax

* test refactor done :)

* eslint

* all but casting int working

* All but unwind

* all casting tests passing

* update javascript visitor to not set type to first child

* empty visitor class added; tests fixed

* eslint

* move imports to codegenvisitor

* more shared code

* Add better error checking

* move function generation into shared visitor

* move identifier generation into shared visitor

* move attribute generation into shared visitor

* move object generation into shared visitor

* move array generation into shared visitor

* move numeric constructor generation into shared visitor

* do literals next

* part-way through casting refactor

* contiued

* finish moving casting/literals into shared visitor

* eslint

* only use templates if defined

* Add possible bson types to shared visitor

* line length

* Add native regex to python

* Add named arguments to python (#128)

* All working but re.compile

* Finish named args

* update docs

* more docs

* contributing typo

* COMPASS-3196: Bump Node driver dependencies

* 0.10.0

* Add support for translating to javascript objects (#129)

* Don't include all the src in the published artifact

* Using BSON 4.0.x:

- [x] JS Symbol -> BSONSymbol
- [x] All JS types now require new keyword in constructor
- [ ] Fix remaining Long test failures

* Fix remaining Long issues in the test suite

* Fix 3 new Long misses

* Use default symbol args template in java

* 0.11.0

* Fix JS Symbol output

* 0.11.1

* Change test to use shell as input for Symbol

* 0.11.2

* Need codegeneration module

* 0.11.3

* Need helper module

* 0.11.4

* Need config module

* 0.11.5

* Fix up make-test-file (#132)

* 0.11.6

* Update README with supported langs

* Merge pull request #133 from mongodb-js/add-git-info

COMPASS-3823: Add git info for license metadata

* Generate Drivers Syntax for Node & Python (#134)

* 0.12.0

* Update shell driver syntax

* Add driver syntax for java

* Add tests

* Throw error for csharp driver syntax

* 0.13.0

* minor fixes for driver syntax

* Test updates

* 0.13.1

* Add extra newline before connect in javascript

* Update tests

* 0.13.2

* Add comments to driver code; use mongodb instead of bson for node

* 0.13.3

* Added powerpoint slides for transpilers talk

* use PDF

* Merge pull request #135 from mongodb-js/update-antlr

Update ANTLR to 4.7.2

* fix: pin antlr4 version

* 0.13.4

* Update CONTRIBUTING.md

* Merge pull request #138 from mongodb-js/ignore-pdf

chore: do not publish pdf and download antlr

* Merge pull request #140 from mongodb-js/move-pdf-to-google-docs

docs: move pdf to google docs

* 0.13.5

* Merge pull request #141 from mongodb-js/export-fn-to-js

feat: compile functions to js

* 0.13.6

* Merge pull request #142 from mongodb-js/fix-fn-whitespaces

fix functions whitespaces

* 0.14.0

* Merge pull request #143 from mongodb-js/clean-deps

chore: update and clean dependencies

* 0.15.0

* chore(monorepo): add bson-transpilers

* remove ignored pre-commit and regen package-lock

* remove package-lock

* update license

* add star dep for bson-transpilers

* regen package lock

* update scripts

* fix dep alignment and add depcheck to ci

* add depcheck to precheck-ci

* remove precommit

* remove compile from ci

* fix pretest

* regen package-lock

* chore(bson-transpilers): fix eslint

Co-authored-by: aherlihy <anna.herlihy@10gen.com>
Co-authored-by: Alena Khineika <alenakhineika@users.noreply.github.com>
Co-authored-by: Alena Khineika <alena.khineika@gmail.com>
Co-authored-by: Irina Shestak <shestak.irina@gmail.com>
Co-authored-by: Durran Jordan <durran@gmail.com>
Co-authored-by: Irina Shestak <lrlna@users.noreply.github.com>
Co-authored-by: Lucas Hrabovsky <hrabovsky.lucas@gmail.com>
Co-authored-by: Rhys <Anemy@users.noreply.github.com>
Co-authored-by: Anemy <rhysh@live.com>
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

Successfully merging this pull request may close these issues.

2 participants