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

workspace: add file search #212

Merged
merged 6 commits into from
Jan 14, 2022

Conversation

mvidalgarcia
Copy link
Member

@mvidalgarcia mvidalgarcia commented Jan 12, 2022

closes #211
closes #204

Screen.Recording.2022-01-12.at.4.38.11.PM.mov

Test:

  • To be tested thoroughly rebuilding the REANA-UI docker image as it involves a change in the Node.js version.

@mvidalgarcia mvidalgarcia force-pushed the workspace-search branch 2 times, most recently from b12aa83 to e9ea0f5 Compare January 12, 2022 16:18
@mvidalgarcia mvidalgarcia marked this pull request as ready for review January 12, 2022 16:25
Copy link
Member

@audrium audrium left a comment

Choose a reason for hiding this comment

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

Nice work, everything works as expected without any issues!

  • I think we could update the readme with yarn install instead of npm install. Since we have yarn.lock and package-lock.json it could be confusing which one we should use?
  • Search bar placeholder text is hard to read since the color is barely different from the background if not focused. If it's the same for you, we could create a mini issue and to fix it later?

return async (dispatch) => {
dispatch({ type: WORKFLOW_FILES_FETCH });
const nameSearch = search ? JSON.stringify({ name: [search] }) : search;
Copy link
Member

Choose a reason for hiding this comment

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

Very minor suggestion: since we have the same logic in line 246, we could extract it into a small function

Copy link
Member Author

Choose a reason for hiding this comment

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

I've created a util function and added some basic tests as this is very likely to change in the future if e.g. we want to support multiple-term search ("Search for both roofit and snakemake terms")

@@ -2,20 +2,20 @@
-*- coding: utf-8 -*-

This file is part of REANA.
Copyright (C) 2020 CERN.
Copyright (C) 2020, 2021, 2022 CERN.
Copy link
Member

Choose a reason for hiding this comment

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

Very minor: copyright year was not updated in most of the other touched files

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, thanks!

Did you manage to find a nice way to keep this updated in VSCode?

Copy link
Member

Choose a reason for hiding this comment

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

Not yet, is seems there are no extensions which would do exactly this task in VSCode unfortunately. However there are extensions like 'Run on Save' which could trigger custom task like this after saving a file, but I haven't tried to implement it.

@@ -3,11 +3,11 @@
"version": "0.8.0",
"private": true,
"dependencies": {
"axios": "latest",
"axios": "^0.24.0",
Copy link
Member

Choose a reason for hiding this comment

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

Nice to see this! 👍

@mvidalgarcia
Copy link
Member Author

* I think we could update the `readme` with `yarn install` instead of `npm install`. Since we have `yarn.lock` and `package-lock.json` it could be confusing which one we should use?

Good catch, done in a new commit!

* Search bar placeholder text is hard to read since the color is barely different from the background if not focused. If it's the same for you, we could create a mini issue and to fix it later?

Mmm it's true that is very light but I still can see it. This is the default color, check SUI-React Input. I've created a new commit making it a bit darker, let me know what you think.

@audrium
Copy link
Member

audrium commented Jan 13, 2022

Mmm it's true that is very light but I still can see it. This is the default color, check SUI-React Input. I've created a new commit making it a bit darker, let me know what you think.

That was quick! Thanks, it looks way better now I think

* @param {String} term Search term
* @returns term format expected by the API.
*/
export function parseSearch(term) {
Copy link
Member

Choose a reason for hiding this comment

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

Minor question about the naming. Does this function really parses search input term? As I understand it produces a query param, so this function call could be misleading to someone. Perhaps getSearchParam or something like that would be more meaningful? WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I wasn't very sure either, I followed other function naming but the logic is not really the same. getSearchParam is a bit better but I'm still not convinced, maybe encodeSearch?

Copy link
Member

Choose a reason for hiding this comment

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

One of the hardest problems in CS..
encodeSearch sounds nice to me! Though it might be mixed with encoding of strings. Another solution would be simply formatSearch?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough 👍

mvidalgarcia and others added 6 commits January 14, 2022 10:03
- Extract out common `Search` component
- Add search param to workspace endpoint

closes reanahub#211
- Upgrade `node-sass` package, responsible of some vulnerabilites
listed in https://github.com/reanahub/reana-ui/security/dependabot
- Use `yarn` instead of `npm`, as this is what we use to build the
production docker image.
@mvidalgarcia mvidalgarcia merged commit 2406b62 into reanahub:master Jan 14, 2022
@mvidalgarcia mvidalgarcia deleted the workspace-search branch January 14, 2022 09:50
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.

ui: workspace file filtering package: bump all module versions
3 participants