From 84fa834c847b73b26395251e7d355a29aa6507d5 Mon Sep 17 00:00:00 2001 From: syarnes-ufl <242444798+syarnes-ufl@users.noreply.github.com> Date: Mon, 16 Nov 2026 08:46:28 -0600 Subject: [PATCH 1/3] [BI-3101] Keep table headers and horizontal scrollbars on screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tables in ExpandableTable, SidePanelTableBuefy and SidePanelTable (BaseTable) now scroll inside a box capped to the space left in the window (BoundedTableMixin), with the header pinned below the main header. Opt out with :bounded="false", as the MultipleErrors modal does. - A result count above each table, e.g. "Showing 1–200 of 2,802 observation units" or "Showing all ...". - The box returns to its first row on page, page size, sort or filter change. - A floating horizontal scrollbar at the bottom of the window while the box's own is out of view, and scrollbars that stay drawn on macOS. - Page controls pin to the bottom of the window while the box is on screen but they are below it, with the same 12px gap under the scrollbar in either place. The experiment page's description and fields move into a collapsible "Experiment details" box, with Manage Experiment beside the title, and the dataset summary fits on one line with thousands separators. Co-Authored-By: Claude Opus 5.5 --- src/assets/scss/main.scss | 175 ++++++++++++ .../model/view_models/TableResultRange.ts | 64 +++++ src/components/admin/AdminProgramsTable.vue | 2 + src/components/admin/AdminUsersTable.vue | 2 + .../ExperimentsObservationsTable.vue | 2 + src/components/file-import/MultipleErrors.vue | 3 + .../germplasm/GermplasmGenotypeView.vue | 2 + .../germplasm/GermplasmListsTable.vue | 2 + src/components/germplasm/GermplasmTable.vue | 1 + .../observations/ObservationsListTable.vue | 2 + src/components/ontology/OntologyTable.vue | 2 + .../program/ProgramLocationsTable.vue | 2 + src/components/program/ProgramUsersTable.vue | 2 + src/components/tables/BaseTable.vue | 79 +++--- src/components/tables/FloatingScrollbar.vue | 166 +++++++++++ src/components/tables/SidePanelTable.vue | 33 ++- src/components/tables/SidePanelTableBuefy.vue | 50 +++- src/components/tables/TableResultCount.vue | 63 +++++ .../expandableTable/ExpandableTable.vue | 51 +++- src/mixins/BoundedTableMixin.ts | 258 ++++++++++++++++++ .../ExperimentDetails.vue | 169 ++++++++---- src/views/genotyping/Genotyping.vue | 2 + src/views/germplasm/BreedingMethods.vue | 2 + src/views/import/Dataset.vue | 32 +-- src/views/import/ImportExperiment.vue | 2 + src/views/import/ImportGermplasm.vue | 1 + src/views/import/ImportSample.vue | 2 + src/views/program/JobManagement.vue | 2 + src/views/sample-mgmt/SampleManagement.vue | 2 + src/views/sample-mgmt/SubmissionDetails.vue | 2 + 30 files changed, 1047 insertions(+), 130 deletions(-) create mode 100644 src/breeding-insight/model/view_models/TableResultRange.ts create mode 100644 src/components/tables/FloatingScrollbar.vue create mode 100644 src/components/tables/TableResultCount.vue create mode 100644 src/mixins/BoundedTableMixin.ts diff --git a/src/assets/scss/main.scss b/src/assets/scss/main.scss index 7830f4d0a..3bd39a62c 100644 --- a/src/assets/scss/main.scss +++ b/src/assets/scss/main.scss @@ -527,6 +527,119 @@ table tr.is-edited + .detail { min-height: 100px; } +// Scrollbars that are always drawn. macOS (and Windows 11 by default) show overlay scrollbars only +// while scrolling, which hides that a table scrolls sideways from mouse users. Chrome, Edge and Safari +// draw these; Firefox keeps its own. Keep the size in step with MIN_BAR_HEIGHT_PX in FloatingScrollbar. +// Setting scrollbar-width or scrollbar-color here would make Chrome ignore these rules. +@mixin visible-scrollbars { + &::-webkit-scrollbar { + width: 12px; + height: 12px; + } + + &::-webkit-scrollbar-track, + &::-webkit-scrollbar-corner { + background-color: $white-ter; + } + + &::-webkit-scrollbar-thumb { + background-color: $grey-light; + border: 3px solid $white-ter; + border-radius: 6px; + + &:hover { + background-color: $grey; + } + } +} + +// Tables taller than the window scroll inside a box (sized by BoundedTableMixin) so the header row and +// horizontal scrollbar stay on screen. Shorter tables look the same as unbounded ones. +.bounded-table { + .table-wrapper.has-sticky-header, + .bounded-table-scroll { + // Buefy gives a sticky-header wrapper a fixed 300px height: cap the height instead. + height: auto; + max-height: var(--bounded-table-max-height, calc(100vh - 10rem)); + overflow: auto; + @include visible-scrollbars; + + // Collapsed borders belong to the table rather than the pinned header cells, so rows would show + // through them while scrolling. Bulma only draws bottom borders, so this looks the same. + > .table { + border-collapse: separate; + border-spacing: 0; + } + + // The box scrolls on any overflow, so keep content that used to spill harmlessly past the table + // inside it: Buefy's sort arrow sits just past its label, and the empty message's Bulma columns + // have negative margins. + thead th:last-child .th-wrap { + padding-right: 1rem; + } + + tr.is-empty > td { + overflow: hidden; + } + } + + // Pin the whole header, including the column filter row, not only Buefy's first header row. + // Its z-index stays below the sticky .main-header (30). + .table-wrapper.has-sticky-header thead, + .bounded-table-scroll thead { + position: sticky; + top: 0; + z-index: 2; + + th, + td { + background-color: $white; + } + } + + // The gap above the page controls is theirs rather than the box's, so it stays the same whether + // they sit under the box or BoundedTableMixin has pinned them to the bottom of the window under the + // floating scrollbar. Pinning must not change their size, so the pinned edge is a shadow, not a border. + .table-wrapper.has-sticky-header:not(:last-child) { + margin-bottom: 0; + } + + // Covers the rows the controls pass over while pinned: above the pinned header (2), below the + // sticky .main-header (30). + .bounded-table-controls { + position: relative; + z-index: 20; + padding-top: 0.75rem; + background-color: $white; + + &.is-pinned { + box-shadow: inset 0 1px 0 $grey-lighter; + } + } +} + +.table-result-count { + margin-bottom: 0.5rem; +} + +// Stand-in for a bounded table's horizontal scrollbar while the box's own is below the window +// (FloatingScrollbar), just above any pinned page controls. Above the table's pinned header (2), +// below the sticky .main-header (30). +.floating-scrollbar { + position: fixed; + bottom: 0; + z-index: 20; + overflow-x: auto; + overflow-y: hidden; + background-color: $white; + border-top: 1px solid $grey-lighter; + @include visible-scrollbars; + + > div { + height: 1px; + } +} + .menu-scroll { position: absolute; height: 100%; @@ -920,6 +1033,68 @@ tr:nth-child(odd) td.db-filled { } } +// An experiment's description and fields, in a box whose header collapses it to bring the +// datasets up. The header and body set their own padding so the header's hover fills the box. +.experiment-details { + padding: 0; + margin-bottom: 1.5rem; + // Flat, like the tabs, table and dataset summary around it. + border: 1px solid $grey-lighter; + box-shadow: none; +} + +// A dataset's figures on one line above its table. +.dataset-summary { + display: flex; + flex-wrap: wrap; + column-gap: 2.5rem; + row-gap: 0.25rem; +} + +.experiment-details-toggle { + display: flex; + align-items: center; + gap: 0.5rem; + width: 100%; + padding: 0.75rem 1.25rem; + border: none; + border-radius: inherit; + background: none; + // Link blue, as DeltaBreed marks text actions. + color: $link; + font: inherit; + font-weight: $weight-bold; + text-align: left; + cursor: pointer; + + &:hover { + background-color: $white-ter; + } + + &:focus-visible { + outline: 2px solid $link; + outline-offset: -2px; + } +} + +.experiment-details-body { + padding: 1rem 1.25rem 0.5rem; + border-top: 1px solid $grey-lighter; + + // Line the fields up with the description. + ul { + margin-left: 0; + } +} + +// At a readable line length; long citations carry unbroken URLs. +.experiment-description { + max-width: 60rem; + margin-bottom: 1rem; + overflow-wrap: break-word; + word-break: break-word; +} + .collaborators-section { display: flex; align-items: flex-start; diff --git a/src/breeding-insight/model/view_models/TableResultRange.ts b/src/breeding-insight/model/view_models/TableResultRange.ts new file mode 100644 index 000000000..aadae1b97 --- /dev/null +++ b/src/breeding-insight/model/view_models/TableResultRange.ts @@ -0,0 +1,64 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {PaginationController} from "@/breeding-insight/model/view_models/PaginationController"; + +/** + * The rows a paginated table is showing: rows start to end of total (1-based), or all of them. + */ +export class TableResultRange { + constructor( + public readonly start: number, + public readonly end: number, + public readonly total: number, + public readonly showAll: boolean + ) {} + + /** + * Works out the range for a table whose records are either one page from the server, or every + * record with the table paging (and possibly filtering) them in the browser. + * + * @param pagination the table's pagination state + * @param recordCount the number of records passed to the table + * @param filteredCount the number of records left after the table's own (client-side) filters + */ + static of(pagination: PaginationController, recordCount: number, filteredCount: number): TableResultRange { + const pageSize = Math.max(pagination.pageSize, 1); + // The server holds more rows than it sent, so the records are a single page of server results. + const serverPaged = pagination.totalCount > recordCount; + const total = serverPaged ? pagination.totalCount : filteredCount; + + if (total === 0) { + return new TableResultRange(0, 0, 0, pagination.showAll); + } + + let start: number; + let end: number; + if (serverPaged) { + start = (pagination.currentPage - 1) * pageSize + 1; + end = Math.min(start + recordCount - 1, total); + } else if (total <= pageSize) { + // Matches Buefy, which shows every row when they all fit on one page, whatever the current page. + start = 1; + end = total; + } else { + start = (pagination.currentPage - 1) * pageSize + 1; + end = Math.min(start + pageSize - 1, total); + } + return new TableResultRange(start, end, total, pagination.showAll); + } +} diff --git a/src/components/admin/AdminProgramsTable.vue b/src/components/admin/AdminProgramsTable.vue index 614ee0be7..1fc5d0c8d 100644 --- a/src/components/admin/AdminProgramsTable.vue +++ b/src/components/admin/AdminProgramsTable.vue @@ -119,6 +119,8 @@ File contains data errors
- - - - - - - @@ -90,6 +92,9 @@ showExpandControls!: boolean; @Prop() showRowIcon!: boolean; + // Scroll the rows inside a box with the header pinned; the parent sizes the box (see BoundedTableMixin). + @Prop({default: false}) + bounded!: boolean; private initialUpdate: boolean = false; private tableRows: Array> = new Array>(); diff --git a/src/components/tables/FloatingScrollbar.vue b/src/components/tables/FloatingScrollbar.vue new file mode 100644 index 000000000..a77133ae3 --- /dev/null +++ b/src/components/tables/FloatingScrollbar.vue @@ -0,0 +1,166 @@ + + + + + diff --git a/src/components/tables/SidePanelTable.vue b/src/components/tables/SidePanelTable.vue index ac33a8eca..168261a4c 100644 --- a/src/components/tables/SidePanelTable.vue +++ b/src/components/tables/SidePanelTable.vue @@ -1,5 +1,8 @@ - + \ No newline at end of file diff --git a/src/components/tables/TableResultCount.vue b/src/components/tables/TableResultCount.vue new file mode 100644 index 000000000..b4ca09096 --- /dev/null +++ b/src/components/tables/TableResultCount.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/src/components/tables/expandableTable/ExpandableTable.vue b/src/components/tables/expandableTable/ExpandableTable.vue index 8774af218..8bd469f57 100644 --- a/src/components/tables/expandableTable/ExpandableTable.vue +++ b/src/components/tables/expandableTable/ExpandableTable.vue @@ -16,7 +16,15 @@ --> @@ -122,11 +143,15 @@ import { DataFormEventBusHandler } from '@/components/forms/DataFormEventBusHand import {ChevronRightIcon, ChevronDownIcon} from 'vue-feather-icons' import { TableRow } from '@/breeding-insight/model/view_models/TableRow'; import { PaginationController } from '@/breeding-insight/model/view_models/PaginationController'; +import BoundedTableMixin from '@/mixins/BoundedTableMixin'; +import TableResultCount from '@/components/tables/TableResultCount.vue'; +import FloatingScrollbar from '@/components/tables/FloatingScrollbar.vue'; +import { TableResultRange } from '@/breeding-insight/model/view_models/TableResultRange'; @Component({ - components: { EditDataRowForm, PaginationControls, ChevronRightIcon, ChevronDownIcon } + components: { EditDataRowForm, PaginationControls, ChevronRightIcon, ChevronDownIcon, TableResultCount, FloatingScrollbar } }) -export default class ExpandableTable extends Mixins(ValidationMixin) { +export default class ExpandableTable extends Mixins(ValidationMixin, BoundedTableMixin) { @Prop() records!: Array; @@ -160,6 +185,11 @@ export default class ExpandableTable extends Mixins(ValidationMixin) { deactivateLinkText?: string; @Prop({default: true}) isShowAllEnabled!: boolean; + // What the rows are, for the result count above the table, e.g. "observation units". + @Prop() + recordNoun?: string; + @Prop() + recordNounSingular?: string; private tableRows: Array> = new Array>(); private openDetail: Array> = new Array>(); @@ -195,6 +225,14 @@ export default class ExpandableTable extends Mixins(ValidationMixin) { this.initialUpdate = true; } + mounted() { + this.watchBuefyTable(this.$refs[this.tableRef] as Vue); + } + + get resultRange(): TableResultRange { + return TableResultRange.of(this.pagination, this.records ? this.records.length : 0, this.filteredRecordCount); + } + @Watch('records', {immediate: true, deep:true}) updateTableRows(newRecords: any, oldRecords: any) { let difference: Array = []; @@ -267,14 +305,17 @@ export default class ExpandableTable extends Mixins(ValidationMixin) { paginate(event: any) { this.pagination.updatePage(event); + this.scrollBoundedToTop(); } toggleShowAll(event: any) { this.pagination.toggleShowAll() + this.scrollBoundedToTop(); } updatePageSize(event: any) { this.pagination.updatePageSize(event); + this.scrollBoundedToTop(); } } \ No newline at end of file diff --git a/src/mixins/BoundedTableMixin.ts b/src/mixins/BoundedTableMixin.ts new file mode 100644 index 000000000..06641b1aa --- /dev/null +++ b/src/mixins/BoundedTableMixin.ts @@ -0,0 +1,258 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Component, Prop, Vue} from 'vue-property-decorator' + +// Smallest box worth scrolling in; below this the box fills the window under the header instead. +const MIN_BOX_HEIGHT_PX = 320; +// Space kept between the page controls and the bottom of the window. +const BOTTOM_GAP_PX = 16; + +// The parts of Buefy's b-table internal state that watchBuefyTable() follows. +interface BuefyTableState { + newData: Array; + filters: object; + currentSortColumn: object; + isAsc: boolean; +} + +/** + * Keeps a table's header row and horizontal scrollbar on screen by capping the height of its scroll + * box (the element matched by boundedScrollSelector()) to the space left in the window. + * + * A table shorter than the box looks as it would unbounded. A taller one scrolls inside the box, + * with the header pinned by the .bounded-table styles in main.scss. The box is sized so that, on + * load, its bottom edge and the page controls under it fit in the window. If the table starts too + * far down the page for that, the box fills the window below the sticky DeltaBreed header instead. + * + * Opt out with :bounded="false" where the table already sits inside something that scrolls, such as + * a modal. + */ +@Component +export default class BoundedTableMixin extends Vue { + + @Prop({default: true}) + bounded!: boolean; + + // Rows left after a Buefy table's own (client-side) filters; kept by watchBuefyTable(). + filteredRecordCount: number = 0; + + private boundedMaxHeight: number | null = null; + private boundedFrame: number | null = null; + private pinFrame: number | null = null; + private pageResizeObserver: { observe: (el: Element) => void, disconnect: () => void } | null = null; + + get boundedStyle(): { [key: string]: string } { + return this.bounded && this.boundedMaxHeight !== null + ? {'--bounded-table-max-height': `${this.boundedMaxHeight}px`} + : {}; + } + + /** CSS selector, within this component, of the element that scrolls. */ + boundedScrollSelector(): string { + return '.table-wrapper'; + } + + /** Height of the page controls that sit directly under the scroll box and must stay in view with it. */ + boundedReservedHeight(scrollElement: HTMLElement): number { + let height = 0; + let sibling = scrollElement.nextElementSibling as HTMLElement | null; + while (sibling) { + height += BoundedTableMixin.outerHeight(sibling); + sibling = sibling.nextElementSibling as HTMLElement | null; + } + return height; + } + + /** Scrolls the box back to its first row, after a change of page, page size, sort or filter. */ + scrollBoundedToTop() { + const scrollElement = this.boundedScrollElement(); + if (scrollElement) { + scrollElement.scrollTop = 0; + } + } + + /** + * Follows a Buefy b-table's state: keeps filteredRecordCount current, and returns the box to its + * first row when the sort or a column filter changes. Buefy only emits filters-change for backend + * filtering, so the table's state is watched instead of its events. Call once the table is mounted. + */ + watchBuefyTable(table: Vue) { + const state = table as unknown as BuefyTableState; + this.$watch(() => state.newData.length, (count: number) => { + this.filteredRecordCount = count; + }, {immediate: true}); + this.$watch(() => [state.currentSortColumn, state.isAsc, JSON.stringify(state.filters)], () => { + this.scrollBoundedToTop(); + }); + } + + mounted() { + window.addEventListener('resize', this.scheduleBoundedResize); + window.addEventListener('scroll', this.schedulePinControls, {passive: true}); + // Content elsewhere on the page, such as details collapsed above the table, can move the box + // without this component updating; the page's height changes when it does. ResizeObserver is in + // every supported browser, but not in this TypeScript version's DOM types. + const ResizeObserverClass = (window as any).ResizeObserver; + if (ResizeObserverClass) { + this.pageResizeObserver = new ResizeObserverClass(() => this.scheduleBoundedResize()); + this.pageResizeObserver!.observe(document.body); + } + this.scheduleBoundedResize(); + } + + updated() { + // Rows, page controls or content above the table may have changed. + this.scheduleBoundedResize(); + } + + beforeDestroy() { + window.removeEventListener('resize', this.scheduleBoundedResize); + window.removeEventListener('scroll', this.schedulePinControls); + if (this.pageResizeObserver) { + this.pageResizeObserver.disconnect(); + } + if (this.boundedFrame !== null) { + window.cancelAnimationFrame(this.boundedFrame); + } + if (this.pinFrame !== null) { + window.cancelAnimationFrame(this.pinFrame); + } + } + + /** The table's page controls, marked with the bounded-table-controls class, while they are shown. */ + boundedControlsElement(): HTMLElement | null { + const controls = this.$el instanceof HTMLElement + ? this.$el.querySelector('.bounded-table-controls') as HTMLElement | null + : null; + // offsetParent is null while the controls or the table are hidden. + return controls && controls.offsetParent !== null ? controls : null; + } + + /** + * Height of the page controls while pinControls() holds them at the bottom of the window, or 0. + * Worked out from where the layout puts the controls, not where they have been moved to, so it + * gives the same answer whether or not they have been moved yet in this frame. FloatingScrollbar + * sits this far up from the bottom of the window. + */ + boundedPinnedControlsHeight(): number { + const controls = this.boundedControlsElement(); + const scrollElement = this.boundedScrollElement(); + if (!this.bounded || !controls || !scrollElement) return 0; + + const height = controls.offsetHeight; + const layoutBottom = BoundedTableMixin.layoutBottom(controls); + const belowWindow = layoutBottom > window.innerHeight; + const boxOnScreen = scrollElement.getBoundingClientRect().top < window.innerHeight - height; + return belowWindow && boxOnScreen ? height : 0; + } + + /** The element that scrolls, for FloatingScrollbar's scroll-target. */ + boundedScrollElement(): HTMLElement | null { + return this.$el instanceof HTMLElement + ? this.$el.querySelector(this.boundedScrollSelector()) as HTMLElement | null + : null; + } + + private scheduleBoundedResize() { + if (!this.bounded || this.boundedFrame !== null) return; + this.boundedFrame = window.requestAnimationFrame(() => { + this.boundedFrame = null; + this.updateBoundedMaxHeight(); + }); + } + + private updateBoundedMaxHeight() { + const scrollElement = this.boundedScrollElement(); + // offsetParent is null while the table is hidden, e.g. in an inactive tab. + if (!scrollElement || scrollElement.offsetParent === null) return; + + const mainHeader = document.querySelector('.main-header') as HTMLElement | null; + const headerHeight = mainHeader ? mainHeader.offsetHeight : 0; + // Buefy puts a margin under the box when page controls follow it. + const boxMargin = parseFloat(window.getComputedStyle(scrollElement).marginBottom || '0'); + const reserved = boxMargin + this.boundedReservedHeight(scrollElement) + BOTTOM_GAP_PX; + const top = scrollElement.getBoundingClientRect().top + window.pageYOffset; + + // Tallest the box can be with the page scrolled so the box sits just under the sticky header. + const fitsBelowHeader = window.innerHeight - headerHeight - reserved; + // Tallest the box can be without scrolling the page. + const fitsOnLoad = window.innerHeight - top - reserved; + + // Fit the box on screen as loaded when that leaves room for several rows. When content above the + // table pushes it too far down, fill the window below the header instead: one scroll of the page + // then brings the whole box, its horizontal scrollbar and the page controls into view. + const maxHeight = Math.round(Math.max( + fitsOnLoad >= MIN_BOX_HEIGHT_PX ? fitsOnLoad : fitsBelowHeader, + MIN_BOX_HEIGHT_PX + )); + if (maxHeight !== this.boundedMaxHeight) { + this.boundedMaxHeight = maxHeight; + } + + // Content above the table, its rows or its page size may have moved the box and its controls. + this.schedulePinControls(); + } + + private schedulePinControls() { + if (!this.bounded || this.pinFrame !== null) return; + this.pinFrame = window.requestAnimationFrame(() => { + this.pinFrame = null; + this.pinControls(); + }); + } + + /** + * While the box is on screen but its page controls are below the window, moves the controls up to + * the bottom of the window, so paging stays in reach on pages where content above the table pushes + * the box down. A transform leaves the layout alone, so nothing else on the page moves. + */ + private pinControls() { + const controls = this.boundedControlsElement(); + if (controls) { + const pinnedHeight = this.boundedPinnedControlsHeight(); + const shift = pinnedHeight > 0 ? Math.round(BoundedTableMixin.layoutBottom(controls) - window.innerHeight) : 0; + if (shift !== BoundedTableMixin.pinShift(controls)) { + controls.style.transform = shift > 0 ? `translateY(-${shift}px)` : ''; + controls.dataset.pinShift = String(shift); + controls.classList.toggle('is-pinned', shift > 0); + } + } + + const floatingScrollbar = this.$refs.floatingScrollbar as Vue & { scheduleUpdate?: () => void } | undefined; + if (floatingScrollbar && floatingScrollbar.scheduleUpdate) { + floatingScrollbar.scheduleUpdate(); + } + } + + // How far pinControls() has moved the controls up from where the layout puts them. Kept on the + // element, so a re-rendered one starts from 0. + private static pinShift(controls: HTMLElement): number { + return Number(controls.dataset.pinShift || '0'); + } + + // Bottom edge of the controls, relative to the window, where the layout puts them. + private static layoutBottom(controls: HTMLElement): number { + return controls.getBoundingClientRect().top + BoundedTableMixin.pinShift(controls) + controls.offsetHeight; + } + + private static outerHeight(element: HTMLElement): number { + if (element.offsetParent === null) return 0; + const style = window.getComputedStyle(element); + return element.offsetHeight + parseFloat(style.marginTop || '0') + parseFloat(style.marginBottom || '0'); + } +} diff --git a/src/views/experiments-and-observations/ExperimentDetails.vue b/src/views/experiments-and-observations/ExperimentDetails.vue index 177ddf641..bf02ad3b9 100644 --- a/src/views/experiments-and-observations/ExperimentDetails.vue +++ b/src/views/experiments-and-observations/ExperimentDetails.vue @@ -20,9 +20,26 @@ < All Experiments
-

- {{experiment.trialName}} -

+
+
+

+ {{ experiment.trialName }} +

+
+
+ +
+
-
- -
-
-
-
    -
  • Description: {{experiment.trialDescription}}
  • -
  • Experimental unit: {{ experimentalUnit }}
  • -
  • Type: {{ experimentType }}
  • -
  • User: {{ userName }}
  • -
  • Creation Date: {{ createdDate }}
  • -
  • Experimental design: Externally generated
  • -
-
-
-
-
-
    -
  • Germplasm: {{ germplasmCount }}
  • +
    + + +
    +

    + Description: {{ experiment.trialDescription }} +

    + +
    +
    +
    +
      +
    • Experimental unit: {{ experimentalUnit }}
    • +
    • Type: {{ experimentType }}
    • +
    • Experimental design: Externally generated
    • +
    +
    +
    +
    +
    +
      +
    • Germplasm: {{ germplasmCount }}
    • +
    • User: {{ userName }}
    • +
    • Creation Date: {{ createdDate }}
    • -
    -
    -
    -
    - -
    -
    - Collaborators: -
      -
    • - {{ collaborator.name }} - {{"(" + collaborator.email + ")"}} - -
    -
    -
    -
    -
    - -
    +
    +
+
+ +
+
+ Collaborators: + + None + +
    +
  • + {{ collaborator.name }} + {{"(" + collaborator.email + ")"}} + +
  • +
+
+
+
+
+ -
- - {{ column.label }} - -