Put available settings in the store; etc.

also add `build-watch` script for dev's sake

menu component no longer allows anonymous feedback by default

logo component gets a `centered` prop
This commit is contained in:
Lance Edgar 2022-08-09 14:38:41 -05:00
parent 3392f8cbd6
commit e537d8e3a6
5 changed files with 13 additions and 3 deletions

View file

@ -14,7 +14,8 @@
},
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --target lib --name byjove src/index.js"
"build": "vue-cli-service build --target lib --name byjove src/index.js",
"build-watch": "vue-cli-service build --target lib --name byjove --watch src/index.js"
},
"dependencies": {
"vue": "^2.6.10"

View file

@ -49,6 +49,9 @@ export default {
// also keep track of user's permissions
this.$store.commit('SET_PERMISSIONS', response.data.permissions)
// also keep track of backend app settings
this.$store.commit('SET_SETTINGS', response.data.settings || {})
// declare the session established
this.$store.commit('SET_SESSION_ESTABLISHED', true)

View file

@ -1,5 +1,6 @@
<template>
<div class="byjove-logo">
<div class="byjove-logo"
:style="centered ? 'text-align: center;' : null">
<img v-if="appsettings.logo" :alt="alternateText" :src="appsettings.logo" />
<img v-if="!appsettings.logo" :alt="alternateText" src="../../assets/logo.png" />
</div>
@ -10,6 +11,7 @@ export default {
name: 'ByjoveLogo',
props: {
appsettings: Object,
centered: Boolean,
},
computed: {
alternateText: function() {

View file

@ -89,7 +89,7 @@ export default {
},
allowAnonymousFeedback: {
type: Boolean,
default: true,
default: false,
},
feedbackUrl: {
type: String,

View file

@ -6,6 +6,7 @@ export let ByjoveStoreConfig = {
user_is_admin: false,
user_is_root: false,
permissions: [],
settings: {},
},
mutations: {
SET_SESSION_ESTABLISHED(state, established) {
@ -23,6 +24,9 @@ export let ByjoveStoreConfig = {
SET_PERMISSIONS(state, permissions) {
state.permissions = permissions
},
SET_SETTINGS(state, settings) {
state.settings = settings
},
},
actions: {
// TODO: should we define the logic here, for fetching current session