Skip to content

Conversation

@Amantini1997
Copy link
Contributor

@Amantini1997 Amantini1997 commented Apr 7, 2025

This fixes #5486

Description

The order of ticket properties was affecting the conditional colour of pins.
Using useWatch was not enough as that relied on the "registered" fields. Calling "useForm.reset" was unregistering and reregistering the fields, and useWatch was not catching the value upon registration

Test cases

Setup

Create a template that includes pins with conditional (configurable) colour and make sure to have some of them rendered before the conditional property, and some after. A valid template, for instance, could include the following:

  • default pin (which colour depends on property "Pin condition")
  • "Pin condition" property (which is part of the properties module)
  • another conditional pin (defined after "Pin Condition")
(If you already have it, you may use the template "Pins With color (custom property)". Otherwise, feel free to use the following template:
{
  "code": "CO2",
  "name": "Pins With color (custom property) [duplicate]",
  "config": {
    "pin": {
      "icon": "DEFAULT",
      "color": {
        "property": {
          "name": "Pin Condition"
        },
        "mapping": [
          {
            "default": [
              124,
              124,
              124
            ]
          },
          {
            "value": "Low",
            "color": [
              0,
              255,
              0
            ]
          },
          {
            "value": "Medium",
            "color": [
              255,
              255,
              0
            ]
          },
          {
            "value": "High",
            "color": [
              255,
              0,
              0
            ]
          }
        ]
      }
    }
  },
  "properties": [
    {
      "name": "Pin Condition",
      "type": "oneOf",
      "values": [
        "None",
        "Low",
        "Medium",
        "High"
      ],
      "default": "None"
    },
    {
      "type": "coords",
      "icon": "DEFAULT",
      "color": {
        "property": {
          "name": "Pin Condition"
        },
        "mapping": [
          {
            "default": [
              124,
              124,
              124
            ]
          },
          {
            "value": "Low",
            "color": [
              0,
              255,
              0
            ]
          },
          {
            "value": "Medium",
            "color": [
              255,
              255,
              0
            ]
          },
          {
            "value": "High",
            "color": [
              255,
              0,
              0
            ]
          }
        ]
      },
      "name": "Conditional Pin"
    }
  ],
  "modules": [
    {
      "properties": [
        {
          "type": "coords",
          "icon": "DEFAULT",
          "color": {
            "property": {
              "name": "Pin Condition"
            },
            "mapping": [
              {
                "default": [
                  124,
                  124,
                  124
                ]
              },
              {
                "value": "Low",
                "color": [
                  0,
                  255,
                  0
                ]
              },
              {
                "value": "Medium",
                "color": [
                  255,
                  255,
                  0
                ]
              },
              {
                "value": "High",
                "color": [
                  255,
                  0,
                  0
                ]
              }
            ]
          },
          "name": "Conditional Pin"
        }
      ],
      "name": "Additional pins"
    }
  ]
}

Next create 2 tickets (A and B) and set the pin condition value to something such that the conditional pins will display a colour which is not the default one (in the template provided above, the gray colour is the default one)

test cases

  • Test1
  • open up the viewer
  • open the tickets card
  • open up ticket A

The conditional pins should all display the right colour, as per the conditional pin property

  • Test 2
  • open up the viewer
  • open the tickets card
  • open up ticket A
  • refresh the page

The conditional pins should all display the right colour, as per the conditional pin property

  • Test 3
  • open up the viewer
  • open the tickets card
  • open up ticket A
  • (using the arrows located on the card header) reach ticket B;
  • (again using those arrows) reach ticket A

The conditional pins should all display the right colour, as per the conditional pin property, both in ticket A and ticket B, at all time

Bug reports

@sanmont3drepo sanmont3drepo requested a review from carmenfan April 7, 2025 14:55
@Amantini1997 Amantini1997 changed the title ISSUE #5486 - ncorrect pin colour until you click into the new ticket ISSUE #5486 - Incorrect pin colour until you click into the new ticket Apr 7, 2025
@carmenfan
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Didi-Kwan-Asite-3DRepo
Copy link

Didi-Kwan-Asite-3DRepo commented Apr 8, 2025

Bug Report 5486-001
Existing ticket pin colour changed to teal after triggered ticket template related to pin colouring.
01-WrongColour
Conditional Pins also changed to grey.
01-ConditionalPin

@Didi-Kwan-Asite-3DRepo
Copy link

Didi-Kwan-Asite-3DRepo commented Apr 8, 2025

Bug Report 5486-003
Deselect the ticket by clicking outside the Tickets card does not deselect the pin.
According to Issue and Risk behaviour, It should deselect the pin and ticket only when clicking the card.

oggi.mp4

@Didi-Kwan-Asite-3DRepo
Copy link

Didi-Kwan-Asite-3DRepo commented Apr 8, 2025

Bug Report 5486-004
All pins colour changed after triggered All Default Properties template.

oggi.mp4

@Didi-Kwan-Asite-3DRepo
Copy link

Didi-Kwan-Asite-3DRepo commented Apr 8, 2025

moved to #5491 (comment)

@Didi-Kwan-Asite-3DRepo
Copy link

Didi-Kwan-Asite-3DRepo commented Apr 8, 2025

moved to #5491 (comment)

@carmenfan
Copy link
Member

@Amantini1997 would this be related to this? https://github.com/3drepo/3D-Repo-Product-Team/issues/669

Do we expect this to be resolved as part of this issue? if not, how much more work would it be?

@Didi-Kwan-Asite-3DRepo
Copy link

Didi-Kwan-Asite-3DRepo commented Apr 8, 2025

moved to #5491 (review)

@Didi-Kwan-Asite-3DRepo
Copy link

Didi-Kwan-Asite-3DRepo commented Apr 8, 2025

moved to #5491 (review)

Copy link

@Didi-Kwan-Asite-3DRepo Didi-Kwan-Asite-3DRepo left a comment

Choose a reason for hiding this comment

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

Round 1 Testing Done

@Amantini1997
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link

@Didi-Kwan-Asite-3DRepo Didi-Kwan-Asite-3DRepo left a comment

Choose a reason for hiding this comment

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

Round 2 Testing complete. All bug fixed. It's good to go now :) Here is the test summary report with bug report inside.
https://asitesol-my.sharepoint.com/:x:/g/personal/ylokkwan_asite_com/EeOdJM8yBrBIvf14rqkGL7QBiCG08UiMFKZBpcbnz_RbAw?e=IFuWHk

@carmenfan carmenfan removed their request for review April 11, 2025 14:43
@carmenfan carmenfan merged commit 8f0c00e into master Apr 11, 2025
22 of 28 checks passed
@carmenfan carmenfan deleted the ISSUE_5486 branch April 11, 2025 14:43
@carmenfan carmenfan removed their assignment Apr 15, 2025
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.

Incorrect pin colour until you click into the new ticket

5 participants