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

feat: Change size component implementation #464

Merged
merged 6 commits into from
Apr 29, 2020
Merged

feat: Change size component implementation #464

merged 6 commits into from
Apr 29, 2020

Conversation

EdwinBetanc0urt
Copy link
Collaborator

@EdwinBetanc0urt EdwinBetanc0urt commented Apr 26, 2020

Bug report / Feature

Delete file src/components/ADempiere/Field/fieldSize.js and add code to file src/utils/ADempiere/references.js

export const FIELD_TEXT = {
  type: 'FieldYesNo',
  size: {
    xs: 14,
    sm: 8,
    md: 8,
    lg: 3,
    xl: 6
  }
}
export const DEFAULT_SIZE = {
  xs: 6,
  sm: 8,
  md: 2,
  lg: 6,
  xl: 6
}

Set the field type information with the spread operator, such as the component to render and the size:

export const ACCOUNT_ELEMENT = {
  ...FIELD_TEXT,
  id: 25,
  isSupported: false,
  description: 'Account Element',
  valueType: 'INTEGER',
  alias: ['Account']
}

Additional context

Currently, when a field is generated, the type of component to be rendered is searched in the list of references, then the sizes of the component are searched, in another list, of the component (compatible element-ui). With this change it is only necessary to search for the type of component to render with the diplayType and this will contain both data, the component to render and the default sizes, improving having to search for each field in two lists to a single search.

@yamelsenih yamelsenih merged commit 6e9c48a into adempiere:develop Apr 29, 2020
@yamelsenih yamelsenih deleted the feature/change-size-implementation branch April 29, 2020 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants