Copy the Chatwoot (v4.14.0) frontend runnable subset into frontend/ for customization: - app/javascript/ (Vue SPA: dashboard, widget, sdk, portal, superadmin) - app/views/ (ERB templates for vite-plugin-ruby entrypoint resolution) - app/helpers/, app/assets/ (Rails view helpers, static assets) - enterprise/ (Enterprise edition frontend overlay) - config/vite.json, vite.config.ts, bin/vite (Vite-Rails toolchain) - package.json, pnpm-lock.yaml, tailwind/postcss/eslint configs - Gemfile, Gemfile.lock (vite_rails gem for bin/vite binstub) Excluded Rails backend: controllers, models, services, jobs, mailers, policies, db, lib, spec, public, node_modules. Update references to the new frontend location: - .gitignore: exclude frontend build artifacts (node_modules, tmp, packs), keep frontend/bin/ and frontend/vendor/ via negation - backend/scripts/parity_frontend_smoke.sh: CHATWOOT_DIR default reference/chatwoot -> ../frontend - backend/scripts/parity_frontend_browser_smoke.mjs: same default update - AGENTS.md: add frontend section with Rails/Vite coupling notes - README: architecture tree includes frontend/
80 lines
2.3 KiB
Vue
80 lines
2.3 KiB
Vue
<script setup>
|
|
import { ref } from 'vue';
|
|
import Button from 'dashboard/components-next/button/Button.vue';
|
|
import DropdownContainer from './base/DropdownContainer.vue';
|
|
import DropdownBody from './base/DropdownBody.vue';
|
|
import DropdownSection from './base/DropdownSection.vue';
|
|
import DropdownItem from './base/DropdownItem.vue';
|
|
import DropdownSeparator from './base/DropdownSeparator.vue';
|
|
import ToggleSwitch from 'dashboard/components-next/switch/Switch.vue';
|
|
|
|
const currentUserAutoOffline = ref(false);
|
|
|
|
const menuItems = ref([
|
|
{
|
|
label: 'Contact Support',
|
|
icon: 'i-lucide-life-buoy',
|
|
click: () => console.log('Contact Support'),
|
|
},
|
|
{
|
|
label: 'Keyboard Shortcuts',
|
|
icon: 'i-lucide-keyboard',
|
|
click: () => console.log('Keyboard Shortcuts'),
|
|
},
|
|
{
|
|
label: 'Profile Settings',
|
|
icon: 'i-lucide-user-pen',
|
|
click: () => console.log('Profile Settings'),
|
|
},
|
|
{
|
|
label: 'Change Appearance',
|
|
icon: 'i-lucide-swatch-book',
|
|
click: () => console.log('Change Appearance'),
|
|
},
|
|
{
|
|
label: 'Open SuperAdmin',
|
|
icon: 'i-lucide-castle',
|
|
link: '/super_admin',
|
|
target: '_blank',
|
|
},
|
|
{
|
|
label: 'Log Out',
|
|
icon: 'i-lucide-log-out',
|
|
click: () => console.log('Log Out'),
|
|
},
|
|
]);
|
|
</script>
|
|
|
|
<template>
|
|
<Story
|
|
title="Components/DropdownPrimitives"
|
|
:layout="{ type: 'grid', width: 400, height: 800 }"
|
|
>
|
|
<Variant title="Profile Menu">
|
|
<div class="p-4 bg-n-background h-[500px]">
|
|
<DropdownContainer>
|
|
<template #trigger="{ toggle }">
|
|
<Button label="Open Menu" size="sm" @click="toggle" />
|
|
</template>
|
|
<DropdownBody class="w-80">
|
|
<DropdownSection title="Profile Options">
|
|
<DropdownItem label="Contact Support" class="justify-between">
|
|
<span>{{ $t('SIDEBAR.SET_AUTO_OFFLINE.TEXT') }}</span>
|
|
<div class="flex-shrink-0">
|
|
<ToggleSwitch v-model="currentUserAutoOffline" />
|
|
</div>
|
|
</DropdownItem>
|
|
</DropdownSection>
|
|
<DropdownSeparator />
|
|
<DropdownItem
|
|
v-for="item in menuItems"
|
|
:key="item.label"
|
|
v-bind="item"
|
|
/>
|
|
</DropdownBody>
|
|
</DropdownContainer>
|
|
</div>
|
|
</Variant>
|
|
</Story>
|
|
</template>
|