-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
347 additions
and
86 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
- develop | ||
- hotfix/* | ||
- release/* | ||
- feature/v* | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
|
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
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,79 @@ | ||
<template> | ||
<div> | ||
<app-input | ||
v-model="local.search" | ||
class="span-2" | ||
type="search" | ||
:label="$t('common.search').toString()" | ||
allow-clear | ||
@input="debouncedSearch" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<i18n lang="json"> | ||
{ | ||
"pl": { | ||
"hasRelationships": "Czy posiada relacje", | ||
"mediaType": "Typ mediów" | ||
}, | ||
"en": { | ||
"hasRelationships": "Has relationships", | ||
"mediaType": "Media type" | ||
} | ||
} | ||
</i18n> | ||
|
||
<script lang="ts"> | ||
/* eslint-disable camelcase */ | ||
import { defineComponent, PropType } from 'vue' | ||
import debounce from 'lodash/debounce' | ||
export type PagesFiltersType = { | ||
search: string | ||
} | ||
export const EMPTY_MEDIA_FILTERS: PagesFiltersType = { | ||
search: '', | ||
} | ||
export default defineComponent({ | ||
props: { | ||
filters: { | ||
type: Object as PropType<PagesFiltersType>, | ||
default: () => ({ ...EMPTY_MEDIA_FILTERS }), | ||
}, | ||
}, | ||
data: () => ({ | ||
local: { | ||
...EMPTY_MEDIA_FILTERS, | ||
}, | ||
}), | ||
watch: { | ||
filters(filters: PagesFiltersType) { | ||
this.local = { ...this.local, ...filters } | ||
}, | ||
}, | ||
mounted() { | ||
this.local = { ...this.local, ...this.filters } | ||
}, | ||
methods: { | ||
makeSearch() { | ||
this.$emit('search', { | ||
...this.filters, | ||
...this.local, | ||
}) | ||
}, | ||
debouncedSearch: debounce(function (this: any) { | ||
this.$nextTick(() => { | ||
this.makeSearch() | ||
}) | ||
}, 300), | ||
}, | ||
}) | ||
</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,52 @@ | ||
<template> | ||
<icon-button class="coupon-generate-btn" :disabled="disabled" @click="generateCoupon"> | ||
<template #icon> | ||
<i class="bx bx-barcode"></i> | ||
</template> | ||
{{ $t('generateText') }} | ||
</icon-button> | ||
</template> | ||
|
||
<i18n lang="json"> | ||
{ | ||
"en": { | ||
"generateText": "Generate code" | ||
}, | ||
"pl": { | ||
"generateText": "Generuj kod" | ||
} | ||
} | ||
</i18n> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
export default defineComponent({ | ||
props: { | ||
disabled: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
emits: ['generate'], | ||
methods: { | ||
generateCoupon() { | ||
const CODE_LENGTH = 10 | ||
const code = Array.from({ length: CODE_LENGTH }, () => Math.random().toString(36)[2]) | ||
.join('') | ||
.toUpperCase() | ||
this.$emit('generate', code) | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.coupon-generate-btn { | ||
flex-shrink: 0; | ||
align-self: center; | ||
width: 140px; | ||
} | ||
</style> |
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.