-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implemented: functionality to the Publish segment of the Inventory channels page (#356)
- Loading branch information
Showing
18 changed files
with
995 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-button @click="closeModal"> | ||
<ion-icon :icon="closeOutline" slot="icon-only" /> | ||
</ion-button> | ||
</ion-buttons> | ||
<ion-title>{{ translate("Custom frequency") }}</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<div v-if="customFrequencies.length"> | ||
<ion-list> | ||
<ion-radio-group v-model="frequencyId"> | ||
<ion-item :key="customFrequency.tempExprId" v-for="customFrequency in customFrequencies"> | ||
<ion-radio :value="customFrequency.tempExprId">{{ customFrequency.description }}</ion-radio> | ||
</ion-item> | ||
</ion-radio-group> | ||
</ion-list> | ||
</div> | ||
<div class="empty-state" v-else> | ||
<p>{{ translate("No frequency found.")}}</p> | ||
</div> | ||
</ion-content> | ||
|
||
<ion-fab vertical="bottom" horizontal="end" slot="fixed"> | ||
<ion-fab-button :disabled="!frequencyId" @click="setFrequency()"> | ||
<ion-icon :icon="saveOutline" /> | ||
</ion-fab-button> | ||
</ion-fab> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { IonButton, IonButtons, IonContent, IonFab, IonFabButton, IonHeader, IonIcon, IonItem, IonList, IonRadio, IonRadioGroup, IonTitle, IonToolbar, modalController } from "@ionic/vue"; | ||
import { onMounted, ref } from "vue"; | ||
import { closeOutline, saveOutline } from "ionicons/icons"; | ||
import { translate } from "@hotwax/dxp-components"; | ||
import { useStore } from "vuex"; | ||
const store = useStore(); | ||
const customFrequencies = ref([]) as any; | ||
const frequencyId = ref(""); | ||
onMounted(() => { | ||
findFrequencies(); | ||
}) | ||
function closeModal() { | ||
modalController.dismiss({ dismissed: true }); | ||
} | ||
async function findFrequencies() { | ||
customFrequencies.value = await store.dispatch("channel/findTemporalExpression"); | ||
} | ||
async function setFrequency() { | ||
modalController.dismiss({ dismissed: true, frequencyId: frequencyId.value }); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<template> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-button @click="closeModal"> | ||
<ion-icon slot="icon-only" :icon="closeOutline" /> | ||
</ion-button> | ||
</ion-buttons> | ||
<ion-title>{{ currentJob?.enumName }}</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<div v-if="jobHistory?.length"> | ||
<ion-list> | ||
<ion-item v-for="(job, index) in jobHistory" :key="index"> | ||
<ion-label> | ||
{{ job.runTime ? getTime(job.runTime) : "-" }} | ||
<p v-if="job.runTime">{{ getDate(job.runTime) }}</p> | ||
</ion-label> | ||
<ion-badge v-if="job.statusId" :color="job.statusId === 'SERVICE_FINISHED' ? 'success' : 'danger'">{{ getStatusDesc(job.statusId) }}</ion-badge> | ||
</ion-item> | ||
</ion-list> | ||
</div> | ||
|
||
<div v-else> | ||
<p class="ion-text-center">{{ translate("No available history for this job.")}}</p> | ||
</div> | ||
</ion-content> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { IonBadge, IonButton, IonButtons, IonContent, IonHeader, IonIcon, IonItem, IonLabel, IonList, IonTitle, IonToolbar, modalController } from '@ionic/vue'; | ||
import { translate } from '@hotwax/dxp-components'; | ||
import { closeOutline } from 'ionicons/icons'; | ||
import { computed, defineProps, onMounted, ref } from "vue"; | ||
import { DateTime } from 'luxon'; | ||
import { ChannelService } from '@/services/ChannelService'; | ||
import { useStore } from "vuex"; | ||
const store = useStore(); | ||
const props = defineProps(["currentJob"]); | ||
const jobHistory = ref([]) as any; | ||
const getStatusDesc = computed(() => store.getters["channel/getStatusDesc"]) | ||
onMounted(async () => { | ||
await store.dispatch("channel/getServiceStatusDesc"); | ||
fetchJobHistory(); | ||
}) | ||
function closeModal() { | ||
modalController.dismiss({ dismissed: true }); | ||
} | ||
function getDate(runTime: any) { | ||
return DateTime.fromMillis(runTime).toLocaleString(DateTime.DATE_MED); | ||
} | ||
function getTime(runTime: any) { | ||
return DateTime.fromMillis(runTime).toLocaleString(DateTime.TIME_SIMPLE); | ||
} | ||
async function fetchJobHistory() { | ||
jobHistory.value = await ChannelService.fetchJobInformation({ | ||
"inputFields": { | ||
"productStoreId": props.currentJob.productStoreId, | ||
"statusId": ["SERVICE_CANCELLED", "SERVICE_CRASHED", "SERVICE_FAILED", "SERVICE_FINISHED"], | ||
"statusId_op": "in", | ||
"systemJobEnumId": props.currentJob.systemJobEnumId, | ||
"shopId_fld0_value": props.currentJob.shopId, | ||
"shopId_fld0_grp": "1", | ||
"shopId_fld0_op": "equals", | ||
"shopId_fld1_grp": "2", | ||
"shopId_fld1_op": "empty" | ||
}, | ||
"fieldList": ["runTime", "statusId"], | ||
"noConditionFind": "Y", | ||
"viewSize": process.env.VUE_APP_VIEW_SIZE, | ||
"orderBy": "runTime DESC" | ||
}) | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.