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

Add/remove view UI #359

Merged
merged 16 commits into from
Jul 23, 2024
Merged

Add/remove view UI #359

merged 16 commits into from
Jul 23, 2024

Conversation

sanghoonio
Copy link
Member

Adding views from filtered sample tables works, but the view selector in projects has a bug as of a couple weeks ago and doesn't actually filter the handsontable. The views themselves are good though. You can create a view from dev_sam with a filtered sample table, then git checkout 83e7fe and choose the view you created to display the correctly filtered rows.

@sanghoonio sanghoonio requested a review from nleroy917 July 23, 2024 18:19
@sanghoonio sanghoonio merged commit 3f781a9 into dev Jul 23, 2024
1 check passed
@@ -3,9 +3,11 @@ import { OverlayTrigger, Tooltip } from 'react-bootstrap';
import { useProjectPageView } from '../../hooks/stores/useProjectPageView';
import { ViewSelector } from '../project/view-selector';

type PageView = 'samples' | 'subsamples' | 'config';
type PageView = 'samples' | 'subsamples' | 'config' | 'help';
Copy link
Member

Choose a reason for hiding this comment

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

Do we think we are going to remove this?

Comment on lines +109 to +119
<div className={pageView === 'help' ? 'border-0 px-1 h-100 text-muted bg-white shadow-sm' : 'px-1 h-100'}>
<ViewButton
view="help"
setPageView={setPageView}
icon="bi bi-question-circle-fill me-2"
text="Help"
isDirty={false}
bold={pageView === 'help' ? ' fw-normal' : ' fw-light'}
color={pageView === 'help' ? ' text-dark' : ' text-muted'}
/>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Do we think we will still keep this?

web/src/components/tables/sample-table.tsx Show resolved Hide resolved
Comment on lines +51 to +56
useEffect(() => {
if (projectConfigQuery.data?.config) {
const index = extractSampleTableIndex(projectConfigQuery.data.config);
setSampleTableIndex(index);
}
}, [projectConfigQuery.data]);
Copy link
Member

Choose a reason for hiding this comment

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

You might be able to get away without an effect here.

Just something like:

const sampleTableIndex = projectConfigQuery ? extractSampleTableIndex(projectConfigQuery.data.config) : 'sample_name';

Copy link
Member

Choose a reason for hiding this comment

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

I try to avoid useEffect at all costs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants