-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add a copy error button - errors get report if analytics is enabled or or if reportExperiment is turned on else they are sent to state
- Loading branch information
1 parent
b285370
commit 94f4577
Showing
20 changed files
with
158 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<template> | ||
<div class="copy-container"> | ||
<button class="copy-btn" @click="copyError"> | ||
<CopyIcon class="icon" v-if="!errorCopied" /> | ||
<CheckIcon class="icon" v-if="errorCopied" /> | ||
{{ errorCopied ? $t('common.copied') : $t('common.copyError') }} | ||
</button> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import CopyIcon from '@/assets/icons/copy.svg' | ||
import CheckIcon from '@/assets/icons/check-primary.svg' | ||
import { liqualityErrorStringToJson } from '@liquality/error-parser' | ||
export default { | ||
props: ['translatedError', 'liqualityErrorString'], | ||
components: { | ||
CopyIcon, | ||
CheckIcon | ||
}, | ||
computed: { | ||
jsonError() { | ||
return { | ||
error: liqualityErrorStringToJson(this.liqualityErrorString), | ||
friendlyMessage: this.translatedError | ||
} | ||
} | ||
}, | ||
data() { | ||
return { | ||
errorCopied: false | ||
} | ||
}, | ||
methods: { | ||
async copyError() { | ||
await navigator.clipboard.writeText(JSON.stringify(this.jsonError)) | ||
this.errorCopied = true | ||
setTimeout(() => { | ||
this.errorCopied = false | ||
}, 4000) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.copy-container { | ||
text-align: right; | ||
margin-left: auto; | ||
} | ||
.copy-btn { | ||
display: flex; | ||
align-items: center; | ||
color: #9d4dfa; | ||
background: transparent; | ||
border: none; | ||
cursor: pointer; | ||
.icon { | ||
width: 10px; | ||
height: 10px; | ||
font-size: 10px; | ||
line-height: 12px; | ||
margin-right: 5px; | ||
} | ||
} | ||
</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
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