[BUG] Custom menu name of an app is not respected #148

Closed
opened 2022-10-27 14:19:15 +02:00 by jacotec · 2 comments

Issue

Some apps like "Bigbluebotton Integration" allows to configure the menu name, so in the top menu of NC the configured name (in my case JayMeet) is used instead of the native app name. See https://github.com/sualko/cloud_bbb and search for "app.navigation.name".

Looks like this:

image

Unfortunately the Custom Menu app does not respect this:

image

Environment

  • Custom menu version:
  • Nextcloud version:
  • PHP version:
  • Web server (Nginx, Apache2):
  • Web browser and version (Firefox 80, Google Chrome 74, etc):
{
    "add-logo-link": "1",
    "always-displayed": "0",
    "apps-categories-custom": "{\"activity\":\"files\",\"tasks\":\"cat8362360847804522\",\"bbb\":\"social\",\"dashboard\":\"files\",\"files\":\"files\",\"deck\":\"cat8362360847804522\",\"photos\":\"cat969493617801563\",\"calendar\":\"cat8362360847804522\",\"quicknotes\":\"cat8362360847804522\",\"notes\":\"cat8362360847804522\",\"spreed\":\"social\",\"appointments\":\"cat8362360847804522\",\"polls\":\"cat8362360847804522\",\"fulltextsearch\":\"files\"}",
    "background-color": "#0068a1",
    "background-color-opacity": "100",
    "background-color-to": "#0068a1",
    "big-menu": "0",
    "big-menu-hidden-apps": "[]",
    "categories-custom": "[{\"id\":\"cat707264107304233\",\"en\":\"Files\",\"de\":\"Dateien\",\"de_DE\":\"Dateien\"},{\"id\":\"cat969493617801563\",\"en\":\"Media\",\"de\":\"Medien\",\"de_DE\":\"Medien\"},{\"id\":\"cat9817576932264227\",\"en\":\"Communication\",\"de\":\"Kommunikation\",\"de_DE\":\"Kommunikation\"},{\"id\":\"cat8362360847804522\",\"en\":\"Office\",\"de\":\"Office\",\"de_DE\":\"Office\"},{\"id\":\"cat6157622385991721\",\"en\":\"Others\",\"de\":\"Andere\",\"de_DE\":\"Andere\"}]",
    "categories-order": "[\"other\",\"cat6157622385991721\",\"customization\",\"office\",\"dashboard\",\"files\",\"cat707264107304233\",\"integration\",\"external_links\",\"workflow\",\"social\",\"cat9817576932264227\",\"cat969493617801563\",\"multimedia\",\"cat8362360847804522\",\"organization\",\"security\",\"games\",\"search\",\"tools\",\"monitoring\"]",
    "categories-order-type": "default",
    "current-app-background-color": "#005b8d",
    "dark-mode-background-color": "#0068a1",
    "dark-mode-background-color-opacity": "100",
    "dark-mode-background-color-to": "#0068a1",
    "dark-mode-current-app-background-color": "#005b8d",
    "dark-mode-icon-invert-filter": "0",
    "dark-mode-icon-opacity": "100",
    "dark-mode-loader-color": "#ffffff",
    "dark-mode-opener": "side-menu-opener",
    "dark-mode-text-color": "#ffffff",
    "default-enabled": "1",
    "display-logo": "1",
    "enabled": "yes",
    "force": "1",
    "hide-when-no-apps": "1",
    "icon-invert-filter": "0",
    "icon-opacity": "100",
    "installed_version": "2.5.1",
    "loader-color": "#339bd4",
    "loader-enabled": "1",
    "opener": "side-menu-opener",
    "opener-hover": "0",
    "opener-only": "0",
    "opener-position": "before",
    "show-settings": "1",
    "side-with-categories": "1",
    "size-icon": "small",
    "size-text": "small",
    "target-blank-apps": "[]",
    "text-color": "#ffffff",
    "top-menu-apps": "[\"activity\",\"photos\",\"spreed\"]",
    "top-side-menu-apps": "[\"bbb\",\"files\"]",
    "types": "",
    "use-avatar": "0"
}

Steps to reproduce

Install the Bigbluebutton Integration app and configure a custom menu name with the app.navigation.name parameter. Add the app to the top and the side menu.

Observed Results

In the top menu the configured menu name is correctly used. In the side menu this is ignored and the native app name is used.

Expected Results

The configured app name should be shown in the top- and the side menu.

## Issue Some apps like "Bigbluebotton Integration" allows to configure the menu name, so in the top menu of NC the configured name (in my case JayMeet) is used instead of the native app name. See https://github.com/sualko/cloud_bbb and search for "app.navigation.name". Looks like this: ![image](/attachments/adecfcb4-85f9-4d6f-b24d-bef4e4fa4301) Unfortunately the Custom Menu app does not respect this: ![image](/attachments/a9ded858-994a-43d5-9fe6-bd5dd706f000) ### Environment * Custom menu version: * Nextcloud version: * PHP version: * Web server (Nginx, Apache2): * Web browser and version (Firefox 80, Google Chrome 74, etc): ``` { "add-logo-link": "1", "always-displayed": "0", "apps-categories-custom": "{\"activity\":\"files\",\"tasks\":\"cat8362360847804522\",\"bbb\":\"social\",\"dashboard\":\"files\",\"files\":\"files\",\"deck\":\"cat8362360847804522\",\"photos\":\"cat969493617801563\",\"calendar\":\"cat8362360847804522\",\"quicknotes\":\"cat8362360847804522\",\"notes\":\"cat8362360847804522\",\"spreed\":\"social\",\"appointments\":\"cat8362360847804522\",\"polls\":\"cat8362360847804522\",\"fulltextsearch\":\"files\"}", "background-color": "#0068a1", "background-color-opacity": "100", "background-color-to": "#0068a1", "big-menu": "0", "big-menu-hidden-apps": "[]", "categories-custom": "[{\"id\":\"cat707264107304233\",\"en\":\"Files\",\"de\":\"Dateien\",\"de_DE\":\"Dateien\"},{\"id\":\"cat969493617801563\",\"en\":\"Media\",\"de\":\"Medien\",\"de_DE\":\"Medien\"},{\"id\":\"cat9817576932264227\",\"en\":\"Communication\",\"de\":\"Kommunikation\",\"de_DE\":\"Kommunikation\"},{\"id\":\"cat8362360847804522\",\"en\":\"Office\",\"de\":\"Office\",\"de_DE\":\"Office\"},{\"id\":\"cat6157622385991721\",\"en\":\"Others\",\"de\":\"Andere\",\"de_DE\":\"Andere\"}]", "categories-order": "[\"other\",\"cat6157622385991721\",\"customization\",\"office\",\"dashboard\",\"files\",\"cat707264107304233\",\"integration\",\"external_links\",\"workflow\",\"social\",\"cat9817576932264227\",\"cat969493617801563\",\"multimedia\",\"cat8362360847804522\",\"organization\",\"security\",\"games\",\"search\",\"tools\",\"monitoring\"]", "categories-order-type": "default", "current-app-background-color": "#005b8d", "dark-mode-background-color": "#0068a1", "dark-mode-background-color-opacity": "100", "dark-mode-background-color-to": "#0068a1", "dark-mode-current-app-background-color": "#005b8d", "dark-mode-icon-invert-filter": "0", "dark-mode-icon-opacity": "100", "dark-mode-loader-color": "#ffffff", "dark-mode-opener": "side-menu-opener", "dark-mode-text-color": "#ffffff", "default-enabled": "1", "display-logo": "1", "enabled": "yes", "force": "1", "hide-when-no-apps": "1", "icon-invert-filter": "0", "icon-opacity": "100", "installed_version": "2.5.1", "loader-color": "#339bd4", "loader-enabled": "1", "opener": "side-menu-opener", "opener-hover": "0", "opener-only": "0", "opener-position": "before", "show-settings": "1", "side-with-categories": "1", "size-icon": "small", "size-text": "small", "target-blank-apps": "[]", "text-color": "#ffffff", "top-menu-apps": "[\"activity\",\"photos\",\"spreed\"]", "top-side-menu-apps": "[\"bbb\",\"files\"]", "types": "", "use-avatar": "0" } ``` ### Steps to reproduce Install the Bigbluebutton Integration app and configure a custom menu name with the app.navigation.name parameter. Add the app to the top and the side menu. ### Observed Results In the top menu the configured menu name is correctly used. In the side menu this is ignored and the native app name is used. ### Expected Results The configured app name should be shown in the top- and the side menu.
deblan 2022-10-27 20:30:51 +02:00
Owner

Release in v3.2.0! 👍

Release in v3.2.0! 👍

Hi @debian,

It seems this bug is not really fixed. It is still present with "BBB" and "Announcement Center".

As far as i could see, AppRepository is in charge of overriding the name of the App:

                $app['name'] = $this->getAppName($app);
                $app['href'] = $navigation[$id]['href'];
                $app['icon'] = $navigation[$id]['icon'];

But why ? This doesn't work, as getAppName re-take the name from config value, according to NextStandard, but... Take as default the translated name of the App, according to its ID.

public function getAppName($app): string
{
return $this->config->getAppValue(
'app.navigation.name',
$this->l10nFactory->get($app['id'])->t($app['name']),
$app['id']
);
}
This is not correct (for the default part), indeed, BBB as its own naming procedure (see github.com/littleredbutton/cloud_bbb@c42e77d9b6/lib/AppInfo/Application.php (L84) ) wich defines "BBB" as default.

And AnnouncementCenter uses a dedicated appinfo/info.xml navigation entry point:


Announcements
announcementcenter.page.index
10

This is quite complicated, and i don't know why Apprepository overrides these values (even href) ? Why not using what the navigation manager provides or at least, use as default name for getAppName, not the translated part of appid, but the original name given by
$this->navigationManager->getAll();

What do you think about it ?

Hi @debian, It seems this bug is not really fixed. It is still present with "BBB" and "Announcement Center". As far as i could see, AppRepository is in charge of overriding the name of the App: $app['name'] = $this->getAppName($app); $app['href'] = $navigation[$id]['href']; $app['icon'] = $navigation[$id]['icon']; But why ? This doesn't work, as getAppName re-take the name from config value, according to NextStandard, but... Take as default the translated name of the App, according to its ID. public function getAppName($app): string { return $this->config->getAppValue( 'app.navigation.name', **$this->l10nFactory->get($app['id'])->t($app['name']),** $app['id'] ); } This is not correct (for the default part), indeed, BBB as its own naming procedure (see https://github.com/littleredbutton/cloud_bbb/blob/c42e77d9b6f317c0b24f154d813f03c49772bd84/lib/AppInfo/Application.php#L84 ) wich defines "BBB" as default. And AnnouncementCenter uses a dedicated appinfo/info.xml navigation entry point: <navigations> <navigation> <name>Announcements</name> <route>announcementcenter.page.index</route> <order>10</order> </navigation> </navigations> This is quite complicated, and i don't know why Apprepository overrides these values (even href) ? Why not using what the navigation manager provides or at least, use as default name for getAppName, not the translated part of appid, but the original name given by $this->navigationManager->getAll(); What do you think about it ?
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deblan/side_menu#148
No description provided.