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

fix: Class Level Permissions dialog throws error TypeError: ce.current is null for newly created class #2549

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

devbymak
Copy link
Contributor

New Pull Request Checklist

Issue Description

Closes: #2547

Approach

The SecurityDialog component is rendered based on the existence of the "perms" value, which is subject to a delay as it is fetched. In this scenario, if the user clicks on the menu item and the "perms" value isn't ready, the value of "clpDialogRef" will be null.

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

Copy link

Thanks for opening this pull request!

@devbymak devbymak changed the title FIX: RELATED TO ISSUE 2547 fix: related to issue 2547 Apr 24, 2024
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: related to issue 2547 fix: Related to issue 2547 Apr 24, 2024
@mtrezza mtrezza changed the title fix: Related to issue 2547 fix: Class Level Permissions dialog throws error TypeError: ce.current is null Apr 25, 2024
@mtrezza
Copy link
Member

mtrezza commented Apr 25, 2024

@mathieulb would you like to test this out, whether it fixes your reported issue?

@mathieulb
Copy link

This is the first time I try installing it from Github, I think.

I did git fetch origin pull/2549/head:pull_2549, then git checkout pull_2549, then npm i, then npm run dev, then I get export 'useId' (imported as 'useId$1') was not found in 'react' in ../node_modules/@graphiql/react/dist/index.es.js lines 6152 & 6153, and Module not found: Error: Can't resolve 'crypto' in 'node_modules/bcryptjs/dist', BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

But apparently it runs anyway, so I logged into dashboard and created a new class and some columns and no data, and then pressed Security -> Class Level Permissions, and I still didn't get any dialog box, but this time without any error in the javascript console. Then I pressed on some other class name on the left and then the CLP dialog suddenly appeared, but it doesn't say for which class this CLP dialog is for. I tried again a few times, same thing. Then I cleared the cache & site data, and logged in again, and this time it worked correctly. But I think that it's the first time I ever tried parse dashboard on port 4040 of 127.0.0.1... every other time, I was using another port number, due to loading it as a npm dep in my parse server. So I don't know how it managed to fail at first, but now I can't get it to fail anymore. (Is that good news ?)

@mtrezza mtrezza closed this Apr 29, 2024
@mtrezza mtrezza reopened this Apr 29, 2024
@mtrezza
Copy link
Member

mtrezza commented Apr 29, 2024

Thanks for testing. The preview environment should work again now, so it will be easier to try this out. Let's see if it appears here in a few minutes...

Copy link

uffizzi-cloud bot commented Apr 29, 2024

Uffizzi Ephemeral Environment deployment-50953

⌚ Updated Apr 29, 2024, 11:17 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2549

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza
Copy link
Member

mtrezza commented Apr 29, 2024

I tested in the preview env:

  1. Create new class "Test"
  2. Create column "s" type String
  3. Click Security > CLP

The result for me is as @mathieulb described: no error log in the JS console, but also no CLP dialog appears.

Click on Refresh button in the data browser does not help, but reloading the entire page by clicking on the page reload button of the browser helps, then the dialog appears when clicking on Security > CLP.

If the class is created server-side, and the default ACL is also set server side, and the permissions need to be fetched from the server after creating the class, then maybe fetching that right after class creation would solve the issue, if both are async operations?

@devbymak
Copy link
Contributor Author

Actually, on creating and dropping a class, the value of clp in the Browser component state was not being updated.

New changes were pushed.

@mtrezza mtrezza closed this Apr 29, 2024
@mtrezza mtrezza reopened this Apr 29, 2024
Copy link

uffizzi-cloud bot commented Apr 29, 2024

Uffizzi Ephemeral Environment deployment-50992

⌚ Updated Apr 29, 2024, 17:17 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2549

📄 View Application Logs etc.

What is Uffizzi? Learn more

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Tested with steps mentioned in #2549 (comment) and now works.

@mtrezza mtrezza changed the title fix: Class Level Permissions dialog throws error TypeError: ce.current is null fix: Class Level Permissions dialog throws error TypeError: ce.current is null for newly created class Apr 30, 2024
@mtrezza mtrezza merged commit 27ed692 into parse-community:alpha Apr 30, 2024
9 of 16 checks passed
parseplatformorg pushed a commit that referenced this pull request Apr 30, 2024
# [6.0.0-alpha.2](6.0.0-alpha.1...6.0.0-alpha.2) (2024-04-30)

### Bug Fixes

* Class Level Permissions dialog throws error `TypeError: ce.current is null` for newly created class ([#2549](#2549)) ([27ed692](27ed692))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Apr 30, 2024
parseplatformorg pushed a commit that referenced this pull request May 16, 2024
# [6.0.0-beta.1](5.4.0...6.0.0-beta.1) (2024-05-16)

### Bug Fixes

* App metrics for user and installation counts show dash ([#2528](#2528)) ([850d7b3](850d7b3))
* Class Level Permissions dialog throws error `TypeError: ce.current is null` for newly created class ([#2549](#2549)) ([27ed692](27ed692))
* Config page fails to load ([#2531](#2531)) ([d721b7c](d721b7c))
* Dashboard crashes if Parse Server Cloud Function script returns object ([#2516](#2516)) ([5de08f8](5de08f8))
* Dashboard scrolls when selecting row in data browser ([#2559](#2559)) ([2aa54a5](2aa54a5))
* Data browser redirects to wrong class when changing app ([#2526](#2526)) ([7713f54](7713f54))
* Deleting all code in the JS Console editor fills in the default code ([#2558](#2558)) ([4b830ba](4b830ba))
* Open pointer in new tab in data browser not working when mount path is not root ([#2527](#2527)) ([2f4081f](2f4081f))

### Features

* Add descriptive statistics for number cells in data browser ([#2529](#2529)) ([ead9ec4](ead9ec4))
* Add filter `starts with` in data browser for fields of type Pointer ([#2553](#2553)) ([0b94ab6](0b94ab6))
* Add Node 20 support; remove Node 14, 16 support ([#2532](#2532)) ([578a339](578a339))
* Add Node 20 support; remove Node 14, 16 support ([#2535](#2535)) ([5c90f2d](5c90f2d))
* Execute script for selected rows ([#2508](#2508)) ([5d9901e](5d9901e))
* Select rows in data browser by clicking and dragging mouse cursor over checkboxes ([#2548](#2548)) ([792ba9e](792ba9e))

### BREAKING CHANGES

* Removes support for Node 14 and 16 ([5c90f2d](5c90f2d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clicking "Class Level Permissions" gives error "TypeError: ce.current is null"
4 participants