-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e791939
commit 689d1ea
Showing
13 changed files
with
471 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 145 additions & 0 deletions
145
packages/web-runtime/src/components/Topbar/Tours/Tours.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<template> | ||
<div v-if="toursAllowed" id="tours"> | ||
<oc-button | ||
v-if="tours.length === 1" | ||
id="toursButton" | ||
v-oc-tooltip="tours[0].tooltip" | ||
size="small" | ||
@click.stop="startTour(0)" | ||
> | ||
<oc-icon name="map" /> | ||
{{ tours[0].tourName }} | ||
</oc-button> | ||
|
||
<div v-else> | ||
<oc-button id="toursButton" v-oc-tooltip="toursTooltip" size="small"> | ||
<oc-icon name="map" /> | ||
<translate>Tours</translate> </oc-button | ||
><oc-drop | ||
ref="menu" | ||
drop-id="tours" | ||
toggle="#toursButton" | ||
mode="click" | ||
close-on-click | ||
padding-size="small" | ||
> | ||
<oc-list class="user-menu-list"> | ||
<li | ||
v-for="(tour, id) in tours" | ||
:id="tour.tourName" | ||
:key="`tour-${tour.title}-list-${id}`" | ||
class="user-menu-list" | ||
@click.stop="startTour(id)" | ||
> | ||
<oc-button v-oc-tooltip="tour.tooltip" appearance="raw"> | ||
<span class="profile-info-wrapper" :class="'oc-py-xs'"> | ||
{{ tour.tourName }} | ||
</span></oc-button | ||
> | ||
</li></oc-list | ||
> | ||
</oc-drop> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters } from 'vuex' | ||
import { createTranslatedTour } from '../../../helpers/tours' | ||
export default { | ||
computed: { | ||
...mapGetters(['currentTranslatedTourInfos']), | ||
tours() { | ||
return this.currentTranslatedTourInfos | ||
}, | ||
language() { | ||
return this.$language.current | ||
}, | ||
toursAllowed() { | ||
return this.tours.some((t) => this.tourAllowed(t)) | ||
}, | ||
toursTooltip() { | ||
return this.$gettext('See tours through the interface') | ||
} | ||
}, | ||
methods: { | ||
startTour(id) { | ||
createTranslatedTour(this.tours[id]).start() | ||
}, | ||
tourAllowed(tour) { | ||
// if there are allowed locations, show based on them, otherwise check denied locations, otherwise show always | ||
if (tour.allowedLocations?.length) return tour.allowedLocations.includes(this.$route.name) | ||
else if (tour.deniedLocations?.length) | ||
return !tour.deniedLocations?.includes(this.$route.name) | ||
return true | ||
} | ||
} | ||
} | ||
</script> | ||
<style src="shepherd.js/dist/css/shepherd.css"></style> | ||
<style lang="scss"> | ||
.guide-highlight { | ||
background-color: var(--oc-color-background-highlight); | ||
} | ||
#tour { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
.guide-img { | ||
width: 100%; | ||
} | ||
.shepherd-element { | ||
max-width: 700px !important; | ||
} | ||
.shepherd-header { | ||
align-items: center !important; | ||
background-color: var(--oc-color-swatch-brand-default) !important; | ||
border: 1px solid var(--oc-color-swatch-brand-default) !important; | ||
border: 0 !important; | ||
box-shadow: 5px 0 25px rgb(0 0 0 / 30%) !important; | ||
display: flex !important; | ||
flex-flow: row wrap !important; | ||
padding: var(--oc-space-small) var(--oc-space-medium) !important; | ||
h3 { | ||
color: var(--oc-color-swatch-inverse-default) !important; | ||
font-size: 1rem !important; | ||
font-weight: 700 !important; | ||
margin: 0 !important; | ||
} | ||
} | ||
.shepherd-text { | ||
border-top: 1px solid var(--oc-color-swatch-brand-default) !important; | ||
} | ||
.shepherd-element { | ||
border-radius: 15px !important; | ||
background-color: var(--oc-color-background-default) !important; | ||
} | ||
.shepherd-text, | ||
.shepherd-footer { | ||
background-color: var(--oc-color-background-default) !important; | ||
border: 0 !important; | ||
//box-shadow: 5px 0 25px rgb(0 0 0 / 30%) !important; | ||
color: var(--oc-color-text-default) !important; | ||
padding: var(--oc-space-medium) !important; | ||
} | ||
.shepherd-footer { | ||
border: 0 !important; | ||
} | ||
.shepherd-button { | ||
background-color: var(--oc-color-swatch-primary-default) !important; | ||
border-color: var(--oc-color-swatch-primary-default) !important; | ||
} | ||
.shepherd-button-secondary { | ||
background-color: initial !important; | ||
color: var(--oc-color-swatch-passive-default) !important; | ||
border: 1px solid transparent !important; | ||
border-color: var(--oc-color-swatch-passive-default) !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.