Skip to content

Commit

Permalink
Fixed: Reverted unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritika-Patel08 committed Jan 6, 2024
1 parent 3e6f569 commit aabd644
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/views/TimezoneModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ion-title>{{ $t("Select time zone") }}</ion-title>
</ion-toolbar>
<ion-toolbar>
<ion-searchbar @ionFocus="selectSearchBarText($event)" :placeholder="$t('Search time zones')" v-model="queryString"
@keyup.enter="queryString = $event.target.value; findTimeZone()" @keydown="preventSpecialCharacters($event)" />
<ion-searchbar @ionFocus="selectSearchBarText($event)" :placeholder="$t('Search time zones')" v-model="queryString" @keyup.enter="queryString = $event.target.value;
findTimeZone()" @keydown="preventSpecialCharacters($event)" />
</ion-toolbar>
</ion-header>

Expand All @@ -26,25 +26,21 @@
</ion-item>
</div>
</div>
<div v-if="!loading && filteredTimeZones.length === 0">
<div class="empty-state">
<div class="empty-state" v-if="!loading && filteredTimeZones.length === 0">
<p>{{ $t("No time zone found") }}</p>
</div>
</div>

<!-- Timezones -->
<div v-else>
<ion-list>
<ion-radio-group value="rd" v-model="timeZoneId">
<ion-item :key="timeZone.id" v-for="timeZone in filteredTimeZones">
<ion-radio justify="start" label-placement="end" :value="timeZone.id">{{ timeZone.label }} ({{ timeZone.id
}})</ion-radio>
<ion-radio justify="start" label-placement="end" :value="timeZone.id">{{ timeZone.label }} ({{ timeZone.id}})</ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
</div>


<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button :disabled="!timeZoneId" @click="saveAlert">
<ion-icon :icon="save" />
Expand All @@ -53,7 +49,6 @@
</ion-content>
</template>


<script lang="ts">
import {
IonButtons,
Expand All @@ -80,7 +75,6 @@
import { hasError } from '@/utils'
import { DateTime } from 'luxon';
export default defineComponent({
name: "TimeZoneModal",
components: {
Expand Down Expand Up @@ -133,7 +127,7 @@
},
preventSpecialCharacters($event: any) {
// Searching special characters fails the API, hence, they must be omitted
if (/[`!@#$%^&*()_+\-=\\|,.<>?~]/.test($event.key)) $event.preventDefault();
if(/[`!@#$%^&*()_+\-=\\|,.<>?~]/.test($event.key)) $event.preventDefault();
},
findTimeZone() {
const queryString = this.queryString.toLowerCase();
Expand All @@ -143,8 +137,6 @@
},
async getAvailableTimeZones() {
const resp = await UserService.getAvailableTimeZones()
console.log(resp);
if (resp.status === 200 && !hasError(resp)) {
// We are filtering valid the timeZones coming with response here
this.timeZones = resp.data.filter((timeZone: any) => {
Expand Down

0 comments on commit aabd644

Please sign in to comment.