Skip to content

Commit

Permalink
Merge branch 'master' into fix/survey-hierarchy-sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Sep 20, 2024
2 parents 9b4f344 + 22e16ad commit 64ef58a
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion webapp/components/buttons/ButtonNext.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from './Button'

export const ButtonNext = (props) => {
const { label = 'common.next' } = props
return <Button {...props} iconClassName="icon-arrow-right icon-12px icon-left" label={label} />
return <Button {...props} iconClassName="icon-arrow-right icon-12px" label={label} />
}

ButtonNext.propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion webapp/components/buttons/ButtonPrevious.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from './Button'

export const ButtonPrevious = (props) => {
const { label = 'common.previous' } = props
return <Button {...props} iconClassName="icon-arrow-left icon-12px icon-left" label={label} />
return <Button {...props} iconClassName="icon-arrow-left icon-12px" label={label} />
}

ButtonPrevious.propTypes = {
Expand Down
8 changes: 5 additions & 3 deletions webapp/components/form/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classNames from 'classnames'
import { TextField } from '@mui/material'
import PropTypes from 'prop-types'

import { Strings } from '@openforis/arena-core'
import { Objects } from '@openforis/arena-core'

import { useOnUpdate } from '../../hooks'
import ValidationTooltip from '../../validationTooltip'
Expand Down Expand Up @@ -41,11 +41,13 @@ export const Input = React.forwardRef((props, ref) => {
const selectionAllowed = type === 'text'
const selectionInitial = selectionAllowed ? [value.length, value.length] : null
const selectionRef = useRef(selectionInitial)
const valueText = Strings.defaultIfEmpty('')(value)
const valueText = Objects.isEmpty(value) ? '' : String(value)
const title = titleProp ?? valueText

const handleValueChange = useCallback(
(newValue) => {
if (disabled) return

const input = inputRef.current
if (selectionAllowed) {
selectionRef.current = [input.selectionStart, input.selectionEnd]
Expand All @@ -54,7 +56,7 @@ export const Input = React.forwardRef((props, ref) => {
onChange(textTransformFunction(newValue))
}
},
[inputRef, onChange, selectionAllowed, textTransformFunction]
[disabled, inputRef, onChange, selectionAllowed, textTransformFunction]
)

const onFormattedValueChange = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

.survey-form__node-def-boolean {
display: flex;
border: $formBorder;
margin-left: 0.2rem;
height: 1.2rem;
}

.survey-form__node-def-entity-table-row {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

button {
margin: 0 0.4rem;
padding: 0.6rem 0.6rem;
padding: 0.4rem 0.6rem;
white-space: nowrap;
}

Expand Down
7 changes: 1 addition & 6 deletions webapp/views/App/views/Data/MapView/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { useSurvey } from '@webapp/store/survey'

import { useRandomColors } from '@webapp/components/hooks/useRandomColors'
import { Map } from '@webapp/components/Map'
import SurveyDefsLoader from '@webapp/components/survey/SurveyDefsLoader'

import { SamplingPointDataLayer } from './SamplingPointDataLayer'
import { CoordinateAttributeDataLayer } from './CoordinateAttributeDataLayer'
Expand Down Expand Up @@ -106,8 +105,4 @@ const MapWrapper = () => {
)
}

export const MapView = () => (
<SurveyDefsLoader draft={false} requirePublish>
<MapWrapper />
</SurveyDefsLoader>
)
export const MapView = () => <MapWrapper />
5 changes: 5 additions & 0 deletions webapp/views/App/views/Data/MapView/MapView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@

button {
margin: 0;
height: 2rem;
}

.new-record-btn {
width: 20rem;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ ${itemCodes
)}
{canCreateRecord && !recordUuid && (
<ButtonAdd
className="new-record-btn"
label="mapView.createRecord"
showLabel
onClick={() => createRecordFromSamplingPointDataItem({ itemUuid, callback: onRecordCreate })}
Expand Down

0 comments on commit 64ef58a

Please sign in to comment.