Skip to content

Commit

Permalink
Merge pull request #97 from ymaheshwari1/#31a00jh
Browse files Browse the repository at this point in the history
Improved code to open external links in new tab and update sample date format on clicking save button(#31a00jh)
  • Loading branch information
adityasharma7 authored Nov 21, 2022
2 parents 4243a5d + 5f85927 commit 1139d02
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@

<ion-card-content>
{{ $t('Enter a custom date time format that you want to use when uploading documents to HotWax Commerce.') }}
<p>{{ $t('Luxon date time formats can be found') }} <a href="https://moment.github.io/luxon/#/formatting?id=presets">{{ $t("here") }}</a></p>
<p>{{ $t('Luxon date time formats can be found') }} <a target="_blank" rel="noopener noreferrer" href="https://moment.github.io/luxon/#/formatting?id=presets">{{ $t("here") }}</a></p>
</ion-card-content>
<ion-item>
<ion-input clear-input='true' @keyup.enter="dateTimeFormat = $event.target.value; parse()" v-model="dateTimeFormat" :value="dateTimeFormat" />
<ion-input clear-input='true' @keyup.enter="dateTimeFormat = $event.target.value; parse()" v-model="dateTimeFormat" :value="dateTimeFormat" :placeholder="defaultDateTimeFormat" />
</ion-item>
<ion-item>
<ion-label>{{ sampleDateTime }}</ion-label>
Expand Down Expand Up @@ -140,7 +140,8 @@ export default defineComponent({
return {
baseURL: process.env.VUE_APP_BASE_URL,
sampleDateTime: '',
dateTimeFormat: ''
dateTimeFormat: '',
defaultDateTimeFormat: process.env.VUE_APP_DATE_FORMAT ? process.env.VUE_APP_DATE_FORMAT : 'MM/dd/yyyy'
};
},
computed: {
Expand All @@ -156,10 +157,12 @@ export default defineComponent({
},
methods: {
goToOms(){
window.location.href = this.instanceUrl.startsWith('http') ? this.instanceUrl.replace('api/', "") : `https://${this.instanceUrl}.hotwax.io/`;
window.open(this.instanceUrl.startsWith('http') ? this.instanceUrl.replace('api/', "") : `https://${this.instanceUrl}.hotwax.io/`, '_blank', 'noopener, noreferrer');
},
updateDateTimeFormat(){
this.dateTimeFormat = this.dateTimeFormat ? this.dateTimeFormat : this.defaultDateTimeFormat
this.store.dispatch('user/setDateTimeFormat', this.dateTimeFormat);
this.parse();
},
async changeTimeZone() {
const timeZoneModal = await modalController.create({
Expand Down

0 comments on commit 1139d02

Please sign in to comment.