Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TQLG-50: guest order adjustments #91

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/Account/AccountSideNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ const navItems = ref([
class="mt-4 pb-4 pl-2 text-2xl font-bold"
>
{{ $t('account.dropdownHeading') }}
{{ customerStore.customer?.guest ? $t('account.dropdownHeadingGuest') : $t('account.dropdownHeading') }}
paulapopDD marked this conversation as resolved.
Show resolved Hide resolved
</div>
<li
v-if="!customerStore.customer?.guest"
v-for="(item, index) in navItems"
:key="item.path"
class="mt-4 pb-4 pl-2"
Expand All @@ -66,8 +68,11 @@ const navItems = ref([
type="submit"
prefix-icon="right-from-bracket"
@click.prevent="handleLogout"
:classes="{
input: '!px-0 flex gap-2',
}"
paulapopDD marked this conversation as resolved.
Show resolved Hide resolved
>
{{ $t('account.logout.buttonLabel') }}
{{ customerStore.customer?.guest ? $t('account.logout.guestButtonLabel') : $t('account.logout.buttonLabel') }}
</FormKit>
</li>
</ul>
Expand Down
6 changes: 5 additions & 1 deletion composables/useAuthentication.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
export function useAuthentication() {
const { signedIn, loading } = storeToRefs(useCustomerStore());
const { signedIn, loading, customer } = storeToRefs(useCustomerStore());

const rerouteIfLoggedOut = async (targetRoute: string = '/account/login') => {
await sessionContextLoaded();

if(signedIn.value && customer.value?.guest) {
paulapopDD marked this conversation as resolved.
Show resolved Hide resolved
navigateTo('/');
}
if (!signedIn.value) {
navigateTo(targetRoute);
}
Expand Down
4 changes: 3 additions & 1 deletion i18n/de-DE/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"account": {
"greeting": "Hallo {firstname} {lastname}",
"dropdownHeading": "Ihr Konto",
"dropdownHeadingGuest": "Gast",
"overview": {
"heading": "Übersicht",
"subHeading": "Hier sehen Sie ihre Daten, gespeicherten Bezahlmethoden und Adressen.",
Expand Down Expand Up @@ -143,7 +144,8 @@
"error": "Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut."
},
"logout": {
"buttonLabel": "Logout"
"buttonLabel": "Logout",
"guestButtonLabel": "Gast-Sitzung beenden"
},
"recoverPassword": {
"request": {
Expand Down
4 changes: 3 additions & 1 deletion i18n/en-GB/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"account": {
"greeting": "Hallo {firstname} {lastname}",
"dropdownHeading": "Your account",
"dropdownHeadingGuest": "Guest",
"overview": {
"heading": "Overview",
"subHeading": "Directly access your profile information, the default payment method and given addresses.",
Expand Down Expand Up @@ -143,7 +144,8 @@
"error": "An error has occurred. Please try again."
},
"logout": {
"buttonLabel": "Logout"
"buttonLabel": "Logout",
"guestButtonLabel": "Close guest session"
},
"recoverPassword": {
"request": {
Expand Down