fix: show required fields for provider
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { PageActionType } from '@/config/types';
|
||||
import { createContext, useContext } from 'react';
|
||||
import { maasProviderType } from '.';
|
||||
import { RequiredFields } from './types';
|
||||
|
||||
interface FormContextProps {
|
||||
providerType?: maasProviderType;
|
||||
action: PageActionType;
|
||||
currentData?: any;
|
||||
id?: number;
|
||||
providerFields?: RequiredFields[];
|
||||
getCustomConfig?: () => Record<string, any>;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,3 +40,19 @@ export interface MaasProviderItem {
|
||||
api_token_count: number;
|
||||
api_tokens: { hash: string }[];
|
||||
}
|
||||
|
||||
export interface RequiredFields {
|
||||
type: 'Input' | 'Select' | 'Password';
|
||||
name: string;
|
||||
label: {
|
||||
text: string;
|
||||
locale?: boolean;
|
||||
};
|
||||
required?: boolean;
|
||||
placeholder?: string;
|
||||
description?: {
|
||||
text: string;
|
||||
locale?: boolean;
|
||||
};
|
||||
rules?: any[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user