rip are shared interfaces

This commit is contained in:
Nate Kelley 2025-03-10 21:43:55 -06:00
parent 92e89ea3ac
commit bcede1856d
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
8 changed files with 6 additions and 47 deletions

View File

@ -19,5 +19,3 @@ export type BusterSocketResponseRoute =
| keyof typeof SQLResponses | keyof typeof SQLResponses
| keyof typeof TermsResponses | keyof typeof TermsResponses
| keyof typeof ChatsResponses; | keyof typeof ChatsResponses;
export type * from './shared_interfaces';

View File

@ -1 +0,0 @@
export * from './shareInterfaces';

View File

@ -1,35 +0,0 @@
import type { ShareRole } from '@/api/asset_interfaces/share';
/**
* Type defining the sharing permissions and settings for a dashboard
*
* @interface ShareRequest
*/
export type ShareRequest = {
/** The unique identifier of the dashboard */
id: string;
/** User-specific permissions array */
user_permissions?: {
/** Email of the user to grant permissions to */
user_email: string;
/** Role to assign to the user */
role: ShareRole;
}[];
/** Array of user IDs to remove access from */
remove_users?: string[];
/** Team-specific permissions array */
team_permissions?: {
/** ID of the team to grant permissions to */
team_id: string;
/** Role to assign to the team */
role: ShareRole;
}[];
/** Array of team IDs to remove access from */
remove_teams?: string[];
/** Whether the dashboard is publicly accessible */
publicly_accessible?: boolean;
/** Optional password for public access */
public_password?: string | null;
/** Optional expiration date for public access (timestamptz) */
public_expiry_date?: string | null;
};

View File

@ -1,4 +1,4 @@
import type { ShareRequest } from '@/api/buster_socket/shared_interfaces'; import type { ShareRequest } from '@/api/asset_interfaces/shared_interfaces';
import type { ShareAssetType } from '../../asset_interfaces'; import type { ShareAssetType } from '../../asset_interfaces';
export interface GetCollectionListParams { export interface GetCollectionListParams {

View File

@ -1,6 +1,6 @@
import type { DashboardConfig } from '@/api/asset_interfaces/dashboard'; import type { DashboardConfig } from '@/api/asset_interfaces/dashboard';
import { VerificationStatus } from '@/api/asset_interfaces/share'; import { VerificationStatus } from '@/api/asset_interfaces/share';
import { ShareRequest } from '@/api/asset_interfaces/shared_interfaces'; import type { ShareRequest } from '@/api/asset_interfaces/shared_interfaces';
/** /**
* Interface for dashboard list request parameters * Interface for dashboard list request parameters
@ -47,7 +47,7 @@ export interface DashboardCreateRequest {
/** /**
* Interface for updating a dashboard * Interface for updating a dashboard
*/ */
export interface DashboardUpdateRequest extends ShareRequest { export type DashboardUpdateRequest = {
/** The unique identifier of the dashboard */ /** The unique identifier of the dashboard */
id: string; id: string;
/** New name for the dashboard */ /** New name for the dashboard */
@ -66,7 +66,7 @@ export interface DashboardUpdateRequest extends ShareRequest {
remove_users?: string[]; remove_users?: string[];
/** Array of metric IDs associated with the dashboard */ /** Array of metric IDs associated with the dashboard */
metrics?: string[]; metrics?: string[];
} } & ShareRequest;
/** /**
* Interface for deleting dashboards * Interface for deleting dashboards

View File

@ -3,7 +3,6 @@ import React from 'react';
import { validate } from 'email-validator'; import { validate } from 'email-validator';
import { useMemoizedFn } from '@/hooks'; import { useMemoizedFn } from '@/hooks';
import { BusterShare, ShareRole, ShareAssetType } from '@/api/asset_interfaces'; import { BusterShare, ShareRole, ShareAssetType } from '@/api/asset_interfaces';
import type { ShareRequest } from '@/api/buster_socket/shared_interfaces';
import { Input } from '@/components/ui/inputs'; import { Input } from '@/components/ui/inputs';
import { Button } from '@/components/ui/buttons'; import { Button } from '@/components/ui/buttons';
import { Text } from '@/components/ui/typography'; import { Text } from '@/components/ui/typography';
@ -20,7 +19,7 @@ import { useBusterMetricsIndividualContextSelector } from '@/context/Metrics';
import { inputHasText } from '@/lib/text'; import { inputHasText } from '@/lib/text';
import { UserGroup, ChevronRight } from '@/components/ui/icons'; import { UserGroup, ChevronRight } from '@/components/ui/icons';
import { cn } from '@/lib/classMerge'; import { cn } from '@/lib/classMerge';
import { UpdateMetricParams } from '@/api/buster_rest/metrics'; import type { ShareRequest } from '@/api/asset_interfaces/shared_interfaces';
export const ShareMenuContentBody: React.FC<{ export const ShareMenuContentBody: React.FC<{
selectedOptions: ShareMenuTopBarOptions; selectedOptions: ShareMenuTopBarOptions;

View File

@ -8,7 +8,6 @@ import {
useBusterDashboardContextSelector, useBusterDashboardContextSelector,
useBusterDashboardIndividual useBusterDashboardIndividual
} from '@/context/Dashboards'; } from '@/context/Dashboards';
import type { ShareRequest } from '@/api/buster_socket';
import { useMemoizedFn } from '@/hooks'; import { useMemoizedFn } from '@/hooks';
import { Text } from '@/components/ui/typography'; import { Text } from '@/components/ui/typography';
import { UserGroup } from '@/components/ui/icons'; import { UserGroup } from '@/components/ui/icons';
@ -18,6 +17,7 @@ import {
useBusterCollectionIndividualContextSelector, useBusterCollectionIndividualContextSelector,
useCollectionIndividual useCollectionIndividual
} from '@/context/Collections'; } from '@/context/Collections';
import type { ShareRequest } from '@/api/asset_interfaces/shared_interfaces';
export const ShareWithGroupAndTeam: React.FC<{ export const ShareWithGroupAndTeam: React.FC<{
goBack: () => void; goBack: () => void;

View File

@ -14,8 +14,6 @@ export const useDashboardUpdateConfig = ({
}: { }: {
getDashboardMemoized: (dashboardId: string) => BusterDashboardResponse | undefined; getDashboardMemoized: (dashboardId: string) => BusterDashboardResponse | undefined;
}) => { }) => {
const queryClient = useQueryClient();
const { mutateAsync: updateDashboardMutation, isPending: isUpdatingDashboard } = const { mutateAsync: updateDashboardMutation, isPending: isUpdatingDashboard } =
useUpdateDashboard(); useUpdateDashboard();