Files
chatwoot/app/javascript/packs/superadmin_pages.js
Sojan Jose 773be6f8ec feat: Interface to validate response_source (#8894)
- This PR adds a UI to validate the response source quality quickly. It also helps to test with sample questions and update responses in the database when missing.

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2024-02-26 20:20:12 +05:30

29 lines
804 B
JavaScript

import 'chart.js';
import Vue from 'vue';
import VueDOMPurifyHTML from 'vue-dompurify-html';
Vue.use(VueDOMPurifyHTML);
const PlaygroundIndex = () =>
import('../superadmin_pages/views/playground/Index.vue');
const ComponentMapping = {
PlaygroundIndex: PlaygroundIndex,
};
const renderComponent = (componentName, props) => {
Vue.component(componentName, ComponentMapping[componentName]);
new Vue({
data: { props: props },
template: `<${componentName} :component-data="props"/>`,
}).$mount('#app');
};
document.addEventListener('DOMContentLoaded', () => {
const element = document.getElementById('app');
if (element) {
const componentName = element.dataset.componentName;
const props = JSON.parse(element.dataset.props);
renderComponent(componentName, props);
}
});