Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show board name in browser title #3499

Merged
merged 1 commit into from
Jan 14, 2022

Conversation

luka-nextcloud
Copy link
Contributor

@luka-nextcloud luka-nextcloud commented Dec 28, 2021

Signed-off-by: Luka Trovic luka@nextcloud.com

Summary

Now it shows the current board name in the browser title.

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

@luka-nextcloud luka-nextcloud changed the title show board name in browser title Show board name in browser title Dec 28, 2021
@@ -271,6 +271,8 @@ export default {
if (current?.id !== previous?.id) {
this.clearFilter()
}

document.title = this.board.title
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to store the default page title like "Deck - Nextcloud" that is set and then only add the board title in front. You can find some inspiration on that in the Talk app: https://github.com/nextcloud/spreed/blob/master/src/App.vue#L418-L441

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if no board is set, it should then fall back tio the default one ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check again. All fixed.

setPageTitle(title) {
if (this.defaultPageTitle === false) {
this.defaultPageTitle = window.document.title
if (this.defaultPageTitle.indexOf(' - ' + t('spreed', 'Deck') + ' - ') !== -1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.defaultPageTitle.indexOf(' - ' + t('spreed', 'Deck') + ' - ') !== -1) {
if (this.defaultPageTitle.indexOf(' - Deck - ') !== -1) {

The app name is currently not translated anywhere, so let's stick to that. Otherwise spreed would be the wrong app id here ;)

if (this.defaultPageTitle === false) {
this.defaultPageTitle = window.document.title
if (this.defaultPageTitle.indexOf(' - ' + t('spreed', 'Deck') + ' - ') !== -1) {
this.defaultPageTitle = this.defaultPageTitle.substring(this.defaultPageTitle.indexOf(' - ' + t('spreed', 'Deck') + ' - ') + 3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.defaultPageTitle = this.defaultPageTitle.substring(this.defaultPageTitle.indexOf(' - ' + t('spreed', 'Deck') + ' - ') + 3)
this.defaultPageTitle = this.defaultPageTitle.substring(this.defaultPageTitle.indexOf(' - Deck - ') + 3)

Comment on lines 346 to 347
if (this.defaultPageTitle.indexOf(t('spreed', 'Deck') + ' - ') !== 0) {
this.defaultPageTitle = t('spreed', 'Deck') + ' - ' + this.defaultPageTitle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.defaultPageTitle.indexOf(t('spreed', 'Deck') + ' - ') !== 0) {
this.defaultPageTitle = t('spreed', 'Deck') + ' - ' + this.defaultPageTitle
if (this.defaultPageTitle.indexOf('Deck - ') !== 0) {
this.defaultPageTitle = 'Deck - ' + this.defaultPageTitle

Signed-off-by: Luka Trovic <luka@nextcloud.com>
@juliusknorr juliusknorr merged commit 24c1687 into master Jan 14, 2022
@delete-merged-branch delete-merged-branch bot deleted the feature/show-board-name-in-browser-title branch January 14, 2022 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show board name in browser title
2 participants