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

Version 2.2.0 to 4.0.0 [braking change] #56

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ Changelog

JQueryUI Changelog: https://jqueryui.com/changelog/

4.0.0 (unreleased)
------------------

- Provided resources directly from extracted jQueryUI ZIP file (with require patch)
- Drop controlpanel using plone.app.registry to select plugins
- Drop Python 2 and Plone 4 support
[szakitibi]

2.2.1 (unreleased)
------------------

Expand Down
135 changes: 20 additions & 115 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,141 +3,46 @@ Introduction

Integration of jQueryUI in Plone

IMPORTANT - 2.2.0 > 4.0.0 Upgrade
=================================

WARNINGS
========
Can not be upgraded from 2.2.0 directly! It is a major braking release!
Copy link
Member

Choose a reason for hiding this comment

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

I think it should be possible to do the update. An upgrade step should be created.


Plone < 4
Copy link
Member

Choose a reason for hiding this comment

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

Do not remove version information needed by older Plone.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Even removing support for older versions of Plone, we should not remove the information of which version of collective.js.jqueryui is compatible with these versions. Note that today the product is no longer compatible with Plone < 4, but the information is still in the README. This makes it easy if some old Plone user arrives at the repository and wants to use the product on their site.

---------
There is no upgrade step provided for this "version jump", instead follow these steps:

For Plone 3 you need version 1.7.x of this package

JQueryUI > 1.8.6 is supposed to be compatible with jQuery 1.3.2.
At the moment you should prefer to use the 1.7.X version of jQueryUI
(same package exists for 1.7 branch)
1. First uninstall 2.1.8 version of JQuery UI using "Site Setup / Add-ons" page. This will cleanly remove all: Plugin selection related registry records; Old style `jsregistry` items; Actions and controlpanel pages.
2. Run the buildout to get the 4.0.0 version.
3. Restart instance.
4. Install JQuery UI again using "Site Setup / Add-ons" page.

Plone < 4.3
-----------
WARNINGS
========

Use version < 1.9
Plone < 5
---------

Integration for Zope and Plone
==============================
Support is dropped for older versions of Plone and Python 2.7.

This package can be used as a Plone add-on - for this it adds GenericSetup
profiles and Plone ControlPanel configlets - or it can be used as a simple Zope
jQuery UI resources registrar. See bellow how your zc.buildout config file
should look like if you use collective.js.jqueryui with or without Plone.
Integration for Zope
--------------------

Plone
-----
This package can be used as a Plone add-on only.

for Plone > 4.0:
Usage
=====

buildout.cfg::

[instance]
eggs +=
collective.js.jqueryui

for Plone == 4.0 you must add plone.app.registry yourself:

buildout.cfg::

extends=http://good-py.appspot.com/release/plone.app.registry/1.0b2
[instance]
eggs +=
collective.js.jqueryui
plone.app.registry

Zope
----

buildout.cfg::

[instance]
eggs =
collective.js.jqueryui
zcml =
collective.js.jqueryui

Include plugins and optimizations
=================================

By default this addon register all plugins and activate all of them except tabs.
So ui.tabs is registred but not activated.

Because jQueryUI is big on both javascripts and css you may want to optimize
the configuration of your site or your addon which depends on this one.

So you can activate/unactivate plugins using registry profile or the jQueryUI
controlpanel.

Using registry.xml, you can activate only what you want::

<registry>
<records interface="collective.js.jqueryui.controlpanel.IJQueryUIPlugins">
<value key="ui_draggable">True</value>
<value key="ui_droppable">True</value>
</records>
</registry>

In the case of a policy you can do a full configuration::

<registry>
<records interface="collective.js.jqueryui.controlpanel.IJQueryUIPlugins">
<value key="ui_core">True</value>
<value key="ui_widget">True</value>
<value key="ui_mouse">True</value>
<value key="ui_position">True</value>
<value key="ui_draggable">True</value>
<value key="ui_droppable">True</value>
<value key="ui_resizable">True</value>
<value key="ui_selectable">True</value>
<value key="ui_sortable">True</value>
<value key="ui_accordion">False</value>
<value key="ui_autocomplete">False</value>
<value key="ui_button">False</value>
<value key="ui_dialog">False</value>
<value key="ui_slider">False</value>
<value key="ui_tabs">False</value>
<value key="ui_datepicker">False</value>
<value key="ui_progressbar">False</value>
<value key="effects_core">False</value>
<value key="effects_blind">False</value>
<value key="effects_bounce">False</value>
<value key="effects_clip">False</value>
<value key="effects_drop">False</value>
<value key="effects_explode">False</value>
<value key="effects_fade">False</value>
<value key="effects_fold">False</value>
<value key="effects_highlight">False</value>
<value key="effects_pulsate">False</value>
<value key="effects_scale">False</value>
<value key="effects_shake">False</value>
<value key="effects_slide">False</value>
<value key="effects_transfer">False</value>
</records>
<records interface="collective.js.jqueryui.controlpanel.IJQueryUICSS">
<value key="css">False</value>
<value key="patch">False</value>
</records>
</registry>

Using the control panel, you can select plugins you want. If you unselect a
plugin it will be unactivated (but not its dependencies)

Using python, you just have to use plone.registry api::

from zope.component import getUtility
from plone.registry.interfaces import IRegistry
from collective.js.jqueryui.config import DEPS
from collective.js.jqueryui.interfaces import IJQueryUICSS, IJQueryUIPlugins
#is plone.app.registry
registry = getUtility(IRegistry)
proxy = registry.forInterface(IJQueryUIPlugins)
setattr(proxy, 'ui_draggable', True)
setattr(proxy, 'ui_droppable', True)
By default this addon register all plugins and activate all of them. The registry based plugin activation is dropped. See https://github.com/collective/collective.js.jqueryui/issues/46.

Credits and contributions
=========================
Expand All @@ -148,4 +53,4 @@ Credits and contributions
* `Ecreall <https://www.ecreall.com>`_

.. |makinacom| image:: http://depot.makina-corpus.org/public/logo.gif
.. _makinacom: https://www.makina-corpus.com
.. _makinacom: https://www.makina-corpus.com
71 changes: 45 additions & 26 deletions docs/UPGRADE.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,62 @@
How to upgrade this package
===========================

- Go to https://jqueryui.com/download
- Go to the URL specified in the collective/js/jqueryui/css/sunburst/jqueryui.css file to pre-load current theme settings.

- Go to the URL specified in the src/collective/js/jqueryui/jquery-ui-$VERSION.custom/jquery-ui.theme.css file to pre-load current theme settings.
- Click on "Download theme" in the left-side "Theme rollover".
- At the bottom "Theme" update by "sunburst" in "Theme Folder Name" field.
- Download jquery-ui-X.custom.zip

Commands to execute::

PKG="/home/toutpt/workspace/collective.js.jqueryui/src/collective/js/jqueryui"
VERSION="1.8.13"
PREV="1.8.12"
unzip ~/jquery-ui-$VERSION.custom.zip
cd ~/jquery-ui-$VERSION.custom
rm $PKG/jquery-ui-$PREV.custom.min.js
rm $PKG/jquery-ui-$PREV.custom.js
rm $PKG/js/*
cp ui/jquery-ui.js $PKG/jquery-ui-$VERSION.custom.js
cp ui/minified/jquery-ui.min.js $PKG/jquery-ui-$VERSION.custom.min.js
cp ui/minified/i18n/jquery-ui-i18n.min.js $PKG/jquery-ui-i18n.js
cp ui/minified/*.min.js $PKG/js/

rm $PKG/css/sunburst/images/*
rm $PKG/css/sunburst/jqueryui.css
cp css/sunburst/jquery-ui-$VERSION.custom.css $PKG/css/sunburst/jqueryui.css
cp css/sunburst/images/* $PKG/css/sunburst/images/

- update version in README.txt and common.zcml and config.py
unzip jquery-ui-$VERSION.custom.zip
rm -R jquery-ui-$PREV.custom

- update version in `config.py` and `configure.zcml` for resources

- increment the profile version in metadata.xml

- update the ugprade step::
- provide ugprade step::

<genericsetup:upgradeStep
source="*"
destination="3001"
source="4000"
destination="4001"
title=""
description=""
profile="collective.js.jqueryui:default"
handler=".upgrades.common"
/>


Caveats/Issues:
===============

!IMPORTANT: The old style configurable solution does not work any more!
https://github.com/collective/collective.js.jqueryui/issues/46
This is a simplified 4.0.0 version, with different upgrade steps.

make it work
------------

The result of the unpacked jQuery UI zip with Plone 5.2.4 (5212) patterns require.js raises an error:

```
Uncaught Error: Mismatched anonymous define() module: function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2"; ... require.js:168
at makeError (require.js:168:17)
at intakeDefines (require.js:1254:36)
at Object.localRequire [as require] (require.js:1446:21)
at requirejs (require.js:1797:24)
at patterns-compiled.js:15444:1
```

Solution was to manually remove from `jquery-ui-1.13.2.custom/jquery-ui.min.js` the ADM part (`"function"==typeof define&&define.amd?define(["jquery"],t):`) right at the start of the javascript code:

`!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(V){ ...`

so we end up with:

`!function(t){"use strict";t(jQuery)}(function(V){ ...`


no more i18n datepicker
-----------------------

It does not work anymore, the viewlet is simply short circuited in its render method. It is left in the product in case it is used by other addons.
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="collective.js.jqueryui",
version="2.2.1.dev0",
version="4.0.0 (unreleased)",
Copy link
Member

Choose a reason for hiding this comment

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

Why not 3.0.0?

Copy link
Author

Choose a reason for hiding this comment

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

To point it out better, that it is a huge jump and a braking change. So much has been removed, that I think it is basically a new product, just to register the bundle.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think that makes sense. Even if we were moving from 2.99 to 3.0.0, that would also indicate a breaking release. I think we can use 3.0.0.

description="JQueryUI ready for Plone",
long_description=long_description,
# Get more from https://pypi.org/classifiers/
Expand All @@ -30,12 +30,10 @@
"Framework :: Zope :: 4",
"Framework :: Plone",
"Framework :: Plone :: Addon",
"Framework :: Plone :: 4.3",
"Framework :: Plone :: 5.0",
"Framework :: Plone :: 5.1",
"Framework :: Plone :: 5.2",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
Copy link
Member

Choose a reason for hiding this comment

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

This product doesn't have much in python. I think compatibility with python 2 could be maintained, at least to have a compatible version that fixes the security problem.

"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
Expand All @@ -55,7 +53,7 @@
package_dir={"": "src"},
include_package_data=True,
zip_safe=False,
python_requires=">=2.7",
python_requires=">=3.7",
install_requires=[
"Products.CMFPlone",
"setuptools",
Expand Down
1 change: 0 additions & 1 deletion src/collective/js/jqueryui/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# -*- coding: utf-8 -*-
41 changes: 0 additions & 41 deletions src/collective/js/jqueryui/common.zcml

This file was deleted.

Loading