webtrees icon indicating copy to clipboard operation
webtrees copied to clipboard

Update PlacesModule.php

Open arbor95 opened this issue 1 year ago • 4 comments

change the color of the icon on map for birth and christening of the selected individuum to red.

arbor95 avatar Jun 21 '24 16:06 arbor95

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 33.85%. Comparing base (f8d2a25) to head (dccf224).

Files Patch % Lines
app/Module/PlacesModule.php 0.00% 5 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4999      +/-   ##
============================================
- Coverage     33.85%   33.85%   -0.01%     
- Complexity    11399    11400       +1     
============================================
  Files          1178     1178              
  Lines         47558    47561       +3     
============================================
  Hits          16103    16103              
- Misses        31455    31458       +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 21 '24 16:06 codecov[bot]

hi Greg perhaps you can help resolving the unsuccessful checks. thanks Franz

arbor95 avatar Jun 21 '24 16:06 arbor95

The code-check is complaining that you have elseif at the start of a line. It should be on the previous line, after the }.

Would this be a simpler approach? It makes it easy to modify all the icons for the individual.

    protected const OWN_ICONS = [
        'INDI:BIRT' => ['color' => 'red', 'name' => 'baby-carriage fas'],
        'INDI:CHR'  => ['color' => 'red', 'name' => 'water fas'],
    ] + self::ICONS;

                $icons = $fact->record() === $indi ? static::OWN_ICONS : static::ICONS;
                        'icon'    => $icons[$fact->tag()] ?? static::DEFAULT_ICON,

fisharebest avatar Jun 26 '24 16:06 fisharebest

what to do to handle the remaining unsuccessful check?

arbor95 avatar Jun 26 '24 19:06 arbor95

How to handle: Added line #L153 was not covered by tests and the others "Added line"

arbor95 avatar Jul 03 '24 22:07 arbor95

How to handle: Added line #L153 was not covered by tests and the others "Added line"

You can ignore this.

It says that there are no tests that use these lines of the code.

But none of this module has any tests yet.

fisharebest avatar Jul 08 '24 21:07 fisharebest

Thanks!

fisharebest avatar Jul 08 '24 21:07 fisharebest