robertkasza 2f4b3768c7 fix (dashboard): allow permission variables with in operator (#3461)
### **PR Type**
Bug fix, Tests, Enhancement


___

### **Description**
- Refactor FancyMultiSelect to controlled component

- Enhance RuleValueInput `_in` operator for system variables

- Add unit tests for RuleValueInput variable selection

- Include `Allowed-Ids` in permission variables list


___

### Diagram Walkthrough


```mermaid
flowchart LR
  FV["Form value"]
  GD["getDefaultValueForMultiSelect"]
  FMS["FancyMultiSelect"]
  OC["handleOnChange"]
  SV["setValue"]
  FV -- "parsed by" --> GD
  GD -- "initializes" --> FMS
  FMS -- "user selects" --> OC
  OC -- "updates" --> SV
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>fancy-multi-select.tsx</strong><dd><code>Make
FancyMultiSelect controlled and test-friendly</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/components/ui/v3/fancy-multi-select.tsx

<ul><li>Export <code>Option</code> type<br> <li> Use controlled
<code>value</code> instead of <code>defaultValue</code><br> <li> Sync
selected via <code>useEffect</code> on <code>value</code> changes<br>
<li> Add <code>data-testid</code> to badge span</ul>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3461/files#diff-6e6a7965a2c8e30e9a2c021a5009ff79e71de73892b86a3468d3474163dfeb03">+13/-5</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>getAllPermissionVariables.ts</strong><dd><code>Add
Allowed-Ids system variable</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>


dashboard/src/features/orgs/projects/permissions/settings/utils/getAllPermissionVariables/getAllPermissionVariables.ts

- Include `Allowed-Ids` as system variable


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3461/files#diff-9973106a26aa99d744772d8dfb09281b3f4f2cdaa3f865b2510f47fb9061089c">+6/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Bug fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>RuleValueInput.tsx</strong><dd><code>Enhance
RuleValueInput for in-operator variables</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>


dashboard/src/features/orgs/projects/database/dataGrid/components/RuleGroupEditor/RuleValueInput.tsx

<ul><li>Import <code>Option</code> type<br> <li> Add
<code>getDefaultValueForMultiSelect</code> util<br> <li> Implement
<code>handleOnChange</code> for permission variables<br> <li> Switch
<code>FancyMultiSelect</code> to use controlled props</ul>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3461/files#diff-e3198b245b5963e81e4566758b7d60c8d2784a7ca0ad0b17b354b33074ef1bb0">+57/-11</a>&nbsp;
</td>

</tr>
</table></td></tr><tr><td><strong>Tests</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>RuleValueInput.test.tsx</strong><dd><code>Add tests for
RuleValueInput selection logic</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>


dashboard/src/features/orgs/projects/database/dataGrid/components/RuleGroupEditor/RuleValueInput.test.tsx

<ul><li>Add tests for <code>_in</code> operator variable selection<br>
<li> Mock project and permissions hooks<br> <li> Verify system and
custom variable behaviors</ul>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3461/files#diff-cbb7789d45602230164e65506d0b2132b420b0cddead70ab8b012b0bb5897162">+170/-0</a>&nbsp;
</td>

</tr>
</table></td></tr><tr><td><strong>Miscellaneous</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>signup.tsx</strong><dd><code>Cleanup console logs in
signup page</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/pages/signup.tsx

- Remove debugging `console.log` statements


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3461/files#diff-fc2b5989e3bbafda1d3d8b2317d24c39ef2b8cec0c4dc410170fa2da13464f68">+0/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>dry-snails-type.md</strong><dd><code>Add changelog for
permission variables fix</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

.changeset/dry-snails-type.md

- Add changeset entry for dashboard patch


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3461/files#diff-ccdfc53a10fb172936e239d895569a94a5413d1f8a6d1d81270bcd4051ba64e1">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-09-16 13:38:25 +02:00
2022-05-19 15:33:52 +02:00
2025-08-29 16:48:22 +02:00
2025-06-03 16:01:52 +02:00
2022-02-07 20:10:51 +01:00
2021-03-01 16:48:44 +01:00
2022-11-28 15:59:04 +01:00
2025-07-25 10:46:53 +02:00
2024-02-06 10:00:38 +01:00

Nhost

Nhost

Quickstart   •   Website   •   Docs   •   Blog   •   Twitter   •   Discord   •   Ask Nhost Guru (third party, unofficial)


Nhost is an open source Firebase alternative with GraphQL, built with the following things in mind:

  • Open Source
  • GraphQL
  • SQL
  • Great Developer Experience

Nhost consists of open source software:

Architecture of Nhost




Visit https://docs.nhost.io for the complete documentation.

Get Started

Option 1: Nhost Hosted Platform

  1. Sign in to Nhost.
  2. Create Nhost app.
  3. Done.

Option 2: Self-hosting

Since Nhost is 100% open source, you can self-host the whole Nhost stack. Check out the example docker-compose file to self-host Nhost.

Sign In and Make a GraphQL Request

Install the @nhost/nhost-js package and start building your app:

import { NhostClient } from '@nhost/nhost-js'

const nhost = new NhostClient({
  subdomain: '<your-subdomain>',
  region: '<your-region>'
})

await nhost.auth.signIn({ email: 'user@domain.com', password: 'userPassword' })

await nhost.graphql.request(`{
  users {
    id
    displayName
    email
  }
}`)

Frontend Agnostic

Nhost is frontend agnostic, which means Nhost works with all frontend frameworks.

Resources

  • Start developing locally with the Nhost CLI

Nhost Clients

Integrations

Applications

Community ❤️

First and foremost: Star and watch this repository to stay up-to-date.

Also, follow Nhost on GitHub Discussions, our Blog, and on Twitter. You can chat with the team and other members on Discord and follow our tutorials and other video material at YouTube.

Nhost is Open Source

This repository, and most of our other open source projects, are licensed under the MIT license.

ROSS Index - Fastest Growing Open-Source Startups | Runa Capital

How to contribute

Here are some ways of contributing to making Nhost better:

Contributors

A table of avatars from the project's contributors

Languages
TypeScript 67.8%
Go 17.5%
HTML 6.8%
CSS 1.9%
Vue 1.8%
Other 4%