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/
71 lines
2.1 KiB
Vue
71 lines
2.1 KiB
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import Button from 'dashboard/components-next/button/Button.vue';
|
|
import ButtonGroup from 'dashboard/components-next/buttonGroup/ButtonGroup.vue';
|
|
import { useUISettings } from 'dashboard/composables/useUISettings';
|
|
import { useMapGetter } from 'dashboard/composables/store';
|
|
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
|
const route = useRoute();
|
|
|
|
const { uiSettings, updateUISettings } = useUISettings();
|
|
|
|
const isConversationRoute = computed(() => {
|
|
const CONVERSATION_ROUTES = [
|
|
'inbox_conversation',
|
|
'conversation_through_inbox',
|
|
'conversations_through_label',
|
|
'team_conversations_through_label',
|
|
'conversations_through_folders',
|
|
'conversation_through_mentions',
|
|
'conversation_through_unattended',
|
|
'conversation_through_participating',
|
|
'inbox_view_conversation',
|
|
];
|
|
return CONVERSATION_ROUTES.includes(route.name);
|
|
});
|
|
|
|
const currentAccountId = useMapGetter('getCurrentAccountId');
|
|
const isFeatureEnabledonAccount = useMapGetter(
|
|
'accounts/isFeatureEnabledonAccount'
|
|
);
|
|
|
|
const showCopilotLauncher = computed(() => {
|
|
const isCaptainEnabled = isFeatureEnabledonAccount.value(
|
|
currentAccountId.value,
|
|
FEATURE_FLAGS.CAPTAIN
|
|
);
|
|
return (
|
|
isCaptainEnabled &&
|
|
!uiSettings.value.is_copilot_panel_open &&
|
|
!isConversationRoute.value
|
|
);
|
|
});
|
|
const toggleSidebar = () => {
|
|
updateUISettings({
|
|
is_copilot_panel_open: !uiSettings.value.is_copilot_panel_open,
|
|
is_contact_sidebar_open: false,
|
|
});
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
v-if="showCopilotLauncher"
|
|
class="fixed bottom-4 ltr:right-4 rtl:left-4 z-50"
|
|
>
|
|
<ButtonGroup
|
|
class="rounded-full bg-n-alpha-2 backdrop-blur-lg p-1 shadow hover:shadow-md"
|
|
>
|
|
<Button
|
|
icon="i-woot-captain"
|
|
no-animation
|
|
class="!rounded-full !bg-n-solid-3 dark:!bg-n-alpha-2 !text-n-slate-12 text-xl transition-all duration-200 ease-out hover:brightness-110"
|
|
lg
|
|
@click="toggleSidebar"
|
|
/>
|
|
</ButtonGroup>
|
|
</div>
|
|
<template v-else />
|
|
</template>
|