- apps: the fixed «در حال مشاهده بهعنوان» strip (38px) sat over the fixed page headers, which still sat at top: 0 (the old 30px body padding was shorter than the strip too). The strip's height is now one variable, --aab-h, that the fixed headers (PageBar, home, dashboard, toasts) use as their top. - admin: the customer form offers only «مغازه دار اپلیکیشن» to anyone but the super admin; bankers and walk-in shopkeepers are listed by super-admin-only endpoints, so ordinary admins lost the customers they created under them. - admin: the mobile slider rid (custom.config.statics.slider) was only under the «سفارشی» branch, which the permission screen hides outside level 104. Same rid, now listed under «مدیریت ثابت ها». Display only: the slider routes are still gated by config.statics. Rebuilds admin-panel, user-app and user-app-v2 dist. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
106 lines
2.8 KiB
Vue
106 lines
2.8 KiB
Vue
<!--
|
|
Ported from legacy henza_pwa/src/App.vue — layout switching, RTL shell, and
|
|
and the update gate (components/AppUpdateGate.vue).
|
|
|
|
Not ported (deliberate): Firebase push init and WebOTP autofill. Both were
|
|
already commented out in legacy's own App.vue, so neither ran there either.
|
|
-->
|
|
<template>
|
|
<div :class="{ 'is-actingAs': Boolean(session.actingAs) }">
|
|
<ActingAsBar />
|
|
<component :is="getLayout" class="relative">
|
|
<router-view v-slot="{ Component, route }">
|
|
<keep-alive>
|
|
<suspense>
|
|
<template #default>
|
|
<component :is="Component" :key="route.name" />
|
|
</template>
|
|
</suspense>
|
|
</keep-alive>
|
|
</router-view>
|
|
</component>
|
|
|
|
<AppUpdateGate />
|
|
|
|
<ProductMorph />
|
|
<ToastHost />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRegisterSW } from 'virtual:pwa-register/vue'
|
|
import MasterLayout from './layout/MasterLayout.vue'
|
|
import FullPageLayout from './layout/FullPageLayout.vue'
|
|
import AppUpdateGate from './components/AppUpdateGate.vue'
|
|
import ToastHost from './components/ui/ToastHost.vue'
|
|
import ProductMorph from './components/product/ProductMorph.vue'
|
|
import ActingAsBar from './components/expert/ActingAsBar.vue'
|
|
import { useSessionStore } from './stores/session'
|
|
|
|
const router = useRouter()
|
|
const session = useSessionStore()
|
|
// Registers the service worker (offline, install). Updates are not applied
|
|
// here: AppUpdateGate shows what changed and applies them on the user's tap.
|
|
useRegisterSW()
|
|
|
|
const getLayout = computed(() => {
|
|
if (router.currentRoute.value.meta && router.currentRoute.value.meta.layout === 'FullPage') {
|
|
return FullPageLayout
|
|
}
|
|
return MasterLayout
|
|
})
|
|
</script>
|
|
|
|
<style lang="less">
|
|
body::-webkit-scrollbar {
|
|
display: none;
|
|
}
|
|
|
|
/* The act-as strip is fixed, so push everything down by its height while it is
|
|
up — otherwise it covers the top of each page, including sticky headers. */
|
|
.is-actingAs {
|
|
/* The strip's height. Fixed headers read it as their `top`, and the page flow
|
|
is pushed down by the same amount. */
|
|
--aab-h: 38px;
|
|
padding-top: var(--aab-h);
|
|
}
|
|
|
|
#app {
|
|
overflow: hidden;
|
|
direction: rtl !important;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
text-align: start;
|
|
color: @primary;
|
|
-webkit-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.slideDown-enter-active,
|
|
.slideDown-leave-active {
|
|
transition: all @transition-duration ease;
|
|
}
|
|
.slideDown-enter-from {
|
|
transform: translateY(-100vh);
|
|
}
|
|
|
|
.slideDown-leave-to {
|
|
transform: translateY(100vh);
|
|
}
|
|
|
|
.slideDown-leave-from {
|
|
transform: translateY(0);
|
|
}
|
|
.slideDown-enter-to {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.fade-down-enter-active,
|
|
.fade-down-leave-active {
|
|
transition: all @transition-duration ease;
|
|
}
|
|
</style>
|