From 27ed6920d38bfe6476aaf2cebd4124dc30389959 Mon Sep 17 00:00:00 2001 From: MohammadAli Karimi <65307721+devbymak@users.noreply.github.com> Date: Wed, 1 May 2024 01:17:36 +0400 Subject: [PATCH] fix: Class Level Permissions dialog throws error `TypeError: ce.current is null` for newly created class (#2549) --- src/dashboard/Data/Browser/Browser.react.js | 2 ++ src/dashboard/Data/Browser/BrowserToolbar.react.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index ad5ec9238b..b380268742 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -368,6 +368,7 @@ class Browser extends DashboardView { this.props.schema .dispatch(ActionTypes.CREATE_CLASS, { className }) .then(() => { + this.state.clp[className] = this.props.schema.data.get('CLPs').toJS()[className]; this.state.counts[className] = 0; this.props.navigate(generatePath(this.context, 'browser/' + className)); }) @@ -380,6 +381,7 @@ class Browser extends DashboardView { this.props.schema.dispatch(ActionTypes.DROP_CLASS, { className }).then( () => { this.setState({ showDropClassDialog: false }); + delete this.state.clp[className]; delete this.state.counts[className]; this.props.navigate(generatePath(this.context, 'browser')); }, diff --git a/src/dashboard/Data/Browser/BrowserToolbar.react.js b/src/dashboard/Data/Browser/BrowserToolbar.react.js index b697dd220a..ff3504ad57 100644 --- a/src/dashboard/Data/Browser/BrowserToolbar.react.js +++ b/src/dashboard/Data/Browser/BrowserToolbar.react.js @@ -341,7 +341,7 @@ const BrowserToolbar = ({ disabled={isPendingEditCloneRows} /> {onAddRow &&
} - {perms && enableSecurityDialog ? ( + {enableSecurityDialog ? (