Skip to content

Commit

Permalink
[SDPA-6014] - Add feature toggle logic for hardcoded nuxt routes (#1175)
Browse files Browse the repository at this point in the history
* SDPA-6014 - Add feature toggle logic for hardcoded nuxt routes

* SDPA-6014 - Update reference site nuxt config to test new feature flags

* SDPA-6014 - UNDO - Update reference site nuxt config to test new feature flags

* SDPA-6014 - UNDO - Update reference site nuxt config to test new feature flags
  • Loading branch information
Chris Campbell committed Mar 16, 2022
1 parent 899c2ba commit 7969239
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
14 changes: 9 additions & 5 deletions packages/ripple-nuxt-tide/modules/event/module.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
module.exports = function () {
this.extendRoutes((routes, resolve) => {
routes.push({
name: 'tidewhatson',
path: '/whatson',
component: '@dpc-sdp/ripple-nuxt-tide/modules/event/pages/search.vue'
})
const eventConfig = this.options.tide.modules.event

if (!eventConfig?.disableEventListing) {
routes.push({
name: 'tidewhatson',
path: '/whatson',
component: '@dpc-sdp/ripple-nuxt-tide/modules/event/pages/search.vue'
})
}
})
}
14 changes: 9 additions & 5 deletions packages/ripple-nuxt-tide/modules/grant/module.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
module.exports = function () {
this.extendRoutes((routes, resolve) => {
routes.push({
name: 'tidegrants',
path: '/grants',
component: '@dpc-sdp/ripple-nuxt-tide/modules/grant/pages/search.vue'
})
const grantConfig = this.options.tide.modules.grant

if (!grantConfig?.disableGrantListing) {
routes.push({
name: 'tidegrants',
path: '/grants',
component: '@dpc-sdp/ripple-nuxt-tide/modules/grant/pages/search.vue'
})
}
})
}
13 changes: 8 additions & 5 deletions packages/ripple-nuxt-tide/modules/profile/module.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module.exports = function () {
this.extendRoutes((routes, resolve) => {
const profileConfig = this.options.tide.modules.profile
routes.push({
name: 'tidehonorroll',
path: profileConfig.route || '/profiles',
component: '@dpc-sdp/ripple-nuxt-tide/modules/profile/pages/search.vue'
})

if (!profileConfig?.disableProfileListing) {
routes.push({
name: 'tidehonorroll',
path: profileConfig.route || '/profiles',
component: '@dpc-sdp/ripple-nuxt-tide/modules/profile/pages/search.vue'
})
}
})
}

0 comments on commit 7969239

Please sign in to comment.