Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hotwax/facilities
Browse files Browse the repository at this point in the history
  • Loading branch information
dt2patel committed Nov 30, 2023
2 parents 154e095 + 15f101d commit 8403374
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 74 deletions.
15 changes: 1 addition & 14 deletions src/components/AddStaffMemberModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@

<ion-content class="ion-padding">
<ion-searchbar v-model="queryString" @keyup.enter="queryString = $event.target.value; findParties()"/>
<ion-row>
<ion-chip v-for="party in selectedPartyValues" :key="party.partyId">
<ion-label>{{ party.fullName }}</ion-label>
<ion-icon :icon="closeCircle" @click="removeSelectedParty(party.partyId)" />
</ion-chip>
</ion-row>

<div class="ion-padding" v-if="!parties.length">
{{ translate("No party found") }}
Expand Down Expand Up @@ -47,7 +41,6 @@
import {
IonButton,
IonButtons,
IonChip,
IonContent,
IonFab,
IonFabButton,
Expand All @@ -57,7 +50,6 @@ import {
IonLabel,
IonList,
IonListHeader,
IonRow,
IonSearchbar,
IonSelect,
IonSelectOption,
Expand All @@ -80,7 +72,6 @@ export default defineComponent({
components: {
IonButton,
IonButtons,
IonChip,
IonContent,
IonFab,
IonFabButton,
Expand All @@ -90,7 +81,6 @@ export default defineComponent({
IonLabel,
IonList,
IonListHeader,
IonRow,
IonSearchbar,
IonSelect,
IonSelectOption,
Expand Down Expand Up @@ -153,7 +143,7 @@ export default defineComponent({
let parties = resp.data.docs
parties.map((party: any) => {
party.fullName = party.groupName ? party.groupName : `${party.firstName} ${party.lastName}`
party.fullName = party.groupName ? party.groupName : party.firstName ? `${party.firstName} ${party.lastName}` : ''
})
this.parties = parties
} else {
Expand All @@ -163,9 +153,6 @@ export default defineComponent({
logger.error(err)
}
},
removeSelectedParty(partyId: string) {
this.selectedPartyValues = this.selectedPartyValues.filter((party: any) => party.partyId !== partyId)
},
async saveParties() {
const partiesToAdd = this.selectedPartyValues.filter((selectedParty: any) => !this.selectedParties.some((party: any) => party.partyId === selectedParty.partyId && party.roleTypeId === selectedParty.roleTypeId))
const partiesToRemove = this.selectedParties.filter((party: any) => !this.selectedPartyValues.some((selectedParty: any) => party.partyId === selectedParty.partyId))
Expand Down
77 changes: 18 additions & 59 deletions src/views/FacilityDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,26 @@

<ion-card v-if="!facilityCalendar.calendarId">
<ion-card-header>
<div>
<ion-card-title>
{{ translate("Operating hours") }}
</ion-card-title>
<ion-card-subtitle>
{{ translate("Select a saved calendar of store hours or create a new calendar") }}
</ion-card-subtitle>
</div>
<ion-card-title>
{{ translate("Operating hours") }}
</ion-card-title>
</ion-card-header>
<ion-card-content>
{{ translate("Select a saved calendar of store hours or create a new calendar") }}
</ion-card-content>
<ion-radio-group v-model="selectedCalendarId">
<ion-item v-for="(calendar, index) in calendars.slice(0,3)" :key="index" lines="none">
<ion-label class="ion-text-wrap">{{ calendar.description }}</ion-label>
<ion-radio :value="calendar.calendarId"/>
<ion-radio slot="end" :value="calendar.calendarId"/>
</ion-item>
</ion-radio-group>
<ion-item button lines="none" v-if="calendars.length > 3" @click="addOperatingHours">
<ion-label> {{ calendars.length - 3 }} {{ translate("Others") }}</ion-label>
<ion-icon :icon="chevronForwardOutline" />
<ion-icon slot="end" :icon="chevronForwardOutline" />
</ion-item>
<ion-item button lines="none" @click="addCustomSchedule">
<ion-label>{{ translate("Custom schedule") }}</ion-label>
<ion-icon color="primary" :icon="addCircleOutline" button />
<ion-icon slot="end" color="primary" :icon="addCircleOutline" button />
</ion-item>
<ion-button fill="outline" expand="block" :disabled="!selectedCalendarId" @click="associateCalendarToFacility">
{{ translate("Add operating hours") }}
Expand All @@ -110,7 +108,7 @@
<ion-card v-else>
<ion-card-header>
<div>
<ion-text>{{ "Operating Hours" }}</ion-text>
<p class="overline">{{ translate("Operating hours") }}</p>
<ion-card-title>
{{ facilityCalendar.description }}
</ion-card-title>
Expand All @@ -120,47 +118,11 @@
</ion-button>
</ion-card-header>
<ion-list lines="none">
<ion-item>
<ion-label>
<p>{{ translate("Monday") }}</p>
</ion-label>
<ion-label slot="end">{{ facilityCalendar.mondayStartTime ? getOpenEndTime(facilityCalendar.mondayStartTime, facilityCalendar.mondayCapacity) : '-' }} </ion-label>
</ion-item>
<ion-item>
<ion-label>
<p>{{ translate("Tuesday") }}</p>
</ion-label>
<ion-label slot="end">{{ facilityCalendar.tuesdayStartTime ? getOpenEndTime(facilityCalendar.tuesdayStartTime, facilityCalendar.tuesdayCapacity) : '-' }}</ion-label>
</ion-item>
<ion-item>
<ion-item v-for="day in days" :key="day">
<ion-label>
<p>{{ translate("Wednesday") }}</p>
<p>{{ translate(day.charAt(0).toUpperCase() + day.slice(1)) }}</p>
</ion-label>
<ion-label slot="end">{{ facilityCalendar.wednesdayStartTime ? getOpenEndTime(facilityCalendar.wednesdayStartTime, facilityCalendar.wednesdayCapacity) : '-' }}</ion-label>
</ion-item>
<ion-item>
<ion-label>
<p>{{ translate("Thursday") }}</p>
</ion-label>
<ion-label slot="end">{{ facilityCalendar.thursdayStartTime ? getOpenEndTime(facilityCalendar.thursdayStartTime, facilityCalendar.thursdayCapacity) : '-' }}</ion-label>
</ion-item>
<ion-item>
<ion-label>
<p>{{ translate("Friday") }}</p>
</ion-label>
<ion-label slot="end">{{ facilityCalendar.fridayStartTime ? getOpenEndTime(facilityCalendar.fridayStartTime, facilityCalendar.fridayCapacity) : '-' }}</ion-label>
</ion-item>
<ion-item>
<ion-label>
<p>{{ translate("Saturday") }}</p>
</ion-label>
<ion-label slot="end">{{ facilityCalendar.saturdayStartTime ? getOpenEndTime(facilityCalendar.saturdayStartTime, facilityCalendar.saturdayCapacity) : '-' }}</ion-label>
</ion-item>
<ion-item>
<ion-label>
<p>{{ translate("Sunday") }}</p>
</ion-label>
<ion-label slot="end">{{ facilityCalendar.sundayStartTime ? getOpenEndTime(facilityCalendar.sundayStartTime, facilityCalendar.sundayCapacity) : '-' }}</ion-label>
<ion-label slot="end">{{ facilityCalendar[day+'StartTime'] ? getOpenEndTime(facilityCalendar[day+'StartTime'], facilityCalendar[day+'Capacity']) : '-' }} </ion-label>
</ion-item>
</ion-list>
</ion-card>
Expand All @@ -171,15 +133,13 @@
{{ translate("Product Stores") }}
</ion-card-title>
<ion-button @click="selectProductStores()" fill="clear">
<ion-icon :icon="addCircleOutline" slot="start" />
<ion-icon :icon="addCircleOutline" slot="end" />
{{ translate("Add") }}
</ion-button>
</ion-card-header>
<ion-item v-for="store in facilityProductStores" :key="store.productStoreId">
<ion-label>
<h2>{{ getProductStore(store.productStoreId)?.storeName }}</h2>
</ion-label>
<ion-badge v-if="store.productStoreId === primaryMember.facilityGroupId">{{ translate("primary store") }}</ion-badge>
<h2>{{ getProductStore(store.productStoreId)?.storeName }}</h2>
<ion-badge slot="end" v-if="store.productStoreId === primaryMember.facilityGroupId">{{ translate("primary store") }}</ion-badge>
<ion-button slot="end" fill="clear" color="medium" @click="productStorePopover($event, store)">
<ion-icon slot="icon-only" :icon="ellipsisVerticalOutline" />
</ion-button>
Expand Down Expand Up @@ -411,7 +371,6 @@ import {
IonCard,
IonCardContent,
IonCardHeader,
IonCardSubtitle,
IonCardTitle,
IonChip,
IonContent,
Expand Down Expand Up @@ -480,7 +439,6 @@ export default defineComponent({
IonCard,
IonCardContent,
IonCardHeader,
IonCardSubtitle,
IonCardTitle,
IonChip,
IonContent,
Expand Down Expand Up @@ -509,7 +467,8 @@ export default defineComponent({
primaryMember: {} as any,
isCalendarFound: true,
selectedCalendarId: '',
isRegenerationRequired: true
isRegenerationRequired: true,
days: ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
}
},
computed: {
Expand Down
8 changes: 7 additions & 1 deletion src/views/FacilityManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
<ion-icon slot="start" :icon="golfOutline"/>
<h1>{{ translate("Parking") }}</h1>
</ion-item>
<ion-card class="ion-hide" button @click="router.push('/find-parking')">
<ion-card-header>
<ion-icon :icon="golfOutline"/>
<ion-card-title>{{ translate("Parking") }}</ion-card-title>
</ion-card-header>
</ion-card>

<ion-card class="ion-hide" button @click="router.push('/find-groups')">
<ion-card-header>
<ion-card button @click="router.push('/find-groups')">
<ion-item>
<ion-icon :icon="albumsOutline"/>
Expand Down Expand Up @@ -107,7 +114,6 @@ main {
display: grid;
place-content: center;
grid-template-columns: 1fr 1fr;
height: calc(100vh - 56px);
}
ion-card-header {
Expand Down
2 changes: 2 additions & 0 deletions src/views/FindFacilities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@
</ion-chip>
<p>{{ translate('threshold consumed') }}</p>
</div>

<ion-chip outline v-else-if="facility.orderLimitType === 'unlimited'" @click.stop="changeOrderLimitPopover($event, facility)">
<ion-label>{{ translate("Unlimited orders") }}</ion-label>
<ion-icon :icon="lockOpenOutline"/>
</ion-chip>

<ion-chip outline v-else @click.stop="changeOrderLimitPopover($event, facility)">
<ion-label>{{ translate("No capacity") }}</ion-label>
<ion-icon :icon="lockClosedOutline"/>
Expand Down

0 comments on commit 8403374

Please sign in to comment.