Disable portfolio based on env variable
This commit is contained in:
parent
6101964282
commit
1f973aa15f
|
|
@ -9,6 +9,7 @@ module.exports = {
|
|||
* around strings
|
||||
*/
|
||||
VUE_APP_LOGO: JSON.stringify(process.env.VUE_APP_LOGO) || '"/static/logo.png"',
|
||||
VUE_APP_ENABLE_PORTFOLIO: process.env.ENABLE_PORTFOLIO || "true",
|
||||
/*
|
||||
* Vars used in HTML templates don't need to be stringyfied, as HTML does not need them to have quotes
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@
|
|||
</router-link>
|
||||
</div>
|
||||
|
||||
<div class="content-navigation__item content-navigation__item--secondary">
|
||||
<div
|
||||
class="content-navigation__item content-navigation__item--secondary"
|
||||
v-if="showPortfolio">
|
||||
<router-link
|
||||
to="/portfolio"
|
||||
active-class="content-navigation__link--active"
|
||||
|
|
@ -100,6 +102,12 @@
|
|||
Logo
|
||||
},
|
||||
|
||||
computed: {
|
||||
showPortfolio() {
|
||||
return process.env.VUE_APP_ENABLE_PORTFOLIO;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
isActive(linkName) {
|
||||
return linkName === 'book' && this.$route.path.indexOf('module') > -1;
|
||||
|
|
|
|||
|
|
@ -14,15 +14,11 @@ import submissions from '@/pages/submissions';
|
|||
import p404 from '@/pages/p404';
|
||||
import start from '@/pages/start';
|
||||
import submission from '@/pages/studentSubmission';
|
||||
import portfolio from '@/pages/portfolio';
|
||||
import project from '@/pages/project';
|
||||
import profilePage from '@/pages/profile';
|
||||
import profile from '@/components/profile/Profile';
|
||||
import myClass from '@/pages/myClass';
|
||||
import activity from '@/pages/activity';
|
||||
import Router from 'vue-router';
|
||||
import editProject from '@/pages/editProject';
|
||||
import newProject from '@/pages/newProject';
|
||||
import surveyPage from '@/pages/survey';
|
||||
import styleGuidePage from '@/pages/styleguide';
|
||||
import moduleRoom from '@/pages/moduleRoom';
|
||||
|
|
@ -44,6 +40,7 @@ import onboardingStart from '@/pages/onboarding/start';
|
|||
import onboardingStep1 from '@/pages/onboarding/step1';
|
||||
import onboardingStep2 from '@/pages/onboarding/step2';
|
||||
import onboardingStep3 from '@/pages/onboarding/step3';
|
||||
import portfolioRoutes from './portfolio.routes';
|
||||
|
||||
import store from '@/store/index';
|
||||
|
||||
|
|
@ -121,10 +118,7 @@ const routes = [
|
|||
},
|
||||
{path: '/instrument/:slug', name: 'instrument', component: instrument, meta: {layout: 'simple'}},
|
||||
{path: '/submission/:id', name: 'submission', component: submission, meta: {layout: 'simple'}},
|
||||
{path: '/portfolio', name: 'portfolio', component: portfolio},
|
||||
{path: '/portfolio/:slug', name: 'project', component: project, props: true},
|
||||
{path: '/new-project/', name: 'new-project', component: newProject},
|
||||
{path: '/edit-project/:id', name: 'edit-project', component: editProject, props: true},
|
||||
...portfolioRoutes,
|
||||
{path: '/topic/:topicSlug', name: 'topic', component: topic, alias: '/book/topic/:topicSlug'},
|
||||
{
|
||||
path: '/me',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
import portfolio from '@/pages/portfolio/portfolio';
|
||||
import project from '@/pages/portfolio/project';
|
||||
import newProject from '@/pages/portfolio/newProject';
|
||||
import editProject from '@/pages/portfolio/editProject';
|
||||
|
||||
const portfolioRoutes = [
|
||||
{path: '/portfolio', name: 'portfolio', component: portfolio},
|
||||
{path: '/portfolio/:slug', name: 'project', component: project, props: true},
|
||||
{path: '/new-project/', name: 'new-project', component: newProject},
|
||||
{path: '/edit-project/:id', name: 'edit-project', component: editProject, props: true},
|
||||
];
|
||||
|
||||
const routes = process.env.VUE_APP_ENABLE_PORTFOLIO ? portfolioRoutes : [];
|
||||
|
||||
export default routes;
|
||||
Loading…
Reference in New Issue