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

refactor formbuilder #19

Open
sgratzl opened this issue Sep 15, 2017 · 3 comments
Open

refactor formbuilder #19

sgratzl opened this issue Sep 15, 2017 · 3 comments
Labels
priority: medium type: refactor Refactor the current implementation

Comments

@sgratzl
Copy link
Contributor

sgratzl commented Sep 15, 2017

the form builder is the only piece left in the core using d3. I order to avoid using d3(v3) in the core the FormBuilder needs to be refactored.

At the same time it can be improved.

  • Atm there is no overview what are the options for specific form element descs. A builder pattern could help in this case.
  • similarly when calling getParameter the view has to now which are valid parameter and what will be the return value. When using an interface object (IParams...) everything could be typed.
  • select vs select2 both have different styles how to provide data, name/value vs id/text in which forms (data, promise, ajax, ... This should be refactored
  • simplify select2 similarly to the search box in the Dashboard application, i.e. implementing a custom transport method
  • provide option to extend a form desc e.g. with a visualization to generate the parameter like a histogram selector
@sgratzl
Copy link
Contributor Author

sgratzl commented Nov 14, 2017

related #25

@thinkh
Copy link
Member

thinkh commented Nov 14, 2017

It's also related to #52

@sgratzl sgratzl self-assigned this Jan 11, 2018
@sgratzl sgratzl removed their assignment Nov 13, 2018
@lehnerchristian
Copy link

we could either do this by using union types:

interface ISelectDesc {
  type: 'select';
  name: string;
}
interface ITextDesc {
  type: 'text';
  value: string;
}

declare type IDesc = ISelectDesc | ITextDesc;

const t: IDesc[] = [
  {
    type: "select",
    name: 'test'
  },
  {
    type: 'text',
    value: 'a'
  }
];

or with the builder pattern as a wrapper around the usual form description objects (i.e. the buildSelectElement function returns an object with the correct form element type):

buildSelectElement(ParameterFormIds.DATA_SOURCE).label('Data Source').required().useSession().optionsData(..).build()

thinkh added a commit that referenced this issue Aug 7, 2019
@thinkh thinkh mentioned this issue Aug 7, 2019
4 tasks
@thinkh thinkh linked a pull request Nov 10, 2020 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: refactor Refactor the current implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants