Skip to content

N°9418 - Add colors on UserRequest request type in Simple Ticket#862

Open
v-dumas wants to merge 1 commit intodevelopfrom
feature/9418-color-request-type
Open

N°9418 - Add colors on UserRequest request type in Simple Ticket#862
v-dumas wants to merge 1 commit intodevelopfrom
feature/9418-color-request-type

Conversation

@v-dumas
Copy link
Copy Markdown
Contributor

@v-dumas v-dumas commented Mar 30, 2026

Base information

Question Answer
Related to a SourceForge thread / Another PR / Combodo ticket?
Type of change? Enhancement

Symptom (bug) / Objective (enhancement)

Put colors on User request field "request type" in Simple Ticket mode

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 digging in the code?

Checklist of things to do before PR is ready to merge

  • ...
  • ...
  • ...

@v-dumas v-dumas self-assigned this Mar 30, 2026
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Mar 30, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR adds visual styling (colors and icons) to the request_type enum field (incident and service_request) on the UserRequest class, specifically to improve the Simple Ticket display. The approach follows the existing pattern already used by status and priority enum fields in the same class — each value receives a <rank>, a <main_color>, a <complementary_color>, and a <decoration_classes> icon. The CSS variable references ($ibo-lifecycle-failure-state-* and $ibo-lifecycle-neutral-state-*) are already in use elsewhere in this same file, so no new theme variables are introduced.

Key findings:

  • The color semantic choices are reasonable: "incident" maps to failure/red tones (fas fa-exclamation) and "service_request" maps to neutral tones (fas fa-list-ul), consistent with how other alarm-style values are colored across the codebase.
  • <sort_type>rank</sort_type> is missing from the request_type field definition; without it the newly added <rank> elements will not affect the ordering of the dropdown values.
  • No <default_style> block has been added despite is_null_allowed=true and an empty default_value; the analogous status and priority fields in this class both carry a <default_style>, so its absence here may result in an unstyled badge when the field value is null.

Confidence Score: 5/5

Safe to merge; both remaining findings are style/completeness suggestions that do not break existing behavior.

All findings are P2. The color and icon additions are straightforward and follow the established pattern in the codebase. The missing sort_type means ranks are inert (same as pre-PR behavior), and the missing default_style only affects null-value rendering which was already unstyled before this change. Neither issue introduces a regression.

datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml — consider adding <sort_type>rank</sort_type> to the field definition and a <default_style> block.

Important Files Changed

Filename Overview
datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml Added rank and style blocks (color + icon) to the incident and service_request enum values of the request_type field; missing <sort_type>rank</sort_type> on the field definition and no <default_style> for the nullable field.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[UserRequest object] --> B{request_type value}
    B -->|incident| C[rank=10
failure-state colors
fas fa-exclamation]
    B -->|service_request| D[rank=20
neutral-state colors
fas fa-list-ul]
    B -->|null / empty| E[No default_style defined
⚠️ potentially unstyled]
    C --> F[Badge rendered in UI]
    D --> F
    E --> G[Fallback rendering
undefined behavior]
Loading

Reviews (1): Last reviewed commit: "N°9418 - Add colors on UserRequest reque..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants