Closed (fixed)
Project:
Translation Management Tool
Version:
8.x-1.x-dev
Component:
Source: Configuration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2015 at 14:09 UTC
Updated:
24 Aug 2015 at 23:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
giancarlosotelo commentedWhen the source is of type
SIMPLE_CONFIGwe can not use the search form.Here is a patch for that and a test.
Comment #2
giancarlosotelo commentedComment #3
juanse254 commentedExtend this test, add coverage for searches with results and no results. Try to test that results are shown in /admin/tmgmt/sources/locale/default/ as expected and so on and so forth.
The rest looks good to me.
Comment #4
giancarlosotelo commentedI think we can create a follow up for a better test coverage since this issue is about the broken button. I am not sure because some of the entities have already a test filter including
LocaleSourceUiTestthat tests filters in /admin/tmgmt/sources/locale/default/Comment #5
LKS90 commentedThis looks correct, removing the search button and adding a test to see if it is removed seems sufficient for this issue.
Comment #6
berdirHm, actually, at least some of those filters are still useful, for example searching on the name, and also target language but that's likely not implemented atm.
Comment #7
giancarlosotelo commentedAdded filters for name and target language and also test coverage for them.
Comment #8
sasanikolic commentedWhy removing empty lines? :)
I don't think we need to use "Config entities" with capital C.
Other than that, seems fine.
Comment #9
giancarlosotelo commentedUps, I didn't realize that. Fixed now.
Comment #10
juanse254 commentedComment #11
juanse254 commentedi think you can put this together.
The rest looks good to me.
Comment #12
giancarlosotelo commentedComment #13
giancarlosotelo commentedDone.
Comment #14
edurenye commentedIt works and the code looks fine to me.
Comment #15
berdirThe logic of the filtering is quite repetitive here at the moment.
I'd suggest you add a $this->getFilteredSimpledConfigDefinitions($search_property_params) method here.
Then in there, you can just have a single loop with a list of checks, if any doesn't match you just use continue; to skip to the next definition.
Using array_filter() with a callback or anonymous function would be another option.
Comment #16
giancarlosotelo commentedI added a function and instead of using a loop I am using an array filter. Looks better now.
Comment #17
mbovan commentedWe are doing the same thing here - filtering. Can we combine these 2 loops into one and turn the logic a bit around?
E.g.
etc.
Comment #18
giancarlosotelo commentedNow both filters in the same loop and the logic changed a bit.
Comment #19
LKS90 commentedPatch looks good, works as intended. Maybe take a look at this issue which is quite similar.
Comment #20
berdirCan you add another test that tests for both the name and the status?
I have a feeling that's not going to work as expected with the current code..
Comment #21
giancarlosotelo commentedAdded tests when target status is 'translated' and when is not.
Comment #22
giancarlosotelo commentedComment #25
LKS90 commentedI'd put the comment as the third argument, you then get pretty information in the test and save four lines! :D
Maybe shorten the comments a little:
Just 1 simple configuration was translated.->Found one translated simple configurationIf the count is not equal to one, the test tells you it failed finding a single configuration etc.
Sascha also asked you to add a test for this:
And while you have a lot of scenarios covered, exactly that one is missing (and broken).
Query:
Valid HTML found on "http://d8.dev/admin/tmgmt/sources/config/_simple_config?name=system&langcode=&target_language=&target_status=translated"Output:

The first entry is not translated, why is it displayed?
Comment #26
LKS90 commentedComment #27
giancarlosotelo commentedIt is not possible to filter without
target_language, so the patch was quite fine (working as intended) but here is a much better approach.Comment #29
berdirNice, committed.