Fixes Issue #12421 - Change page title based on the site section being viewed (#12627)

* Update title for tabs not including challenges, guild and team

* add section titles to challenges, guilds, and groups

* Update dynamic title to use vuex action

* Remove duplicate key

* Actually remove duplicate key

* Fix section sub section in group

* Add note to implement setTitle when adding a page

* Add missing sections to dynamic title

* Features string not translated

* Use onGroupUpdate to update group titles

* Add watcher to challenges for dynamic title updates

* Small fixes

* Add register and login to title, remove duplicate keys

* Add home page dynamic title functionality

* Minor name changes

* remove wrong i18n strings from front.js

* refactor router note

Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>
This commit is contained in:
jbusa22
2020-10-26 06:22:46 -04:00
committed by GitHub
parent 869d2df4fa
commit ad51675ac6
36 changed files with 188 additions and 6 deletions
@@ -155,6 +155,12 @@ export default {
return this.guilds.filter(guild => filterGuild(guild, filters, search, user));
},
},
mounted () {
this.$store.dispatch('common:setTitle', {
subSection: this.$t('guildsDiscovery'),
section: this.$t('guilds'),
});
},
methods: {
async updateSearch (eventData) {
// this.search = eventData.searchTerm; @TODO: Probably don't need this anymore
@@ -500,7 +500,10 @@ export default {
if (this.isParty) this.searchId = 'party';
if (!this.searchId) this.searchId = this.groupId;
await this.fetchGuild();
this.$store.dispatch('common:setTitle', {
section: this.$t('groupPlans'),
subSection: this.group.name,
});
this.$root.$on('updatedGroup', this.onGroupUpdate);
},
beforeDestroy () {
@@ -508,7 +511,6 @@ export default {
},
beforeRouteUpdate (to, from, next) {
this.$set(this, 'searchId', to.params.groupId);
next();
},
methods: {
@@ -518,6 +520,10 @@ export default {
onGroupUpdate (group) {
const updatedGroup = extend(this.group, group);
this.$set(this.group, updatedGroup);
this.$store.dispatch('common:setTitle', {
section: this.$t('groupPlans'),
subSection: group.name,
});
},
/**
@@ -486,6 +486,9 @@ export default {
},
mounted () {
this.activePage = this.PAGES.BENEFITS;
this.$store.dispatch('common:setTitle', {
section: this.$t('groupPlans'),
});
},
methods: {
launchModal () {
@@ -165,6 +165,12 @@ export default {
});
},
},
mounted () {
this.$store.dispatch('common:setTitle', {
subSection: this.$t('myGuilds'),
section: this.$t('guilds'),
});
},
created () {
this.fetchGuilds();
},
@@ -843,6 +843,10 @@ export default {
},
},
async mounted () {
this.$store.dispatch('common:setTitle', {
subSection: this.$t('tavern'),
section: this.$t('guilds'),
});
this.group = await this.$store.dispatch('guilds:getGroup', { groupId: TAVERN_ID });
},
methods: {