Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Cédric Anne <cedric.anne@gmail.com>
  • Loading branch information
cconard96 and cedric-anne committed Apr 29, 2024
1 parent 2678828 commit 97a1b12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -941,15 +941,13 @@ public static function progressBar($id, array $options = [])
*
* @return string|void
**/
public static function createProgressBar($msg = "&nbsp;", array $options = [])
public static function createProgressBar($msg = null, array $options = [])
{
$options = array_replace([
'create' => true,
'display' => true
], $options);
if ($msg !== "&nbsp;") {
$options['message'] = $msg;
}
$options['message'] = $msg;

if (!$options['display']) {
return self::progressBar('doaction_progress', $options);
Expand Down
2 changes: 1 addition & 1 deletion src/Software.php
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ public function merge($item, $html = true)
// language=Twig
echo TemplateRenderer::getInstance()->renderFromStringTemplate(<<<TWIG
{% import 'components/form/fields_macros.html.twig' as fields %}
<div class='text-center'>
<div class="text-center">
{{ fields.htmlField('', progress, merge_msg) }}
</div>
TWIG, $twig_params);
Expand Down
5 changes: 3 additions & 2 deletions src/SoftwareVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ public function showForm($ID, array $options = [])
{% if item.isNewItem() %}
<input type="hidden" name="softwares_id" value="{{ softwares_id }}">
{% endif %}
{{ fields.htmlField('', get_item_link('Software', softwares_id), 'Software'|itemtype_name(1)) }}
{{ fields.htmlField('', get_item_link('Software', softwares_id), 'Software'|itemtype_name()) }}
{{ parent() }}
{{ fields.dropdownField('OperatingSystem', 'operatingsystems_id', item.fields['operatingsystems_id'], 'OperatingSystem'|itemtype_name(1)) }}
{{ fields.dropdownField('OperatingSystem', 'operatingsystems_id', item.fields['operatingsystems_id'], 'OperatingSystem'|itemtype_name()) }}
{% endblock %}
TWIG, $twig_params);
return true;
Expand Down Expand Up @@ -358,6 +358,7 @@ public static function showForSoftware(Software $soft)
],
'formatters' => [
'version' => 'raw_html',
'comments' => 'raw_html',
],
'footers' => [
['', '', '', __('Total'), $tot, '']
Expand Down

0 comments on commit 97a1b12

Please sign in to comment.