Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Sidebar component. Also tweak RemoveIcon props and do some CSS module conversions. * Add MetadataEditor and SampleDetailsSidebar and backend endpoints. Also tweak the API of some base ui components. * Fix issue where some filters in PipelineSampleReport aren't working right. Change Dropdown so first value isn't displayed even when it's not selected. Change Dropdown so Menu is 100% width by default. Fix bug where Dropdowns in MetadataEditor weren't working due to setState behavior. * Check if metadata changed before saving. * Fix some proptypes errors while I'm at it.
- Loading branch information
1 parent
87b60b4
commit 119e2c5
Showing
41 changed files
with
587 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// TODO(mark): Split this file up as more API methods get added. | ||
import axios from "axios"; | ||
|
||
const postWithCSRF = async (url, params) => { | ||
const resp = await axios.post(url, { | ||
...params, | ||
// Fetch the CSRF token from the DOM. | ||
authenticity_token: document.getElementsByName("csrf-token")[0].content | ||
}); | ||
|
||
// Just return the data. | ||
// resp also contains headers, status, etc. that we might use later. | ||
return resp.data; | ||
}; | ||
|
||
const get = async url => { | ||
const resp = await axios.get(url); | ||
|
||
return resp.data; | ||
}; | ||
|
||
const getSampleMetadata = id => get(`/samples/${id}/metadata`); | ||
|
||
const saveSampleMetadata = (id, field, value) => | ||
postWithCSRF(`/samples/${id}/save_metadata_v2`, { | ||
field, | ||
value | ||
}); | ||
|
||
const getMetadataTypes = () => get("/samples/metadata_types"); | ||
|
||
export { getSampleMetadata, saveSampleMetadata, getMetadataTypes }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.