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

User select in UI feature #1385

Merged
merged 3 commits into from
Jun 30, 2023
Merged

User select in UI feature #1385

merged 3 commits into from
Jun 30, 2023

Conversation

PiTrem
Copy link
Member

@PiTrem PiTrem commented Jun 29, 2023

Unify user-find-by-name api endpoint:

  • remove duplicated endpoint in admin api
  • extract option-formatting from components to a utility function
  • user api endpoint to also use simple user entity

resolve #1384

desc 'Find top (5) matched user by name and by type'
params do
requires :name, type: String, desc: 'user name'
optional :type, type: Array[String], desc: 'user types',

Choose a reason for hiding this comment

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

Style/RedundantArrayConstructor: Remove the redundant Array constructor.

@@ -5,14 +5,14 @@ class UserAPI < Grape::API
desc 'Find top 3 matched user names'
params do
requires :name, type: String
optional :type, type: Array[String], desc: 'user types',

Choose a reason for hiding this comment

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

Style/RedundantArrayConstructor: Remove the redundant Array constructor.

it 'returns a response with an array of people' do
expect(parsed_json_response['users']).to include(person_obj)
end
end

Choose a reason for hiding this comment

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

RSpec/EmptyLineAfterExampleGroup: Add an empty line after describe.

adapt corresponding non admin endpoint to use user simple entity
@PiTrem PiTrem force-pushed the user-select-in-ui-feature branch from df27243 to a8c3fec Compare June 29, 2023 18:13
@github-actions
Copy link

LCOV of commit a8c3fec during Continuous Integration #1211

Summary coverage rate:
  lines......: 60.9% (12481 of 20481 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

Copy link
Contributor

@FabianMauz FabianMauz left a comment

Choose a reason for hiding this comment

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

Looks good to me except for one maybe bug. Lets have a talk about it.

app/api/chemotion/user_api.rb Show resolved Hide resolved
app/api/chemotion/user_api.rb Show resolved Hide resolved
app/packs/src/fetchers/AdminFetcher.js Outdated Show resolved Hide resolved
app/packs/src/utilities/selectHelper.js Outdated Show resolved Hide resolved
@PiTrem PiTrem force-pushed the user-select-in-ui-feature branch from 7a2d5bf to 0c09a07 Compare June 30, 2023 12:13
@github-actions
Copy link

LCOV of commit 0c09a07 during Continuous Integration #1217

Summary coverage rate:
  lines......: 59.4% (12267 of 20659 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

Copy link
Contributor

@FabianMauz FabianMauz left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -186,7 +186,7 @@ export default class AdminFetcher {
}

static fetchUsersByNameType(name, type, limit = 5) {
return fetch(`/api/v1/admin_user/listUsers/byname.json?type=${type}&name=${name}&limit=${limit}`, {
return fetch(`/api/v1/admin_user/listUsers/byname.json?${new URLSearchParams({ name, type, limit })}`, {
Copy link
Contributor

Choose a reason for hiding this comment

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

cool, if naming the variable as the parameter makes it may more easier

@PiTrem PiTrem merged commit 3e894cf into main Jun 30, 2023
2 of 3 checks passed
PiTrem added a commit that referenced this pull request Jul 7, 2023
* remove duplicated admin api endpoint

also adapt equivalent non admin endpoint to use user simple entity

* extract react select option formatting to utility function

* remove deprecated fetcher
mekkyz pushed a commit that referenced this pull request Sep 21, 2023
* remove duplicated admin api endpoint

also adapt equivalent non admin endpoint to use user simple entity

* extract react select option formatting to utility function

* remove deprecated fetcher
baolanlequang pushed a commit that referenced this pull request Mar 5, 2024
* remove duplicated admin api endpoint

also adapt equivalent non admin endpoint to use user simple entity

* extract react select option formatting to utility function

* remove deprecated fetcher
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.

user select in Admin-UI feature to display full user info
2 participants