-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat(price create form): allow user to select a recent proof #376
Conversation
@dq18 a number of things, more or less necessary, come to mind:
|
<v-card-text> | ||
<v-row> | ||
<v-col cols="6" sm="6" md="3" v-for="proof in userProofList" :key="proof"> | ||
<ProofCard :proof="proof" :showProofFooter="false" :isSelectable="true" :isSelected="selectedProof === proof" @proofSelected="selectProof"></ProofCard> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was thinking of doing a horizontal version of the ProofCard, but can be done after this PR & #375
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but like toelemon mentions, maybe showing part or all of the footer is useful here, to have context on each proof
Looks great ! Could almost be deployed right now :)
|
Awesome feedback guys, I will get started to make the next version.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm validitating because I want this badly ;-) @raphodn you can merge if that's ok technically.
We'll iterate on this one, until it becomes truly addictive.
</script> | ||
|
||
<style scoped> | ||
.d-flex { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this style ? d-flex
should work out of the box : https://vuetifyjs.com/en/styles/display/#display
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
</v-row> | ||
</v-card-text> | ||
</v-card> | ||
<v-bottom-sheet v-model="showConfirmationPopup"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently the confirmation popups (delete a price, delete a proof) are v-dialog
. I would have kept this instead of creating a new behavior with the v-bottom-sheet
+ complexifying the ProofCard
when selected 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was to be able to see the whole proof before validating. With a v-dialog
, one can't see the proof before validating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-dialog has a fullscreen option : https://vuetifyjs.com/en/api/v-dialog/#props-fullscreen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But honestly for a v1 I wouldn't even have a confirmation dialog (it's friction, so first and foremost for deletion, not addition..)
- worst case is that the user goes back to the "select a proof"
- the user can zoom with 2 fingers
- 1 row of proofs on small screens
<v-divider></v-divider> | ||
<v-card-text> | ||
<v-row> | ||
<v-col cols="6" sm="6" md="3" v-for="proof in userProofList" :key="proof"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<v-col cols="6" sm="6" md="3" v-for="proof in userProofList" :key="proof"> | |
<v-col cols="12" sm="6" md="3" v-for="proof in userProofList" :key="proof"> |
On small screens I think we should just show the list in 1 column. Also avoids having the zoomed image when selected, not really needed as the user can zoom already with 2 fingers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright
src/components/ProofFooter.vue
Outdated
@@ -13,9 +13,9 @@ | |||
</span> | |||
|
|||
</v-chip> | |||
<PriceCountChip :count="proof.price_count" :withLabel="true"></PriceCountChip> | |||
<PriceCountChip v-if="!reducedProofFooter" :count="proof.price_count" :withLabel="true"></PriceCountChip> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- why hide the price count ? seems a useful info to display
- and I'd rename
reducedProofFooter
tohideProofDelete
(mecanism similar to other components)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first v-chip
for proof type is also hidden, so it would be named hideProofTypeDelete
, but I suppose we should decide first what chip to keep before naming this boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why hide the proof type then ? 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking a lot of space, and info not needed to in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree, I wouldn't want to select a GDPR proof here. or I would like to discriminate on a specific type.
But in any case this is not important, you can keep it as is, it was just to simplify the logic
src/views/AddPriceSingle.vue
Outdated
<i>{{ $t('AddPriceSingle.PriceDetails.ProofUploaded') }}</i> | ||
</p> | ||
<p v-if="!proofFormFilled && !createProofLoading" class="text-red mt-2 mb-2"> | ||
<i>{{ $t('AddPriceSingle.PriceDetails.UploadProof') }}</i> | ||
</p> | ||
<p v-if="proofFormFilled && proofSelectedMessage" class="text-green mt-2 mb-2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather move this in the first <p>
and add a v-if inside (avoids having 3 <p>
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is already a v-if in the first <p>
element, I don't think that would simplify. What I could do is group the 3 <p>
together with a computed method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, though I still think one
and a computed method is better :) But that can come in the future
src/components/ProofCard.vue
Outdated
@@ -32,3 +50,20 @@ export default { | |||
} | |||
} | |||
</script> | |||
|
|||
<style scoped> | |||
.highlighted { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with the current implementation of showing the card in fullscreen when selected. However if I remove that implementation, do we want to highlight or just show the confirmation dialog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neither ? proof simply selected on click
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. I commited the changes
merged ! made some last small changes :
|
What
Allow user to select an existing proof when adding a price.
This is a WIP and only implemented for addSinglePrice. Please add your feedback to this PR on design and code and I will change / implement further.
How
A new button allows to open a dialog with the last (max 10) proofs.
![image](https://private-user-images.githubusercontent.com/21193194/307538836-b2965b49-84c5-43c4-ab85-71897ebf41a8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzODY2NTUsIm5iZiI6MTcyMDM4NjM1NSwicGF0aCI6Ii8yMTE5MzE5NC8zMDc1Mzg4MzYtYjI5NjViNDktODRjNS00M2M0LWFiODUtNzE4OTdlYmY0MWE4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDIxMDU1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2YzllMjFiZDRhZThjNzFjNTRlMzZjOWYwNTU0MWE5YzAzMjUyMWE0NDc2NThhZDllNTVkN2RmMjJhMjMyOGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.LlxlfUyP629bwzEAsZLLKjjtc37OxDdYBZvHJbTFtdo)
![image](https://private-user-images.githubusercontent.com/21193194/307538966-e3650951-71fa-4b8d-86dc-05482c508fb2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnV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SV-An1nOTSmdL0mjE0GZqW14AiJFklprKL9TMbY)
They will be displayed in a 5x2 grid.
Selecting one will highlight it and show a confirmation dialog
If "No" is selected, user goes back to choosing the proof.
If "Yes", it closes both dialogs and displays the selected proof as is done for "Camera" or "Gallery" modes
PR simplified, no more confirmation dialog, works for both single & multiple price forms, rename "existing" to "recent"