Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 140
    • Merge requests 140
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !337

Merged
Created Aug 03, 2017 by Tomáš Peterka@katomasoContributor2 of 3 tasks completed2/3 tasks

[renderjs_ui] Implement FormBox field

  • Overview 7
  • Commits 4
  • Changes 55

FormBox receives form definition directly inside its field thanks to modification of hateoas script to include result of renderForm.

Implementation details

  • New embedded page template was added (gadget_erp5_pt_embedded_form_render) which only passes all arguments directly to the form. Form was not modified thus as many code as possible is reused.
  • Page:form was modified to accept erp5_document in its arguments. It is because FormBox uses it as direct subgadget.
  • FormBox.py was modified to fix a bug in case of embedded context - the Form was saving field into a wrong object. Thus validation phase of a FormBox yields FormEditor (as before) but if there is embedded context in the formbox field itself it will pass it to the Editor.

Refactoring

  • getHateoas renderField was heavily modified to be
    • sematically more consistent
    • not to use global variables which are defined after function definition (thus are not even clojures)
    • shorten and simplify field dictionary construction by exporting common parts
  • Base_edit was refactored meanwhile implementing FormBox edit (was deleted later because it was not needed)
    • the same problems as before - semantics and unreadibility by not using comprehensions and destructive assignment

Tests

  • FormBox with the same document as parent's and with fields directly on the document
  • FormBox with the same document as parent's but with fields which are not on the document (such as Phone on Person for example)
  • FormBox with different document than parent's

Changes carried out meanwhile

  • fix naming of formpage -> page_form gadget to be consistent with other pages
  • renderered -> rendered (variable name in page_form)
  • keep name jio_key consistent in every page_template (form page template gadgets)
  • clean up state dictionaries passed around (define important state variables in advance)
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: feature/renderjs-formbox
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7