You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the filebrowser is opened, it attempts to determine the visibility of buttons with the dataprovider.canI() method. However, this results in the the canI call being made before the permissions have been fetched from the back end resulting in incorrect permissions. In addition, the __getButtons method only adds the buttons to the toolbar (or not) during dialog open, so if the initial set of permissions are not correct, the buttons never show regardless of permissions on other folders or sources.
The __getButtons() call should be eliminated.
Code
--- a/src/modules/file-browser/file-browser.ts+++ b/src/modules/file-browser/file-browser.ts@@ -271,7 +271,13 @@ export class FileBrowser extends ViewWithToolbar implements IFileBrowser, Dlgs {
const header = this.c.div();
- this.toolbar?.build(this.__getButtons()).appendTo(header);+ // the __getButtons() call is not valid. It prevents the buttons from EVER displaying+ // regardless of permissions since they are never added to the header.+ // this.toolbar?.build(this.__getButtons()).appendTo(header);++ this.toolbar+ ?.build(this.o.buttons ?? ([] as ButtonsOption))+ .appendTo(header);
this._dialog.open(this.browser, header);
The getButtons call should not filter the existence of the buttons, but rather set the enabled/disabled state of the button.
Expected behavior:
Buttons are enabled/ disabled based on the permissions returned from the backend
Actual behavior:
Buttons are added/removed removed based on the results of the first call to the canI method which may not be correct for all sources/folders.
The text was updated successfully, but these errors were encountered:
Jodit Version: 4.0
Browser: Chrome
OS: Mac
Is React App: False
Description
When the filebrowser is opened, it attempts to determine the visibility of buttons with the
dataprovider.canI()
method. However, this results in the thecanI
call being made before the permissions have been fetched from the back end resulting in incorrect permissions. In addition, the__getButtons
method only adds the buttons to the toolbar (or not) during dialog open, so if the initial set of permissions are not correct, the buttons never show regardless of permissions on other folders or sources.The __getButtons() call should be eliminated.
Code
The getButtons call should not filter the existence of the buttons, but rather set the enabled/disabled state of the button.
Expected behavior:
Buttons are enabled/ disabled based on the permissions returned from the backend
Actual behavior:
Buttons are added/removed removed based on the results of the first call to the
canI
method which may not be correct for all sources/folders.The text was updated successfully, but these errors were encountered: