mirror of
https://github.com/crater-invoice/crater.git
synced 2026-02-10 21:02:41 -05:00
Merge branch 'fix-issue' into 'master'
fix app_url and quantity validation issue See merge request mohit.panjvani/crater-web!97
This commit is contained in:
@@ -87,5 +87,16 @@ export default {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
checkValidUrl (url) {
|
||||||
|
let pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
|
||||||
|
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
||||||
|
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
||||||
|
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
||||||
|
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
||||||
|
'(\\#[-a-z\\d_]*)?$', 'i') // fragment locator
|
||||||
|
|
||||||
|
return !!pattern.test(url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<base-input
|
<base-input
|
||||||
v-model="item.quantity"
|
v-model="item.quantity"
|
||||||
:invalid="$v.item.quantity.$error"
|
:invalid="$v.item.quantity.$error"
|
||||||
type="number"
|
type="text"
|
||||||
small
|
small
|
||||||
@keyup="updateItem"
|
@keyup="updateItem"
|
||||||
@input="$v.item.quantity.$touch()"
|
@input="$v.item.quantity.$touch()"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<base-input
|
<base-input
|
||||||
v-model="item.quantity"
|
v-model="item.quantity"
|
||||||
:invalid="$v.item.quantity.$error"
|
:invalid="$v.item.quantity.$error"
|
||||||
type="number"
|
type="text"
|
||||||
small
|
small
|
||||||
@keyup="updateItem"
|
@keyup="updateItem"
|
||||||
@input="$v.item.quantity.$touch()"
|
@input="$v.item.quantity.$touch()"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<span v-if="!$v.databaseData.app_url.required" class="text-danger">
|
<span v-if="!$v.databaseData.app_url.required" class="text-danger">
|
||||||
{{ $tc('validation.required') }}
|
{{ $tc('validation.required') }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="!$v.databaseData.app_url.url" class="text-danger">
|
<span v-if="!$v.databaseData.app_url.isUrl" class="text-danger">
|
||||||
{{ $tc('validation.invalid_url') }}
|
{{ $tc('validation.invalid_url') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -184,7 +184,9 @@ export default {
|
|||||||
},
|
},
|
||||||
app_url: {
|
app_url: {
|
||||||
required,
|
required,
|
||||||
url
|
isUrl (val) {
|
||||||
|
return this.$utils.checkValidUrl(val)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user