mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-08-15 13:40:29 +03:00
console: refactor PermissionBuilder.js to typescript
### Changelog no changelog required ### Affected components - [ ] Server - [x] Console - [ ] CLI - [ ] Docs - [ ] Community Content - [ ] Build System - [ ] Tests - [ ] Other (list it) https://github.com/hasura/graphql-engine-mono/pull/2122 GitOrigin-RevId: d12d225454659621198286c15965345c7a8a8e01
This commit is contained in:
parent
81df199169
commit
dc4713b9d3
@ -165,7 +165,11 @@ export const isStringArray = (str: string): boolean => {
|
||||
|
||||
/* JSON utils */
|
||||
|
||||
export function getAllJsonPaths(json: any, leafKeys: any[], prefix = '') {
|
||||
export function getAllJsonPaths(
|
||||
json: any,
|
||||
leafKeys: any[],
|
||||
prefix = ''
|
||||
): Record<string, any>[] | string[] {
|
||||
const paths = [];
|
||||
|
||||
const addPrefix = (subPath: string) => {
|
||||
@ -175,7 +179,7 @@ export function getAllJsonPaths(json: any, leafKeys: any[], prefix = '') {
|
||||
const handleSubJson = (subJson: any, newPrefix: string) => {
|
||||
const subPaths = getAllJsonPaths(subJson, leafKeys, newPrefix);
|
||||
|
||||
subPaths.forEach(subPath => {
|
||||
subPaths.forEach((subPath: typeof subPaths[0]) => {
|
||||
paths.push(subPath);
|
||||
});
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import styles from './PermissionBuilder.scss';
|
||||
import { addToPrefix } from './utils';
|
||||
|
||||
type OptGroup = { optGroupTitle: string; options: string[] };
|
||||
export type OptGroup = { optGroupTitle: string; options: string[] };
|
||||
interface SelectGroupProps {
|
||||
selectDispatchFunc: (value: string) => void;
|
||||
value: string;
|
||||
|
@ -82,6 +82,7 @@ export type CheckConstraint = {
|
||||
};
|
||||
|
||||
export type ComputedField = {
|
||||
name?: string;
|
||||
computed_field_name: string;
|
||||
definition: {
|
||||
function: FunctionDefinition;
|
||||
|
Loading…
Reference in New Issue
Block a user