Skip to content

Commit

Permalink
Fix records list layout (#3428)
Browse files Browse the repository at this point in the history
* Data explorer / scatter plot: show record keys in tooltip

* solved deepscan issue

* show record editor on click

* download chart to PNG

* code cleanup

* code cleanup

* records list: layout adjustments

---------

Co-authored-by: Stefano Ricci <SteRiccio@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed May 22, 2024
1 parent df98a4b commit df9e712
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
10 changes: 6 additions & 4 deletions server/db/massiveUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ const pgp = pgPromise()

export default class MassiveUpdate {
/**
* @class
* It manages updates in bulk using pgp.helpers.update.
*
* @param {string} schema - The database schema name.
* @param {string} table - The database table name.
* @param {object|pgp.helpers.Columns|Array} cols - The columns (see http://vitaly-t.github.io/pg-promise/helpers.ColumnSet.html).
* @param {!object} params - Parameters object.
* @param {!string} params.schema - The database schema name.
* @param {!string} params.table - The database table name.
* @param {object|pgp.helpers.Columns|Array} params.cols - The columns (see http://vitaly-t.github.io/pg-promise/helpers.ColumnSet.html).
* @param {string} params.where - The where condition (optional).
* @param {pgPromise.IDatabase} [client=db] - The database client.
* @param {number} [bufferSize=100000] - The size of the buffer.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useCallback } from 'react'
import { useDispatch } from 'react-redux'
import PropTypes from 'prop-types'

import { Objects } from '@openforis/arena-core'
Expand All @@ -8,15 +9,14 @@ import * as NodeDef from '@core/survey/nodeDef'
import * as Survey from '@core/survey/survey'
import * as ObjectUtils from '@core/objectUtils'

import { useRandomColors } from '@webapp/components/hooks/useRandomColors'
import { ScatterChart } from '@webapp/charts/ScatterChart'
import { DataExplorerActions } from '@webapp/store/dataExplorer'
import { useSurvey, useSurveyPreferredLang } from '@webapp/store/survey'
import { useI18n } from '@webapp/store/system'

import { useDataQueryChartData } from '../useDataQueryChartData'
import { useRandomColors } from '@webapp/components/hooks/useRandomColors'
import { DataQueryScatterChartTooltip } from './DataQueryScatterChartTooltip'
import { useDispatch } from 'react-redux'
import { DataExplorerActions } from '@webapp/store/dataExplorer'

const maxItems = 5000

Expand Down
3 changes: 2 additions & 1 deletion webapp/views/App/views/Data/Records/RecordOwnerColumn.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useCallback, useState } from 'react'
import { useDispatch } from 'react-redux'
import classNames from 'classnames'
import PropTypes from 'prop-types'

import * as Record from '@core/record/record'
Expand Down Expand Up @@ -110,7 +111,7 @@ export const RecordOwnerColumn = (props) => {

return (
<div
className="width100"
className={classNames('record-owner-col', { editing })}
onClick={onContainerClick}
onFocus={onContainerFocus}
onKeyDown={onContainerKeyDown}
Expand Down
7 changes: 7 additions & 0 deletions webapp/views/App/views/Data/Records/Records.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@
justify-content: flex-end;
gap: 0.2rem;
}
.record-owner-col {
width: fit-content;
margin: auto;
&.editing {
width: 100%;
}
}
}
}

0 comments on commit df9e712

Please sign in to comment.