mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 15:48:00 +00:00
fix: do not display the page title
This commit is contained in:
parent
7e76c54012
commit
95f4406ba9
@ -25,12 +25,12 @@ import { Spin } from 'antd';
|
|||||||
import 'antd/dist/antd.css';
|
import 'antd/dist/antd.css';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { I18nextProvider } from 'react-i18next';
|
import { I18nextProvider } from 'react-i18next';
|
||||||
import { Link, MemoryRouter, NavLink } from 'react-router-dom';
|
import { Link, NavLink } from 'react-router-dom';
|
||||||
import apiClient from './apiClient';
|
import apiClient from './apiClient';
|
||||||
|
|
||||||
const providers = [
|
const providers = [
|
||||||
// [HashRouter],
|
// [HashRouter],
|
||||||
[MemoryRouter, { initialEntries: ['/'] }],
|
// [MemoryRouter, { initialEntries: ['/'] }],
|
||||||
[APIClientProvider, { apiClient }],
|
[APIClientProvider, { apiClient }],
|
||||||
[I18nextProvider, { i18n }],
|
[I18nextProvider, { i18n }],
|
||||||
[AntdConfigProvider, { remoteLocale: true }],
|
[AntdConfigProvider, { remoteLocale: true }],
|
||||||
|
@ -3,6 +3,7 @@ import React, { useRef, useState } from 'react';
|
|||||||
import { useHistory, useRouteMatch } from 'react-router-dom';
|
import { useHistory, useRouteMatch } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
CurrentUser,
|
CurrentUser,
|
||||||
|
findByUid,
|
||||||
findMenuItem,
|
findMenuItem,
|
||||||
PluginManager,
|
PluginManager,
|
||||||
RemoteSchemaComponent,
|
RemoteSchemaComponent,
|
||||||
@ -42,6 +43,10 @@ export function AdminLayout(props: any) {
|
|||||||
}}
|
}}
|
||||||
onSuccess={(data) => {
|
onSuccess={(data) => {
|
||||||
if (defaultSelectedUid) {
|
if (defaultSelectedUid) {
|
||||||
|
const s = findByUid(data?.data, defaultSelectedUid);
|
||||||
|
if (s) {
|
||||||
|
setTitle(s.title);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setHidden(true);
|
setHidden(true);
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
export * from './Menu';
|
export * from './Menu';
|
||||||
export { findMenuItem } from './util';
|
export * from './util';
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import { Schema, observer, useFieldSchema, useField, RecursionField } from '@formily/react';
|
import { Schema } from '@formily/react';
|
||||||
|
|
||||||
function findByUid(schema: Schema, uid: string) {
|
export function findByUid(schema: Schema, uid: string) {
|
||||||
|
if (!Schema.isSchemaInstance(schema)) {
|
||||||
|
schema = new Schema(schema);
|
||||||
|
}
|
||||||
return schema.reduceProperties((buffter, s) => {
|
return schema.reduceProperties((buffter, s) => {
|
||||||
if (s['x-uid'] === uid) {
|
if (s['x-uid'] === uid) {
|
||||||
return s;
|
return s;
|
||||||
|
Loading…
Reference in New Issue
Block a user