semantic cleanup
This commit is contained in:
@@ -33,6 +33,11 @@
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
// [DEF:onMount:Function]
|
||||
/**
|
||||
* @purpose Load branches when component is mounted.
|
||||
* @pre Component is initialized.
|
||||
* @post loadBranches is called.
|
||||
*/
|
||||
onMount(async () => {
|
||||
await loadBranches();
|
||||
});
|
||||
@@ -41,6 +46,7 @@
|
||||
// [DEF:loadBranches:Function]
|
||||
/**
|
||||
* @purpose Загружает список веток для дашборда.
|
||||
* @pre dashboardId is provided.
|
||||
* @post branches обновлен.
|
||||
*/
|
||||
async function loadBranches() {
|
||||
@@ -59,6 +65,11 @@
|
||||
// [/DEF:loadBranches:Function]
|
||||
|
||||
// [DEF:handleSelect:Function]
|
||||
/**
|
||||
* @purpose Handles branch selection from dropdown.
|
||||
* @pre event contains branch name.
|
||||
* @post handleCheckout is called with selected branch.
|
||||
*/
|
||||
function handleSelect(event) {
|
||||
handleCheckout(event.target.value);
|
||||
}
|
||||
@@ -88,7 +99,8 @@
|
||||
// [DEF:handleCreate:Function]
|
||||
/**
|
||||
* @purpose Создает новую ветку.
|
||||
* @post Новая ветка создана и загружена.
|
||||
* @pre newBranchName is not empty.
|
||||
* @post Новая ветка создана и загружена; showCreate reset.
|
||||
*/
|
||||
async function handleCreate() {
|
||||
if (!newBranchName) return;
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
// [DEF:onMount:Function]
|
||||
/**
|
||||
* @purpose Load history when component is mounted.
|
||||
* @pre Component is initialized with dashboardId.
|
||||
* @post loadHistory is called.
|
||||
*/
|
||||
onMount(async () => {
|
||||
await loadHistory();
|
||||
@@ -36,6 +38,7 @@
|
||||
// [DEF:loadHistory:Function]
|
||||
/**
|
||||
* @purpose Fetch commit history from the backend.
|
||||
* @pre dashboardId is valid.
|
||||
* @post history state is updated.
|
||||
*/
|
||||
async function loadHistory() {
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
// [DEF:loadStatus:Watcher]
|
||||
$: if (show) loadEnvironments();
|
||||
// [/DEF:loadStatus:Watcher]
|
||||
|
||||
// [DEF:loadEnvironments:Function]
|
||||
/**
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
// [DEF:checkStatus:Function]
|
||||
/**
|
||||
* @purpose Проверяет, инициализирован ли репозиторий для данного дашборда.
|
||||
* @pre Component is mounted and has dashboardId.
|
||||
* @post initialized state is set; configs loaded if not initialized.
|
||||
*/
|
||||
async function checkStatus() {
|
||||
checkingStatus = true;
|
||||
@@ -72,6 +74,8 @@
|
||||
// [DEF:handleInit:Function]
|
||||
/**
|
||||
* @purpose Инициализирует репозиторий для дашборда.
|
||||
* @pre selectedConfigId and remoteUrl are provided.
|
||||
* @post Repository is created on backend; initialized set to true.
|
||||
*/
|
||||
async function handleInit() {
|
||||
if (!selectedConfigId || !remoteUrl) {
|
||||
@@ -94,6 +98,8 @@
|
||||
// [DEF:handleSync:Function]
|
||||
/**
|
||||
* @purpose Синхронизирует состояние Superset с локальным Git-репозиторием.
|
||||
* @pre Repository is initialized.
|
||||
* @post Dashboard YAMLs are exported to Git and staged.
|
||||
*/
|
||||
async function handleSync() {
|
||||
loading = true;
|
||||
@@ -111,6 +117,11 @@
|
||||
// [/DEF:handleSync:Function]
|
||||
|
||||
// [DEF:handlePush:Function]
|
||||
/**
|
||||
* @purpose Pushes local commits to the remote repository.
|
||||
* @pre Repository is initialized and has commits.
|
||||
* @post Changes are pushed to origin.
|
||||
*/
|
||||
async function handlePush() {
|
||||
loading = true;
|
||||
try {
|
||||
@@ -125,6 +136,11 @@
|
||||
// [/DEF:handlePush:Function]
|
||||
|
||||
// [DEF:handlePull:Function]
|
||||
/**
|
||||
* @purpose Pulls changes from the remote repository.
|
||||
* @pre Repository is initialized.
|
||||
* @post Local branch is updated with remote changes.
|
||||
*/
|
||||
async function handlePull() {
|
||||
loading = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user