Skip to content

Commit

Permalink
Merge pull request #185 from k2maan/preorder/#182
Browse files Browse the repository at this point in the history
Implemented: button to copy audit message (#182)
  • Loading branch information
ravilodhi authored Aug 10, 2023
2 parents 08afec1 + 7a18d32 commit 87fe411
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"Configuration updated": "Configuration updated",
"Confirm": "Confirm",
"Copied": "{text} Copied",
"Copied to clipboard": "Copied to clipboard",
"Corresponding sales orders": "Corresponding sales orders",
"Custom": "Custom",
"Delisting at": "Delisting at {listingTime}",
Expand Down
20 changes: 19 additions & 1 deletion src/views/catalog-product-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
</ion-item>
<ion-item-divider color="light">
<ion-label color="medium">{{ $t("Timeline") }}</ion-label>
<ion-button v-if="poSummary.header || poSummary.body" color="medium" fill="clear" slot="end" @click="copyAuditMsg()">
<ion-icon slot="icon-only" :icon="copyOutline" />
</ion-button>
</ion-item-divider>
<!-- internationalized while preparaion -->
<ion-item v-if="poSummary.header || poSummary.body">
Expand Down Expand Up @@ -382,6 +385,7 @@

<script lang="ts">
import {
IonButton,
IonButtons,
IonBackButton,
IonCard,
Expand Down Expand Up @@ -409,6 +413,7 @@ import {
alertCircleOutline,
checkmarkCircleOutline,
chevronForwardOutline,
copyOutline,
shirtOutline
} from "ionicons/icons";
import { useStore } from "@/store";
Expand All @@ -425,11 +430,13 @@ import { JobService } from "@/services/JobService";
import { StockService } from "@/services/StockService";
import { UtilService } from "@/services/UtilService";
import { useRouter } from "vue-router";
import { Plugins } from "@capacitor/core";

export default defineComponent({
name: "catalog-product-details",
components: {
Image,
IonButton,
IonButtons,
IonBackButton,
IonCard,
Expand Down Expand Up @@ -1067,7 +1074,17 @@ export default defineComponent({
externalId = externalIdentificationSplit[2] ? externalIdentificationSplit[2] : '';
}
return externalId;
}
},
async copyAuditMsg() {
const { Clipboard } = Plugins;
const auditMsg = this.poSummary.header + '\n' + this.poSummary.body

await Clipboard.write({
string: auditMsg
}).then(() => {
showToast(this.$t("Copied to clipboard"));
})
},
},
setup() {
const store = useStore();
Expand All @@ -1076,6 +1093,7 @@ export default defineComponent({
alertCircleOutline,
checkmarkCircleOutline,
chevronForwardOutline,
copyOutline,
router,
shirtOutline,
store
Expand Down

0 comments on commit 87fe411

Please sign in to comment.