Browse Source
* fix: error-processing-request (#3402) * Close: #3398 * error authority is undefined * feat: add new config "menu.enableLocale" (#3310) * feat: add new config "layoutLocal" * Use enableLayoutLocale instead of layoutLocale * Use enableMenuLocale instead of enableMenuLocale * use menu.disableLocal * Fix an issue in list item Add (#3423) * try fix test error (#3424) * try fix test error * try fix ci error in windows * feat: Routing is in the root directory can also matchs. (#3364) * fix viewport content Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead. * Set up CI with Azure Pipelines (#3268) * Set up CI with Azure Pipelines * change some js filemod to 644 (#3447) * fix #2851 (#3440) * add responsive-table (#3472) * remove PureComponent (#3470) * remove PureComponent * fix typo * chore: upgrade jest-puppeteer and remove some puppeteer config * html prettier (#3473) * prettier html * update dependencies * centering icon * set icon size * edit text * Removed redundant colon - zh-CN (#3480) * Removed redundant colon - zh-CN * Removed redundant colon - zh-TW * Removed redundant colon - en-US * fix: horizontal scroll bar appears on SiderMenu with light navTheme (#3381) * fix: horizontal scroll bar appears on SiderMenu with light navTheme * a better solution * fix Badge error (#3488) * fix tag error * Move flags to badges in README * Make "home" optional in breadcrumb (#3416) * fixed submenu collapsed when refresh page (#3494) * perf: add checkout config in azure (#3498) * 🆙 upgrade deps (#3503) * fix: unresponsive collapse btn on mobile (#3504) * style: prettier SiderMenu.js (#3501) * style: prettier SiderMenu.js * new config file * fix ci error * feat: support pwa config (#3508) * feat: support pwa config * style: change code style * reset ci (#3507) * add actionsText prop to TagSelect, add locales to List page #3367 (#3442) * add actionsText prop to TagSelect, add locales to List page * add actionsText prop to TagSelect, add locales to List page * 修正繁体中文文案 (#3511) * Route authority attribute behavior (#3514) * fix customize menu icon bug (#3509) * fix customize menu icon bug 当采用自定义菜单图标(即通过url引用方式)且菜单折叠时,文字不隐藏 * fix customize menu icon bug 修改样式 * feat: add a demo that jump to details (#3502) * feat: add a demo that jump to details * feat: hide progress in coi * remove trigger config * remove fetchDepth: 1 * refactor: userinfo and application from api * style: fix code style * Enhance stylelint rules, fix propTypes error of TagSelect (#3518) * add stylelint shareable config for css modules * fix CSS pseudo element with double colon * support stylelint declaration-block-no-ignored-properties rule * support sorted CSS properties order for readability and consistency * autofix order of all styles by lint:fix script * fix propTypes error of TagSelect component * Revert "autofix order of all styles by lint:fix script" This reverts commitpull/3719/head51cb9d055f. * Revert "support sorted CSS properties order for readability and consistency" This reverts commitff6c24d263. * make lint:fix work for stylelint * Revert "Revert "autofix order of all styles by lint:fix script"" This reverts commit946ed0a351. * Revert "Revert "support sorted CSS properties order for readability and consistency"" This reverts commit31b557e382. * Update README.zh-CN.md * doc: add umi-badge (#3538) * doc: add umi-badge * Update README.ru-RU.md (#3539) add umi badge * feat: Officially traded will use cdn to optimize bizchart (#3535) * route authority attribute behavior no use while (#3522) * route authority attribute behavior no use while * i18n pt-BR: analysis & component (#3540) * Translation of form and monitor (pt-BR) * Change flag of Portugal (pt-PT) to Brazil (pt-BR) * i18n pt-BR: analysis & component * Fix missing export default (#3525) * fix types missing export default * Update package.json * Update index.d.ts * Update index.d.ts * Update index.d.ts * 增加IconFont组件、菜单图标可以使用自己的IconFont项目图标 (#3517) * feature: 1.add iconfont component; 2.menu can add iconfont icon. * fix: 调整菜单引入iconfont的方式为String. 1. 新增IconFont组件,需在组件内配置自己的IconFont图标项目地址; 2. 然后,菜单图标可以引入自己的IconFont图标,图标字符串以icon-开头. * ajust: put the IconFont Script Url into defaultSetting.js * 调整iconfontUrl名称 * fix:注释更新 * 留空iconfontUrl * Site title use defaultSettings (#3546) * Site title od top use defaultSettings (#3551) * pref: optimize performance (#3542) * pref: optimize performance * pref: use less img * pref: use less img * fix: Eslint warning of Mock dependence (#3554) * perf: use requestAnimationFrame * Fix: onPressEnter trigger twice login request in IE11 * Fix: onPressEnter trigger twice login request in IE11 * Login title (#3564) * Added document title to UserLayout by identifying the current route object and using its name kaey to set the title * Adjusment to document title * feat: use same getPageTile function * when select 3 item ,text branch * style: use standard frontmatter * doc: remove subtitle in en-Us * better demo md * fix PageHeader no title bug (#3583) * fix PageHeader no title bug * default value * fix: React does not recognize the `staticContext` prop on a DOM element. (#3582) * doc: better demo * remove drawer onHandleClick, ant-design/ant-design#15051 (#3602) * Use Umi Permission Routing (#3587) Use Umi Permission Routing * fix the problem that breadcrumbNameMap does not contain hidden menus. (#3606) * Update enzyme to version 3.9.0 * Update package.json * Update jest-puppeteer to version 4.0.0 * Update prettier to version 1.16.4 * Update package.json * 🐛 fix TagCloud style override bug (#3632) * Update stylelint-config-prettier to version 5.0.0 * Update index.md (#3644) * dead code (#3639) * dead code Close: #3637 * delete dead props * [NoticeIcon] Replace `LoadMore` with `ViewMore` button (#3439) * enhance LoadMore: Debounce * enhance LoadMore: debounce * use Tag instead of div * rewrite margin-right of Tag * hide LoadMore in NoticeList without onLoadMore * another style * fix a mistake * remove local config * fix a bug * user-select: none * remover local config * replace global/fetchMoreNotices with global/fetchNotices * replace LoadMore with ViewMore * remove prop `name` in NoticeIcon * fix: tab title does not show correct text * Fix margin top style error of Description List following Description List (#3653) * fix login model statu
committed by
陈帅
65 changed files with 696 additions and 627 deletions
@ -1,25 +0,0 @@ |
|||||
version: 2 |
|
||||
jobs: |
|
||||
build: |
|
||||
docker: |
|
||||
- image: circleci/node:latest |
|
||||
steps: |
|
||||
- checkout |
|
||||
- run: npm install |
|
||||
- run: npm run lint |
|
||||
- run: npm run build |
|
||||
test: |
|
||||
docker: |
|
||||
- image: circleci/node:latest-browsers |
|
||||
steps: |
|
||||
- checkout |
|
||||
- run: npm install |
|
||||
- run: |
|
||||
command: npm run test:all |
|
||||
no_output_timeout: 30m |
|
||||
workflows: |
|
||||
version: 2 |
|
||||
build_and_test: |
|
||||
jobs: |
|
||||
- build |
|
||||
- test |
|
||||
@ -1,7 +1,5 @@ |
|||||
**/*.md |
**/*.md |
||||
**/*.svg |
**/*.svg |
||||
**/*.ejs |
|
||||
**/*.html |
|
||||
package.json |
package.json |
||||
.umi |
.umi |
||||
.umi-production |
.umi-production |
||||
|
|||||
@ -1,9 +1,13 @@ |
|||||
{ |
{ |
||||
"extends": ["stylelint-config-standard", "stylelint-config-prettier"], |
"extends": [ |
||||
|
"stylelint-config-standard", |
||||
|
"stylelint-config-css-modules", |
||||
|
"stylelint-config-rational-order", |
||||
|
"stylelint-config-prettier" |
||||
|
], |
||||
|
"plugins": ["stylelint-order", "stylelint-declaration-block-no-ignored-properties"], |
||||
"rules": { |
"rules": { |
||||
"declaration-empty-line-before": null, |
|
||||
"no-descending-specificity": null, |
"no-descending-specificity": null, |
||||
"selector-pseudo-class-no-unknown": null, |
"plugin/declaration-block-no-ignored-properties": true |
||||
"selector-pseudo-element-colon-notation": null |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,26 +0,0 @@ |
|||||
# Test against the latest version of this Node.js version |
|
||||
environment: |
|
||||
nodejs_version: '10' |
|
||||
|
|
||||
# this is how to allow failing jobs in the matrix |
|
||||
matrix: |
|
||||
fast_finish: true # set this flag to immediately finish build once one of the jobs fails. |
|
||||
|
|
||||
# Install scripts. (runs after repo cloning) |
|
||||
install: |
|
||||
# Get the latest stable version of Node.js or io.js |
|
||||
- ps: Install-Product node $env:nodejs_version |
|
||||
# install modules |
|
||||
- npm install |
|
||||
# Output useful info for debugging. |
|
||||
- node --version |
|
||||
- npm --version |
|
||||
|
|
||||
# Post-install test scripts. |
|
||||
test_script: |
|
||||
- npm run lint |
|
||||
- npm run test:all |
|
||||
- npm run build |
|
||||
|
|
||||
# Don't actually build. |
|
||||
build: off |
|
||||
@ -0,0 +1,74 @@ |
|||||
|
# Node.js |
||||
|
# Build a general Node.js project with npm. |
||||
|
# Add steps that analyze code, save build artifacts, deploy, and more: |
||||
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript |
||||
|
name: ant design pro |
||||
|
|
||||
|
trigger: |
||||
|
- master |
||||
|
|
||||
|
jobs: |
||||
|
- job: lintAndBuild |
||||
|
|
||||
|
pool: |
||||
|
vmImage: 'Ubuntu-16.04' |
||||
|
|
||||
|
steps: |
||||
|
- checkout: self |
||||
|
clean: false |
||||
|
- script: yarn install |
||||
|
displayName: install |
||||
|
- script: npm run lint |
||||
|
displayName: lint |
||||
|
- script: npm run build |
||||
|
env: |
||||
|
PROGRESS: none |
||||
|
displayName: build |
||||
|
|
||||
|
- job: test |
||||
|
pool: |
||||
|
vmImage: 'Ubuntu-16.04' |
||||
|
|
||||
|
container: |
||||
|
image: circleci/node:latest-browsers |
||||
|
options: '-u root' |
||||
|
|
||||
|
steps: |
||||
|
- script: yarn install |
||||
|
displayName: install |
||||
|
- script: npm run test:all |
||||
|
env: |
||||
|
PROGRESS: none |
||||
|
displayName: test |
||||
|
|
||||
|
- job: Windows |
||||
|
pool: |
||||
|
vmImage: 'vs2017-win2016' |
||||
|
steps: |
||||
|
- task: NodeTool@0 |
||||
|
inputs: |
||||
|
versionSpec: '11.x' |
||||
|
- script: yarn install |
||||
|
displayName: install |
||||
|
- script: npm run lint |
||||
|
displayName: lint |
||||
|
- script: npm run build |
||||
|
env: |
||||
|
PROGRESS: none |
||||
|
displayName: build |
||||
|
|
||||
|
- job: MacOS |
||||
|
pool: |
||||
|
vmImage: 'macOS-10.13' |
||||
|
steps: |
||||
|
- task: NodeTool@0 |
||||
|
inputs: |
||||
|
versionSpec: '11.x' |
||||
|
- script: yarn install |
||||
|
displayName: install |
||||
|
- script: npm run lint |
||||
|
displayName: lint |
||||
|
- script: npm run |
||||
|
env: |
||||
|
PROGRESS: none |
||||
|
displayName: build |
||||
@ -1,15 +1,6 @@ |
|||||
// ps https://github.com/GoogleChrome/puppeteer/issues/3120
|
// ps https://github.com/GoogleChrome/puppeteer/issues/3120
|
||||
module.exports = { |
module.exports = { |
||||
launch: { |
launch: { |
||||
headless: true, |
args: ['--disable-gpu', '--disable-dev-shm-usage', '--no-first-run', '--no-zygote'], |
||||
args: [ |
|
||||
'--disable-gpu', |
|
||||
'--disable-dev-shm-usage', |
|
||||
'--disable-setuid-sandbox', |
|
||||
'--no-first-run', |
|
||||
'--no-sandbox', |
|
||||
'--no-zygote', |
|
||||
'--single-process', |
|
||||
], |
|
||||
}, |
}, |
||||
}; |
}; |
||||
|
|||||
@ -0,0 +1,2 @@ |
|||||
|
import * as React from 'react'; |
||||
|
export default class HeaderDropdown extends React.Component<any, any> {} |
||||
@ -0,0 +1,7 @@ |
|||||
|
import { Icon } from 'antd'; |
||||
|
import { iconfontUrl as scriptUrl } from '../../defaultSettings'; |
||||
|
|
||||
|
// 使用:
|
||||
|
// import IconFont from '@/components/IconFont';
|
||||
|
// <IconFont type='icon-demo' className='xxx-xxx' />
|
||||
|
export default Icon.createFromIconfontCN({ scriptUrl }); |
||||
@ -1,21 +1,21 @@ |
|||||
.themeColor { |
.themeColor { |
||||
overflow: hidden; |
|
||||
margin-top: 24px; |
margin-top: 24px; |
||||
|
overflow: hidden; |
||||
.title { |
.title { |
||||
font-size: 14px; |
margin-bottom: 12px; |
||||
color: rgba(0, 0, 0, 0.65); |
color: rgba(0, 0, 0, 0.65); |
||||
|
font-size: 14px; |
||||
line-height: 22px; |
line-height: 22px; |
||||
margin-bottom: 12px; |
|
||||
} |
} |
||||
.colorBlock { |
.colorBlock { |
||||
|
float: left; |
||||
width: 20px; |
width: 20px; |
||||
height: 20px; |
height: 20px; |
||||
border-radius: 2px; |
|
||||
float: left; |
|
||||
cursor: pointer; |
|
||||
margin-right: 8px; |
margin-right: 8px; |
||||
text-align: center; |
|
||||
color: #fff; |
color: #fff; |
||||
font-weight: bold; |
font-weight: bold; |
||||
|
text-align: center; |
||||
|
border-radius: 2px; |
||||
|
cursor: pointer; |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,54 +1,61 @@ |
|||||
import React from 'react'; |
import React from 'react'; |
||||
import { notification, Button, message } from 'antd'; |
import { notification, Button, message } from 'antd'; |
||||
import { formatMessage } from 'umi/locale'; |
import { formatMessage } from 'umi/locale'; |
||||
|
import defaultSettings from './defaultSettings'; |
||||
|
|
||||
// Notify user if offline now
|
window.React = React; |
||||
window.addEventListener('sw.offline', () => { |
|
||||
message.warning(formatMessage({ id: 'app.pwa.offline' })); |
|
||||
}); |
|
||||
|
|
||||
// Pop up a prompt on the page asking the user if they want to use the latest version
|
const { pwa } = defaultSettings; |
||||
window.addEventListener('sw.updated', e => { |
// if pwa is true
|
||||
const reloadSW = async () => { |
if (pwa) { |
||||
// Check if there is sw whose state is waiting in ServiceWorkerRegistration
|
// Notify user if offline now
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration
|
window.addEventListener('sw.offline', () => { |
||||
const worker = e.detail && e.detail.waiting; |
message.warning(formatMessage({ id: 'app.pwa.offline' })); |
||||
if (!worker) { |
}); |
||||
return Promise.resolve(); |
|
||||
} |
// Pop up a prompt on the page asking the user if they want to use the latest version
|
||||
// Send skip-waiting event to waiting SW with MessageChannel
|
window.addEventListener('sw.updated', e => { |
||||
await new Promise((resolve, reject) => { |
const reloadSW = async () => { |
||||
const channel = new MessageChannel(); |
// Check if there is sw whose state is waiting in ServiceWorkerRegistration
|
||||
channel.port1.onmessage = event => { |
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration
|
||||
if (event.data.error) { |
const worker = e.detail && e.detail.waiting; |
||||
reject(event.data.error); |
if (!worker) { |
||||
} else { |
return Promise.resolve(); |
||||
resolve(event.data); |
} |
||||
} |
// Send skip-waiting event to waiting SW with MessageChannel
|
||||
}; |
await new Promise((resolve, reject) => { |
||||
worker.postMessage({ type: 'skip-waiting' }, [channel.port2]); |
const channel = new MessageChannel(); |
||||
|
channel.port1.onmessage = event => { |
||||
|
if (event.data.error) { |
||||
|
reject(event.data.error); |
||||
|
} else { |
||||
|
resolve(event.data); |
||||
|
} |
||||
|
}; |
||||
|
worker.postMessage({ type: 'skip-waiting' }, [channel.port2]); |
||||
|
}); |
||||
|
// Refresh current page to use the updated HTML and other assets after SW has skiped waiting
|
||||
|
window.location.reload(true); |
||||
|
return true; |
||||
|
}; |
||||
|
const key = `open${Date.now()}`; |
||||
|
const btn = ( |
||||
|
<Button |
||||
|
type="primary" |
||||
|
onClick={() => { |
||||
|
notification.close(key); |
||||
|
reloadSW(); |
||||
|
}} |
||||
|
> |
||||
|
{formatMessage({ id: 'app.pwa.serviceworker.updated.ok' })} |
||||
|
</Button> |
||||
|
); |
||||
|
notification.open({ |
||||
|
message: formatMessage({ id: 'app.pwa.serviceworker.updated' }), |
||||
|
description: formatMessage({ id: 'app.pwa.serviceworker.updated.hint' }), |
||||
|
btn, |
||||
|
key, |
||||
|
onClose: async () => {}, |
||||
}); |
}); |
||||
// Refresh current page to use the updated HTML and other assets after SW has skiped waiting
|
|
||||
window.location.reload(true); |
|
||||
return true; |
|
||||
}; |
|
||||
const key = `open${Date.now()}`; |
|
||||
const btn = ( |
|
||||
<Button |
|
||||
type="primary" |
|
||||
onClick={() => { |
|
||||
notification.close(key); |
|
||||
reloadSW(); |
|
||||
}} |
|
||||
> |
|
||||
{formatMessage({ id: 'app.pwa.serviceworker.updated.ok' })} |
|
||||
</Button> |
|
||||
); |
|
||||
notification.open({ |
|
||||
message: formatMessage({ id: 'app.pwa.serviceworker.updated' }), |
|
||||
description: formatMessage({ id: 'app.pwa.serviceworker.updated.hint' }), |
|
||||
btn, |
|
||||
key, |
|
||||
onClose: async () => {}, |
|
||||
}); |
}); |
||||
}); |
} |
||||
|
|||||
@ -1,3 +1,3 @@ |
|||||
import React from 'react'; |
import React from 'react'; |
||||
|
|
||||
export default props => <div {...props} />; |
export default ({ children }) => <div>{children}</div>; |
||||
|
|||||
@ -0,0 +1,5 @@ |
|||||
|
export default { |
||||
|
'component.tagSelect.expand': 'Expand', |
||||
|
'component.tagSelect.collapse': 'Collapse', |
||||
|
'component.tagSelect.all': 'All', |
||||
|
}; |
||||
@ -0,0 +1,5 @@ |
|||||
|
export default { |
||||
|
'component.tagSelect.expand': 'Expandir', |
||||
|
'component.tagSelect.collapse': 'Diminuir', |
||||
|
'component.tagSelect.all': 'Todas', |
||||
|
}; |
||||
@ -0,0 +1,5 @@ |
|||||
|
export default { |
||||
|
'component.tagSelect.expand': '展开', |
||||
|
'component.tagSelect.collapse': '收起', |
||||
|
'component.tagSelect.all': '全部', |
||||
|
}; |
||||
@ -0,0 +1,5 @@ |
|||||
|
export default { |
||||
|
'component.tagSelect.expand': '展開', |
||||
|
'component.tagSelect.collapse': '收起', |
||||
|
'component.tagSelect.all': '全部', |
||||
|
}; |
||||
@ -1,13 +1,44 @@ |
|||||
import React from 'react'; |
import React from 'react'; |
||||
import RenderAuthorized from 'ant-design-pro/lib/Authorized'; |
|
||||
import { getAuthority } from '@/utils/authority'; |
|
||||
import Redirect from 'umi/redirect'; |
import Redirect from 'umi/redirect'; |
||||
|
import pathToRegexp from 'path-to-regexp'; |
||||
|
import { connect } from 'dva'; |
||||
|
import Authorized from '@/utils/Authorized'; |
||||
|
|
||||
const Authority = getAuthority(); |
function AuthComponent({ children, location, routerData, currentCuser }) { |
||||
const Authorized = RenderAuthorized(Authority); |
const isLogin = currentCuser && currentCuser.name; |
||||
|
|
||||
export default ({ children }) => ( |
const getRouteAuthority = (pathname, routeData) => { |
||||
<Authorized authority={children.props.route.authority} noMatch={<Redirect to="/user/login" />}> |
const routes = routeData.slice(); // clone
|
||||
{children} |
|
||||
</Authorized> |
const getAuthority = (routeDatas, path) => { |
||||
); |
let authorities; |
||||
|
routeDatas.forEach(route => { |
||||
|
// check partial route
|
||||
|
if (pathToRegexp(`${route.path}(.*)`).test(path)) { |
||||
|
if (route.authority) { |
||||
|
authorities = route.authority; |
||||
|
} |
||||
|
// is exact route?
|
||||
|
if (!pathToRegexp(route.path).test(path) && route.routes) { |
||||
|
authorities = getAuthority(route.routes, path); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
return authorities; |
||||
|
}; |
||||
|
|
||||
|
return getAuthority(routes, pathname); |
||||
|
}; |
||||
|
return ( |
||||
|
<Authorized |
||||
|
authority={getRouteAuthority(location.pathname, routerData)} |
||||
|
noMatch={isLogin ? <Redirect to="/exception/403" /> : <Redirect to="/user/login" />} |
||||
|
> |
||||
|
{children} |
||||
|
</Authorized> |
||||
|
); |
||||
|
} |
||||
|
export default connect(({ menu: menuModel, user: userModel }) => ({ |
||||
|
routerData: menuModel.routerData, |
||||
|
currentCuser: userModel.currentCuser, |
||||
|
}))(AuthComponent); |
||||
|
|||||
@ -1,15 +1,17 @@ |
|||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||
<html lang="en"> |
<html lang="en"> |
||||
<head> |
<head> |
||||
<meta charset="UTF-8"> |
<meta charset="UTF-8" /> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
<meta |
||||
<title>Ant Design Pro</title> |
name="viewport" |
||||
<link rel="icon" href="/favicon.png" type="image/x-icon"> |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" |
||||
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.9.6/dist/data-set.min.js"></script> |
/> |
||||
</head> |
<title>Ant Design Pro</title> |
||||
<body> |
<link rel="icon" href="/favicon.png" type="image/x-icon" /> |
||||
<noscript>Sorry, we need js to run correctly!</noscript> |
</head> |
||||
<div id="root"></div> |
<body> |
||||
</body> |
<noscript>Sorry, we need js to run correctly!</noscript> |
||||
|
<div id="root"></div> |
||||
|
</body> |
||||
</html> |
</html> |
||||
|
|||||
@ -0,0 +1,27 @@ |
|||||
|
import { formatMessage } from 'umi/locale'; |
||||
|
import pathToRegexp from 'path-to-regexp'; |
||||
|
import isEqual from 'lodash/isEqual'; |
||||
|
import memoizeOne from 'memoize-one'; |
||||
|
import { menu, title } from '../defaultSettings'; |
||||
|
|
||||
|
export const matchParamsPath = (pathname, breadcrumbNameMap) => { |
||||
|
const pathKey = Object.keys(breadcrumbNameMap).find(key => pathToRegexp(key).test(pathname)); |
||||
|
return breadcrumbNameMap[pathKey]; |
||||
|
}; |
||||
|
|
||||
|
const getPageTitle = (pathname, breadcrumbNameMap) => { |
||||
|
const currRouterData = matchParamsPath(pathname, breadcrumbNameMap); |
||||
|
if (!currRouterData) { |
||||
|
return title; |
||||
|
} |
||||
|
const pageName = menu.disableLocal |
||||
|
? currRouterData.name |
||||
|
: formatMessage({ |
||||
|
id: currRouterData.locale || currRouterData.name, |
||||
|
defaultMessage: currRouterData.name, |
||||
|
}); |
||||
|
|
||||
|
return `${pageName} - ${title}`; |
||||
|
}; |
||||
|
|
||||
|
export default memoizeOne(getPageTitle, isEqual); |
||||
Loading…
Reference in new issue