Added storybook to production if SHOW_STORYBOOK env variable is true
This commit is contained in:
@@ -48,13 +48,12 @@
|
||||
import FeatureCard from '/imports/ui/properties/features/FeatureCard.Story.vue';
|
||||
import HealthBar from '/imports/ui/properties/attributes/HealthBar.Story.vue';
|
||||
import HitDiceListTile from '/imports/ui/properties/attributes/HitDiceListTile.Story.vue';
|
||||
import IconSearch from '/imports/ui/components/IconSearch.Story.vue';
|
||||
// import IconSearch from '/imports/ui/components/IconSearch.Story.vue';
|
||||
import ResourceCard from '/imports/ui/properties/attributes/ResourceCard.Story.vue';
|
||||
import SkillListTile from '/imports/ui/properties/skills/SkillListTile.Story.vue';
|
||||
import SmartInput from '/imports/ui/components/global/SmartInput.Story.vue';
|
||||
import SpellSlotListTile from '/imports/ui/properties/attributes/SpellSlotListTile.Story.vue';
|
||||
import ToolbarLayout from '/imports/ui/layouts/ToolbarLayout.vue';
|
||||
import TreeNode from '/imports/ui/components/tree/TreeNodeList.Story.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -67,13 +66,12 @@
|
||||
FeatureCard,
|
||||
HealthBar,
|
||||
HitDiceListTile,
|
||||
IconSearch,
|
||||
// IconSearch,
|
||||
ResourceCard,
|
||||
SkillListTile,
|
||||
SmartInput,
|
||||
SpellSlotListTile,
|
||||
ToolbarLayout,
|
||||
TreeNode,
|
||||
},
|
||||
data(){ return {
|
||||
sidebar: undefined,
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
v-for="(link, i) in links"
|
||||
v-if="link.vif || link.vif === undefined"
|
||||
:to="link.to"
|
||||
:href="link.href"
|
||||
:key="i"
|
||||
>
|
||||
<v-list-tile-action>
|
||||
@@ -79,14 +80,18 @@
|
||||
return user && user.username || user && user._id;
|
||||
},
|
||||
links(){
|
||||
return [
|
||||
let links = [
|
||||
{title: "Home", icon: "home", to: "/"},
|
||||
{title: "Creatures", icon: "group", to: "/characterList", vif: Meteor.userId()},
|
||||
{title: "Libraries", icon: "book", to: "/library", vif: Meteor.userId()},
|
||||
{title: "Send Feedback", icon: "bug_report", to: "/feedback"},
|
||||
{title: "Patreon", icon: "", href: "https://www.patreon.com/dicecloud"},
|
||||
{title: "Github", icon: "", href: "https://github.com/ThaumRystra/DiceCloud1"},
|
||||
{title: "Github", icon: "", href: "https://github.com/ThaumRystra/DiceCloud/tree/version-2"},
|
||||
];
|
||||
if (process.env.SHOW_STORYBOOK || Meteor.isDevelopment){
|
||||
links.push({title: 'Component Previews', icon: "category", to: '/storybook/HealthBar'})
|
||||
}
|
||||
return links;
|
||||
},
|
||||
parties(){
|
||||
let parties = Parties.find(
|
||||
|
||||
@@ -54,10 +54,9 @@ RouterFactory.configure(factory => {
|
||||
component: Account,
|
||||
},
|
||||
]);
|
||||
//Development routes
|
||||
if (Meteor.isDevelopment){
|
||||
// Storybook routes
|
||||
if (process.env.SHOW_STORYBOOK || Meteor.isDevelopment){
|
||||
let StoryBook = require('/imports/ui/StoryBook.vue').default;
|
||||
let IconAdmin = require('/imports/ui/icons/IconAdmin.vue').default;
|
||||
factory.addRoutes([
|
||||
{
|
||||
path: '/storybook/:component',
|
||||
@@ -67,7 +66,14 @@ RouterFactory.configure(factory => {
|
||||
path: '/storybook',
|
||||
name: 'storybook',
|
||||
component: StoryBook,
|
||||
}, {
|
||||
},
|
||||
]);
|
||||
}
|
||||
// Icon admin routes
|
||||
if (Meteor.isDevelopment){
|
||||
let IconAdmin = require('/imports/ui/icons/IconAdmin.vue').default;
|
||||
factory.addRoutes([
|
||||
{
|
||||
path: '/icon-admin',
|
||||
name: 'iconAdmin',
|
||||
component: IconAdmin,
|
||||
|
||||
Reference in New Issue
Block a user