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": { "scripts": {
"serve": "vue-cli-service serve", "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": { "dependencies": {
"vue": "^2.6.10" "vue": "^2.6.10"

View file

@ -49,6 +49,9 @@ export default {
// also keep track of user's permissions // also keep track of user's permissions
this.$store.commit('SET_PERMISSIONS', response.data.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 // declare the session established
this.$store.commit('SET_SESSION_ESTABLISHED', true) this.$store.commit('SET_SESSION_ESTABLISHED', true)

View file

@ -1,5 +1,6 @@
<template> <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="appsettings.logo" />
<img v-if="!appsettings.logo" :alt="alternateText" src="../../assets/logo.png" /> <img v-if="!appsettings.logo" :alt="alternateText" src="../../assets/logo.png" />
</div> </div>
@ -10,6 +11,7 @@ export default {
name: 'ByjoveLogo', name: 'ByjoveLogo',
props: { props: {
appsettings: Object, appsettings: Object,
centered: Boolean,
}, },
computed: { computed: {
alternateText: function() { alternateText: function() {

View file

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

View file

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