Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge to master - Release 2.3.5 - Optimize order by and filters queri…
…es (#35) * add tests for the new dsl to write property data types * append the property :type values to the :enforce array * update solution mapper to support multilingual * update solution mapper to support multilingual * fix typo ( name ) * add validators tests file * add validator interface module * implement data_type validator * migrate existence validator to the new DSL * migrate uniqueness validator to the new DSL * implement object_type validator with the new DSL * migrate range validator to the new DSL * refactor the enforce module to use the new validators implementation * force to regenerate the id when we update related attribute (named_with) * require the validators implementation * update existence validator to not accept empty to_s objects * update exist? test * add symmetric validator tests for no_list and list cases * implement symmetric validator * move re used methods to the parent class * update symmetric code and error message * add distinct of validator tests * implement distinct_of validator * add superior_equal_to validator tests * extract property method to ValidatorBase class * implement superior_equal_to validator * add inverse of validator tests * implement inverse_of validator * use the class method property in distinct of * add proc validator tests * add instance proc validators * fix call_proc validator to test if the returned values are correct * add model_with_yaml_scheme test * implement YAMLScheme module * use YAMLScheme module in Settings module * use platform lang and code refacto * filter by lang in properties * do some refactoring * add unmapped_get to goo resources * update lang filter module to support requested_lang and portal_lang * use the new lang filter module in the solution_mapper * remove the usage of the old lang filter module in map_attributes * add request language global variable * fix datatype check for list values * remove old unused test if clause * for no unmapped values cast them to object before sending * for resource unmapped_set merge new value if an array * prevent add_object_to_model if no_lang and previous value exist * move from the mapper lang_filter related code to lang_filter module * move internal lang filter module methods to private section * add request_store gem to save request language globally * save requested language in model_load options * force requested_lang and portal_langs to be upcase and symbol * change methodes/vars names * get the last item in objects instead of passing the current object * Revert "get the last item in objects instead of passing the current object" This reverts commit 996922a. * handle this case where values is nil in save_model_values * handle the casf of nil values for the SuperiorEqualTo validator * add onUpdate callback tests * implement enforce_callback to run an attribute callback * move the attribute default callback to the save method * implement onUpdate DSL in the ressource settings * call to the attributes onUpdate callback in the save method * in validators bring attribute if needed * make superior_equal_to works for list attributes * add email validator test * implement email validator * add filters patterns to select variables * make make regex filter no-case sensitive * if requested_lang = 'all' return all * support select multilanguage * show the values with their corresponding language * use @attributes_to_translate * change methode name * remove platform languages * add complex_order_by unit test * refactor query_builder to extract internal_variables as instance variable * update order_by to work for joined patterns (object attributes) * downcase lang key * Fix the issue of undefined 'id' of the language filter module * Show literal attribute if we requested all the languages * Use portal language by default in the language filter module * group unmapped properties by lang * Feature: group unmapped properties by language (#38) * group unmapped properties by lang * downcase language keys of unmapped properties --------- Co-authored-by: Syphax bouazzouni <gs_bouazzouni@esi.dz> * assert that pre in an array in get_value_object * add label to attributes_to_translate * update define_method * update solution mapper * update get_preload_value * Feature: Support multi lingual - add show_language argument to the attributes getters (#39) * update define_method * update solution mapper * update get_preload_value * fix save_model_values if unmmaped condition * fix getters for list attributes to not take only the first value * remove the languages hash for the unmapped if not a mutli langual asked * move some language helper from the mapper to the lang_filter module * move @requested_lang variable from the mapper to the lang_filter module * remove no more used @attributes_to_translate variable in lang_filter * fix save_model_values method to not save RDF:Literal object but a string * remove not used method in lang filter module * refecator and rename some methods of the lang_filter module * use the new name of the lang filter methods in the solution mapper * replace the getters argument to show languages from :show_all_languages to :show_languages: true * catch transform_values of unmapped if it is nil * change the getters show_all_languages argument from to include_languages * make the map_attributes handle the option showing all the languages * fix order by an attribute that is already filtered * don't add the filtered variables to the select clause of the query * add filters patterns to select variables * fix pagination with order_by with filter that returns empty pages for 4store * include the in the select variables filtered variables * optimize pagination query by not re-doing the filters and order in the include query --------- Co-authored-by: HADDAD Zineddine <hz_haddad@esi.dz>
- Loading branch information