app api fix

This commit is contained in:
2023-09-22 09:53:35 +02:00
parent d37fcda0db
commit a6c6a4feb0
5 changed files with 17 additions and 7 deletions

View File

@@ -14,6 +14,7 @@
<div v-else-if="contentType === 'text'" class="options">
<h3>{{ data.message }}</h3>
<input type="text" v-model="data.selected">
<p>{{ info }}</p>
<div class="button-wrapper">
<button @click="closePopup( 'ok' )" title="Save changes">Save</button>
<button @click="closePopup( 'cancel' )" title="Cancel changes">Cancel</button>
@@ -108,10 +109,19 @@
return {
contentType: 'dropdown',
data: {},
info: '',
}
},
methods: {
closePopup( message ) {
if ( this.data.options.disallowedCharacters ) {
for ( let letter in this.data.selected ) {
if ( this.data.options.disallowedCharacters.includes( this.data.selected[ letter ] ) ) {
this.info = `Illegal character "${ this.data.selected[ letter ] }"`;
return false;
}
}
}
$( '#popup-backdrop' ).fadeOut( 300 );
if ( message ) {
this.$emit( 'data', { 'data': this.data.selected, 'status': message } );

View File

@@ -158,7 +158,7 @@
},
addEvent () {
this.currentPopup = 'add';
this.$refs.popup.openPopup( 'Please give the new event a name for internal use', {}, 'text' );
this.$refs.popup.openPopup( 'Please give the new event a name for internal use', { 'disallowedCharacters': [ '_', '-' ] }, 'text' );
},
setActiveTicket ( id ) {
sessionStorage.setItem( 'selectedTicket', id );