Skip to main content

EtlImportModal.vue Usage Guide

This document provides a complete developer guide for integrating and using the EtlImportModal.vue component within a parent Vue component.

(English)

1. Component Overview

The EtlImportModal.vue is the primary frontend component for the ETL system. It orchestrates a complete, multi-stage user interface for importing files:
  1. Stage 1 (Upload & Buffering): The user uploads a file. The component shows real-time progress as the backend parses the file into a temporary “buffer”.
  2. Stage 2 (Preview & Configure): Once buffering is complete, the modal displays a preview of the imported data and allows the user to configure import options (e.g., the field to use for “upserting”).
  3. Stage 3 (Commit): After the user confirms, the component shows a final progress bar as the data is committed from the buffer to the production database collection.
The component is designed for programmatic control, meaning the parent component tells it when to show and hide.

2. Component API

Props
These are the properties you must pass to the component.
Public Methods
You can call these methods on the component instance using a ref.
Events
You can listen for these events emitted by the component.

3. Integration Example

Here is a complete example of how to use the EtlImportModal from a parent page (e.g., UsersPage.vue). Step 1: Import and Register the Component
Step 2: Add a Trigger Button and the Modal to Your Template
Step 3: Implement the Methods in Your Script


(Bahasa Indonesia)

1. Gambaran Umum Komponen

EtlImportModal.vue adalah komponen frontend utama untuk sistem ETL. Komponen ini mengatur antarmuka pengguna multi-tahap yang lengkap для mengimpor file:
  1. Tahap 1 (Upload & Buffering): Pengguna mengunggah file. Komponen menampilkan progres real-time saat backend mem-parsing file ke dalam “buffer” sementara.
  2. Tahap 2 (Preview & Konfigurasi): Setelah proses buffering selesai, modal menampilkan pratinjau data yang diimpor dan memungkinkan pengguna untuk mengkonfigurasi opsi impor (misalnya, field yang digunakan untuk “upsert”).
  3. Tahap 3 (Commit): Setelah pengguna mengkonfirmasi, komponen menampilkan progress bar terakhir saat data dipindahkan dari buffer ke koleksi database produksi.
Komponen ini dirancang untuk kontrol terprogram, artinya komponen induk yang akan memberitahunya kapan harus ditampilkan dan disembunyikan.

2. API Komponen

Props
Ini adalah properti yang harus Anda teruskan ke komponen.
Method Publik
Anda dapat memanggil method ini pada instance komponen menggunakan ref.
Event
Anda dapat mendengarkan event yang dipancarkan (emit) oleh komponen ini.

3. Contoh Integrasi

Berikut adalah contoh lengkap cara menggunakan EtlImportModal dari halaman induk (misalnya, UsersPage.vue). Langkah 1: Impor dan Daftarkan Komponen
Langkah 2: Tambahkan Tombol Pemicu dan Modal ke Template Anda
Langkah 3: Implementasikan Method di Script Anda