-
Notifications
You must be signed in to change notification settings - Fork 0
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
57 - Clean up the no longer used resources and functions #61
base: dev
Are you sure you want to change the base?
Conversation
…tActions and its test (we handles the params for search using the search maanger and search page - will create a test for it in refinebio-web)
…geDataset (not reuired sorting when merging dataset object)
…djust the codebase (for the sample debug page which is no longer used)
…d update their corresponding test
…debug page) and remove the filter action (not reequired)
… which was removed from refinebio-web but it will used in a seprate internal application in the future)
Could you help me understand why this PR seems to depart from the docs? It looks like the "listing" response has been moved into the Per the docs:
|
The Based on our current implementation of the
And the For this reason, for instance, I simpified the organism resource and its test by removing the For the search resource, we still use the Please let me know your thoughts on this @davidsmejia 💬 |
Yeah I see what you mean that it is currently possible to do that. The I am open to considering renaming get/filter to something else but the distinction between these functionalities is important to preserve. |
Given that this is a JS API client and that the Perhaps, we can use the term
👍 I am open to different approaches/ideas as well and to improve this API client 💡 and any recommended resources are welcome (I found an article on Python API and ORMs (with Django) but was too broad)! |
This is not This is just convention, but the goal of creating something like refinebio-js is that people are not concerned with the underlying networking requests and can think of things more directly as objects / collections of objects. Here are some examples of what I would expect to have a function named for what it does.
Here is the section of the docs that shows its not a 1:1 correspondence of HTTP verb and function name.
|
The term
In the refinebio-js's README, we initially defined the
Let's chat on the above actions and how we can improve them. In the meantime, let me know if you want me to revise the commit 02cc53f back for now, thank you @davidsmejia ! |
Ok so sounds like its just the name that is tripping you up. I am sure we can find a reasonable alternative. Please do roll back that commit for now and we can discuss in another issue. Just a reminder this is not just for the FE but is just a javascript implementation of an API client that is modeled after a variation of CRUD. CRUDL - which is the same thing but with List as a separate action. To be fair I always call "CRUDL" "CRUD" because that listing action is sort of assumed. The benefit is that when calling what we currently call The idea is that one would use the read action on the detail page, so a FE example would be when you present a single experiment like Ping me when that is rolled back and I will review then, thank you! |
…list of resources)
Not only the naming but also the usability, since we plan to use this client API for developing web UI. The key responsibilities of our refinebio web app are currently the following;
For the samples table, we currently do the following operations:
Currently, when the FE requests the samples (for samples table) via the BE API, the BE returns a single server response which includes the // no result { "count": 0, ... "results: [] } // a single sample { "count": 1, ... "results: [{"id":..."}] } // multiple samples { "count": 3 ... "results: [{"id":..."}, {"id":..."}, {"id":..."} ] , } Technically, whether we used the Also if we decide to introduce CRUDList in refinebio-web, it requires codebase adjustments which differs from the standard REST API web UI development (in terms of naming and UI rendering in FE etc) and we'll need to discuss about that as well. Perhaps we should re-target the main audience of the refinebio-js tool. I reverted back the previous commit (f16c224), thank you @davidsmejia ! |
Please revert the changes on everything in the resources folder. The removal of filtering from |
@davidsmejia So we should open a separate PR for the resource folder for the updates (I only ask because on 1:1, we already chatted about this issue that includes the resource folder)? |
@nozomione, please update this PR in response to this comment:
I'd break the resources part of #57 out into a new ticket for @davidsmejia's review. Thank you. |
@jaclyn-taroni completed, thank you! @davidsmejia I revised back the updates for the resources. Regarding the Although I reverted back 287e32b, please let me know if it's okay to include the auto-generated |
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.
Looking good, just had a couple concerns
} else { | ||
newObj[key] = isObject(source[key]) ? deepCopy(source[key]) : source[key] | ||
} | ||
newObj[key] = isObject(source[key]) ? deepCopy(source[key]) : source[key] |
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.
newObj[key] = isObject(source[key]) ? deepCopy(source[key]) : source[key] | |
newObj[key] = isObject(source[key]) || isArray(source[key]) ? deepCopy(source[key]) : source[key] |
It looks to me that if a value is an array we would return the reference. We should probably create a copy here.
I think another approach to this function would to have a base state of an atomic type (not object or array), and then recursively handle objects and arrays.
set setA(v) { | ||
this.a = v | ||
} | ||
c: [1, 2, 3, 4, 5] |
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.
This test could be improved by adding another array inside of c and then testing if their reference is the same.
expect(output.c[output.c.length - 1]).not.toBe(input.c[input.c.length - 1])
import { urlSearchParamsFromKeys } from 'utils/urlSearchParamsFromKeys' | ||
|
||
export const getAPIUrl = ({ path, verbose }, endpoint = '', query = {}) => { | ||
export const getAPIUrl = ({ path, verbose }, endpoint = '') => { |
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.
This signature no longer matches how it is used in src/utils/makeRequest
Issue Number
Closing #57
Purpose/Implementation Notes
Cleaned up the no longer used resources and helper functions and its corresponding test, and adjusted the codbase.
Types of changes
Functional tests
List out the functional tests you've completed to verify your changes work locally.
Checklist