From a3deb5eff0a4ccc87852cf6ea02239085a23aa86 Mon Sep 17 00:00:00 2001 From: Julian <118911427+julian-mayorga@users.noreply.github.com> Date: Fri, 28 Jul 2023 16:11:50 -0300 Subject: [PATCH] Group Permission editors into the same folder This will make it easier to make changes and reuse code on the future. They were grouped together by only the storybook title. Now they are on the same folder, which is `frontend/libs/console/legacy-ce/src/lib/Permissions`. Since now they are together, removed the title to all storybook stories. Important: I did not make any behavior changes. Only moved code around. I need this for a separate PR but I thought it was good to create this isolated PR with non behavioral changes so it's easy to review (it has a lot of files changed). Jira ticket: https://hasurahq.atlassian.net/browse/DSF-496 PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9974 GitOrigin-RevId: 940020d06e0144eac95c614f84aea122852396b9 --- .../components/LogicalModelTabs.tsx | 2 +- .../lib/features/Data/LogicalModels/index.ts | 2 +- .../Data/ManageFunction/components/Modify.tsx | 2 +- ...ModifyFunctionPermissionsDialog.stories.tsx | 3 +-- .../ModifyFunctionPermissionsDialog.tsx | 18 +++++++++--------- .../FunctionPermissions}/mocks/config.ts | 0 .../FunctionPermissions/mocks/index.ts | 0 .../FunctionPermissions/mocks/metadata.ts | 0 .../FunctionPermissions/utils.ts | 4 ++-- .../LogicalModelPermissions.stories.tsx | 3 +-- .../LogicalModelPermissions.tsx | 2 +- .../LogicalModelPermissionsPage.stories.tsx | 5 ++--- .../LogicalModelPermissionsPage.tsx | 10 +++++----- .../LogicalModelPermissionsFormProvider.tsx | 0 .../components/PermissionAccessCell.tsx | 2 +- .../components/PermissionsForm.tsx | 10 +++++----- .../components/PermissionsRow.tsx | 0 .../components/PermissionsRowName.tsx | 0 .../components/PermissionsTable.tsx | 2 +- .../components/types.ts | 2 +- .../hooks/useCreateLogicalModelsPermissions.ts | 10 +++++----- .../hooks/usePermissionForm.ts | 0 .../hooks/useRemoveLogicalModelsPermissions.ts | 10 +++++----- .../hooks/utils/errorTransform.ts | 0 .../hooks/utils/getCreateLogicalModelBody.ts | 2 +- .../hooks/utils/getDeleteLogicalModelBody.ts | 2 +- .../hooks/utils/getPermissionValues.ts | 0 .../hooks/utils/index.ts | 0 .../LogicalModelPermissions}/mocks/config.ts | 0 .../LogicalModelPermissions/mocks/delete.ts | 0 .../LogicalModelPermissions/mocks/index.ts | 0 .../LogicalModelPermissions/mocks/metadata.ts | 0 .../LogicalModelPermissions/mocks/save.ts | 0 .../LogicalModelPermissions/utils.ts | 0 .../PermissionsForm/BulkDelete.stories.tsx | 1 - .../PermissionsForm.stories.tsx | 1 - .../components/Aggregation.stories.tsx | 1 - .../components/BackendOnly.stories.tsx | 1 - .../components/ClonePermissions.stories.tsx | 8 ++++++-- .../components/ColumnPermissions.stories.tsx | 1 - .../components/ColumnPresets.stories.tsx | 1 - .../PermissionsConfirmationModal.stories.tsx | 1 - .../components/RowPermissions.stories.tsx | 1 - .../LogicalModelPermissionsInput.stories.tsx | 9 ++++----- .../components/RowPermissionsInput.stories.tsx | 1 - .../components/RowPermissionsInput.tsx | 2 +- .../__tests__/fixtures/jsonb/query.ts | 6 +++--- .../PermissionsTab/PermissionsTab.stories.tsx | 1 - .../PermissionsTable.stories.tsx | 2 +- .../components/Cells.stories.tsx | 1 - .../components/PermissionsLegend.stories.tsx | 1 - 51 files changed, 59 insertions(+), 71 deletions(-) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/ManageFunction => Permissions}/FunctionPermissions/ModifyFunctionPermissionsDialog.stories.tsx (92%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/ManageFunction => Permissions}/FunctionPermissions/ModifyFunctionPermissionsDialog.tsx (94%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels/LogicalModelPermissions => Permissions/FunctionPermissions}/mocks/config.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/ManageFunction => Permissions}/FunctionPermissions/mocks/index.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/ManageFunction => Permissions}/FunctionPermissions/mocks/metadata.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/ManageFunction => Permissions}/FunctionPermissions/utils.ts (54%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/LogicalModelPermissions.stories.tsx (96%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/LogicalModelPermissions.tsx (97%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/LogicalModelPermissionsPage.stories.tsx (93%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/LogicalModelPermissionsPage.tsx (86%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/components/LogicalModelPermissionsFormProvider.tsx (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/components/PermissionAccessCell.tsx (89%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/components/PermissionsForm.tsx (94%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/components/PermissionsRow.tsx (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/components/PermissionsRowName.tsx (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/components/PermissionsTable.tsx (95%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/components/types.ts (92%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/useCreateLogicalModelsPermissions.ts (85%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/usePermissionForm.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/useRemoveLogicalModelsPermissions.ts (86%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/utils/errorTransform.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/utils/getCreateLogicalModelBody.ts (95%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/utils/getDeleteLogicalModelBody.ts (92%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/utils/getPermissionValues.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/hooks/utils/index.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/ManageFunction/FunctionPermissions => Permissions/LogicalModelPermissions}/mocks/config.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/mocks/delete.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/mocks/index.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/mocks/metadata.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/mocks/save.ts (100%) rename frontend/libs/console/legacy-ce/src/lib/features/{Data/LogicalModels => Permissions}/LogicalModelPermissions/utils.ts (100%) diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/components/LogicalModelTabs.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/components/LogicalModelTabs.tsx index 5a4e5994033..1566bdd2a4d 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/components/LogicalModelTabs.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/components/LogicalModelTabs.tsx @@ -1,6 +1,6 @@ import { Tabs } from '../../../../new-components/Tabs'; +import { LogicalModelPermissionsPage } from '../../../Permissions/LogicalModelPermissions/LogicalModelPermissionsPage'; import { ViewLogicalModelPage } from '../LogicalModel/ViewLogicalModelPage'; -import { LogicalModelPermissionsPage } from '../LogicalModelPermissions/LogicalModelPermissionsPage'; export const LogicalModelTabs = ({ defaultValue, diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/index.ts b/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/index.ts index c5ce876ede2..4d20ca02f9c 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/index.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/index.ts @@ -1,2 +1,2 @@ -export { LogicalModelPermissionsRoute } from './LogicalModelPermissions/LogicalModelPermissionsPage'; +export { LogicalModelPermissionsRoute } from '../../Permissions/LogicalModelPermissions/LogicalModelPermissionsPage'; export { ViewLogicalModelRoute } from './LogicalModel/ViewLogicalModelPage'; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/components/Modify.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/components/Modify.tsx index bfd6d4722dc..859a35d3e27 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/components/Modify.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/components/Modify.tsx @@ -5,7 +5,7 @@ import { SupportedDrivers, } from '../../../hasura-metadata-types'; import { ModifyFunctionConfiguration } from './ModifyFunctionConfiguration'; -import { ModifyFunctionPermissionsDialog } from '../FunctionPermissions/ModifyFunctionPermissionsDialog'; +import { ModifyFunctionPermissionsDialog } from '../../../Permissions/FunctionPermissions/ModifyFunctionPermissionsDialog'; import { IconTooltip } from '../../../../new-components/Tooltip'; import { FaEdit, FaKey } from 'react-icons/fa'; import { DisplayConfigurationDetails } from './DisplayConfigurationDetails'; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/ModifyFunctionPermissionsDialog.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/ModifyFunctionPermissionsDialog.stories.tsx similarity index 92% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/ModifyFunctionPermissionsDialog.stories.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/ModifyFunctionPermissionsDialog.stories.tsx index ed702c9f496..c2d7bec7476 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/ModifyFunctionPermissionsDialog.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/ModifyFunctionPermissionsDialog.stories.tsx @@ -1,13 +1,12 @@ import { Meta, StoryObj } from '@storybook/react'; import { expect } from '@storybook/jest'; -import { ReactQueryDecorator } from '../../../../storybook/decorators/react-query'; +import { ReactQueryDecorator } from '../../../storybook/decorators/react-query'; import { ModifyFunctionPermissionsDialog } from './ModifyFunctionPermissionsDialog'; import { handlers } from './mocks'; import { action } from '@storybook/addon-actions'; import { userEvent, waitFor, within } from '@storybook/testing-library'; export default { - title: 'Features/Permissions/Form/UDF Permissions', component: ModifyFunctionPermissionsDialog, decorators: [ReactQueryDecorator()], parameters: { diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/ModifyFunctionPermissionsDialog.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/ModifyFunctionPermissionsDialog.tsx similarity index 94% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/ModifyFunctionPermissionsDialog.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/ModifyFunctionPermissionsDialog.tsx index f0eb6a32d2c..1fa2d178380 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/ModifyFunctionPermissionsDialog.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/ModifyFunctionPermissionsDialog.tsx @@ -1,21 +1,21 @@ -import { Dialog } from '../../../../new-components/Dialog'; +import { Dialog } from '../../../new-components/Dialog'; import { MetadataFunction, QualifiedFunction, -} from '../../../hasura-metadata-types'; -import { areTablesEqual, useMetadata } from '../../../hasura-metadata-api'; +} from '../../hasura-metadata-types'; +import { areTablesEqual, useMetadata } from '../../hasura-metadata-api'; import { FaCheck, FaTimes } from 'react-icons/fa'; import React from 'react'; -import { Switch } from '../../../../new-components/Switch'; +import { Switch } from '../../../new-components/Switch'; import clsx from 'clsx'; -import { hasuraToast } from '../../../../new-components/Toasts'; +import { hasuraToast } from '../../../new-components/Toasts'; import { QueryClient, useQueryClient } from 'react-query'; -import { IndicatorCard } from '../../../../new-components/IndicatorCard'; +import { IndicatorCard } from '../../../new-components/IndicatorCard'; import { Link } from 'react-router'; -import { LearnMoreLink } from '../../../../new-components/LearnMoreLink'; +import { LearnMoreLink } from '../../../new-components/LearnMoreLink'; import { getMetadataDataSource } from './utils'; -import { useManageFunctionPermission } from '../../../MetadataAPI/hooks/useManageFunctionPermission'; -import { MetadataHelpers } from '../../../hasura-metadata-api/metadataHelpers'; +import { useManageFunctionPermission } from '../../MetadataAPI/hooks/useManageFunctionPermission'; +import { MetadataHelpers } from '../../hasura-metadata-api/metadataHelpers'; export type ModifyFunctionPermissionsProps = { qualifiedFunction: QualifiedFunction[]; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/config.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/mocks/config.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/config.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/mocks/config.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/mocks/index.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/mocks/index.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/mocks/index.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/mocks/index.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/mocks/metadata.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/mocks/metadata.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/mocks/metadata.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/mocks/metadata.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/utils.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/utils.ts similarity index 54% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/utils.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/utils.ts index 8da18690f33..0729d525b93 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/utils.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/FunctionPermissions/utils.ts @@ -1,5 +1,5 @@ -import { Metadata } from '../../../hasura-metadata-types'; -import { MetadataSelectors } from '../../../hasura-metadata-api'; +import { Metadata } from '../../hasura-metadata-types'; +import { MetadataSelectors } from '../../hasura-metadata-api'; export const getMetadataDataSource = (dataSourceName: string) => (m: Metadata) => { diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissions.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissions.stories.tsx similarity index 96% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissions.stories.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissions.stories.tsx index 243d7a72f69..739d402bf89 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissions.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissions.stories.tsx @@ -1,13 +1,12 @@ import { Meta, StoryObj } from '@storybook/react'; import { LogicalModelPermissions } from './LogicalModelPermissions'; -import { comparators } from '../../../Permissions/PermissionsForm/components/RowPermissionsBuilder/components/__tests__/fixtures/comparators'; +import { comparators } from '../PermissionsForm/components/RowPermissionsBuilder/components/__tests__/fixtures/comparators'; import { userEvent, within } from '@storybook/testing-library'; import { expect } from '@storybook/jest'; import { ComponentProps } from 'react'; export default { - title: 'Features/Permissions/Form/Logical Model Permissions', component: LogicalModelPermissions, } as Meta; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissions.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissions.tsx similarity index 97% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissions.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissions.tsx index 3d9011e279f..9faf98bf541 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissions.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissions.tsx @@ -2,7 +2,7 @@ import { useCallback } from 'react'; import { Comparators, RowPermissionsInput, -} from '../../../Permissions/PermissionsForm/components/RowPermissionsBuilder/components'; +} from '../PermissionsForm/components/RowPermissionsBuilder/components'; import { LogicalModelWithPermissions, OnDelete, diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissionsPage.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissionsPage.stories.tsx similarity index 93% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissionsPage.stories.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissionsPage.stories.tsx index 4b2d4361fb9..a395a4b2d16 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/LogicalModelPermissionsPage.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/LogicalModelPermissionsPage.stories.tsx @@ -1,14 +1,13 @@ import { Meta, StoryObj } from '@storybook/react'; import { LogicalModelPermissionsPage } from './LogicalModelPermissionsPage'; -import { ReactQueryDecorator } from '../../../../storybook/decorators/react-query'; -import { RouteWrapper } from '../components/RouteWrapper'; import { handlers, deleteHandlers } from './mocks'; +import { RouteWrapper } from '../../Data/LogicalModels/components/RouteWrapper'; +import { ReactQueryDecorator } from '../../../storybook/decorators/react-query'; const name = 'LogicalModel'; const source = 'Postgres'; export default { - title: 'Features/Permissions/Form/Logical Model Permissions Page', component: params => { return ( { access: 'fullAccess' | 'partialAccess' | 'noAccess'; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsForm.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsForm.tsx similarity index 94% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsForm.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsForm.tsx index c8e3490fb80..5110814c6de 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsForm.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsForm.tsx @@ -1,11 +1,11 @@ import { ReactNode } from 'react'; -import { Button } from '../../../../../new-components/Button'; -import { IconTooltip } from '../../../../../new-components/Tooltip'; +import { Button } from '../../../../new-components/Button'; +import { IconTooltip } from '../../../../new-components/Tooltip'; import { usePermissionsFormContext } from '../hooks/usePermissionForm'; import { Permission } from './types'; -import { Collapse } from '../../../../../new-components/deprecated'; -import { getEdForm } from '../../../../../components/Services/Data/utils'; -import { Badge } from '../../../../../new-components/Badge'; +import { Collapse } from '../../../../new-components/deprecated'; +import { getEdForm } from '../../../../components/Services/Data/utils'; +import { Badge } from '../../../../new-components/Badge'; type PermissionsFormProps = { permission: Permission; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsRow.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsRow.tsx similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsRow.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsRow.tsx diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsRowName.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsRowName.tsx similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsRowName.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsRowName.tsx diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsTable.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsTable.tsx similarity index 95% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsTable.tsx rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsTable.tsx index 030589ef731..e78bdf4b7cc 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/PermissionsTable.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/PermissionsTable.tsx @@ -1,7 +1,7 @@ import { createRef } from 'react'; -import { PermissionsIcon } from '../../../../Permissions/PermissionsTable/components/PermissionsIcons'; import { Action, Permission } from './types'; import { PermissionsRow } from './PermissionsRow'; +import { PermissionsIcon } from '../../PermissionsTable/components/PermissionsIcons'; export type PermissionsTableProps = { allowedActions: Action[]; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/types.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/types.ts similarity index 92% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/types.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/types.ts index f28580ae981..22bb64312fd 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/components/types.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/components/types.ts @@ -1,4 +1,4 @@ -import { LogicalModel, Source } from '../../../../hasura-metadata-types'; +import { LogicalModel, Source } from '../../../hasura-metadata-types'; export type LogicalModelWithSourceName = LogicalModel & { source: Source; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/useCreateLogicalModelsPermissions.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/useCreateLogicalModelsPermissions.ts similarity index 85% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/useCreateLogicalModelsPermissions.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/useCreateLogicalModelsPermissions.ts index c8c34e51839..55e5c4cddb1 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/useCreateLogicalModelsPermissions.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/useCreateLogicalModelsPermissions.ts @@ -1,9 +1,9 @@ import { useCallback } from 'react'; -import { useFireNotification } from '../../../../../new-components/Notifications/index'; -import { exportMetadata } from '../../../../DataSource'; -import { useMetadataMigration } from '../../../../MetadataAPI'; -import { useHttpClient } from '../../../../Network'; -import { LogicalModel, Source } from '../../../../hasura-metadata-types'; +import { useFireNotification } from '../../../../new-components/Notifications/index'; +import { exportMetadata } from '../../../DataSource'; +import { useMetadataMigration } from '../../../MetadataAPI'; +import { useHttpClient } from '../../../Network'; +import { LogicalModel, Source } from '../../../hasura-metadata-types'; import { errorTransform } from './utils/errorTransform'; import { getCreateLogicalModelBody } from './utils/getCreateLogicalModelBody'; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/usePermissionForm.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/usePermissionForm.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/usePermissionForm.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/usePermissionForm.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/useRemoveLogicalModelsPermissions.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/useRemoveLogicalModelsPermissions.ts similarity index 86% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/useRemoveLogicalModelsPermissions.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/useRemoveLogicalModelsPermissions.ts index 9ec2a4fd117..436c33598ae 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/useRemoveLogicalModelsPermissions.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/useRemoveLogicalModelsPermissions.ts @@ -1,9 +1,9 @@ import { useCallback } from 'react'; -import { useFireNotification } from '../../../../../new-components/Notifications/index'; -import { exportMetadata } from '../../../../DataSource'; -import { useMetadataMigration } from '../../../../MetadataAPI'; -import { useHttpClient } from '../../../../Network'; -import { LogicalModel, Source } from '../../../../hasura-metadata-types'; +import { useFireNotification } from '../../../../new-components/Notifications/index'; +import { exportMetadata } from '../../../DataSource'; +import { useMetadataMigration } from '../../../MetadataAPI'; +import { useHttpClient } from '../../../Network'; +import { LogicalModel, Source } from '../../../hasura-metadata-types'; import { Permission } from '../components/types'; import { errorTransform } from './utils/errorTransform'; import { getDeleteLogicalModelBody } from './utils/getDeleteLogicalModelBody'; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/errorTransform.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/errorTransform.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/errorTransform.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/errorTransform.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getCreateLogicalModelBody.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getCreateLogicalModelBody.ts similarity index 95% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getCreateLogicalModelBody.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getCreateLogicalModelBody.ts index 07fd295c78e..fa329ff3433 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getCreateLogicalModelBody.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getCreateLogicalModelBody.ts @@ -1,5 +1,5 @@ import { getPermissionValues } from './getPermissionValues'; -import { LogicalModel, Source } from '../../../../../hasura-metadata-types'; +import { LogicalModel, Source } from '../../../../hasura-metadata-types'; import { Permission } from '../../components/types'; import { mapPostgresToPg } from '.'; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getDeleteLogicalModelBody.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getDeleteLogicalModelBody.ts similarity index 92% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getDeleteLogicalModelBody.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getDeleteLogicalModelBody.ts index 80a0c36aaab..c763eecad83 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getDeleteLogicalModelBody.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getDeleteLogicalModelBody.ts @@ -1,5 +1,5 @@ import { mapPostgresToPg } from '.'; -import { Source } from '../../../../../hasura-metadata-types'; +import { Source } from '../../../../hasura-metadata-types'; import { Permission } from '../../components/types'; export interface DeleteLogicalModalBodyArgs { logicalModelName: string; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getPermissionValues.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getPermissionValues.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/getPermissionValues.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/getPermissionValues.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/index.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/index.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/hooks/utils/index.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/hooks/utils/index.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/mocks/config.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/config.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/ManageFunction/FunctionPermissions/mocks/config.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/config.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/delete.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/delete.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/delete.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/delete.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/index.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/index.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/index.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/index.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/metadata.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/metadata.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/metadata.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/metadata.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/save.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/save.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/mocks/save.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/mocks/save.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/utils.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/utils.ts similarity index 100% rename from frontend/libs/console/legacy-ce/src/lib/features/Data/LogicalModels/LogicalModelPermissions/utils.ts rename to frontend/libs/console/legacy-ce/src/lib/features/Permissions/LogicalModelPermissions/utils.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/BulkDelete.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/BulkDelete.stories.tsx index c9593a2b63b..131d0708321 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/BulkDelete.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/BulkDelete.stories.tsx @@ -8,7 +8,6 @@ import { BulkDelete, BulkDeleteProps } from './BulkDelete'; import { handlers } from './mocks/handlers.mock'; export default { - title: 'Features/Permissions/Bulk Update', component: BulkDelete, decorators: [ReactQueryDecorator()], } as Meta; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/PermissionsForm.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/PermissionsForm.stories.tsx index 762b2516e51..058fe9f5a9a 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/PermissionsForm.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/PermissionsForm.stories.tsx @@ -5,7 +5,6 @@ import { PermissionsForm, PermissionsFormProps } from './PermissionsForm'; import { handlers } from './mocks/handlers.mock'; export default { - title: 'Features/Permissions/Form', component: PermissionsForm, decorators: [ReactQueryDecorator()], parameters: { diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/Aggregation.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/Aggregation.stories.tsx index 5d6d9ea9536..3408e41f48f 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/Aggregation.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/Aggregation.stories.tsx @@ -7,7 +7,6 @@ import { action } from '@storybook/addon-actions'; import { AggregationProps, AggregationSection } from './Aggregation'; export default { - title: 'Features/Permissions/Form/Aggregation Section', component: AggregationSection, parameters: { // Disable storybook for playground stories diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/BackendOnly.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/BackendOnly.stories.tsx index 0a5ba0d6bdf..7bf628cbb81 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/BackendOnly.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/BackendOnly.stories.tsx @@ -6,7 +6,6 @@ import { SimpleForm } from '../../../../new-components/Form'; import { BackendOnlySection, BackEndOnlySectionProps } from './BackendOnly'; export default { - title: 'Features/Permissions/Form/Backend Only Section', component: BackendOnlySection, parameters: { // Disable storybook for playground stories diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ClonePermissions.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ClonePermissions.stories.tsx index e07d1109fdd..4dc23434101 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ClonePermissions.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ClonePermissions.stories.tsx @@ -10,7 +10,6 @@ import { } from './ClonePermissions'; export default { - title: 'Features/Permissions/Form/Clone Permissions', component: ClonePermissionsSection, decorators: [ (StoryComponent: React.FC) => ( @@ -23,7 +22,12 @@ export default { export const Default: StoryObj = { args: { - tables: ['users', 'public'], + tables: [ + { + name: 'users', + schema: 'public', + }, + ], supportedQueryTypes: ['insert', 'select', 'update', 'delete'], roles: ['one', 'two'], }, diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPermissions.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPermissions.stories.tsx index 710fe5d96b7..0e325e34abd 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPermissions.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPermissions.stories.tsx @@ -12,7 +12,6 @@ import { const schema = z.object({ columns: z.record(z.optional(z.boolean())) }); export default { - title: 'Features/Permissions/Form/Column Section', component: ColumnPermissionsSection, decorators: [ ReactQueryDecorator(), diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPresets.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPresets.stories.tsx index 5b16feceeec..c07fef733cc 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPresets.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/ColumnPresets.stories.tsx @@ -9,7 +9,6 @@ import { } from './ColumnPresets'; export default { - title: 'Features/Permissions/Form/Presets Section', component: ColumnPresetsSection, decorators: [ (StoryComponent: React.FC) => ( diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RootFieldPermissions/PermissionsConfirmationModal.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RootFieldPermissions/PermissionsConfirmationModal.stories.tsx index a90df1bcdec..d893e87c019 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RootFieldPermissions/PermissionsConfirmationModal.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RootFieldPermissions/PermissionsConfirmationModal.stories.tsx @@ -6,7 +6,6 @@ import { } from './PermissionsConfirmationModal'; export default { - title: 'Features/Permissions/Confirmation Modal', component: PermissionsConfirmationModal, argTypes: { onSubmit: { action: true }, diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissions.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissions.stories.tsx index ced10126754..eb19db3883d 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissions.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissions.stories.tsx @@ -12,7 +12,6 @@ import { } from './RowPermissions'; export default { - title: 'Features/Permissions/Form/Row Section', component: RowPermissionsSection, decorators: [ (StoryComponent: React.FC) => ( diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/LogicalModelPermissionsInput.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/LogicalModelPermissionsInput.stories.tsx index 5c9df8617db..a709760ec40 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/LogicalModelPermissionsInput.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/LogicalModelPermissionsInput.stories.tsx @@ -7,7 +7,6 @@ import { handlers } from './__tests__/fixtures/jsonb/handlers'; import { ReactQueryDecorator } from '../../../../../../storybook/decorators/react-query'; export default { - title: 'Features/Permissions/Form/Logical Model Permissions Input', component: RowPermissionsInput, parameters: { msw: handlers(), @@ -25,8 +24,8 @@ export const Basic: Story = { logicalModels: [ { fields: [ - { name: 'one', nullable: false, type: 'text' }, - { name: 'two', nullable: false, type: 'text' }, + { name: 'one', type: { scalar: 'text', nullable: false } }, + { name: 'two', type: { scalar: 'text', nullable: false } }, ], name: 'hello_world', source: { @@ -38,8 +37,8 @@ export const Basic: Story = { }, { fields: [ - { name: 'a', nullable: false, type: 'text' }, - { name: 'b', nullable: false, type: 'text' }, + { name: 'a', type: { scalar: 'text', nullable: false } }, + { name: 'b', type: { scalar: 'text', nullable: false } }, ], name: 'logical_model', source: { diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.stories.tsx index b9723dd2337..b4553ead4fa 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.stories.tsx @@ -23,7 +23,6 @@ import { useState } from 'react'; import { Permissions } from './types'; export default { - title: 'Features/Permissions/Form/Row Permissions Input', component: RowPermissionsInput, parameters: { msw: handlers(), diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.tsx index cca72635f00..b2b7998e3f5 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/RowPermissionsInput.tsx @@ -7,11 +7,11 @@ import { RootInput } from './RootInput'; import { JsonEditor } from './JsonEditor'; import { RootTableProvider } from './RootTableProvider'; import { RootLogicalModelProvider } from './RootLogicalModelProvider'; -import { LogicalModelWithSourceName } from '../../../../../Data/LogicalModels/LogicalModelPermissions/components/types'; import { ForbiddenFeaturesProvider, Feature, } from './ForbiddenFeaturesProvider'; +import { LogicalModelWithSourceName } from '../../../../LogicalModelPermissions/components/types'; export const RowPermissionsInput = ({ permissions, diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/__tests__/fixtures/jsonb/query.ts b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/__tests__/fixtures/jsonb/query.ts index 84f688215a4..395ce44dc39 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/__tests__/fixtures/jsonb/query.ts +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsForm/components/RowPermissionsBuilder/components/__tests__/fixtures/jsonb/query.ts @@ -23,7 +23,7 @@ export const queries = [ payload: { type: 'run_sql', args: { - sql: "\n SELECT \n column_name, data_type, is_nullable\n FROM \n information_schema.columns \n WHERE \n table_schema = 'public' AND \n table_name = 'Stuff';", + sql: "\n SELECT a.attname as column_name,\n pg_catalog.format_type(a.atttypid, NULL) as data_type,\n case\n when a.attnotnull = 'f' then 'true'\n else 'false'\n end as is_nullable\nFROM pg_attribute a\n JOIN pg_class t on a.attrelid = t.oid\n JOIN pg_namespace s on t.relnamespace = s.oid\nWHERE a.attnum > 0 \n AND NOT a.attisdropped\n AND t.relname = 'Stuff'\n AND s.nspname = 'public' \n", source: 'default', }, }, @@ -54,7 +54,7 @@ export const queries = [ payload: { type: 'run_sql', args: { - sql: "\n SELECT \n column_name, data_type, is_nullable\n FROM \n information_schema.columns \n WHERE \n table_schema = 'public' AND \n table_name = 'Stuff';", + sql: "\n SELECT a.attname as column_name,\n pg_catalog.format_type(a.atttypid, NULL) as data_type,\n case\n when a.attnotnull = 'f' then 'true'\n else 'false'\n end as is_nullable\nFROM pg_attribute a\n JOIN pg_class t on a.attrelid = t.oid\n JOIN pg_namespace s on t.relnamespace = s.oid\nWHERE a.attnum > 0 \n AND NOT a.attisdropped\n AND t.relname = 'Stuff'\n AND s.nspname = 'public' \n", source: 'default', }, }, @@ -85,7 +85,7 @@ export const queries = [ payload: { type: 'run_sql', args: { - sql: "\n SELECT \n column_name, data_type, is_nullable\n FROM \n information_schema.columns \n WHERE \n table_schema = 'public' AND \n table_name = 'Stuff';", + sql: "\n SELECT a.attname as column_name,\n pg_catalog.format_type(a.atttypid, NULL) as data_type,\n case\n when a.attnotnull = 'f' then 'true'\n else 'false'\n end as is_nullable\nFROM pg_attribute a\n JOIN pg_class t on a.attrelid = t.oid\n JOIN pg_namespace s on t.relnamespace = s.oid\nWHERE a.attnum > 0 \n AND NOT a.attisdropped\n AND t.relname = 'Stuff'\n AND s.nspname = 'public' \n", source: 'default', }, }, diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTab/PermissionsTab.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTab/PermissionsTab.stories.tsx index ada41e810cb..f3d47af68b6 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTab/PermissionsTab.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTab/PermissionsTab.stories.tsx @@ -9,7 +9,6 @@ import { expect } from '@storybook/jest'; import { userEvent } from '@storybook/testing-library'; export default { - title: 'Features/Permissions', component: PermissionsTab, decorators: [ReactQueryDecorator()], } as Meta; diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/PermissionsTable.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/PermissionsTable.stories.tsx index 9fb467b5a43..d64f8731e98 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/PermissionsTable.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/PermissionsTable.stories.tsx @@ -7,7 +7,6 @@ import { handlers } from '../PermissionsForm/mocks/handlers.mock'; import { useTableMachine } from './hooks'; export default { - title: 'Features/Permissions/Table', component: PermissionsTable, decorators: [ReactQueryDecorator()], parameters: { @@ -15,6 +14,7 @@ export default { }, } as Meta; +// Fails export const GDCTable: StoryObj = { render: args => { const machine = useTableMachine(); diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/Cells.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/Cells.stories.tsx index 8ed3f871f00..d7143e0d576 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/Cells.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/Cells.stories.tsx @@ -12,7 +12,6 @@ import { } from './Cells'; export default { - title: 'Features/Permissions/Table/Cells', component: InputCell, decorators: [ (StoryComponent: React.FC) => ( diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/PermissionsLegend.stories.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/PermissionsLegend.stories.tsx index db16e13d7f6..c2525aa6514 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/PermissionsLegend.stories.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Permissions/PermissionsTable/components/PermissionsLegend.stories.tsx @@ -4,7 +4,6 @@ import { StoryFn, Meta } from '@storybook/react'; import { PermissionsLegend } from './PermissionsLegend'; export default { - title: 'Features/Permissions/Table/Permissions Legend', component: PermissionsLegend, parameters: { chromatic: { disableSnapshot: true } }, } as Meta;