Skip to content

Fix/adopt fom dependencies#1120

Merged
werrolf merged 19 commits into
release/3.0.7from
fix/adopt-fom-dependencies
Mar 15, 2019
Merged

Fix/adopt fom dependencies#1120
werrolf merged 19 commits into
release/3.0.7from
fix/adopt-fom-dependencies

Conversation

@werrolf

@werrolf werrolf commented Mar 15, 2019

Copy link
Copy Markdown
Contributor

BC impact

Drop-replacements for manager.html.twig (in app/Resources) will have to be moved (or safer yet, duplicated) to new directory structure to remain effective.

  • A customized app/Resources/FOM/ManagerBundle/Resources/views/manager.html.twig should be duplicated to app/Resources/Mapbender/ManagerBundle/Resources/views/manager.html.twig
  • A customized app/Resources/FOM/CoreBundle/Resources/views/Form/fields.html.twig should be duplicated to app/Resources/Mapbender/CoreBundle/Resources/views/form/fields.html.twig
  • A customized app/Resources/FOM/CoreBundle/Resources/views/Manager/menu.html. should be duplicated to app/Resources/Mapbender/ManagerBundle/Resources/views/menu.html.twig

Twig extends and include clauses for manager.html.twig will be kept safe and working. The other two templates fields.html.twig and menu.html.twig will vanish completely from their original locations.

Change summary

This brings in the following assets from FOM v3.0.6.3:

  • fields.html.twig (the default form theme)
  • manager.html.twig (the backend layout)
  • menu.html.twig (skin for the backend sidepane menu)
  • checkbox.js
  • dropdown.js
  • radiobuttonExtended.js
  • collection.js
  • components.js
  • tabcontainer.js
  • sidepane.js

It also brings in the FOM\ManagerBundle\ManagerController, renamed to Mapbender\ManagerBundle\IndexController.

Updating of references

There is generally no need to manually update anything on the project level, except for cases of drop-in twig replacements already described on top.

Includes of the twigs in Mapbender scope have been updated manually.

The form theme is carefully auto-rewritten based on previous work. This change of default theme location only happens if the configured default theme was FOM's.
Enterprising types who have already configured their system with, say, a Bootstrap 3 form theme, will not be impacted in any way.
Doing this automatically frees us from attempting a "simultaneous" commit into the Mapbender Starter repository.

References to the JavaScript assets are auto-updated on the AssetFactory level. This ensures custom Element and Template classes will move along automatically, with no need to rewrite the asset references.

Standard Mapbender routing configuration loads Mapbender ManagerBundle controllers before FOM ManagerBundle controllers, so the adopted new IndexController will take precedence automatically.

This change can coexist with older FOM versions. They will continue to wrap the "Users", "Groups" and "ACLs" sections in their their own backend twigs (general layout skeleton and menu). Mapbender's version of the form theme (whichever way it will develop from here) will take effect though.

Rationale

  1. Nothing in FOM even references any of the JavaScript assets. They are only referenced by the manager template in Mapbender, frontend Templates also in Mapbender and assorted Elements, of which FOM has no concept at all. As such, it makes no sense that FOM should control how these widgets work.
  2. FOM only has a teeny tiny bit of backend section of its own, for users and ACLs. The bulk of the backend is in Mapbender's ManagerBundle. As such it makes no sense that FOM should control the layout of the Mapbender backend.
  3. FOM's form theme has numerous limitations and quirks that can only reasonably be fixed in conjunction with its CSS, which is in Mapbender, along with the vast majority of form types and form templates.

@werrolf werrolf requested a review from DavidPatzke March 15, 2019 13:30
@werrolf werrolf merged commit 51e152c into release/3.0.7 Mar 15, 2019
@werrolf werrolf deleted the fix/adopt-fom-dependencies branch March 15, 2019 20:53
werrolf added a commit to mapbender/fom that referenced this pull request Mar 19, 2019
@werrolf werrolf mentioned this pull request Apr 26, 2019
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.

1 participant