Skip to content

Commit

Permalink
Improved: changed the variable name that checks the auto generation o…
Browse files Browse the repository at this point in the history
…f facilityId(hotwax#265)
  • Loading branch information
R-Sourabh committed Nov 20, 2024
1 parent 6352f8e commit 5206c2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/components/CreateVirtualFacilityModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ export default defineComponent({
facilityId: '',
description: '',
},
isVirtualFacIdManuallySet: false
isAutoGenerateId: true
}
},
methods: {
setFacilityId(event: any) {
if(!this.isVirtualFacIdManuallySet) {
if(this.isAutoGenerateId) {
this.formData.facilityId = generateInternalId(event.target.value)
}
},
Expand Down Expand Up @@ -160,7 +160,7 @@ export default defineComponent({
this.formData.facilityId.length <= 20
? (this as any).$refs.facilityId.$el.classList.add('ion-valid')
: (this as any).$refs.facilityId.$el.classList.add('ion-invalid');
this.isVirtualFacIdManuallySet = true;
this.isAutoGenerateId = false;
},
markFacilityIdTouched() {
(this as any).$refs.facilityId.$el.classList.add('ion-touched');
Expand Down
8 changes: 4 additions & 4 deletions src/views/CreateFacility.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default defineComponent({
},
selectedFacilityTypeId: '' as any,
facilityTypesByParentTypeId: {} as any,
isFacilityIdManuallySet: false,
isAutoGenerateId: true,
}
},
async ionViewWillEnter() {
Expand Down Expand Up @@ -139,10 +139,10 @@ export default defineComponent({
facilityId: '',
externalId: '',
}
this.isFacilityIdManuallySet = false;
this.isAutoGenerateId = true;
},
setFacilityId(event: any) {
if(!this.isFacilityIdManuallySet) {
if(this.isAutoGenerateId) {
this.formData.facilityId = generateInternalId(event.target.value)
}
},
Expand Down Expand Up @@ -218,7 +218,7 @@ export default defineComponent({
this.formData.facilityId.length <= 20
? (this as any).$refs.facilityId.$el.classList.add('ion-valid')
: (this as any).$refs.facilityId.$el.classList.add('ion-invalid');
this.isFacilityIdManuallySet = true;
this.isAutoGenerateId = false;
},
markFacilityIdTouched() {
(this as any).$refs.facilityId.$el.classList.add('ion-touched');
Expand Down
6 changes: 3 additions & 3 deletions src/views/CreateFacilityGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default defineComponent({
},
isFacilityGroupTypeDisabled: false,
selectedProductStoreIds: [],
isFacilityGroupIdManuallySet: false
isAutoGenerateId: true
}
},
props: ['selectedFacilityGroupTypeId'],
Expand All @@ -148,7 +148,7 @@ export default defineComponent({
this.selectedProductStoreIds = selectedProductStoreIds
},
setFacilityGroupId(event: any) {
if(!this.isFacilityGroupIdManuallySet) {
if(this.isAutoGenerateId) {
this.formData.facilityGroupId = generateInternalId(event.target.value)
}
},
Expand Down Expand Up @@ -239,7 +239,7 @@ export default defineComponent({
this.formData.facilityGroupId.length <= 20
? (this as any).$refs.facilityGroupId.$el.classList.add('ion-valid')
: (this as any).$refs.facilityGroupId.$el.classList.add('ion-invalid');
this.isFacilityGroupIdManuallySet = true
this.isAutoGenerateId = false
},
markFacilityGroupIdTouched() {
(this as any).$refs.facilityGroupId.$el.classList.add('ion-touched');
Expand Down

0 comments on commit 5206c2c

Please sign in to comment.