-
Notifications
You must be signed in to change notification settings - Fork 6
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(my-history): add modal to confirm disable history queries #148
Merged
mnavarroespinosa
merged 11 commits into
main
from
feature/EX-6517-confirm-dialog-to-disable-history-queries
Jul 19, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d8201ba
feat: update X Components and add history queries switch
ajperezbau dda4a53
feat: add modal to confirm disabling the history queries
ajperezbau 91476af
fix: prevent the my history aside to close on confirm modal click
ajperezbau 4f7d6c3
feat: set mobile styles to modal
ajperezbau 28748fd
refactor: move modal events to script tag to avoid re-renderings
ajperezbau 26e22c7
refactor: move new texts to translations files
ajperezbau c94057e
feat: show history queries grey icon if the history queries are empty
ajperezbau b57fa06
fix: avoid X Modal closing when a modal overlay is clicked
ajperezbau 0856768
feat: add optimized icons for my history
ajperezbau e434019
build: update X Components
ajperezbau 6c6386e
fix: PR Fixes
ajperezbau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
81 changes: 81 additions & 0 deletions
81
src/components/my-history/my-history-confirm-disable-modal.vue
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,81 @@ | ||
<template> | ||
<BaseEventsModal | ||
@focusin.native.stop | ||
class="x-my-history-confirm-disable-modal x-layout__aside" | ||
:eventsToOpenModal="eventsToOpenModal" | ||
:eventsToCloseModal="eventsToCloseModal" | ||
> | ||
<div | ||
class=" | ||
x-my-history-confirm-disable-modal-content | ||
x-background--neutral-100 | ||
x-list x-list--gap-05 | ||
" | ||
:class=" | ||
$x.device === 'mobile' | ||
? 'x-padding--06 x-padding--bottom-03 x-border-radius--03' | ||
: 'x-padding--10' | ||
" | ||
> | ||
<h1 class="x-title3 x-text--bold">{{ $t('myHistory.confirmDisableModal.title') }}</h1> | ||
<span class="x-font-color--neutral-35"> | ||
{{ $t('myHistory.confirmDisableModal.message') }} | ||
</span> | ||
<div | ||
class="x-list x-list--horizontal" | ||
:class="$x.device === 'mobile' ? 'x-list--justify-end' : 'x-list--justify-center'" | ||
> | ||
<BaseEventButton | ||
class="x-button x-button--ghost x-font-color--neutral-35" | ||
:events="dismissEvents" | ||
> | ||
{{ $t('myHistory.confirmDisableModal.dismiss') }} | ||
</BaseEventButton> | ||
<BaseEventButton class="x-button x-button--ghost" :events="confirmEvents"> | ||
{{ $t('myHistory.confirmDisableModal.confirm') }} | ||
</BaseEventButton> | ||
</div> | ||
</div> | ||
</BaseEventsModal> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import { Component } from 'vue-property-decorator'; | ||
import { BaseEventsModal, BaseEventButton } from '@empathyco/x-components'; | ||
|
||
@Component({ | ||
components: { | ||
BaseEventsModal, | ||
BaseEventButton | ||
} | ||
}) | ||
export default class MyHistoryConfirmDisableModal extends Vue { | ||
protected eventsToOpenModal = ['UserClickedDisableHistoryQueries']; | ||
protected eventsToCloseModal = [ | ||
'UserClickedConfirmDisableHistoryQueries', | ||
'UserClickedDismissDisableHistoryQueries' | ||
]; | ||
protected dismissEvents = { UserClickedDismissDisableHistoryQueries: undefined }; | ||
protected confirmEvents = { UserClickedConfirmDisableHistoryQueries: undefined }; | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.x-my-history-confirm-disable-modal { | ||
--x-size-width-layout-aside: 100%; | ||
&-content { | ||
box-sizing: border-box; | ||
max-width: 332px; | ||
} | ||
.x-modal__content { | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
} | ||
.x-mobile { | ||
.x-my-history-confirm-disable-modal-content { | ||
max-width: 296px; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
With this change we can't close the
XModal
now, as theClose
button is emittingUserClickedCloseEventsModal
instead of the newly configuredUserClickedCloseX
event.Modify
desktop.vue
line 35:<Close closingEvent="UserClickedCloseX" class="x-button--ghost x-padding--right-00">
Modify
mobile.vue
line 16: