Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set any agent query combo box to the current user's agent #3994

Open
grantfitzsimmons opened this issue Sep 9, 2023 · 3 comments · May be fixed by #6037
Open

Add ability to set any agent query combo box to the current user's agent #3994

grantfitzsimmons opened this issue Sep 9, 2023 · 3 comments · May be fixed by #6037
Labels
1 - Enhancement Improvements or extensions to existing behavior 2 - Forms Issues that are related to the form system good first issue
Milestone

Comments

@grantfitzsimmons
Copy link
Member

In my preparationproperty form, I need the agent qrycbox to have a default value (the person who logged in).

​The only query combo box which can be set to the currently logged-in user is the cataloger field. Here is the specific piece of code that sets the cataloger field to the current logged-in user's agent:

React.useEffect(() => {
if (resource === undefined || !resource.isNew()) return;
if (field.name === 'cataloger') {
const record = toTable(resource, 'CollectionObject');
record?.set(
'cataloger',
record?.get('cataloger') ?? userInformation.agent.resource_uri,

Unfortunately, since it is hard-coded to only work for the cataloger field, it cannot be used for other fields.

Requested By: Willem at SAIAB

@grantfitzsimmons grantfitzsimmons added 1 - Request A request made by a member of the community 2 - Forms Issues that are related to the form system labels Sep 9, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Front-End Backlog Sep 9, 2023
@realVinayak
Copy link
Contributor

Good first issue. Not particularly hard to expand that.

@maxpatiiuk
Copy link
Member

If I remember, support for default values for query combo boxes was added in 7.7, but broke along the way - need to fix that anyway as there are use cases
Then default value can be either a record ID (since we know the table, just ID is sufficient) or a record API url or one of the special value i.e CURRENT_USER (just an example), like what @realVinayak implemented in the query builder that resolves to current user (if you decide to support special value, make sure it's consistent with what's used in the query builder)

@bronwyncombs
Copy link

Ohio Mollusks has requested this for their preparedByAgent and geoRefDetBy fields

@sharadsw sharadsw added this to the 7.9.x milestone Jun 13, 2024
@grantfitzsimmons grantfitzsimmons added 1 - Enhancement Improvements or extensions to existing behavior and removed 1 - Request A request made by a member of the community labels Dec 20, 2024
@alesan99 alesan99 linked a pull request Jan 3, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Enhancement Improvements or extensions to existing behavior 2 - Forms Issues that are related to the form system good first issue
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

5 participants