Skip to content
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

Decoupling tabs in the experiment page and display them after validating #375

Open
wants to merge 40 commits into
base: develop
Choose a base branch
from
Open
Changes from 5 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f0677d3
Initial commit on decoupling tabs in the experiment page
upendrakumbham Dec 12, 2023
a21e6ee
Merge branch 'develop' into bugfix/decouple-experiment-page-tabs-and-…
upendrakumbham Dec 12, 2023
7a48932
Add multiple ternary conditional operator
upendrakumbham Jan 9, 2024
a071970
Merge branch 'develop' into bugfix/decouple-experiment-page-tabs-and-…
upendrakumbham Jan 9, 2024
aa55ced
Improved version of code after a tweak of tab conditions
upendrakumbham Jan 17, 2024
585972d
Add fubctions to validate tabs and it's props
upendrakumbham Jan 30, 2024
25ef163
Remove compilation errors and improve functions
upendrakumbham Feb 2, 2024
13e7ee2
Remove unused code and improve function
upendrakumbham Feb 9, 2024
532389c
remove hardcode strings and reuse code
upendrakumbham Feb 19, 2024
1f9aa46
Add tabtype 'resources' conditional check
upendrakumbham Feb 19, 2024
2c05e1a
Add empty object check and null, undefined function and update tab va…
upendrakumbham Feb 19, 2024
ca946ac
Fix camel casing in the function
upendrakumbham Feb 19, 2024
ea37496
Initiate tabTypeComponent = []; before return statement to clear data
upendrakumbham Jun 6, 2024
fcaab7c
Remove log messages
upendrakumbham Jun 6, 2024
05d2fb2
Improved code by removing if, else conditions & removed redundant code
upendrakumbham Jun 7, 2024
35bceb9
Merge branch 'develop' into bugfix/decouple-experiment-page-tabs-and-…
upendrakumbham Jun 7, 2024
99088cf
Move all helper functions to tabConfig.js file as part of ExperiemntP…
upendrakumbham Jun 10, 2024
b1cf7e5
Move PropTypes to propTypes.js file as part of ExperiemntPageRouter.j…
upendrakumbham Jun 10, 2024
5eaf719
Improved file
upendrakumbham Jun 10, 2024
dcf06f8
Add validation fields (common & specific)for the tabs
upendrakumbham Jun 26, 2024
e84663d
Add validations for tabs and common props
upendrakumbham Sep 4, 2024
08588ac
Remove renamed file
upendrakumbham Sep 4, 2024
bef7792
Merge branch 'develop' into bugfix/decouple-experiment-page-tabs-and-…
upendrakumbham Sep 4, 2024
a60205f
result tab validations
upendrakumbham Sep 4, 2024
53c0ce8
conflict resolved html demo page update
upendrakumbham Sep 4, 2024
7189295
add a suggesterEndpoint validation to the result tab
upendrakumbham Sep 5, 2024
d4179e1
add experiment-design tab validations
upendrakumbham Sep 5, 2024
4d3abc1
Add validation attributes to the 'Supplementary-information' and 'Dow…
upendrakumbham Sep 5, 2024
bf01724
Common validations code improvements
upendrakumbham Sep 6, 2024
21731ac
Add inner tab validations and make it result tab enablement depends o…
upendrakumbham Sep 9, 2024
865c176
Update TabConfig
upendrakumbham Sep 9, 2024
fea148e
Refactor a function name
upendrakumbham Sep 9, 2024
707dd79
Improve cell plots tab validations function
upendrakumbham Sep 9, 2024
0473eeb
Improve cell plots tab and marker genes tab validations
upendrakumbham Sep 9, 2024
a690dfc
Add backend ksWithMarkerGenes attribute payload for the marker genes …
upendrakumbham Sep 9, 2024
4ef6772
Remove console.log messages and ; to make code consistent
upendrakumbham Sep 10, 2024
10a0f14
Made code format changes to make code consitent
upendrakumbham Sep 10, 2024
76ed29e
Delete propTypes.js file
upendrakumbham Sep 11, 2024
f9a1240
Refactor variable name
upendrakumbham Sep 11, 2024
2887bfb
Merge branch 'develop' into bugfix/decouple-experiment-page-tabs-and-…
upendrakumbham Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ const TabCommonPropTypes = {
}

// What component each tab type should render, coupled to ExperimentController.java
const tabTypeComponent = {
'results' : TSnePlotViewRoute,
'experiment-design' : ExperimentDesignRoute,
'supplementary-information' : SupplementaryInformationRoute,
'downloads' : DownloadsRoute
}
let tabTypeComponent = []


const TopRibbon = ({tabs, routeProps}) =>
<ul className={`tabs`}>
{
tabs.map((tab) =>
<li title={tab.name} key={tab.type} className={`tabs-title`}>
{
tab.type === 'results' && Array.isArray(tab.props.ks) ? console.log("result1 **************", tabTypeComponent.push({'results' : TSnePlotViewRoute})) :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@upendrakumbham Could you clean this code please? We are watching Uncle Bob's Clean Code videos to apply his teaching in our every day coding.
I would like you to find yourself why this code is not clean and I would like you to change it. It is not that hard.
If you struggle with it, then please ping me and I can help, but I would really like to see that you can do it yourself.
Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per @lingyun1010 review comment, I have created JS functions to validate tabs and it's props.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review and provide comments

tab.type === 'experiment-design' && Array.isArray(tab.props.table.data) ? console.log("result2 **************",tabTypeComponent.push({'experiment-design' : ExperimentDesignRoute})) :
tab.type === 'supplementary-information' && Array.isArray(tab.props.sections) ? console.log("result3 **************", tabTypeComponent.push({'supplementary-information' : SupplementaryInformationRoute})) :
tab.type === 'resources'&& Array.isArray(tab.props.data)? console.log('result4********', tabTypeComponent.push({'resources' : DownloadsRoute})): ""
}
<NavLink to={{pathname:`/${tab.type}`, search: routeProps.location.search, hash: routeProps.location.hash}}
activeClassName={`active`}>
{tab.name}
Expand Down
Loading