-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cancel button to unsaved changes dialog (#11644)
* Add cancel button to unsaved changes dialog * Add changelog item
- Loading branch information
1 parent
7607848
commit 9affb8f
Showing
5 changed files
with
75 additions
and
13 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
changelog/unreleased/enhancement-add-cancel-button-to-unsaved-changes-dialog
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,6 @@ | ||
Enhancement: Add cancel button to unsaved changes dialog | ||
|
||
We've added a cancel button to the unsaved changes dialog to allow users to cancel the action. | ||
|
||
https://github.com/owncloud/web/pull/11644 | ||
https://github.com/owncloud/web/issues/11636 |
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
57 changes: 57 additions & 0 deletions
57
packages/web-pkg/src/components/Modals/UnsavedChangesModal.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,57 @@ | ||
<template> | ||
<span | ||
class="oc-display-inline-block oc-mb-m" | ||
v-text="$gettext('Your changes were not saved. Do you want to save them?')" | ||
/> | ||
<div class="oc-my-m"></div> | ||
<div class="oc-flex oc-flex-right oc-flex-middle oc-mt-m"> | ||
<div class="oc-modal-body-actions-grid"> | ||
<oc-button | ||
class="oc-modal-body-actions-cancel oc-ml-s" | ||
appearance="outline" | ||
variation="passive" | ||
@click="$emit('cancel')" | ||
>{{ $gettext('Cancel') }} | ||
</oc-button> | ||
<oc-button | ||
class="oc-modal-body-actions-secondary oc-ml-s" | ||
appearance="outline" | ||
variation="passive" | ||
@click="onClose" | ||
> | ||
{{ $gettext("Don't Save") }} | ||
</oc-button> | ||
<oc-button | ||
class="oc-modal-body-actions-confirm oc-ml-s" | ||
appearance="filled" | ||
variation="primary" | ||
@click="$emit('confirm')" | ||
>{{ $gettext('Save') }} | ||
</oc-button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, PropType } from 'vue' | ||
import { Modal, useModals } from '../../composables' | ||
export default defineComponent({ | ||
name: 'UnsavedChangesModal', | ||
props: { | ||
modal: { type: Object as PropType<Modal>, required: true }, | ||
closeCallback: { type: Function as PropType<() => void>, required: true } | ||
}, | ||
setup(props) { | ||
const { removeModal } = useModals() | ||
const onClose = () => { | ||
removeModal(props.modal.id) | ||
props.closeCallback() | ||
} | ||
return { | ||
onClose | ||
} | ||
} | ||
}) | ||
</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
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