Skip to content

Conversation

@JohnVillalovos
Copy link
Contributor

@JohnVillalovos JohnVillalovos commented Jul 30, 2025

Optional feature, that when changing the contact of a resource in the
Web UI, the contact must be chosen from a list of users on the system.

This is enabled via:
$conf['settings']['resource.contact.is.user'] = 'true';

Copilot AI review requested due to automatic review settings July 30, 2025 15:10
@JohnVillalovos JohnVillalovos marked this pull request as draft July 30, 2025 15:10

This comment was marked as outdated.

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/contact_select branch 3 times, most recently from e58a89a to e304fc0 Compare July 30, 2025 16:54
@JohnVillalovos JohnVillalovos requested a review from Copilot July 30, 2025 16:56
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/contact_select branch from e304fc0 to 621d7d1 Compare July 30, 2025 16:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to allow resource contacts to be selected from a dropdown list of registered users instead of free-form text entry. This provides better data validation and consistency for resource contact information.

  • Added a configuration option to enable/disable user-based contact selection
  • Modified the UI to show a dropdown for user selection when the feature is enabled
  • Created a new autocomplete endpoint for user selection with formatted display

Reviewed Changes

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

Show a summary per file
File Description
tpl/Admin/Resources/manage_resources.tpl Updates the contact field to conditionally use dropdown selection based on configuration
lib/Config/ConfigKeys.php Adds new configuration key for enabling user-based contact selection
config/config.dist.php Adds default configuration setting for the new feature
config/config.devel.php Adds development configuration setting for the new feature
Pages/Ajax/AutoCompletePage.php Implements new autocomplete endpoint for user selection with formatted output
Pages/Admin/ManageResourcesPage.php Sets template variable based on configuration to control UI behavior
Comments suppressed due to low confidence (2)

Pages/Ajax/AutoCompletePage.php:194

  • The class name 'XAutocompleteUser' is unclear. The 'X' prefix doesn't convey meaningful information about its purpose. Consider renaming to something more descriptive like 'FormattedAutocompleteUser' or 'AutocompleteUserOption'.
class XAutocompleteUser

Pages/Ajax/AutoCompletePage.php:233

  • The constant name 'XUser' is unclear. The 'X' prefix doesn't convey meaningful information about its purpose. Consider renaming to something more descriptive like 'FormattedUser' to indicate it returns formatted user data.
    public const XUser = 'xuser';

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/contact_select branch from 621d7d1 to 92933ca Compare July 30, 2025 16:57
@JohnVillalovos JohnVillalovos marked this pull request as ready for review July 30, 2025 16:57
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/contact_select branch 2 times, most recently from d352578 to 032c4ba Compare July 30, 2025 17:06
@JohnVillalovos JohnVillalovos changed the title feat: resource contact is now chosen via a drop-down list of users feat: optional: resource contact may be chosen via a drop-down list of users Jul 30, 2025
…f users

Optional feature, that when changing the contact of a resource in the
Web UI, the contact must be chosen from a list of users on the system.

This is enabled via:
    $conf['settings']['resource.contact.is.user'] = 'true';
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/contact_select branch from 032c4ba to 2e5055d Compare July 30, 2025 17:07
@JohnVillalovos JohnVillalovos merged commit dcff109 into develop Jul 30, 2025
11 checks passed
@JohnVillalovos JohnVillalovos deleted the jlvillal/contact_select branch July 30, 2025 17:31
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.

2 participants