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 manual discretization method for styles #352

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

CFarcy
Copy link
Contributor

@CFarcy CFarcy commented Feb 8, 2021

No description provided.

@CFarcy CFarcy requested review from jrmi and dtrucs February 8, 2021 07:58
@CFarcy CFarcy force-pushed the style-manual-discretization branch from f04fad7 to 977748d Compare February 8, 2021 09:41
CFarcy and others added 3 commits February 8, 2021 11:02
…istField.js

Co-authored-by: Jérémie Pardou-Piquemal <jeremie.pardou@makina-corpus.com>
Co-authored-by: Jérémie Pardou-Piquemal <jeremie.pardou@makina-corpus.com>
Co-authored-by: Jérémie Pardou-Piquemal <jeremie.pardou@makina-corpus.com>
// eslint-disable-next-line react/no-array-index-key
<React.Fragment key={index}>
<Condition when={`${path}.method`} is="manual">
<Field
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't you use react-admin NumberInput here ?

>
{({ meta, input: { value: boundValue, onChange: onBoundChange } }) => (
<TextField
label={translate('datalayer.form.styles.step')}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use same translation prefix as other field.

onChange={handleColorChange(index)}
/>
// eslint-disable-next-line react/no-array-index-key
<React.Fragment key={index}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a validation for step order ?


import styles from './styles';

const useStyles = makeStyles(styles);

const DEFAULT_MAX_CLASSES = 15;

const ColorListField = ({ value, onChange = () => {}, maxClasses = DEFAULT_MAX_CLASSES }) => {
const ColorListField = ({ path, value, onChange = () => {}, maxClasses = DEFAULT_MAX_CLASSES }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not a colorListField anymore...

@CFarcy CFarcy marked this pull request as draft February 8, 2021 10:11
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.

3 participants