Use consistent names, apply prefix in consumer

This commit is contained in:
guerler
2022-09-01 12:40:42 -04:00
parent 05f1d967c7
commit d2ff532b5c
4 changed files with 28 additions and 30 deletions
+19 -15
View File
@@ -1,8 +1,8 @@
<template>
<b-navbar id="masthead" type="dark" role="navigation" aria-label="Main" class="justify-content-center">
<b-navbar-brand :href="brandLink" aria-label="homepage">
<img alt="logo" class="navbar-brand-image" :src="brandImage" />
<img v-if="brandImageSecondary" alt="logo" class="navbar-brand-image" :src="brandImageSecondary" />
<b-navbar-brand :href="getPath(logoUrl)" aria-label="homepage">
<img alt="logo" class="navbar-brand-image" :src="getPath(logoSrc)" />
<img v-if="logoSrcSecondary" alt="logo" class="navbar-brand-image" :src="getPath(logoSrcSecondary)" />
<span class="navbar-brand-title">{{ brandTitle }}</span>
</b-navbar-brand>
<b-navbar-nav>
@@ -23,6 +23,7 @@ import { BNavbar, BNavbarBrand, BNavbarNav } from "bootstrap-vue";
import MastheadItem from "./MastheadItem";
import { loadWebhookMenuItems } from "./_webhooks";
import QuotaMeter from "./QuotaMeter.vue";
import { safePath } from "utils/redirect";
export default {
name: "Masthead",
@@ -46,22 +47,22 @@ export default {
type: String,
default: null,
},
brandLink: {
type: String,
default: null,
},
brandImage: {
type: String,
default: null,
},
brandImageSecondary: {
type: String,
default: null,
},
initialActiveTab: {
type: String,
default: "analysis",
},
logoUrl: {
type: String,
default: null,
},
logoSrc: {
type: String,
default: null,
},
logoSrcSecondary: {
type: String,
default: null,
},
windowTab: {
type: Object,
default: null,
@@ -99,6 +100,9 @@ export default {
addItem(item) {
this.tabs.push(item);
},
getPath(url) {
return safePath(url);
},
updateTab() {
const currentRoute = this.$route?.path;
let matchedId = null;
+3 -9
View File
@@ -7,9 +7,9 @@
id="masthead"
:display-galaxy-brand="config.display_galaxy_brand"
:brand="config.brand"
:brand-link="getPath(config.logo_url)"
:brand-image="getPath(config.logo_src)"
:brand-image-secondary="getPath(config.logo_src_secondary)"
:logo-url="config.logo_url"
:logo-src="config.logo_src"
:logo-src-secondary="config.logo_src_secondary"
:base-tabs="baseTabs"
:window-tab="windowTab" />
<alert
@@ -43,7 +43,6 @@ import { getGalaxyInstance } from "app";
import { getAppRoot } from "onload";
import { HistoryPanelProxy } from "components/History/adapters/HistoryPanelProxy";
import { fetchMenu } from "entry/analysis/menu";
import { safePath } from "utils/redirect";
import { WindowManager } from "layout/window-manager";
export default {
@@ -92,10 +91,5 @@ export default {
}
};
},
methods: {
getPath(url) {
return safePath(url);
},
},
};
</script>
+3 -3
View File
@@ -14,9 +14,9 @@ export function mountMasthead(el, options) {
displayGalaxyBrand: options.display_galaxy_brand,
baseTabs: fetchMenu(options),
brand: options.brand,
brandLink: options.logo_url,
brandImage: options.logo_src,
brandImageSecondary: options.logo_src_secondary,
logoUrl: options.logo_url,
logoSrc: options.logo_src,
logoSrcSecondary: options.logo_src_secondary,
windowTab: windowManager.getTab(),
},
el
@@ -21,9 +21,9 @@
'release_doc_base_url' : app.config.release_doc_base_url,
'terms_url' : app.config.terms_url or '',
'allow_user_creation' : app.config.allow_user_creation,
'logo_url' : h.url_for(app.config.logo_url),
'logo_src' : h.url_for(app.config.get('logo_src', '/static/favicon.png')),
'logo_src_secondary' : h.url_for(app.config.get('logo_src_secondary')) if app.config.get('logo_src_secondary') else None,
'logo_url' : app.config.logo_url,
'logo_src' : app.config.get('logo_src', '/static/favicon.png'),
'logo_src_secondary' : app.config.get('logo_src_secondary'),
'is_admin_user' : trans.user_is_admin,
'active_view' : active_view,
'ftp_upload_site' : app.config.ftp_upload_site,