Skip to content

Commit

Permalink
add ui validation
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen committed Aug 23, 2023
1 parent a0d5d72 commit ffe4af1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 8 additions & 1 deletion console/atest-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
})
}
const importSuiteFormRules = reactive<FormRules<Suite>>({
url: [
{ required: true, message: 'URL is required', trigger: 'blur' },
{ type: 'url', message: 'Should be a valid URL value', trigger: 'blur' }
],
store: [{ required: true, message: 'Location is required', trigger: 'blur' }]
})
const importSuiteFormSubmit = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate((valid: boolean, fields) => {
Expand Down Expand Up @@ -334,7 +341,7 @@ const viewName = ref('testcase')
<template #footer>
<span class="dialog-footer">
<el-form
:rules="rules"
:rules="importSuiteFormRules"
:model="importSuiteForm"
ref="importSuiteFormRef"
status-icon label-width="120px">
Expand Down
2 changes: 0 additions & 2 deletions pkg/generator/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ package generator

import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
Expand Down Expand Up @@ -149,7 +148,6 @@ func (p *postmanImporter) ConvertFromURL(dataURL string) (suite *testing.TestSui
if data, err = io.ReadAll(resp.Body); err == nil {
suite, err = p.Convert(data)
}
fmt.Println(suite)
}
return
}

0 comments on commit ffe4af1

Please sign in to comment.