|
|
@@ -10,14 +10,14 @@ import { AnyStore, ItemMenu, ItemsMenu, Menu, organizationState } from '~/types/
|
|
|
* Classe pour la construction du Menu Sites internet
|
|
|
*/
|
|
|
class WebsiteMenu extends BaseMenu implements Menu {
|
|
|
- private $ability:Ability;
|
|
|
- private $store:AnyStore;
|
|
|
+ private $ability: Ability;
|
|
|
+ private $store: AnyStore;
|
|
|
|
|
|
/**
|
|
|
* @constructor
|
|
|
* Initialisation des services issues du context
|
|
|
*/
|
|
|
- constructor ($config:NuxtConfig, $ability:Ability, $store:AnyStore) {
|
|
|
+ constructor ($config: NuxtConfig, $ability: Ability, $store: AnyStore) {
|
|
|
super($config)
|
|
|
this.$ability = $ability
|
|
|
this.$store = $store
|
|
|
@@ -28,7 +28,7 @@ class WebsiteMenu extends BaseMenu implements Menu {
|
|
|
* @return {ItemMenu | null}
|
|
|
*/
|
|
|
getMenu ():ItemMenu | null {
|
|
|
- const children:ItemsMenu = []
|
|
|
+ const children: ItemsMenu = []
|
|
|
|
|
|
if (!this.$store.state.profile.organization.website && this.$store.state.profile.access.isAdminAccess) {
|
|
|
children.push(this.constructMenu('fa-globe-europe', 'simple_modification', this.getWebsite(this.$store.state.profile.organization), false, undefined, true))
|
|
|
@@ -43,7 +43,7 @@ class WebsiteMenu extends BaseMenu implements Menu {
|
|
|
* @return {ItemMenu | null}
|
|
|
*/
|
|
|
getHeaderMenu ():ItemMenu | null {
|
|
|
- const children:ItemsMenu = []
|
|
|
+ const children: ItemsMenu = []
|
|
|
|
|
|
children.push(this.constructMenu(this.$store.state.profile.organization.name, undefined, this.getWebsite(this.$store.state.profile.organization), false, undefined, true))
|
|
|
|
|
|
@@ -54,9 +54,9 @@ class WebsiteMenu extends BaseMenu implements Menu {
|
|
|
return children.length > 0 ? this.constructMenu('website', 'fa-globe-europe', undefined, undefined, children) : null
|
|
|
}
|
|
|
|
|
|
- getWebsite (organization:organizationState):string {
|
|
|
+ getWebsite (organization: organizationState):string {
|
|
|
return organization.website ? organization.website : this.$config.baseURL_typo3.replace('###subDomain###', organization.subDomain)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export const getWebsiteMenu = ($config:NuxtConfig, $ability:Ability, $store:AnyStore) => new WebsiteMenu($config, $ability, $store)
|
|
|
+export const getWebsiteMenu = ($config: NuxtConfig, $ability: Ability, $store: AnyStore) => new WebsiteMenu($config, $ability, $store)
|