Skip to content

Feature/5874#977

Open
v-dumas wants to merge 7 commits into
developfrom
feature/5874
Open

Feature/5874#977
v-dumas wants to merge 7 commits into
developfrom
feature/5874

Conversation

@v-dumas

@v-dumas v-dumas commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Base information

Question Answer
Related to a Combodo ticket? N°5874 - Quick create: improvement for newcomer
Type of change? Enhancement

Objective (enhancement)

User videos of the SaaS platform showed that the initial use of the "Quick create" button was not intuitive.

When starting out, no default value is suggested, and it is unclear what needs to be typed...

Opening the drop-down menu is extremely difficult because the cursor remains in text-insertion mode, making it hard to target the small "down" arrow.

Proposed solution (bug and enhancement)

Rename the "Recent" section to "Most Popular" (consistent with the "Most Relevant" search criteria).
Change the cursor that appears over the small arrow (which opens the drop-down menu) to a pointer or a finger—something indicating a click—rather than the text-input cursor.
Ensure the classes offered to a new user are relevant: Not the first classes in alphabetical order, but the most popular ones (classes with the "popular" category in the data model).

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance
  • I have added a unit test, otherwise I have explained why I couldn't
  • Is the PR clear and detailed enough so anyone can understand without digging in the code?

Change description of parameters and functions
Add comments in twig for clarity
Add default popular category to UserRequest and FunctionalCI classes
Add comments to tests for clarity
Add comments to tests for clarity
Add comments to tests for clarity
Add setUp and tearDown methods on tests
Add classes on history and popular sections
Hide Popular section when empty
Copilot AI review requested due to automatic review settings July 21, 2026 08:37
@v-dumas v-dumas self-assigned this Jul 21, 2026
@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a “Most popular” section to Quick Create. The main changes are:

  • New configuration for popular and recent result limits.
  • Popular categories on selected data-model classes.
  • Permission-filtered popular-class links with recent-item de-duplication.
  • Updated Quick Create rendering and translations.
  • Unit tests for popular and recent class handling.

Confidence Score: 4/5

The new popular-class path needs fixes before merging: it exposes an abstract creation target and loses the selected class code.

  • Selecting FunctionalCI can open creation for a non-instantiable class.
  • Popular links render an empty or undefined data-class-code.
  • Permission filtering and dependency compatibility otherwise appear consistent with the surrounding code.

datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml; templates/base/components/quick-create/layout.html.twig

Important Files Changed

Filename Overview
sources/Application/UI/Base/Component/QuickCreate/QuickCreateHelper.php Adds permission-filtered popular-class discovery, result limiting, and recent-item de-duplication.
templates/base/components/quick-create/layout.html.twig Renders popular classes but assigns their links an undefined class-code value.
datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml Marks the abstract FunctionalCI class as a popular creation target.
tests/php-unit-tests/unitary-tests/sources/Application/UI/Base/Components/QuickCreate/QuickCreateHelperTest.php Tests popular-class retrieval and removal of classes already present in recent history.
tests/php-unit-tests/composer.lock Refreshes the PHPUnit dependency tree consistently with the repository PHP requirement.

Reviews (1): Last reviewed commit: "N° 5874 - Quick create: improvement for ..." | Re-trigger Greptile

Comment thread datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml
</div>
<div class="ibo-quick-create--compartment-content ibo-quick-create--popular-classes--content" data-role="ibo-quick-create--compartment-content">
{% for aClass in oUIBlock.GetPopularClasses() %}
<a href="{{ aClass.target_url }}" class="ibo-quick-create--compartment-element" data-role="ibo-quick-create--compartment-element" data-class-code="{{ aQuery.class }}">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Popular Links Lose Class Code

The popular loop defines aClass, but this attribute reads aQuery.class. Each new popular link therefore receives an undefined or empty data-class-code, so code that identifies the selected class from this attribute receives the wrong value.

Suggested change
<a href="{{ aClass.target_url }}" class="ibo-quick-create--compartment-element" data-role="ibo-quick-create--compartment-element" data-class-code="{{ aQuery.class }}">
<a href="{{ aClass.target_url }}" class="ibo-quick-create--compartment-element" data-role="ibo-quick-create--compartment-element" data-class-code="{{ aClass.class }}">

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves Quick Create by adding commonly used object classes as default suggestions.

Changes:

  • Adds rights-aware “Most Popular” class suggestions and configuration.
  • Marks FunctionalCI and UserRequest as popular.
  • Adds UI rendering, translations, and unit tests.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/php-unit-tests/unitary-tests/sources/Application/UI/Base/Components/QuickCreate/QuickCreateHelperTest.php Tests popular/recent filtering.
tests/php-unit-tests/composer.lock Upgrades PHPUnit dependencies.
templates/base/components/quick-create/layout.html.twig Renders popular classes.
sources/Application/UI/Base/Component/QuickCreate/QuickCreateHelper.php Builds popular class entries.
sources/Application/UI/Base/Component/QuickCreate/QuickCreate.php Exposes popular classes and limits.
dictionaries/ui/components/quick-create/zh_cn.dictionary.itop.quick-create.php Adds Chinese label.
dictionaries/ui/components/quick-create/tr.dictionary.itop.quick-create.php Adds Turkish fallback label.
dictionaries/ui/components/quick-create/sk.dictionary.itop.quick-create.php Adds Slovak fallback label.
dictionaries/ui/components/quick-create/ru.dictionary.itop.quick-create.php Adds Russian label.
dictionaries/ui/components/quick-create/pt_br.dictionary.itop.quick-create.php Adds Portuguese label.
dictionaries/ui/components/quick-create/pl.dictionary.itop.quick-create.php Adds Polish label.
dictionaries/ui/components/quick-create/nl.dictionary.itop.quick-create.php Adds Dutch label.
dictionaries/ui/components/quick-create/ja.dictionary.itop.quick-create.php Adds Japanese fallback label.
dictionaries/ui/components/quick-create/it.dictionary.itop.quick-create.php Adds Italian label.
dictionaries/ui/components/quick-create/hu.dictionary.itop.quick-create.php Adds Hungarian label.
dictionaries/ui/components/quick-create/fr.dictionary.itop.quick-create.php Adds French label.
dictionaries/ui/components/quick-create/es_cr.dictionary.itop.quick-create.php Adds Spanish label.
dictionaries/ui/components/quick-create/en.dictionary.itop.quick-create.php Adds English label.
dictionaries/ui/components/quick-create/en_gb.dictionary.itop.quick-create.php Adds British English label.
dictionaries/ui/components/quick-create/de.dictionary.itop.quick-create.php Adds German label.
dictionaries/ui/components/quick-create/da.dictionary.itop.quick-create.php Adds Danish fallback label.
dictionaries/ui/components/quick-create/cs.dictionary.itop.quick-create.php Adds Czech label.
datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml Marks UserRequest as popular.
datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml Marks ITIL UserRequest as popular.
datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml Marks FunctionalCI as popular.
core/config.class.inc.php Configures popular and history limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +143 to +149
// Prevent classes in both Popular and Recent to appear twice
for($iIdx = 0; $iIdx < count($aHistoryEntries); $iIdx++)
{
if (($key = array_search($aHistoryEntries[$iIdx]['class'], $aPopularClassesNames)) !== false) {
unset($aPopularClassesNames[$key]);
}
}
$aPopularClasses = QuickCreateHelper::GetPopularClasses();
$this->AssertPopularClassesMatches(['FunctionalCI'], $aPopularClasses, "");
}
private function GivenRecentClasses(array $aGivenClasses)
</div>
<div class="ibo-quick-create--compartment-title" data-role="ibo-quick-create--compartment-title">
{# History section #}
<div class="ibo-quick-create--compartment-title ibo-quick-create--history-classes--title" data-role="ibo-quick-create--compartment-title">
</div>
{# Popular classes section #}
{% if oUIBlock.GetPopularClasses()|length > 0 %}
<div class="ibo-quick-create--compartment-title ibo-quick-create--popular-classes--title" data-role="ibo-quick-create--compartment-title">
Comment on lines +150 to +151
//die(var_dump($aPopularClassesNames));
static::Truncate($aPopularClassesNames, 'quick_create.max_popular_results');
}

/**
* @see $aMaxPopularClasses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants