Only show number of installs if non-zero

Created on 12 July 2024, 2 months ago
Updated 14 August 2024, about 1 month ago

Problem/Motivation

Recipes do not really have a concept of "number of active installs" and I don't think we'll necessarily have a way to record installs for general projects, if that's what they end up being on d.o.

Proposed resolution

I think it makes sense to solve this issue by only showing the number of installs if it's non-zero, at least for now.

I think this can easily be handled with a Svelte if statement:
https://git.drupalcode.org/project/project_browser/-/blob/2.0.x/sveltejs...

📌 Task
Status

Needs work

Version

2.0

Component

User experience

Created by

🇺🇸United States chrisfromredfin Portland, Maine

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @chrisfromredfin
  • Assigned to Sourav_Paul
  • Issue was unassigned.
  • Status changed to Needs review about 2 months ago
  • 🇮🇳India Sourav_Paul Kolkata

    Please review the MR.

  • Pipeline finished with Success
    about 2 months ago
    Total: 475s
    #238277
  • 🇮🇳India snehal-chibde

    Hello @sourav_paul, I have reproduced the issue successfully.
    I have tested MR 557 on the Drupal 10.3.1 version, Module version 2.0.x-dev.
    The MR is applied cleanly.

    Test Result:
    If a recipe has 0 installs, no span is added with text as '0 installs' which was appearing before.
    Added a before and after screenshot of the same.

    Moving this to review state.

  • Status changed to RTBC about 1 month ago
  • Status changed to Needs work about 1 month ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Merge conflict in the generated file, needs to be re-compiled.

    Shouldn't the IF statement only work on recipes? I would imagine for regular modules/themes it's valid to know there are 0 installs.

  • 🇮🇳India Prashant.c Dharamshala

    @BramDriesen

    Currently, I think the recipes are being fetched from the local directory only which is core/recipes and if that is the case then the number of installs would be either 1 or 0, which will not make sense in my opinion.

    Therefore I think it a good idea to not show this section at all in case of Recipes.

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Therefore I think it a good idea to not show this section at all in case of Recipes.

    Yes sure, but I don't see that distinction being made in the code changes. I only see a counter check if 0 to hide it, meaning in my eyes this is for everything and not only recipes.

  • 🇺🇸United States chrisfromredfin Portland, Maine

    I actually would prefer that the behavior be the same across all, not just for recipes.

Production build 0.71.5 2024