Skip to content

Commit

Permalink
Merge pull request #249 from Ritika-Patel08/#210
Browse files Browse the repository at this point in the history
Implemented: Spinner in Timezone Model for Timezone Configuration (#210)
  • Loading branch information
ymaheshwari1 authored Jan 10, 2024
2 parents 5b53a11 + f93a39a commit 7b4a40b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"Make sure you've reviewed the products and their counts before uploading them for review": "Make sure you've reviewed the products and their counts before uploading them for review",
"No results found": "No results found",
"No time zone found": "No time zone found",
"Fetching time zones": "Fetching time zones",
"Ok": "Ok",
"OMS": "OMS",
"OMS instance": "OMS instance",
Expand Down
15 changes: 12 additions & 3 deletions src/views/TimezoneModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@

<ion-content class="ion-padding">
<!-- Empty state -->
<div class="empty-state" v-if="filteredTimeZones.length === 0">
<p>{{ $t("No time zone found")}}</p>
<div class="empty-state" v-if="isLoading">
<ion-item lines="none">
<ion-spinner color="secondary" name="crescent" slot="start" />
{{ $t("Fetching time zones") }}
</ion-item>
</div>
<div class="empty-state" v-else-if="filteredTimeZones.length === 0">
<p>{{ $t("No time zone found") }}</p>
</div>

<!-- Timezones -->
Expand Down Expand Up @@ -86,7 +92,8 @@ export default defineComponent({
queryString: '',
filteredTimeZones: [],
timeZones: [],
timeZoneId: ''
timeZoneId: '',
isLoading: false
}
},
methods: {
Expand Down Expand Up @@ -123,6 +130,7 @@ export default defineComponent({
});
},
async getAvailableTimeZones() {
this.isLoading = true;
const resp = await UserService.getAvailableTimeZones()
if(resp.status === 200 && !hasError(resp)) {
// We are filtering valid the timeZones coming with response here
Expand All @@ -131,6 +139,7 @@ export default defineComponent({
});
this.findTimeZone();
}
this.isLoading = false;
},
async selectSearchBarText(event: any) {
const element = await event.target.getInputElement()
Expand Down

0 comments on commit 7b4a40b

Please sign in to comment.