From 14d5d3ad060adab5207dbd6e57e0746cdf66df09 Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Tue, 21 Jan 2020 15:05:15 +0100 Subject: [PATCH 1/3] Page title is now set correctly --- CHANGELOG.md | 1 + scm-ui/ui-components/src/layout/Page.tsx | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a83e5b743b..8c2446c4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Subversion revision 0 leads to error - Create mock subject to satisfy legman - Multiple versions of hibernate-validator caused problems when starting from plugins +- Page title is now set correctly ## 2.0.0-rc1 - 2019-12-02 ### Added diff --git a/scm-ui/ui-components/src/layout/Page.tsx b/scm-ui/ui-components/src/layout/Page.tsx index 472acc0410..fe8ace9253 100644 --- a/scm-ui/ui-components/src/layout/Page.tsx +++ b/scm-ui/ui-components/src/layout/Page.tsx @@ -28,6 +28,13 @@ const PageActionContainer = styled.div` `; export default class Page extends React.Component { + componentDidUpdate() { + const { title } = this.props; + if (document.title !== title) { + document.title = title; + } + } + render() { const { error } = this.props; return ( From 70788697da48eb3da37466dc24addc044cc21f85 Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Tue, 21 Jan 2020 15:18:37 +0100 Subject: [PATCH 2/3] Check if title exists --- scm-ui/ui-components/src/layout/Page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-components/src/layout/Page.tsx b/scm-ui/ui-components/src/layout/Page.tsx index fe8ace9253..128337fd73 100644 --- a/scm-ui/ui-components/src/layout/Page.tsx +++ b/scm-ui/ui-components/src/layout/Page.tsx @@ -30,7 +30,7 @@ const PageActionContainer = styled.div` export default class Page extends React.Component { componentDidUpdate() { const { title } = this.props; - if (document.title !== title) { + if (title && title !== document.title) { document.title = title; } } From 2dc39e8c25255f83ce5f5fe77d1ed4343a1653b3 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Thu, 23 Jan 2020 14:12:57 +0000 Subject: [PATCH 3/3] Close branch bugfix/set_title_correctly