ChRIS_store_ui
ChRIS_store_ui copied to clipboard
Sorting of plugin search results
https://github.com/FNNDSC/ChRIS_store_ui/blob/ca45de40784ddb979445252c3d71c05bc3699b50/src/components/Plugins/Plugins.js#L218
Some sorts could be:
- alphabetical, by author
- alphabetical, by name
- chronological, by date created
Can I work on this one @jennydaman?
@jennydaman, I'm trying to resolve conflicts but my code isn't passing these 2 tests. I didn't change any code related to them. I've checking what's wrong and updated my branch to be inline with the master before fixing plugin sort.
I've also checked if the "mark as favorite" functionality on plugins store website is working but it's not - was it working before?
Try these commands:
git remote add upstream [email protected]:FNNDSC/ChRIS_store_ui.git
git fetch upstream
git diff upstream/master
I found the bug:
diff --git a/src/components/Plugins/Plugins.js b/src/components/Plugins/Plugins.js
index a157f49..e5e2b45 100755
--- a/src/components/Plugins/Plugins.js
+++ b/src/components/Plugins/Plugins.js
@@ -113,20 +114,23 @@ export class Plugins extends Component {
}
}
- fetchPlugins = () => {
- const params = new URLSearchParams(window.location.search)
- const name = params.get('q') //get value searched from the URL
+ fetchPlugins() {
+ const params = new URLSearchParams(window.location.search);
+ const name = params.get("q"); //get value searched from the URL
+
const searchParams = {
limit: 20,
offset: 0,
name_title_category:name,
- };
+ }
+
Notice the declaration of fetchPlugins
was changed. This is an oddity with syntax. If a function is defined as fetchPlugins() {
, this
will be undefined unless you manually "bind" it.
Notice the declaration of
fetchPlugins
was changed. This is an oddity with syntax. If a function is defined asfetchPlugins() {
,this
will be undefined unless you manually "bind" it.
Thanks for that @jennydaman. What about the starsByPlugin
test?
@sonylomo all tests are passing on https://github.com/sonylomo/ChRIS_store_ui/commit/b154b309e04425a781d0a8f59aa033f665388d45
Yeah, I spotted the problem with the tests. Everything is ok now.
I've closed the other PR because I deleted that forked repo 😁.