Skip to content

Commit

Permalink
hotfix removed url validation
Browse files Browse the repository at this point in the history
  • Loading branch information
RalkeyOfficial committed Aug 7, 2024
1 parent 8826ee3 commit 8a57826
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/modals/directory/AddDirectoryModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ import { navigationStore, directoryStore } from '../../store/store.js'
</NcNoteCard>
</div>
<div v-if="success === null" class="form-group">
<NcNoteCard v-if="validateUrlError" type="error">
<p>Er is geen valide URL ingevoerd.</p>
</NcNoteCard>
<NcTextField v-model="directory.directory" label="Url" @input="validateUrl" />
<NcTextField v-model="directory.directory" label="Url" />
</div>
<NcButton
v-if="success === null"
:disabled="!isUrlValid || loading || !directory.directory"
:disabled="loading || !directory.directory"
type="primary"
@click="addDirectory">
<template #icon>
Expand Down Expand Up @@ -74,16 +71,8 @@ export default {
loading: false,
success: null,
error: false,
validateUrlError: null,
// eslint-disable-next-line no-useless-escape
urlPattern: /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,
}
},
computed: {
isUrlValid() {
return this.urlPattern.test(this.directory.directory)
},
},
methods: {
addDirectory() {
this.loading = true
Expand Down Expand Up @@ -120,14 +109,6 @@ export default {
closeModal() {
navigationStore.setModal(false)
},
validateUrl(event) {
this.directory.directory = event.target.value
if (!this.isUrlValid) {
this.validateUrlError = 'Er is geen valide URL ingevoerd.'
} else {
this.validateUrlError = null
}
},
openLink(url, type = '') {
window.open(url, type)
},
Expand Down

0 comments on commit 8a57826

Please sign in to comment.