-
Notifications
You must be signed in to change notification settings - Fork 156
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
JanAckermann
committed
Apr 7, 2022
1 parent
df6ad55
commit 66a75f3
Showing
11 changed files
with
201 additions
and
34 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
packages/web-app-user-management/src/components/CompareSaveDialog.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,58 @@ | ||
<template> | ||
<div class="compare-save-dialog oc-p-s oc-width-1-1"> | ||
<div class="oc-flex oc-flex-between oc-flex-middle oc-width-1-1"> | ||
<span>{{ unsavedChangesText }}</span> | ||
<div> | ||
<oc-button v-translate :disabled="!unsavedChanges" @click="$emit('revert')" | ||
>Revert</oc-button | ||
> | ||
<oc-button | ||
v-translate | ||
appearance="filled" | ||
variation="primary" | ||
:disabled="!unsavedChanges || confirmButtonDisabled" | ||
@click="$emit('confirm')" | ||
>Save</oc-button | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="js"> | ||
import isEqual from 'lodash-es/isEqual' | ||
export default { | ||
name: 'CompareSaveDialog', | ||
props: { | ||
originalObject: { | ||
type: Object, | ||
required: true | ||
}, | ||
compareObject: { | ||
type: Object, | ||
required: true | ||
}, | ||
confirmButtonDisabled: { | ||
type: Boolean, | ||
required: false, | ||
default: () => { | ||
return false | ||
} | ||
}, | ||
}, | ||
computed: { | ||
unsavedChanges(){ | ||
return !isEqual(this.originalObject, this.compareObject) | ||
}, | ||
unsavedChangesText(){ | ||
return this.unsavedChanges ? this.$gettext('Unsaved changes') : this.$gettext('No changes') | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="scss"> | ||
.compare-save-dialog { | ||
background: var(--oc-color-background-highlight); | ||
} | ||
</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
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
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