-
Notifications
You must be signed in to change notification settings - Fork 33
workspace: add file search #212
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
Changes from all commits
7278a50
1d46494
030eca0
a6b1f1c
42163b4
2406b62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:12 as react-build | ||
FROM node:16 as react-build | ||
WORKDIR /code | ||
COPY . /code | ||
# hadolint ignore=DL3003 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,31 +2,43 @@ | |
-*- coding: utf-8 -*- | ||
|
||
This file is part of REANA. | ||
Copyright (C) 2020 CERN. | ||
Copyright (C) 2020, 2021, 2022 CERN. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
REANA is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
*/ | ||
|
||
import PropTypes from "prop-types"; | ||
|
||
import { unstable_batchedUpdates } from "react-dom"; | ||
import { Input } from "semantic-ui-react"; | ||
import debounce from "lodash/debounce"; | ||
|
||
import styles from "./Search.module.scss"; | ||
|
||
const TYPING_DELAY = 1000; | ||
|
||
export default function WorkflowSearch({ search }) { | ||
export default function Search({ search }) { | ||
const handleChange = debounce(search, TYPING_DELAY); | ||
return ( | ||
<Input | ||
fluid | ||
icon="search" | ||
placeholder="Search..." | ||
className={styles.input} | ||
onChange={(_, data) => handleChange(data.value)} | ||
/> | ||
); | ||
} | ||
|
||
WorkflowSearch.propTypes = { | ||
Search.propTypes = { | ||
search: PropTypes.func.isRequired, | ||
}; | ||
|
||
export const applyFilter = (filter, pagination, setPagination) => (value) => { | ||
// FIXME: refactor once implemented by default in future versions of React | ||
// https://github.com/facebook/react/issues/16387#issuecomment-521623662c | ||
unstable_batchedUpdates(() => { | ||
filter(value); | ||
setPagination({ ...pagination, page: 1 }); | ||
}); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
-*- coding: utf-8 -*- | ||
|
||
This file is part of REANA. | ||
Copyright (C) 2022 CERN. | ||
|
||
REANA is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
*/ | ||
|
||
@import "@palette"; | ||
|
||
:global(.ui.input).input { | ||
:global(input)::placeholder { | ||
color: $gray; | ||
} | ||
|
||
:global(input):focus::placeholder { | ||
color: darken($gray, 30%); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see this! 👍