Skip to content

Commit

Permalink
Fix export of boolean values in list and export and extend list searc…
Browse files Browse the repository at this point in the history
…h for id (#132)

* fix export of boolean values in list and export

* Add changelog
  • Loading branch information
alexander-schranz authored Dec 11, 2017
1 parent 07fe4c6 commit a6a9dd2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 1.0.0-RC2

- BUGFIX #132 Fix boolean values in list
- FEATURE #132 Add id to search fields in form and dynamic list
- ENHANCEMENT #131 Add created date to list view
- BUGFIX #130 Fixed csv export for big results
- FEATURE #129 Add disabled field type configuration
Expand Down
8 changes: 4 additions & 4 deletions ListBuilder/DynamicListBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ public function build(Dynamic $dynamic, $locale)
*/
protected function toString($value)
{
if (!$value) {
return '';
}

if (is_string($value) || is_numeric($value)) {
return $value;
}
Expand All @@ -100,6 +96,10 @@ protected function toString($value)
return $value->format('c');
}

if (!$value) {
return '';
}

if (!is_array($value)) {
throw new \Exception('Invalid value for list builder.');
}
Expand Down
3 changes: 1 addition & 2 deletions ListBuilder/DynamicListFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ public function getFieldDescriptors(Form $form, $locale)
}

$title = '';

$translation = $field->getTranslation($locale);

if ($translation) {
$title = $translation->getTitle();
$title = $translation->getShortTitle() ?: $translation->getTitle();
}

$fieldDescriptors[$field->getKey()] = new FieldDescriptor(
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/dist/components/dynamics/list/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Resources/public/dist/components/forms/list/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Resources/public/js/components/dynamics/list/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ define(['jquery'], function ($) {
instanceName: this.instanceName,
url: constants.endPointUrl + queryString,
resultKey: 'dynamics',
searchFields: ['email', 'firstName', 'lastName'],
searchFields: ['id', 'email', 'firstName', 'lastName'],
viewOptions: {
table: {
selectItem: false,
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/components/forms/list/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define(['suluform/collections/forms'], function (Collection) {
lastClickedEventSettingsKey: 'suluformformLastClicked',
endPointUrl: collection.url(),
toolbarKey: 'forms',
toolbarSearchFields: ['title'],
toolbarSearchFields: ['id', 'title'],
fieldsAction: collection.fieldsUrl(),
eventPrefix: 'sulu.form.forms.',
translatePrefix: 'sulu_form.forms.'
Expand Down

0 comments on commit a6a9dd2

Please sign in to comment.