Bug 48839 - App Tabs: Be fully backwards compatible while enabling tab for Apps installed in 4.3
App Tabs: Be fully backwards compatible while enabling tab for Apps installed...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Users
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4
Assigned To: Dirk Wiesenthal
Florian Best
: interim-3
: 48791 (view as bug list)
Depends on: 48621
Blocks: 48791 48895
  Show dependency treegraph
 
Reported: 2019-03-04 04:19 CET by Dirk Wiesenthal
Modified: 2019-03-12 13:40 CET (History)
6 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments
Screenshot: Layout messed up (53.56 KB, image/png)
2019-03-05 12:44 CET, Florian Best
Details
Screenshot: Icon wrong (70.40 KB, image/png)
2019-03-05 12:45 CET, Florian Best
Details
Still wrong icon (38.56 KB, image/png)
2019-03-06 14:13 CET, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2019-03-04 04:19:10 CET
Maybe we can implement the App Tabs by not changing 4.3 at all.

Idea: Modify the UMC layout. (I.e., UMC only, not changing UDM)

+++ This bug was initially created as a clone of Bug #48621 +++

The users/user view should have a tab which shows a checkbox for every available app and to activate users for this app.

See attachment for a mock up.
Comment 1 Dirk Wiesenthal univentionstaff 2019-03-04 04:36:22 CET
Done like this:

ini files may now specify the attributes that act as options. As such, they do not need to be specified in the .attributes file, they may be created by the join script.

univention-app dev-set openproject UMCOptionsAttributes=openprojectActivated

This option is only known to UCS 4.4, but if we change every ini file, Apps installed by any 4.3 systems will still generate the App tab as the tab is rendered on the 4.4 master system. Installed apps are recognized by the appcenter/apps UDM module.

We hack into get_layout and get_options so that an attribute like openprojectActivated is the name of an option. Associated attributes (in this case: openproject-isadmin) are put into its own App specific tab.

This is done by searching all extended attributes that are in the same container and are connected to the same UDM module.

We also change modify and add so that an activated option is mapped to a "TRUE" value for the actual attribute.

=> No settings/extended_option needed. No subtle change in the LDAP behaviour. No new .attributes file needed. No errata for 4.3 needed. No 4.3/4.4 mixed installation issues.

The new layout is very simple and currently does not support fancy layout-in-layout.

Tested with OpenProject, ownCloud, Nextcloud.
(Needs explicit settings in the ini file, though!)

Not tested with OX.

Failed for current SuiteCRM. But this is not a huge problem: Just do not specify anything in the ini file and it works as before, just without the neat Apps tab.

Git: 848cd19e1adec7192b2aa4dcc2c647dbcccb2bec
Comment 2 Florian Best univentionstaff 2019-03-04 12:55:21 CET
*** Bug 48791 has been marked as a duplicate of this bug. ***
Comment 3 Florian Best univentionstaff 2019-03-05 12:05:34 CET
Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 253, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 117, in _decoarated
    ret = [func(self, request) for request.options in options]
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 836, in layout
    return module.get_layout(object_dn)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 884, in get_layout
    layout = AppAttributes.new_layout(self.name, layout)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 266, in new_layout
    options = cls.options_for_module(module)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 199, in options_for_module
    for option_name, option_def in cls.data_for_module(module).iteritems():
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 194, in data_for_module
    return cls._get_cache().get(module, {})
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 160, in _get_cache
    if obj['sytax'] == 'boolean':
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 466, in __getitem__
    elif key not in self.__no_default and self.descriptions[key].editable:
KeyError: 'sytax'
Comment 4 Dirk Wiesenthal univentionstaff 2019-03-05 12:06:34 CET
Currently building
  univention-management-console-module-udm 9.0.6-5A~4.4.0.201903051205
Comment 5 Florian Best univentionstaff 2019-03-05 12:44:42 CET
Created attachment 9887 [details]
Screenshot: Layout messed up
Comment 6 Florian Best univentionstaff 2019-03-05 12:45:15 CET
Created attachment 9888 [details]
Screenshot: Icon wrong
Comment 7 Florian Best univentionstaff 2019-03-05 12:49:59 CET
It is very strange/odd now and I can't explain what's the cause but:

* The icon for some apps is wrong now (Guacomole shows RocketChat icon).
* The tab name is wrong (Open-Xchange is called Guacomole)
* The widgets are on the wrong tab (openprojectActivated is shown on the OX tab)
* Why is Open-Xchange even affected? It's not using the "UMCOptionsAttributes".
Comment 8 Dirk Wiesenthal univentionstaff 2019-03-05 16:40:18 CET
This was because you had several settings/extended_options in your domain. Currently, this cannot happen. But if we want to migrate existing Apps, we should not render those twice...

Fixed in
  univention-management-console-module-udm 9.0.7-3A~4.4.0.201903051639
Comment 9 Jürn Brodersen univentionstaff 2019-03-06 13:06:52 CET
I think commit 848cd19e1adec7192b2aa4dcc2c647dbcccb2bec broke:
69_udm-syntax/20_ucrwidget
http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-0/job/AutotestUpgrade/lastCompletedBuild/SambaVersion=s4,Systemrolle=master/testReport/69_udm-syntax/20_ucrwidget/test/

Could you take a look?
The test checks if it is possible to override umc widgets through ucr which is used by IN8. Currently this does not seem to work. I might be using  extended_attribute wrong in the test.
Comment 10 Florian Best univentionstaff 2019-03-06 14:13:41 CET
Created attachment 9896 [details]
Still wrong icon
Comment 11 Florian Best univentionstaff 2019-03-06 14:15:28 CET
root@master5:/var/www/univention/js/dijit/themes/umc/icons/scalable# ls guacamole* -l
lrwxrwxrwx 1 root root 34 Mär  6 00:23 guacamoleActivated.svg -> apps-rocketchat_20190128160726.svg
lrwxrwxrwx 1 root root 33 Mär  4 10:13 guacamoleUser.svg -> apps-guacamole_20180525181438.svg
Comment 12 Dirk Wiesenthal univentionstaff 2019-03-06 14:53:13 CET
(In reply to Florian Best from comment #10)
> Created attachment 9896 [details]
> Still wrong icon

Error in Test App Center ini files.
Comment 13 Florian Best univentionstaff 2019-03-06 14:56:42 CET
(In reply to Jürn Brodersen from comment #9)
> I think commit 848cd19e1adec7192b2aa4dcc2c647dbcccb2bec broke:
> 69_udm-syntax/20_ucrwidget
> http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-0/job/
> AutotestUpgrade/lastCompletedBuild/SambaVersion=s4,Systemrolle=master/
> testReport/69_udm-syntax/20_ucrwidget/test/
> 
> Could you take a look?
> The test checks if it is possible to override umc widgets through ucr which
> is used by IN8. Currently this does not seem to work. I might be using 
> extended_attribute wrong in the test.
I checked it, yes, the test case was broken by the changes.
Comment 14 Florian Best univentionstaff 2019-03-06 16:16:23 CET
The tabs are not sorted by names anymore. Order is e.g. Open-Xchange, Nextcloud, owncloud.
Can be ignored?
Comment 15 Daniel Tröder univentionstaff 2019-03-07 08:51:24 CET
IMHO the UDM UMC module should not depend on the AppCenter (talking about the appcenter import in udm_ldap.AppAttributes).

One is a frontend for a general LDAP abstraction, the other a networked package manager and configuration system.
It looks to me like a layering breach. At least it should not be so tightly coupled!

But if it must be done this way, then please add the dependency to the Debian "control" file.
Comment 16 Florian Best univentionstaff 2019-03-07 09:24:20 CET
(In reply to Daniel Tröder from comment #15)
Yes, that's also my opinion.
It would be nice if the appcenter could store these relevant information somewhere, for example in UCR variables.
Comment 17 Dirk Wiesenthal univentionstaff 2019-03-07 15:58:02 CET
Fixed in
  univention-management-console-module-udm 9.0.10-3A~4.4.0.201903071539

Test adjusted in
  ucs-test 9.0.2-7A~4.4.0.201903071535
Comment 18 Daniel Tröder univentionstaff 2019-03-07 22:20:15 CET
Commit 5e9c7a17 (Bug #48839: Hide widgets that shall not be visible in UMC) is not complete. The LDAP browser of the UMC sets the value of boolean False to '0' not None/False, so line 205 should be something like:

- if _obj['disableUDMWeb']:
+ if _obj['disableUDMWeb'] == '1':
Comment 19 Dirk Wiesenthal univentionstaff 2019-03-08 02:18:07 CET
Fixed in
  univention-management-console-module-udm 9.0.10-5A~4.4.0.201903080208
Comment 20 Florian Best univentionstaff 2019-03-08 17:56:30 CET
I adjusted the implementation so that it allows an alias for the option name, so that it doesn't need to be foobarActivated but foobarUser. This is required for user templates which store an option name.

univention-appcenter (8.0.11-1)
244541eb7814 | Bug #48839: allow attribute:option syntax for app.umc_options_attributes

univention-management-console-module-udm (9.0.11-1)
3bbfe4c58dd6 | Bug #48839: use attribute:option syntax for app.umc_options_attributes
Comment 21 Florian Best univentionstaff 2019-03-08 17:58:47 CET
OK: app tabs are displayed
OK: thread safety (cache is set as atomic operation)
OK: univention.admin.modules.init() only called once
OK: cache is only set in case everything works to prevent half-set states
OK: changelog
Comment 22 Florian Best univentionstaff 2019-03-12 13:40:56 CET
UCS 4.4 has been released:
 https://docs.software-univention.de/release-notes-4.4-0-en.html
 https://docs.software-univention.de/release-notes-4.4-0-de.html

If this error occurs again, please use "Clone This Bug".