Skip to content

Commit

Permalink
Implemented: support to update auto cancel days(#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Jan 18, 2024
1 parent 7865bd7 commit 9634720
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
</ion-item>
<ion-item lines="none">
<ion-label>{{ "Auto cancel days" }}</ion-label>
<ion-chip outline>{{ ruleActions[actionEnums['AUTO_CANCEL_DAYS'].id]?.actionValue }}{{ ' days' }}</ion-chip>
<ion-chip outline @click="updateAutoCancelDays(ruleActions[actionEnums['AUTO_CANCEL_DAYS'].id]?.actionValue)">{{ ruleActions[actionEnums['AUTO_CANCEL_DAYS'].id]?.actionValue }}{{ ' days' }}</ion-chip>
</ion-item>
</ion-card>
</div>
Expand All @@ -198,6 +198,7 @@ import { computed, defineProps } from "vue";
import store from "@/store";
import AddInventoryFilterOptionsModal from "@/components/AddInventoryFilterOptionsModal.vue";
import AddInventorySortOptionsModal from "@/components/AddInventorySortOptionsModal.vue";
import { showToast } from "@/utils";
const router = useRouter();
const props = defineProps({
Expand Down Expand Up @@ -270,6 +271,42 @@ function getRuleActionType() {
return actionTypes.includes(actionId)
})
}
async function updateAutoCancelDays(cancelDays: any) {
const alert = await alertController.create({
header: "Auto Cancel Days",
inputs: [{
name: "autoCancelDays",
placeholder: "auto cancel days",
type: "number",
min: 0,
value: cancelDays
}],
buttons: [{
text: "Cancel",
role: "cancel"
},
{
text: "Apply",
handler: (data) => {
let setLimit = this.setLimit as any;

Check warning on line 292 in src/views/BrokeringQuery.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'setLimit' is assigned a value but never used

Check warning on line 292 in src/views/BrokeringQuery.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'setLimit' is assigned a value but never used
if(data) {
if(data.cancelDays === '') {
showToast("Please provide a value")
return false;
} else if(data.cancelDays < 0) {
showToast("Provide a value greater than or equal to 0")
return false;
} else {
cancelDays = data.cancelDays
}
}
}
}]
})
await alert.present()
}
</script>

<style scoped>
Expand Down

0 comments on commit 9634720

Please sign in to comment.