Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: centralised searchbar component through DXP #238

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/views/catalog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<div class="header">
<div class="filters ion-padding-top">
<ion-toolbar>
<ion-searchbar :placeholder="$t('Search products')" v-model="queryString" @keyup.enter="queryString = $event.target.value; getCatalogProducts()" />
<Searchbar
:placeholder="$t('Search products')"
@updateQueryString="queryString = $event"
@onSearch="getCatalogProducts()"
/>
<ion-item lines="none">
<ion-chip :outline="prodCatalogCategoryTypeId !== filter.value" v-for="filter in filters" :key="filter.value" @click="applyFilter(filter.value)">
<!-- Used v-show as v-if caused the ion-chip click animation to render weirdly -->
Expand Down Expand Up @@ -101,7 +105,6 @@ import {
IonLabel,
IonMenuButton,
IonPage,
IonSearchbar,
IonThumbnail,
IonTitle,
IonToolbar,
Expand Down Expand Up @@ -132,10 +135,9 @@ export default defineComponent({
IonLabel,
IonMenuButton,
IonPage,
IonSearchbar,
IonThumbnail,
IonTitle,
IonToolbar,
IonToolbar
},
data() {
return {
Expand Down
9 changes: 6 additions & 3 deletions src/views/orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
<ion-content>
<div class="header">
<div class="search">
<ion-searchbar @ionFocus="selectSearchBarText($event)" @ionClear="query.queryString = ''; updateQuery()" :value="query.queryString" v-on:keyup.enter="query.queryString = $event.target.value; updateQuery()"> </ion-searchbar>
<Searchbar
@updateQueryString="query.queryString = $event"
@onSearch="updateQuery()"
@onFocus="selectSearchBarText($event)"
@onClear="query.queryString = ''; updateQuery()"
/>
</div>

<div class="filters">
Expand Down Expand Up @@ -191,7 +196,6 @@ import {
IonPage,
IonSelect,
IonSelectOption,
IonSearchbar,
IonThumbnail,
IonTitle,
IonToggle,
Expand Down Expand Up @@ -248,7 +252,6 @@ export default defineComponent({
IonPage,
IonSelect,
IonSelectOption,
IonSearchbar,
IonThumbnail,
IonTitle,
IonToggle,
Expand Down
9 changes: 6 additions & 3 deletions src/views/products.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
</ion-header>

<ion-content>
<ion-searchbar @ionFocus="selectSearchBarText($event)" :placeholder="$t('Search products')" v-model="queryString" v-on:keyup.enter="getProducts()"></ion-searchbar>
<Searchbar
:placeholder="$t('Search products')"
@updateQueryString="queryString = $event"
@onSearch="getProducts()"
@onFocus="selectSearchBarText($event)"
/>

<!-- Empty state -->
<div class="empty-state" v-if="products.length === 0">
Expand Down Expand Up @@ -62,7 +67,6 @@ import {
IonPage,
IonThumbnail,
IonTitle,
IonSearchbar,
IonToolbar,
modalController,
} from "@ionic/vue";
Expand Down Expand Up @@ -91,7 +95,6 @@ export default defineComponent({
IonPage,
IonThumbnail,
IonTitle,
IonSearchbar,
IonToolbar,
ShopifyImg
},
Expand Down
9 changes: 6 additions & 3 deletions src/views/warehouse-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
<ion-title>{{ $t("Release preorder to a warehouse") }}</ion-title>
</ion-toolbar>
<ion-toolbar>
<ion-searchbar @ionFocus="selectSearchBarText($event)" :placeholder="$t('Search warehouses')" v-model="queryString" v-on:keyup.enter="findFacility()"></ion-searchbar>
<Searchbar
:placeholder="$t('Search warehouses')"
@updateQueryString="queryString = $event"
@onSearch="findFacility()"
@onFocus="selectSearchBarText($event)"
/>
</ion-toolbar>
</ion-header>

Expand Down Expand Up @@ -53,7 +58,6 @@ import {
IonRadioGroup,
IonRadio,
IonList,
IonSearchbar,
IonTitle,
IonToolbar,
modalController,
Expand Down Expand Up @@ -231,7 +235,6 @@ export default defineComponent({
IonList,
IonRadioGroup,
IonRadio,
IonSearchbar,
IonTitle,
IonToolbar
},
Expand Down
27 changes: 18 additions & 9 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
const path = require('path')
require("@hotwax/app-version-info")
module.exports = {
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: true
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: true
}
},
configureWebpack: {
resolve: {
alias: {
vue: path.resolve('./node_modules/vue')
}
},
runtimeCompiler: true
}
}
},
runtimeCompiler: true,
transpileDependencies: ['@hotwax/dxp-components']
}
Loading