Advertisement
darksantos

Step = paso

May 9th, 2024
832
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
  2. import { DriveStep, Driver } from 'driver.js';
  3.  
  4. export const crearOTSteps = (driver: Driver): DriveStep[] => {
  5.   return [
  6.     {
  7.       element: '.seccion-detalles-tutorial',
  8.       popover: {
  9.         title: 'Detalles',
  10.         description: `
  11.           ● Debe rellenar los campos no opcionales.
  12.         `,
  13.         side: "right",
  14.         align: 'start',
  15.       },
  16.     },
  17.     {
  18.       element: '.vehiculo-tutorial',
  19.       popover: {
  20.         title: 'Vehículo',
  21.         description: `
  22.           ● Puede seleccionar su vehículo. <br>
  23.           ● Puede editar un vehículo seleccionado. <br>
  24.           ● Puede crear un nuevo vehículo. <br>`,
  25.         side: "right",
  26.         align: 'start',
  27.       },
  28.     },
  29.     {
  30.       element: '.cliente-tutorial',
  31.       popover: {
  32.         title: 'Cliente',
  33.         description: `
  34.           ● Puede seleccionar su cliente. <br>
  35.           ● Puede editar un cliente seleccionado. <br>
  36.           ● Puede crear un nuevo cliente.
  37.         `,
  38.         side: "right",
  39.         align: 'start',
  40.       },
  41.     },
  42.     {
  43.       element: '.seccion-venta-tutorial',
  44.       popover: {
  45.         title: 'Ventas',
  46.         description: `
  47.           ● Sección para agregar servicios/productos.
  48.         `,
  49.         side: "right",
  50.         align: 'start',
  51.       },
  52.     },
  53.     {
  54.       element: '.crear-productos-tutorial',
  55.       popover: {
  56.         title: 'Crear',
  57.         description: `
  58.           ● Puede crear productos y/o servicios.
  59.         `,
  60.         side: "right",
  61.         align: 'start',
  62.       },
  63.     },
  64.     {
  65.       element: '.cargar-fotos-vehiculo-tutorial',
  66.       popover: {
  67.         title: 'Cargar fotos',
  68.         description: `
  69.           ● Puede cargar fotos de su vehículo.
  70.         `,
  71.         side: 'left',
  72.         align: 'start',
  73.       }
  74.     },
  75.     {
  76.       element: '.agregar-productos-tutorial',
  77.       popover: {
  78.         title: 'Agregar Productos',
  79.         description: `
  80.           ● Para agregar productos a su venta.
  81.         `,
  82.         side: "right",
  83.         align: 'start',
  84.       },
  85.     },
  86.     {
  87.       element: '.descuento-tutorial',
  88.       popover: {
  89.         title: 'Descuento',
  90.         description: `
  91.           ● Puede agregar un descuento al bruto de la venta.
  92.         `,
  93.         side: "right",
  94.         align: 'start',
  95.       },
  96.     },
  97.     {
  98.       element: '.cambiar-descuento-tutorial',
  99.       popover: {
  100.         title: 'Tipo de Descuento',
  101.         description: `
  102.           ● El descuento puede ser por pesos o por % al hacer click en este botón.
  103.         `,
  104.         side: "right",
  105.         align: 'start',
  106.       },
  107.     },
  108.     {
  109.       element: '.tipo-documento-tutorial',
  110.       popover: {
  111.         title: 'Tipo de Documento',
  112.         description: `
  113.           ● Las cotizaciones no descuentan stock de inventario.
  114.         `,
  115.       },
  116.     },
  117.     {
  118.       element: '.metodo-pago-tutorial',
  119.       popover: {
  120.         title: 'Método de Pago',
  121.         description: `
  122.           ● Deshabilitado en las cotizaciones.
  123.         `,
  124.       },
  125.     },
  126.     {
  127.       element: '.registrar-venta-tutorial',
  128.       popover: {
  129.         title: 'Registrar Venta',
  130.         description: `
  131.           ● Para guardar su venta.
  132.         `,
  133.       },
  134.     },
  135.   ];
  136. };
  137.  
  138. export const crearVentaSteps = (driver: Driver): DriveStep[] => {
  139.   return [
  140.     {
  141.       element: '.seccion-detalles-tutorial',
  142.       popover: {
  143.         title: 'Detalles',
  144.         description: `
  145.           ● Debe rellenar los campos no opcionales.
  146.         `,
  147.         side: "right",
  148.         align: 'start',
  149.       },
  150.     },
  151.     {
  152.       element: '.cliente-tutorial',
  153.       popover: {
  154.         title: 'Cliente',
  155.         description: `
  156.           ● Puede seleccionar su cliente. <br>
  157.           ● Puede editar un cliente seleccionado. <br>
  158.           ● Puede crear un nuevo cliente.
  159.         `,
  160.         side: "right",
  161.         align: 'start',
  162.       },
  163.     },
  164.     {
  165.       element: '.seccion-venta-tutorial',
  166.       popover: {
  167.         title: 'Ventas',
  168.         description: `
  169.           ● Sección para agregar productos.
  170.         `,
  171.         side: "right",
  172.         align: 'start',
  173.       },
  174.     },
  175.     {
  176.       element: '.crear-productos-tutorial',
  177.       popover: {
  178.         title: 'Crear',
  179.         description: `
  180.           ● Puede crear nuevos productos.
  181.         `,
  182.         side: "right",
  183.         align: 'start',
  184.       },
  185.     },
  186.     {
  187.       element: '.agregar-productos-tutorial',
  188.       popover: {
  189.         title: 'Agregar Productos',
  190.         description: `
  191.           ● Para agregar productos a su venta.
  192.         `,
  193.         side: "right",
  194.         align: 'start',
  195.       },
  196.     },
  197.     {
  198.       element: '.descuento-tutorial',
  199.       popover: {
  200.         title: 'Descuento',
  201.         description: `
  202.           ● Puede agregar un descuento al bruto de la venta.
  203.         `,
  204.         side: "right",
  205.         align: 'start',
  206.       },
  207.     },
  208.     {
  209.       element: '.cambiar-descuento-tutorial',
  210.       popover: {
  211.         title: 'Tipo de Descuento',
  212.         description: `
  213.           ● El descuento puede ser por pesos o por % al hacer click en este botón.
  214.         `,
  215.         side: "right",
  216.         align: 'start',
  217.       },
  218.     },
  219.     {
  220.       element: '.tipo-documento-tutorial',
  221.       popover: {
  222.         title: 'Tipo de Documento',
  223.         description: `
  224.           ● Las cotizaciones no descuentan stock de inventario.
  225.         `,
  226.       },
  227.     },
  228.     {
  229.       element: '.metodo-pago-tutorial',
  230.       popover: {
  231.         title: 'Método de Pago',
  232.         description: `
  233.           ● Deshabilitado en las cotizaciones.
  234.         `,
  235.       },
  236.     },
  237.     {
  238.       element: '.registrar-venta-tutorial',
  239.       popover: {
  240.         title: 'Registrar Venta',
  241.         description: `
  242.           ● Para guardar su venta.
  243.         `,
  244.       },
  245.     },
  246.   ];
  247. };
  248.  
  249. export const sidebarSteps = (driver: Driver): DriveStep[] => {
  250.   return [
  251.     {
  252.       element: 'kuv-sidebar-item:has(.fas.fa-chart-bar)',
  253.       popover: {
  254.         title: 'Reportes de Ventas',
  255.         description: `
  256.           ● Puede visualizar los reportes de su sistema.
  257.         `,
  258.         side: "right",
  259.         align: 'start',
  260.       },
  261.     },
  262.     {
  263.       element: 'kuv-sidebar-item:has(.fas.fa-car)',
  264.       popover: {
  265.         title: 'Taller',
  266.         description: `
  267.           ● Órdenes de Trabajo. <br>
  268.           ● Flujo OT. <br>
  269.           ● Vehículos y Servicios.
  270.         `,
  271.         side: "right",
  272.         align: 'start',
  273.       },
  274.     },
  275.     {
  276.       element: 'kuv-sidebar-item:has(.fas.fa-boxes)',
  277.       popover: {
  278.         title: 'Inventario',
  279.         description: `
  280.           ● Productos y Categorías. <br>
  281.           ● Stock Crítico. <br>
  282.           ● Ajustes de Stock.
  283.         `,
  284.         side: "right",
  285.         align: 'start',
  286.       },
  287.     },
  288.   ];
  289. };
  290.  
  291. export const crearServicioSteps = (driver: Driver, activeModal: NgbModal): DriveStep[] => {
  292.   return [
  293.     {
  294.       element: '.agregar-servicio-tutorial',
  295.       popover: {
  296.         title: 'Agregar Servicio',
  297.         description: `
  298.           ● Para agregar un nuevo servicio.
  299.         `,
  300.         side: "right",
  301.         align: 'start',
  302.         onNextClick: (element, step, options) => {
  303.           (document.querySelector('.agregar-servicio-tutorial') as HTMLButtonElement)?.click();
  304.           setTimeout(() => {
  305.             driver.moveNext();
  306.           }, 0);
  307.         },
  308.       },
  309.     },
  310.     {
  311.       element: '.nombre-servicio-tutorial',
  312.       popover: {
  313.         title: 'Nombre del Servicio',
  314.         description: `
  315.           ● Obligatorio.
  316.         `,
  317.         side: "right",
  318.         align: 'start',
  319.         onPrevClick: () => {
  320.           activeModal.dismissAll();
  321.           driver.movePrevious();
  322.         }
  323.       },
  324.     },
  325.   ];
  326. };
  327.  
  328. export const crearProductoSteps = (driver: Driver, activeModal: NgbModal): DriveStep[] => {
  329.   return [
  330.     {
  331.       element: '.agregar-producto-tutorial',
  332.       popover: {
  333.         title: 'Agregar Producto',
  334.         description: `
  335.           ● Para agregar un nuevo producto.
  336.         `,
  337.         onNextClick: (element, step, options) => {
  338.           (document.querySelector('.agregar-producto-tutorial') as HTMLButtonElement)?.click();
  339.           setTimeout(() => {
  340.             driver.moveNext();
  341.           }, 0);
  342.         },
  343.         align: 'start',
  344.       },
  345.     },
  346.     {
  347.       element: '.nombre-producto-tutorial',
  348.       popover: {
  349.         title: 'Nombre del Producto',
  350.         description: `
  351.           ● El nombre del producto es obligatorio.
  352.         `,
  353.         side: "right",
  354.         align: 'start',
  355.         onPrevClick: () => {
  356.           activeModal.dismissAll();
  357.           driver.movePrevious();
  358.         },
  359.         onNextClick: () => {
  360.           driver.moveNext();
  361.         }
  362.       },
  363.     },
  364.     {
  365.       element: '.precio-venta-tutorial',
  366.       popover: {
  367.         title: 'Precio de Venta',
  368.         description: `
  369.           ● Al ingresar un precio, se calcula el otro tras hacer click afuera.
  370.         `,
  371.         side: "right",
  372.         align: 'start',
  373.       },
  374.     },
  375.     {
  376.       element: '.precio-compra-tutorial',
  377.       popover: {
  378.         title: 'Precio de Compra',
  379.         description: `
  380.           ● Al ingresar un precio, se calcula el otro tras hacer click afuera.
  381.         `,
  382.         side: "right",
  383.         align: 'start',
  384.       },
  385.     },
  386.     {
  387.       element: '.stock-inicial-tutorial',
  388.       popover: {
  389.         title: 'Stock Inicial',
  390.         description: `
  391.           ● (Opcional) Se asigna el stock cuando se crea una sucursal .
  392.         `,
  393.         side: "right",
  394.         align: 'start',
  395.       },
  396.     },
  397.     {
  398.       element: '.stock-minimo-tutorial',
  399.       popover: {
  400.         title: 'Stock Mínimo',
  401.         description: `
  402.           ● (Opcional) Para resaltar con rojo si el stock es inferior.
  403.         `,
  404.         side: "right",
  405.         align: 'start',
  406.       },
  407.     },
  408.     {
  409.       element: '.imagen-tutorial',
  410.       popover: {
  411.         title: 'Imagen',
  412.         description: `
  413.           ● (Opcional) Imagen del producto .
  414.         `,
  415.         side: "right",
  416.         align: 'start',
  417.       },
  418.     },
  419.   ];
  420. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement