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

3.x The context menu with a gear is shown in a grid in which it should not be #14862

Closed
Ruslan-Aleev opened this issue Dec 1, 2019 · 5 comments

Comments

@Ruslan-Aleev
Copy link
Collaborator

Ruslan-Aleev commented Dec 1, 2019

Bug report

Summary

Unfortunately, the new and cool menu is shown on almost all grids, even in which there are no actions, for example (/manager/?a=source):

gear-menu

This is very confusing. Need additional check.
We partially discussed this in PR - #14806 (comment), created a separate issue, so that the bug is not lost.

Environment

MODX 3

@Mark-H
Copy link
Collaborator

Mark-H commented Dec 1, 2019

Yeah, there will be cases of this. It's easy to fix. Would be great to get a list (in a single issue) of the grids that are affected so they can be quickly fixed ahead of the alpha.

@Ruslan-Aleev
Copy link
Collaborator Author

Ruslan-Aleev commented Dec 1, 2019

Is it possible to do this somehow more universally?
For example, in grids where there is a context menu there is a call to getMenu (this function, in my opinion, has this name everywhere) - https://github.com/modxcms/revolution/blob/3.x/manager/assets/modext/widgets/source/modx.panel.sources.js#L142.
And in grids where there is no context menu, getMenu is also not called - https://github.com/modxcms/revolution/blob/3.x/manager/assets/modext/widgets/source/modx.panel.sources.js#L298. Two different grids (with and without actions) in one file.
p.s. Perhaps my example is not correct.

Unfortunately, there are a lot of files with grids, and again they are not clearly named (somewhere the grids are called by a separate file, and somewhere there are several grids in the form of tabs in one file) and how to understand which file is connected and where - is not obvious.

@JoshuaLuckers
Copy link
Contributor

JoshuaLuckers commented Dec 2, 2019

List of grid components that don't have a getMenu function:

  • MODx.grid.Search - manager/assets/modext/widgets/modx.panel.search.js
  • MODx.grid.PluginEvent - manager/assets/modext/widgets/element/modx.grid.plugin.event.js
  • MODx.grid.TVSecurity - manager/assets/modext/widgets/element/modx.grid.tv.security.js
  • MODx.grid.TemplateVarTemplate - manager/assets/modext/widgets/element/modx.grid.tv.template.js
  • MODx.grid.ActiveResources - manager/assets/modext/widgets/resource/modx.grid.resource.active.js
  • MODx.grid.ResourceSecurity - manager/assets/modext/widgets/resource/modx.grid.resource.security.js
  • MODx.grid.ResourceSchedule - manager/assets/modext/widgets/resource/modx.panel.resource.schedule.js
  • MODx.grid.RoleUser - manager/assets/modext/widgets/security/modx.grid.role.user.js
  • MODx.grid.UserGroupCategory - manager/assets/modext/widgets/security/modx.grid.user.group.category.js
  • MODx.grid.UserGroupNamespace - manager/assets/modext/widgets/security/modx.grid.user.group.namespace.js
  • MODx.grid.UserGroupResourceGroup - manager/assets/modext/widgets/security/modx.grid.user.group.resource.js
  • MODx.grid.UserGroupSource - manager/assets/modext/widgets/security/modx.grid.user.group.source.js
  • MODx.grid.WhoIsOnline - manager/assets/modext/widgets/security/modx.grid.user.online.js
  • MODx.grid.RecentlyEditedResourcesByUser - manager/assets/modext/widgets/security/modx.grid.user.recent.resource.js
  • MODx.grid.SourceTypes - manager/assets/modext/widgets/source/modx.panel.sources.js
  • MODx.grid.ManagerLog - manager/assets/modext/widgets/system/modx.grid.manager.log.js
  • MODx.grid.DatabaseTables - manager/assets/modext/widgets/system/mysql/modx.grid.databasetables.js
  • MODx.grid.DatabaseTables - manager/assets/modext/widgets/system/sqlsrv/modx.grid.databasetables.js
  • MODx.grid.PackageBrowserGrid - manager/assets/modext/workspace/package.browser.panels.js
  • MODx.grid.Package - manager/assets/modext/workspace/package.grid.js
  • MODx.grid.Provider - manager/assets/modext/workspace/provider.grid.js
  • MODx.grid.Language - manager/assets/modext/workspace/lexicon/language.grid.js
  • MODx.grid.LexiconTopic - manager/assets/modext/workspace/lexicon/lexicon.topic.grid.js
  • MODx.grid.PackageVersions - manager/assets/modext/workspace/package/package.versions.grid.js

@Ruslan-Aleev
Copy link
Collaborator Author

Ruslan-Aleev commented Dec 2, 2019

Unfortunately, it turned out to be more difficult. For example, in the search (/manager/?a=search), the context menu works, but getMenu is not called - https://github.com/modxcms/revolution/blob/3.x/manager/assets/modext/widgets/modx.panel.search.js

Here the context menu works:

  • MODx.grid.Search - manager/assets/modext/widgets/modx.panel.search.js (Search page /manager/?a=search)
  • MODx.grid.PluginEvent - manager/assets/modext/widgets/element/modx.grid.plugin.event.js ("System Events" tab in Plugin edit page)
  • MODx.grid.RoleUser - manager/assets/modext/widgets/security/modx.grid.role.user.js (If this is a user editing page /manager/?a=security/user/update&id=1, the "Access Permission" tab)
  • MODx.grid.RecentlyEditedResourcesByUser - manager/assets/modext/widgets/security/modx.grid.user.recent.resource.js (Account editing page /manager/?a=security/profile, "Recent Resources" tab, but if this a page /manager/?a=system/info, the "Recent documents" tab, then menu dont work :) )

User Group editing page /manager/?a=security/usergroup/update&id=1, the "Permissions" tab)

  • MODx.grid.UserGroupCategory - manager/assets/modext/widgets/security/modx.grid.user.group.category.js ("Element Category Access")
  • MODx.grid.UserGroupNamespace - manager/assets/modext/widgets/security/modx.grid.user.group.namespace.js ("Namespace Access")
  • MODx.grid.UserGroupResourceGroup - manager/assets/modext/widgets/security/modx.grid.user.group.resource.js ("Resource Group Access")
  • MODx.grid.UserGroupSource - manager/assets/modext/widgets/security/modx.grid.user.group.source.js ("Media Source Access")

As a result, it is not clear whether there is a broken context menu, because in the examples above there is no call to getMenu, but the context menu works :)

@theboxer
Copy link
Member

theboxer commented Dec 5, 2019

getMenu function is on every grid that extends MODx.grid.Grid. It defaults to a menu value returned from the processor for each row.

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

No branches or pull requests

4 participants