fix(plugin-cm): fix interfaces injection and getter (#1196)

This commit is contained in:
Junyi 2022-12-04 20:39:51 -08:00 committed by GitHub
parent d1a6aeec76
commit e5f5a2a0c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ export const CollectionManagerProvider: React.FC<CollectionManagerOptions> = (pr
value={{ value={{
...ctx, ...ctx,
service, service,
interfaces: { ...defaultInterfaces, ...interfaces }, interfaces: { ...defaultInterfaces, ...ctx.interfaces, ...interfaces },
templates: { ...defaultTemplates, ...templates }, templates: { ...defaultTemplates, ...templates },
collections, collections,
refreshCM, refreshCM,

View File

@ -14,7 +14,7 @@ import { useCollectionManager } from '../hooks';
import { IField } from '../interfaces/types'; import { IField } from '../interfaces/types';
import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider'; import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider';
import * as components from './components'; import * as components from './components';
import { options } from './interfaces'; import { getOptions } from './interfaces';
const getSchema = (schema: IField, record: any, compile) => { const getSchema = (schema: IField, record: any, compile) => {
if (!schema) { if (!schema) {
@ -152,7 +152,7 @@ export const AddFieldAction = (props) => {
const { availableFieldInterfaces } = getTemplate(record.template) || {}; const { availableFieldInterfaces } = getTemplate(record.template) || {};
const { exclude, include } = availableFieldInterfaces || {}; const { exclude, include } = availableFieldInterfaces || {};
const optionArr = []; const optionArr = [];
options.forEach((v) => { getOptions().forEach((v) => {
if (v.key === 'systemInfo') { if (v.key === 'systemInfo') {
optionArr.push({ optionArr.push({
...v, ...v,