Skip to content

Commit

Permalink
refactor(Proof add): rename ProofDateCurrencyInputRow to ProofMetadat…
Browse files Browse the repository at this point in the history
…aInputRow
  • Loading branch information
raphodn committed Oct 21, 2024
1 parent e92516a commit 31a5771
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/ProofEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<v-card-text>
<ProofTypeInputRow :proofTypeForm="updateProofForm" />
<ProofDateCurrencyInputRow :proofDateCurrencyForm="updateProofForm" />
<ProofMetadataInputRow :proofMetadataForm="updateProofForm" />
</v-card-text>

<v-divider />
Expand Down Expand Up @@ -43,7 +43,7 @@ export default {
components: {
ProofCard: defineAsyncComponent(() => import('../components/ProofCard.vue')),
ProofTypeInputRow: defineAsyncComponent(() => import('../components/ProofTypeInputRow.vue')),
ProofDateCurrencyInputRow: defineAsyncComponent(() => import('../components/ProofDateCurrencyInputRow.vue')),
ProofMetadataInputRow: defineAsyncComponent(() => import('../components/ProofMetadataInputRow.vue')),
},
props: {
proof: {
Expand Down
8 changes: 4 additions & 4 deletions src/components/ProofInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ProofTypeInputRow :proofTypeForm="proofForm" />
<ProofImageInputRow :proofImageForm="proofForm" :hideRecentProofChoice="hideRecentProofChoice" @proof="proofImage = $event" />
<LocationInputRow :locationForm="proofForm" @location="locationObject = $event" />
<ProofDateCurrencyInputRow :proofDateCurrencyForm="proofForm" />
<ProofMetadataInputRow :proofMetadataForm="proofForm" />
<v-row>
<v-col>
<v-btn color="success" :loading="loading" :disabled="!proofFormFilled || loading" @click="uploadProof">
Expand Down Expand Up @@ -62,7 +62,7 @@ export default {
components: {
ProofTypeInputRow: defineAsyncComponent(() => import('../components/ProofTypeInputRow.vue')),
ProofImageInputRow: defineAsyncComponent(() => import('../components/ProofImageInputRow.vue')),
ProofDateCurrencyInputRow: defineAsyncComponent(() => import('../components/ProofDateCurrencyInputRow.vue')),
ProofMetadataInputRow: defineAsyncComponent(() => import('../components/ProofMetadataInputRow.vue')),
ProofCard: defineAsyncComponent(() => import('../components/ProofCard.vue')),
LocationInputRow: defineAsyncComponent(() => import('../components/LocationInputRow.vue')),
},
Expand Down Expand Up @@ -95,12 +95,12 @@ export default {
proofImageFormFilled() {
return !!this.proofImage
},
proofDateCurrencyFormFilled() {
proofMetadataFormFilled() {
let keys = ['date', 'currency']
return Object.keys(this.proofForm).filter(k => keys.includes(k)).every(k => !!this.proofForm[k])
},
proofFormFilled() {
return this.proofTypeFormFilled && this.proofImageFormFilled && this.proofDateCurrencyFormFilled
return this.proofTypeFormFilled && this.proofImageFormFilled && this.proofMetadataFormFilled
},
},
watch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ $t('Common.Date') }}
</h3>
<v-text-field
v-model="proofDateCurrencyForm.date"
v-model="proofMetadataForm.date"
:label="$t('Common.Date')"
type="date"
:max="currentDate"
Expand All @@ -23,7 +23,7 @@
</span>
</h3>
<v-select
v-model="proofDateCurrencyForm.currency"
v-model="proofMetadataForm.currency"
:label="$t('Common.Currency')"
:items="userFavoriteCurrencies"
hide-details="auto"
Expand All @@ -39,7 +39,7 @@ import utils from '../utils.js'
export default {
props: {
proofDateCurrencyForm: {
proofMetadataForm: {
type: Object,
default: () => ({ date: this.currentDate, currency: null })
},
Expand All @@ -51,9 +51,9 @@ export default {
},
computed: {
...mapStores(useAppStore),
proofDateCurrencyFormFilled() {
proofMetadataFormFilled() {
let keys = ['date', 'currency']
return Object.keys(this.proofDateCurrencyForm).filter(k => keys.includes(k)).every(k => !!this.proofDateCurrencyForm[k])
return Object.keys(this.proofMetadataForm).filter(k => keys.includes(k)).every(k => !!this.proofMetadataForm[k])
},
userFavoriteCurrencies() {
return this.appStore.getUserFavoriteCurrencies
Expand Down

0 comments on commit 31a5771

Please sign in to comment.