motrpac-frontend

所属分类:生物医药技术
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2023-07-21 14:45:50
上 传 者sh-1993
说明:  MoTrPAC生物信息中心的用户界面和前端,
(User interface and Frontend for MoTrPAC Bioinformatics Center,)

文件列表:
.circleci/ (0, 2020-05-01)
.circleci/config.yml (1310, 2020-05-01)
.eslintrc.js (534, 2020-05-01)
.storybook/ (0, 2020-05-01)
.storybook/addons.js (86, 2020-05-01)
.storybook/config.js (420, 2020-05-01)
.storybook/preview-head.html (87, 2020-05-01)
LICENSE (1057, 2020-05-01)
package.json (1970, 2020-05-01)
public/ (0, 2020-05-01)
public/MoTrPAC_horizontal.png (96971, 2020-05-01)
public/favicon.ico (3870, 2020-05-01)
public/favicon_MoTrPAC.ico (15406, 2020-05-01)
public/index.html (3191, 2020-05-01)
public/logo-motrpac-preview.png (129714, 2020-05-01)
public/manifest.json (335, 2020-05-01)
src/ (0, 2020-05-01)
src/AnalysisPage/ (0, 2020-05-01)
src/AnalysisPage/__test__/ (0, 2020-05-01)
src/AnalysisPage/__test__/analysisHomePage.stories.jsx (2497, 2020-05-01)
src/AnalysisPage/__test__/analysisHomePage.test.jsx (5503, 2020-05-01)
src/AnalysisPage/__test__/analysisReducer.test.js (1590, 2020-05-01)
src/AnalysisPage/__test__/animalPhenotypeData.stories.jsx (322, 2020-05-01)
src/AnalysisPage/__test__/animalPhenotypeData.test.jsx (1147, 2020-05-01)
src/AnalysisPage/analysisHomePage.jsx (8435, 2020-05-01)
src/AnalysisPage/analysisReducer.js (1279, 2020-05-01)
src/AnalysisPage/animalDataAnalysis.jsx (480, 2020-05-01)
src/AnalysisPage/animalPhenotypeData.jsx (18661, 2020-05-01)
src/AnalysisPage/humanDataAnalysis.jsx (487, 2020-05-01)
src/AnalysisPage/humanGeneMetaAnalysis.jsx (8243, 2020-05-01)
src/AnnouncementsPage/ (0, 2020-05-01)
src/AnnouncementsPage/__tets__/ (0, 2020-05-01)
src/AnnouncementsPage/__tets__/announcementsPage.stories.jsx (886, 2020-05-01)
src/AnnouncementsPage/announcements.json (2678, 2020-05-01)
src/AnnouncementsPage/announcementsPage.jsx (3477, 2020-05-01)
src/App.css (468, 2020-05-01)
src/App/ (0, 2020-05-01)
src/App/App.jsx (3351, 2020-05-01)
... ...

[![MoTrPAC Data Hub](https://github.com/src/assets/logo-motrpac.png)](https://github.comhttps://motrpac-data.org) **User interface and Frontend for MoTrPAC Bioinformatics Center** --- [![CircleCI](https://github.comhttps://circleci.com/gh/AshleyLab/motrpac-frontend.svg?style=svg)](https://github.comhttps://circleci.com/gh/AshleyLab/motrpac-frontend) [![Sauce Test Status](https://github.comhttps://saucelabs.com/buildstatus/motrpac-developers)](https://github.comhttps://app.saucelabs.com/u/motrpac-developers) ### Directory Layout and Setup #### File Structure . ├── src │ ├── assets: images, logos, etc. │ ├── components: jsx UI components │ ├── lib: static information like team member names and assay lists │ ├── main.css: Compiled from sass/main.sass │ ├── sass: source sass styling │ ├── storybook.test.js: initialize snapshots for storybook tests │ ├── storybookSnapshotInit.Skiptest.js: rename Skiptest to test to include snapshot testing │ ├── testData: Mock data used in stories and tests │ └── \[Component/Feature Name\]: contains reducers, actions, components, subcomponents, and tests │ | └── \_\_test\_\_: contains the storybook story and jest tests for the feature. ├── public ├── .storybook: configuration for storybook ├── .eslintrc.js: ESlint configuration ├── .stylelint.config.js: StyleLint configurations for Sass Linting . #### Flow for creating new components 1. Create \[component\].jsx file in src/\[Component\] 2. Create storybook snapshots file src/\[Component\]/\_\_test\_\_/\[component\].stories.jsx 3. Create tests in src/\[Component\]/\_\_test\_\_/\[component\].test.jsx 4. Integrate required actions and reducers in to the components directory (ex. for upload handling logic that would be src/UploadPage/uploadReducer.js) 5. If it is a full page, add routing logic to src/App/App.jsx #### Building and running * Running React App: - `yarn start` - runs core React app at localhost:3000 * Running Storybook: - `yarn run storybook` - runs storybook server at localhost:9009 * Testing: - `yarn test` - runs tests and storybook snapshots - `yarn test --coverage` - runs all tests and returns table illustrating code coverage * Building CSS: Uses sass in node_modules/sass/sass.js - `yarn sass` - compiles sass from src/sass/main.scss to src/main.css - `yarn sass-watch` - compiles sass from src/sass/main.scss to src/main.css and watches for changes * Quickly inspect someone's branch: - `yarn inspect-branch` - compiles Scss, rebuilds node_modules if different, and starts react app ### Software versions and styles #### Software: * [Node v10](https://github.comhttps://github.com/nodejs/Release) - Check your version: `node --version` - If the version is not 10, you can `brew install node@10` or use [nvm](https://github.comhttps://github.com/creationix/nvm/blob/master/README.md#installation), the Node Version Manager * [React v16](https://github.comhttps://reactjs.org/versions) - Storybook used to visualize individual UI components * Style guide: - [Eslint](https://github.comhttps://github.com/eslint/eslint) - [Airbnb JavaScript Style Guide](https://github.comhttps://github.com/airbnb/javascript) - [Style Lint Recommended SCSS Guide](https://github.comhttps://github.com/stylelint/stylelint-config-recommended) ### Additional Notes #### Testing meta tags - localtunnel used to serve react app with command `lt --port 3000` after running the app using `yarn start` in a seperate terminal - url from localtunnel used to test in [Twitter Card Validator](https://github.comhttps://cards-dev.twitter.com/validator) and the [Facebook Sharing Debugger](https://github.comhttps://developers.facebook.com/tools/debug/sharing/) - `%PUBLIC_URL%` evaluates to nothing if the application is running on the dev server so the images which require absolute urls may not display #### Notes on redux integration - Components that need to be linked to a redux store in implementation are exported by default as connected functions/containers. They are also exported in pure function form (ex: "import { UploadScreen } from 'path/to/component' " for pure function and "import UploadScreen from 'path/to/component'" for container). - mapStateToProps used to link the section from the combined reducer to properties required by the container - mapDispatchtoProps defines required actions and what to send to a reducer. - redux-thunk middleware used to handle asynchronous requests like for authentication #### Potential down the line dependency issues - Storybook has trouble integrating with react-router, I installed a package called storybook-react-router to make them work together. If you run in to an issue with storybook saying something like "You should not use outside " it has something to do with react-router and storybook-react-router #### Current navigation/routing implementation - React-router is being used to handle routing - history ( createBrowserHistory ) is used to update location from button clicks and function calls ( history.push('path/to/new/location') ) - \< Link > tags from react-router are used in place of \< a > tags handle navigation from links. Certain elements return \< Redirect to="path/to/new/location" > elements if protected and user not authenticated. - Analysis page only uses routing to differentiate between human and analysis (/analysis/human or /analysis/animal). After that it acts as a single page application. #### Download Page Behavior - Makes call to backend for a list of uploads (size depending maxRows variable) on a given page. Expects backend to give total count of uploads fitting filters and the uploads for a specific page. (e.g on page 2, with 10 rows per page, expects items 11-20 from backend and a count of all rows that fit current filters) - Changing filters should also call backend #### Samir's Flow for Creating Custom Font Icons 1. Create a 200px by 200px artboard in Adobe Illustrator 2. Draw Icon and export artboard as SVG (make sure only one color -- white counts as a color but transparent does not) 3. Upload all icons to [IcoMoon](https://github.comhttps://icomoon.io/app/#/select) 4. Download and unzip resultant zipped file 5. Copy contents of the fonts folder (icomoon.eot, icomoon.woff, icomoon.svg, icomoon.tff) and place them in the src/assets/fonts folder overwriting the previous file. - Make sure you upload ALL custom icons to icomoon so that previously created icons are still accessible --- Cross-browser Testing Platform and Open Source provided by [Sauce Labs][homepage] [homepage]: https://saucelabs.com

近期下载者

相关文件


收藏者