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/
106 lines
2.9 KiB
Vue
106 lines
2.9 KiB
Vue
<script setup>
|
|
import TemplatePreview from './TemplatePreview.vue';
|
|
import {
|
|
whatsAppTemplates,
|
|
getWhatsAppVariables,
|
|
} from './templates/whatsapp-templates.js';
|
|
import { twilioTemplates } from './templates/twilio-templates.js';
|
|
|
|
const findWhatsApp = name => whatsAppTemplates.find(t => t.name === name);
|
|
const findTwilio = name => twilioTemplates.find(t => t.friendly_name === name);
|
|
|
|
const greet = findWhatsApp('greet');
|
|
const eventInvitation = findWhatsApp('event_invitation_static');
|
|
const orderConfirmation = findWhatsApp('order_confirmation');
|
|
const discountCoupon = findWhatsApp('discount_coupon');
|
|
const trainingVideo = findWhatsApp('training_video');
|
|
|
|
const twilioGreet = findTwilio('greet');
|
|
const shoeLaunch = findTwilio('shoe_launch');
|
|
const welcomeMessage = findTwilio('welcome_message_new');
|
|
const courseFeeReminder = findTwilio('course_fee_reminder');
|
|
</script>
|
|
|
|
<template>
|
|
<Story
|
|
title="Components/TemplatePreview"
|
|
:layout="{ type: 'grid', width: 400 }"
|
|
>
|
|
<Variant title="WhatsApp - Simple Text">
|
|
<TemplatePreview
|
|
:template="greet"
|
|
:variables="getWhatsAppVariables(greet)"
|
|
platform="whatsapp"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="WhatsApp - Simple Text (No Variables)">
|
|
<TemplatePreview :template="greet" :variables="{}" platform="whatsapp" />
|
|
</Variant>
|
|
|
|
<Variant title="WhatsApp - Call to Action Buttons">
|
|
<TemplatePreview
|
|
:template="eventInvitation"
|
|
:variables="getWhatsAppVariables(eventInvitation)"
|
|
platform="whatsapp"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="WhatsApp - Image Media">
|
|
<TemplatePreview
|
|
:template="orderConfirmation"
|
|
:variables="getWhatsAppVariables(orderConfirmation)"
|
|
platform="whatsapp"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="WhatsApp - Video Media">
|
|
<TemplatePreview
|
|
:template="trainingVideo"
|
|
:variables="getWhatsAppVariables(trainingVideo)"
|
|
platform="whatsapp"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="WhatsApp - Copy Code">
|
|
<TemplatePreview
|
|
:template="discountCoupon"
|
|
:variables="getWhatsAppVariables(discountCoupon)"
|
|
platform="whatsapp"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="Twilio - Text">
|
|
<TemplatePreview
|
|
:template="twilioGreet"
|
|
:variables="twilioGreet.variables"
|
|
platform="twilio"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="Twilio - Media">
|
|
<TemplatePreview
|
|
:template="shoeLaunch"
|
|
:variables="shoeLaunch.variables"
|
|
platform="twilio"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="Twilio - Quick Reply">
|
|
<TemplatePreview
|
|
:template="welcomeMessage"
|
|
:variables="welcomeMessage.variables"
|
|
platform="twilio"
|
|
/>
|
|
</Variant>
|
|
|
|
<Variant title="Twilio - Call to Action">
|
|
<TemplatePreview
|
|
:template="courseFeeReminder"
|
|
:variables="courseFeeReminder.variables"
|
|
platform="twilio"
|
|
/>
|
|
</Variant>
|
|
</Story>
|
|
</template>
|