Skip to content

Minor UI issue: Resource lock indicator ("Resource locked while it updates") persists when switching resources until page refresh #4590

@JC-wk

Description

@JC-wk

Describe the bug
When viewing a resource that is currently locked (shows "Resource locked while it updates") and then switching to a different resource that is not locked, the lock indicator remains visible. The indicator only disappears after a full page refresh.

To Reproduce
Steps to reproduce the behavior:

  1. Edit a resource so that it shows the "Resource locked while it updates" message.
  2. Without refreshing the page, switch to another resource that is not locked.
  3. Observe that the lock indicator is still shown for the new resource, even though it is not locked.

Expected behavior
The lock indicator should only be shown for resources that are actually locked. When switching to a resource that is not locked, the indicator should disappear immediately.

Technical details

  • The UI uses a componentAction state (from the useComponentManager hook) to control whether the lock indicator is shown.
  • When switching between resources, the componentAction value is not reset. If the previous resource was locked, the new resource will incorrectly inherit the Lock state until a page refresh.
  • This happens because the latestUpdate state in useComponentManager is not reset when the resource prop changes. As a result, the lock indicator persists even if the new resource is not locked.
  • A fix would be to reset componentAction to ComponentAction.None whenever the resource changes, ensuring the lock indicator is only shown for the correct resource.

Screenshots

Video

Desktop:

  • OS: Windows 11
  • Browser: Edge & Chrome
  • Version: 137

Additional context
A page refresh clears the indicator, so this appears to be a UI state management issue.


Azure TRE release version (e.g. v0.14.0 or main):
23.0

Deployed Azure TRE components - click the (i) in the UI:
UI Version:
0.8.7
API Version:
0.24.2
Cosmos DB:
OK
Service Bus:
OK
Resource Processor:
OK

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions