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

mass navigation misc options are shown on right #2601

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 2 additions & 17 deletions client/mass/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ function setRenderers(self) {
.style('vertical-align', 'top')
.style('margin', '10px')
.style('display', 'inline-block')
.style('float', 'right')
self.opts.holder.attr('class', 'sjpp-nav')
self.dom = {
holder: self.opts.holder,
Expand Down Expand Up @@ -232,17 +233,6 @@ function setRenderers(self) {
title: 'Delete all plots. To revert, click Undo button'
})

if (appState.nav.header_mode == 'only_buttons') {
// may retire this?
self.dom.tabDiv.style('display', 'none')
self.dom.recoverDiv.style('display', 'none')
titleDiv.style('margin-top', '95px').style('font-size', '0.9em')
if (massNav?.title?.link)
titleDiv
.on('click', () => window.open(massNav.title?.link, '_blank'))
.on('mouseover', () => titleDiv.style('cursor', 'pointer'))
}

if (self.opts.header_mode === 'with_cohortHtmlSelect') {
// not part of filter div
self.dom.cohortStandaloneDiv = header
Expand Down Expand Up @@ -426,12 +416,7 @@ function setRenderers(self) {
}
const selectCohort = self.state.termdbConfig.selectCohort
const massNav = self.state.termdbConfig.massNav
self.dom.searchDiv.style(
'display',
(selectCohort && self.activeCohort == -1) || self.state.nav.header_mode == 'only_buttons'
? 'none'
: 'inline-block'
)
self.dom.searchDiv.style('display', selectCohort && self.activeCohort == -1 ? 'none' : 'inline-block')
//self.dom.holder.style('margin-bottom', self.state.nav.header_mode === 'with_tabs' ? '20px' : '')//To be checked why it was needed
self.dom.header.style('border-bottom', self.state.nav.header_mode === 'with_tabs' ? '1px solid #000' : '')
self.dom.tds
Expand Down
5 changes: 1 addition & 4 deletions client/mass/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ class MassSearch {

async main() {
// show/hide search input from the tree
this.dom.holder.style(
'display',
this.state.search.isVisible && this.state.nav.header_mode != 'only_buttons' ? 'inline-block' : 'none'
)
this.dom.holder.style('display', this.state.search.isVisible ? 'inline-block' : 'none')
}

async doSearch(str) {
Expand Down
1 change: 0 additions & 1 deletion client/mass/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const navHeaderModes = new Set([
'hidden', // no header
'search_only', // ?
'hide_search', // ?
'only_buttons', // show only chart buttons and hide the tabs and search, to tailor header appearance for some ds
'with_cohortHtmlSelect' // only show cohort toggle as <select>
])

Expand Down
2 changes: 1 addition & 1 deletion client/mass/types/mass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type MassNav = {
activeTab: number
/** -1: unselected, 0,1,2...: selected */
activeCohort: number
header_mode: 'only_buttons' | 'with_tabs' | 'search_only' | 'hidden' | 'hide_search' | 'with_cohortHtmlSelect'
header_mode: 'with_tabs' | 'search_only' | 'hidden' | 'hide_search' | 'with_cohortHtmlSelect'
}

export type PlotConfig = {
Expand Down
1 change: 0 additions & 1 deletion server/dataset/termdb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default {
isMds3: true,
cohort: {
massNav: {
title: { text: '' }, //it will show cohorts instead
tabs: {
// about: {
// hide: true,
Expand Down
3 changes: 0 additions & 3 deletions shared/types/src/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1291,9 +1291,6 @@ export type Cohort = {

/** Customizations specific to the mass nav component */
type MassNav = {
/** optional title of this ds, if missing use ds.label. shown on mass nav header.
* use blank string to not to show a label*/
title?: Title
/** Customization for the tabs*/
tabs?: {
/** supported keys: about, charts, groups, filter
Expand Down